-
Notifications
You must be signed in to change notification settings - Fork 23
fix(styles): clean up alert and toast styles #1350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
e604610
feat(styles): close button style updates
alizedebray 4bb59f2
feat(styles): fix linting issue
alizedebray 6b901db
feat(styles): add cookie alert
alizedebray 3153f54
feat(styles): create a placeholder for the close button
alizedebray b537a65
feat(styles): update alert and toastr styles
alizedebray 07fb121
feat(styles): add changeset
alizedebray 31f9626
feat(styles): fix linting errors
alizedebray 4f3740e
Update .changeset/thirty-countries-agree.md
alizedebray bde6a9e
Update .changeset/purple-sloths-bow.md
alizedebray 98bf026
feat(demo): move the alert color deprecation message
alizedebray e5d1c2d
Merge remote-tracking branch 'origin/352-clean-up-alerttoast-styles' …
alizedebray 998972a
feat(styles): rename alert-cookies to alert-gray
alizedebray 303010a
feat(styles): refactor alert and toast variants
alizedebray 2bc38c7
feat(styles): remove deprecated alert and toast examples
alizedebray 0c8280e
feat(styles): rename ngx-toaster to ngx-toastr
alizedebray a23c839
feat(styles): fix incorrect icon on toast
alizedebray 20ee73c
feat(styles): remove CSS custom properties for alerts and toasts
alizedebray 93fff75
feat(styles): remove CSS custom properties for close buttons
alizedebray 664266e
feat(styles): fix linting errors
alizedebray e319f63
Merge branch 'main' into 352-clean-up-alerttoast-styles
alizedebray 2ffbe6a
Merge branch 'main' into 352-clean-up-alerttoast-styles
alizedebray d5ff7b1
Merge branch 'main' into 352-clean-up-alerttoast-styles
alizedebray 112a8c8
feat(styles): add a gray alert example to the documentation
alizedebray 6eff6d0
feat(styles): update close button
alizedebray 7e27337
feat(styles): update notification icons
alizedebray f88b8ed
feat(styles): fix preview alerts
alizedebray c0bc348
feat(styles): fix stories
alizedebray 4489a4c
Update .changeset/purple-sloths-bow.md
alizedebray 12863a1
Update .changeset/thirty-countries-agree.md
alizedebray bd2ea6b
feat(styles): fix typo
alizedebray 5e792b2
feat(styles): update HCM notification styles
alizedebray 5008267
Merge branch 'main' into 352-clean-up-alerttoast-styles
alizedebray 1dd35c6
Update .changeset/clever-kangaroos-switch.md
alizedebray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@swisspost/design-system-styles': patch | ||
| --- | ||
|
|
||
| Updated close button styles. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| '@swisspost/design-system-styles': patch | ||
| --- | ||
|
|
||
| Updated alert and toast styles. | ||
|
alizedebray marked this conversation as resolved.
|
||
|
|
||
| Deprecated classes for alerts/notifications: | ||
| - alert-error becomes alert-danger | ||
| - alert-notification becomes alert-primary | ||
| - toast-notification becomes toast-primary | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@swisspost/design-system-styles': minor | ||
| '@swisspost/design-system-demo': minor | ||
| '@swisspost/design-system-documentation': minor | ||
| --- | ||
|
|
||
| Added a gray notification variant for cookie banners. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 43 additions & 50 deletions
93
packages/demo/src/app/bootstrap/components/alert/toast-demo/toast-demo.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,84 +1,77 @@ | ||
| <div class="row"> | ||
| <div class="col-md-6"> | ||
| <div class="toast-container" id="toast-container-left"> | ||
| <div class="toast toast-notification"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Notification Title</div> | ||
| <div class="toast-message">Notification Message</div> | ||
| </div> | ||
| <div class="col-md-6"> | ||
| <div class="toast-container" id="toast-container-left"> | ||
| <div class="toast toast-primary"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Primary</div> | ||
| <div class="toast-message">Same as "Notification"</div> | ||
| <div class="toast-message">Notification message.</div> | ||
| </div> | ||
| <div class="toast toast-success"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Success example - You did it!</div> | ||
| <div class="toast-title">Success - You did it!</div> | ||
| </div> | ||
| <div class="toast toast-warning"> | ||
| <div class="toast-title">Warning Message</div> | ||
| <div class="toast-message">Example without a button to close the toast.</div> | ||
| </div> | ||
| <div class="toast toast-danger"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Danger - same as error.</div> | ||
| <div class="toast-title">Danger - Something went wrong...</div> | ||
| </div> | ||
| <div class="toast toast-error"> | ||
| <div class="toast toast-info"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Error - Same as Danger.</div> | ||
| <div class="toast-title">Information</div> | ||
| <div class="toast-message"> | ||
| Important information with a long text. Lorem ipsum dolor sit | ||
| amet, consetetur sadipscing elitr, sed diam nonumy eirmod. | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="col-md-6"> | ||
| <div class="toast-container" id="toast-container-right"> | ||
| <div class="toast toast-info"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Information</div> | ||
| <div class="toast-message"> | ||
| Important information with a long text. Lorem ipsum dolor sit | ||
| amet, consetetur sadipscing elitr, sed diam nonumy eirmod. | ||
| </div> | ||
| </div> | ||
| <div class="toast toast-info pi-1001"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Special Icons (Black)</div> | ||
| <div class="toast-message">Example with custom icon. Only needs the corresponding "pi"-class added to the toast.</div> | ||
| </div> | ||
| <div class="toast toast-notification pi-2063-white"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Special Icons (White)</div> | ||
| <div class="toast-message">Example with white icon. Icon needs to be extended in sass.</div> | ||
| </div> | ||
| <div class="toast toast-notification no-icon"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Example without an icon</div> | ||
| <div class="toast-message">Add class "no-icon" to the toast.</div> | ||
| </div> | ||
| <div class="toast toast-info pi-1001"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Special Icons (Black)</div> | ||
| <div class="toast-message">Example with custom icon. Only needs the corresponding "pi"-class added to the toast.</div> | ||
| </div> | ||
| <div class="toast toast-primary pi-2063-white"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Special Icons (White)</div> | ||
| <div class="toast-message">Example with white icon. Icon needs to be extended in sass.</div> | ||
| </div> | ||
| <div class="toast toast-primary no-icon"> | ||
| <button class="toast-close-button" aria-label="Close"><span aria-hidden="true"></span></button> | ||
| <div class="toast-title">Example without an icon</div> | ||
| <div class="toast-message">Add class "no-icon" to the toast.</div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="heading my-3"> | ||
| <h4>Example for ngx-Toaster</h4> | ||
| <a href="https://www.npmjs.com/package/ngx-toastr" target="_blank" rel="noopener" | ||
| class="btn btn-sm btn-primary">Ngx Bootstap Doc</a> | ||
| <h4>Examples of ngx-toastr</h4> | ||
| <a href="https://www.npmjs.com/package/ngx-toastr" target="_blank" rel="noopener" | ||
| class="btn btn-sm btn-primary me-2">ngx-toastr Documentation</a> | ||
| <a href="https://ngx-toastr.vercel.app/" target="_blank" rel="noopener" | ||
| class="btn btn-sm btn-primary">ngx-toastr Demo</a> | ||
| </div> | ||
| <p class="mb-3 mt-5">Screen reader output is a little better if the close button is disabled (alert messages can still be closed by clicking on them). Pass the following option to disable the close button:</p> | ||
| <code class="d-block mt-3 mb-5" [highlight]="JSON.stringify(toastOptions, null, 2)" [languages]="['typescript']"></code> | ||
| <section> | ||
| <button class="btn btn-secondary btn-animated" (click)="showError()"> | ||
| <span>Show Toaster error</span> | ||
| </button> | ||
| <button class="btn btn-secondary btn-animated" (click)="showError()"> | ||
| <span>Show Danger Toast</span> | ||
| </button> | ||
|
|
||
| <button class="btn btn-secondary btn-animated ms-3" (click)="showSuccess()"> | ||
| <span>Show Toaster success</span> | ||
| </button> | ||
| <button class="btn btn-secondary btn-animated ms-3" (click)="showSuccess()"> | ||
| <span>Show Success Toast</span> | ||
| </button> | ||
|
|
||
| <button class="btn btn-secondary btn-animated ms-3" (click)="showInfo()"> | ||
| <span>Show Toaster Info</span> | ||
| </button> | ||
| <button class="btn btn-secondary btn-animated ms-3" (click)="showInfo()"> | ||
| <span>Show Info Toast</span> | ||
| </button> | ||
|
|
||
| <button class="btn btn-secondary btn-animated ms-3" (click)="showWarning()"> | ||
| <span>Show Toaster Warning</span> | ||
| </button> | ||
| <button class="btn btn-secondary btn-animated ms-3" (click)="showWarning()"> | ||
| <span>Show Warning Toast</span> | ||
| </button> | ||
| </section> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.