-
Notifications
You must be signed in to change notification settings - Fork 279
feat(ui5-avatar): add mode property #13004
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
Open
plamenivanov91
wants to merge
5
commits into
main
Choose a base branch
from
avatar-decorative-prop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
436d32c
feat(ui5-avatar): add mode property
plamenivanov91 1349f99
- added missing new files
plamenivanov91 28eb1b4
- interactive prop takes precedence over mode prop
plamenivanov91 33c3a47
Merge branch 'main' into avatar-decorative-prop
plamenivanov91 b0a7139
- deprecated 'interactive' property
plamenivanov91 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 |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /** | ||
| * Different Avatar modes. | ||
| * @public | ||
| */ | ||
| enum AvatarMode { | ||
plamenivanov91 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /** | ||
| * Image mode (by default). | ||
| * Configures the component to internally render role="img". | ||
| * @public | ||
| * @since 2.19 | ||
| */ | ||
| Image = "Image", | ||
|
|
||
| /** | ||
| * Decorative mode. | ||
| * Configures the component to internally render role="presentation" and aria-hidden="true", | ||
| * making it purely decorative without semantic content or interactivity. | ||
| * @public | ||
| * @since 2.19 | ||
| */ | ||
| Decorative = "Decorative", | ||
|
|
||
| /** | ||
| * Interactive mode. | ||
| * Configures the component to internally render role="button". | ||
| * This mode also supports focus and enables keyboard interaction. | ||
| * @public | ||
| * @since 2.19 | ||
| */ | ||
| Interactive = "Interactive", | ||
| } | ||
|
|
||
| export default AvatarMode; | ||
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
4 changes: 4 additions & 0 deletions
4
packages/website/docs/_samples/main/Avatar/Decorative/Decorative.md
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,4 @@ | ||
| import html from '!!raw-loader!./sample.html'; | ||
| import js from '!!raw-loader!./main.js'; | ||
|
|
||
| <Editor html={html} js={js} /> |
2 changes: 2 additions & 0 deletions
2
packages/website/docs/_samples/main/Avatar/Decorative/main.js
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,2 @@ | ||
| import "@ui5/webcomponents/dist/Label.js"; | ||
| import "@ui5/webcomponents/dist/Avatar.js"; |
43 changes: 43 additions & 0 deletions
43
packages/website/docs/_samples/main/Avatar/Decorative/sample.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 |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <!-- playground-fold --> | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Sample</title> | ||
| </head> | ||
|
|
||
| <body style="background-color: var(--sapBackgroundColor)"> | ||
| <!-- playground-fold-end --> | ||
|
|
||
| <style> | ||
| .example-row { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 1rem; | ||
| margin-bottom: 1rem; | ||
| } | ||
| </style> | ||
|
|
||
| <div class="example-row"> | ||
| <ui5-avatar mode="Decorative" initials="AB"></ui5-avatar> | ||
| <ui5-label>Decorative avatar with initials - not in accessibility tree</ui5-label> | ||
| </div> | ||
|
|
||
| <div class="example-row"> | ||
| <ui5-avatar mode="Image" initials="CD"></ui5-avatar> | ||
| <ui5-label>Image mode avatar (default) - announced as "Avatar CD"</ui5-label> | ||
| </div> | ||
|
|
||
| <div class="example-row"> | ||
| <ui5-avatar mode="Interactive" initials="EF"></ui5-avatar> | ||
| <ui5-label>Interactive mode - focusable with role="button"</ui5-label> | ||
| </div> | ||
|
|
||
| <!-- playground-fold --> | ||
| <script type="module" src="main.js"></script> | ||
| </body> | ||
|
|
||
| </html> | ||
| <!-- playground-fold-end --> |
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.