-
Notifications
You must be signed in to change notification settings - Fork 217
docs: update notification examples to support both Lumo and Aura #5228
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 all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
556b6df
docs: update notification examples to support both Lumo and Aura
web-padawan 1bbbb87
refactor: apply code review suggestions
web-padawan 2bf006f
docs: remove mention of primary variant
web-padawan b40215b
docs: also add theme switcher to best practices example
web-padawan 4056b95
Merge branch 'main' into docs/notification-replace-lumo
web-padawan 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,21 +17,21 @@ Notification supports the following style variants. | |
| |=== | ||
| | Variant | Description | Supported by | ||
|
|
||
| |`primary` | ||
| |Used for important informational messages or to draw extra attention | ||
| |Lumo | ||
|
|
||
| |`success` | ||
| |Used to display success messages | ||
| |Lumo | ||
| |Lumo, Aura | ||
|
|
||
| |`warning` | ||
| |Used to display warnings | ||
| |Lumo | ||
| |Lumo, Aura | ||
|
|
||
| |`error` | ||
| |Used to display errors | ||
| |Lumo | ||
| |Lumo, Aura | ||
|
|
||
| |`info` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any benefit to still listing
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. Removed mention of "primary". |
||
| |Used for informational messages | ||
| |Lumo, Aura | ||
|
|
||
| |`contrast` | ||
| |Used to distinguish the notification from the rest of the UI | ||
|
|
@@ -44,7 +44,7 @@ Notification supports the following style variants. | |
|
|
||
| The `success` variant can be used to display success messages, such as when a task or operation is completed. | ||
|
|
||
| [.example] | ||
| [.example,themes="lumo,aura"] | ||
| -- | ||
| ifdef::lit[] | ||
| [source,typescript] | ||
|
|
@@ -76,7 +76,7 @@ Users shouldn't be notified always, or even frequently, of successful operations | |
|
|
||
| The `warning` variant can be used to display warnings. | ||
|
|
||
| [.example] | ||
| [.example,themes="lumo,aura"] | ||
| -- | ||
| ifdef::lit[] | ||
| [source,html] | ||
|
|
@@ -109,7 +109,7 @@ Warning notifications should be persistent, and provide the user with a button t | |
|
|
||
| The `error` variant can be used to display errors. | ||
|
|
||
| [.example] | ||
| [.example,themes="lumo,aura"] | ||
| -- | ||
| ifdef::lit[] | ||
| [source,html] | ||
|
|
@@ -141,67 +141,36 @@ Notifications are non-modal and can be ignored. Therefore, they're usually inapp | |
| The built-in error message feature, included with input field components, should be used for field-specific input validation errors. | ||
|
|
||
|
|
||
| === Primary | ||
| === Info | ||
|
|
||
| The `primary` variant can be used for important informational messages or to draw extra attention to a notification. | ||
| The `info` variant can be used for informational messages or to draw extra attention to a notification. | ||
|
|
||
| [.example] | ||
| [.example,themes="lumo,aura"] | ||
| -- | ||
| ifdef::lit[] | ||
| [source,typescript] | ||
| ---- | ||
| include::{root}/frontend/demo/component/notification/notification-primary.ts[render,frame,tags=snippet,indent=0,group=Lit] | ||
| include::{root}/frontend/demo/component/notification/notification-info.ts[render,frame,tags=snippet,indent=0,group=Lit] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| ifdef::flow[] | ||
| [source,java] | ||
| ---- | ||
| include::{root}/src/main/java/com/vaadin/demo/component/notification/NotificationPrimary.java[render,frame,tags=snippet,indent=0,group=Flow] | ||
| include::{root}/src/main/java/com/vaadin/demo/component/notification/NotificationInfo.java[render,frame,tags=snippet,indent=0,group=Flow] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| ifdef::react[] | ||
| [source,tsx] | ||
| ---- | ||
| include::{root}/frontend/demo/component/notification/react/notification-primary.tsx[render,frame,tags=snippet,indent=0,group=React] | ||
| include::{root}/frontend/demo/component/notification/react/notification-info.tsx[render,frame,tags=snippet,indent=0,group=React] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| -- | ||
|
|
||
|
|
||
| === Contrast | ||
|
|
||
| The `contrast` variant can improve legibility and distinguish the notification from the rest of the UI. | ||
|
|
||
| [.example] | ||
| -- | ||
| ifdef::lit[] | ||
| [source,typescript] | ||
| ---- | ||
| include::{root}/frontend/demo/component/notification/notification-contrast.ts[render,frame,tags=snippet,indent=0,group=Lit] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| ifdef::flow[] | ||
| [source,java] | ||
| ---- | ||
| include::{root}/src/main/java/com/vaadin/demo/component/notification/NotificationContrast.java[render,frame,tags=snippet,indent=0,group=Flow] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| ifdef::react[] | ||
| [source,tsx] | ||
| ---- | ||
| include::{root}/frontend/demo/component/notification/react/notification-contrast.tsx[render,frame,tags=snippet,indent=0,group=React] | ||
| ---- | ||
| endif::[] | ||
|
|
||
| -- | ||
|
|
||
|
|
||
|
|
||
| include::../_styling-section-theming-props.adoc[tag=style-properties] | ||
|
|
||
| ==== Notification Card Properties | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the best practices examples, was there a technical limitation on why we can't have the theme switcher there? IMO not so relevant to be able to switch themes in those, but it feels a bit inconsistent at first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added theme switcher and updated examples to use horizontal layout to make them look better in Aura.