-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui5-avatar): fix default size appearance and font-family (#8415)
- Fix missing font-family. Avatar used to not set font-family and relies on inheriting it which is not always the case. (In storybook this is not visible as the font is set on the body and the Avatar is inheriting it). - Fix default size appearance. When the "size" attribute is not present, the initials font was wrong as styles for the default "S" are applied only when the "size" attribute is present, which by default is missing:
- Loading branch information
Showing
18 changed files
with
176 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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/WithIcon/WithIcon.md
This file contains 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} /> |
This file contains 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 @@ | ||
import "@ui5/webcomponents/dist/Avatar.js"; | ||
|
||
import "@ui5/webcomponents-icons/dist/filter.js"; | ||
import "@ui5/webcomponents-icons/dist/employee.js"; | ||
import "@ui5/webcomponents-icons/dist/product.js"; | ||
import "@ui5/webcomponents-icons/dist/supplier.js"; | ||
import "@ui5/webcomponents-icons/dist/shipping-status.js"; |
25 changes: 25 additions & 0 deletions
25
packages/website/docs/_samples/main/Avatar/WithIcon/sample.html
This file contains 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,25 @@ | ||
<!-- 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 --> | ||
|
||
<ui5-avatar icon="filter" size="XS"></ui5-avatar> | ||
<ui5-avatar icon="employee" size="S"></ui5-avatar> | ||
<ui5-avatar icon="product" size="M"></ui5-avatar> | ||
<ui5-avatar icon="supplier" size="L"></ui5-avatar> | ||
<ui5-avatar icon="shipping-status" size="XL"></ui5-avatar> | ||
|
||
<!-- playground-fold --> | ||
<script type="module" src="main.js"></script> | ||
</body> | ||
|
||
</html> | ||
<!-- playground-fold-end --> |
This file contains 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 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 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 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
...es/website/docs/_samples/main/List/GrowingOnButtonPress/GrowingOnButtonPress.md
This file contains 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} /> |
33 changes: 33 additions & 0 deletions
33
packages/website/docs/_samples/main/List/GrowingOnButtonPress/main.js
This file contains 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 @@ | ||
import "@ui5/webcomponents/dist/List.js"; | ||
import "@ui5/webcomponents/dist/StandardListItem.js"; | ||
|
||
import "@ui5/webcomponents-icons/dist/nutrition-activity.js"; | ||
|
||
let itemsLoaded = 0; | ||
const itemToLoad = 5; | ||
const growingList = document.querySelector("#growingList"); | ||
const listItemTemplate = (index) => { | ||
var li = document.createElement("ui5-li"); | ||
li.textContent = "Fruit name"; | ||
li.description = "the description goes here " + index; | ||
li.additionalText = "Available"; | ||
li.additionalTextState = "Success"; | ||
li.icon = "nutrition-activity"; | ||
return li; | ||
} | ||
|
||
const insertItems = (list) => { | ||
for (var i = itemsLoaded; i < itemsLoaded + itemToLoad; i++) { | ||
list.appendChild(listItemTemplate(i)); | ||
} | ||
itemsLoaded+=itemToLoad; | ||
} | ||
|
||
growingList.addEventListener("load-more", (e) => { | ||
growingList.busy = true; | ||
|
||
setTimeout(() => { | ||
insertItems(growingList); | ||
growingList.busy = false; | ||
}, 1500); | ||
}); |
31 changes: 31 additions & 0 deletions
31
packages/website/docs/_samples/main/List/GrowingOnButtonPress/sample.html
This file contains 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,31 @@ | ||
<!-- 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 --> | ||
|
||
<ui5-list id="growingList" style="height: 300px" growing="Button" busy-delay="0"> | ||
<ui5-li icon="nutrition-activity" description="Tropical plant with an edible fruit" additional-text="In-stock" | ||
additional-text-state="Success">Pineapple</ui5-li> | ||
<ui5-li icon="nutrition-activity" description="Occurs between red and yellow" additional-text="Expires" | ||
additional-text-state="Warning">Orange</ui5-li> | ||
<ui5-li icon="nutrition-activity" description="The yellow lengthy fruit" additional-text="Re-stock" | ||
additional-text-state="Error">Banana</ui5-li> | ||
<ui5-li icon="nutrition-activity" description="Small fruit that comes in various colors, including red, purple" additional-text="Re-stock" | ||
additional-text-state="Information">Plum</ui5-li> | ||
<ui5-li icon="nutrition-activity" description=" tropical fruit known for its sweet and juicy interior" additional-text="Re-stock" | ||
additional-text-state="Error">Mango</ui5-li> | ||
</ui5-list> | ||
<!-- playground-fold --> | ||
<script type="module" src="main.js"></script> | ||
</body> | ||
|
||
</html> | ||
<!-- playground-fold-end --> |
This file contains 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 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