-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65f2f17
commit ab808b6
Showing
18 changed files
with
238 additions
and
132 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
11 changes: 11 additions & 0 deletions
11
ui/components/component-library/icon/__snapshots__/icon.test.js.snap
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,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Icon should render correctly 1`] = ` | ||
<div> | ||
<div | ||
class="box mm-icon mm-icon--size-md box--flex-direction-row box--color-inherit" | ||
data-testid="icon" | ||
style="mask-image: url('./images/icons/icon-add-square-filled.svg');" | ||
/> | ||
</div> | ||
`; |
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 |
---|---|---|
@@ -1,11 +1,25 @@ | ||
import { SIZES } from '../../../helpers/constants/design-system'; | ||
|
||
/** | ||
* The ICON_NAMES object contains all the possible icon names. | ||
* It is generated using the generateIconNames script in development/generate-icon-names.js | ||
* and stored in the environment variable ICON_NAMES | ||
* To add a new icon, add the icon svg file to app/images/icons | ||
* Ensure the svg has been optimized, is kebab case and starts with "icon-" | ||
* See "Adding a new icon" in ./README.md for more details | ||
* | ||
* Search for an icon: https://metamask.github.io/metamask-storybook/?path=/story/ui-components-component-library-icon-icon-stories-js--default-story | ||
* | ||
* Add an icon: https://metamask.github.io/metamask-storybook/?path=/docs/ui-components-component-library-icon-icon-stories-js--default-story#adding-a-new-icon | ||
* | ||
* ICON_NAMES is generated using svgs in app/images/icons and | ||
* the generateIconNames script in development/generate-icon-names.js | ||
* then stored as an environment variable | ||
*/ | ||
|
||
/* eslint-disable prefer-destructuring*/ // process.env is not a standard JavaScript object, so we are not able to use object destructuring | ||
export const ICON_NAMES = JSON.parse(process.env.ICON_NAMES); | ||
export const ICON_SIZES = { | ||
XXS: SIZES.XXS, | ||
XS: SIZES.XS, | ||
SM: SIZES.SM, | ||
MD: SIZES.MD, | ||
LG: SIZES.LG, | ||
XL: SIZES.XL, | ||
AUTO: SIZES.AUTO, | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.icon { | ||
.mm-icon { | ||
--icon-size: var(--size, 16px); | ||
|
||
font-size: var(--icon-size); | ||
|
Oops, something went wrong.