Skip to content

Commit

Permalink
Bundle size (#1844)
Browse files Browse the repository at this point in the history
* chore: reduce dropdown list item text size

* chore: reduce icon mapping json size

* chore: update tab style and dropdown font size

* chore: increment package version

---------

Co-authored-by: James Nestor <jnestor@cisco.com>
  • Loading branch information
NotNestor and jnestorCisco authored Dec 3, 2024
1 parent db91488 commit a087446
Show file tree
Hide file tree
Showing 17 changed files with 981 additions and 3,182 deletions.
2 changes: 1 addition & 1 deletion web-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@momentum-ui/web-components",
"version": "2.16.3",
"version": "2.16.4",
"author": "Yana Harris",
"license": "MIT",
"repository": "https://github.com/momentum-design/momentum-ui.git",
Expand Down
1 change: 1 addition & 0 deletions web-components/src/[sandbox]/examples/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const iconTemplate = html`
size="50"
color="var(--avatar-presence-active)"
></md-icon>
<md-icon name="queue-contact-bold" iconSet="momentumDesign" title="queue-contact-bold" size="32"></md-icon>
<h3>Logos (svg) from Brand Visuals Library</h3>
<md-icon
Expand Down
3 changes: 1 addition & 2 deletions web-components/src/components/dropdown/scss/dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@
top: calc(100% + #{$dropdown-main-indent});
width: 100%;
z-index: 99;
padding: calc((var(--dropdown-list-padding) / 16) * 1rem);
font-size: var(--body-primary-font-size, inherit);
padding: calc((var(--dropdown-list-padding) / 16) * 1rem);
}

&-option {
Expand Down
10 changes: 9 additions & 1 deletion web-components/src/components/icon/Icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export namespace Icon {
if (this.iconSet === "momentumDesign" || this.iconSet === "momentumBrandVisuals") {
return this.name;
}
const lookupName = this.getIconName();
const lookupName = this.momentumUIIconLookupName;
const mappedName = ELEMENT.designLookup.get(lookupName);

return mappedName ?? lookupName;
Expand Down Expand Up @@ -368,6 +368,14 @@ export namespace Icon {
};
}

get momentumUIIconLookupName() {
//The lookup map has the icon name without the size
let iconName = this.name;
iconName = iconName.startsWith("icon-") ? iconName.substring(5) : iconName;
iconName = iconName.split("_")[0];
return iconName;
}

getIconName() {
let iconName = this.name;
iconName = iconName.startsWith("icon-") ? iconName.substring(5) : iconName;
Expand Down
Loading

0 comments on commit a087446

Please sign in to comment.