-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
11 changed files
with
369 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
.root { | ||
width: 100%; | ||
text-align: center; | ||
} | ||
|
||
.container { | ||
width: 100%; | ||
height: 0; | ||
padding-bottom: 100%; | ||
background-color: #f8f8f8; | ||
position: relative; | ||
} | ||
|
||
.container svg { | ||
font-size: var(--size-lg-i); | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
} | ||
|
||
.brand svg { | ||
font-size: var(--size-lg-iii); | ||
} | ||
|
||
.attributes { | ||
text-align: left; | ||
margin-left: 0; | ||
padding: 0; | ||
margin-top: var(--size-regular); | ||
list-style-type: none; | ||
} | ||
|
||
.attribute { | ||
composes: fontRegular from '../../../globals/typography.css'; | ||
color: var(--color-grey); | ||
} | ||
|
||
.attribute + .attribute { | ||
margin-top: var(--size-sm-iii); | ||
} | ||
|
||
.name { | ||
font-weight: var(--fontweight-demi); | ||
color: var(--color-black); | ||
} |
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,45 @@ | ||
import React, { PropTypes } from 'react'; | ||
import cx from 'classnames'; | ||
|
||
import Icon from '../../../components/Icon/Icon'; | ||
|
||
import css from './IconShowcase.css'; | ||
|
||
const IconShowcase = ({ name, value, brandIcon }) => ( | ||
<div className={ css.root }> | ||
<div | ||
className={ cx( | ||
css.container, | ||
brandIcon ? css.brand : null, | ||
) } | ||
> | ||
{ !brandIcon ? <Icon name={ value } /> : brandIcon } | ||
</div> | ||
<ul className={ css.attributes }> | ||
<li | ||
className={ cx( | ||
css.attribute, | ||
css.name | ||
) } | ||
> | ||
{ name } | ||
</li> | ||
<li | ||
className={ cx( | ||
css.attribute, | ||
css.value | ||
) } | ||
> | ||
{ value } | ||
</li> | ||
</ul> | ||
</div> | ||
); | ||
|
||
IconShowcase.propTypes = { | ||
name: PropTypes.string.isRequired, | ||
value: PropTypes.string.isRequired, | ||
brandIcon: PropTypes.node, | ||
}; | ||
|
||
export default IconShowcase; |
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,9 @@ | ||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
|
||
import IconShowcase from './IconShowcase'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
render(<IconShowcase name="Appear Here" value="appearhere" />, 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
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,14 @@ | ||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
|
||
import Navigation from './Navigation'; | ||
|
||
jest.mock('react-router-dom', () => ({ | ||
// eslint-disable-next-line react/prop-types | ||
NavLink: ({ children }) => <div>{ children }</div>, | ||
})); | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
render(<Navigation />, 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@lost gutter 1rem; | ||
|
||
.iconGroup { | ||
lost-utility: clearfix; | ||
} | ||
|
||
.icon { | ||
display: inline-block; | ||
lost-column: 1/2; | ||
} | ||
|
||
@media(--iconography-3up) { | ||
.icon { | ||
lost-column: 1/3; | ||
} | ||
} | ||
|
||
@media(--iconography-4up) { | ||
.icon { | ||
lost-column: 1/4; | ||
} | ||
} | ||
|
||
@media(--iconography-5up) { | ||
.icon { | ||
lost-column: 1/5; | ||
} | ||
} |
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,39 @@ | ||
import React from 'react'; | ||
|
||
import IconShowcase from '../../components/IconShowcase/IconShowcase'; | ||
|
||
import { uiIcons, brandIcons } from './icons'; | ||
|
||
import type from '../../typography.css'; | ||
import css from './Iconography.css'; | ||
|
||
const Iconography = () => ( | ||
<div> | ||
<h1 className={ type.h1 }>Icons</h1> | ||
<h2 className={ type.h2 }>UI Icons</h2> | ||
<div className={ css.iconGroup }> | ||
{ uiIcons.map(icon => ( | ||
<div key={ icon.value } className={ css.icon }> | ||
<IconShowcase | ||
name={ icon.name } | ||
value={ icon.value } | ||
/> | ||
</div> | ||
)) } | ||
</div> | ||
<h2 className={ type.h2 }>Brand Icons</h2> | ||
<div className={ css.iconGroup }> | ||
{ brandIcons.map(icon => ( | ||
<div key={ icon.value } className={ css.icon }> | ||
<IconShowcase | ||
name={ icon.name } | ||
value={ icon.value } | ||
brandIcon={ <icon.valueIcon /> } | ||
/> | ||
</div> | ||
)) } | ||
</div> | ||
</div> | ||
); | ||
|
||
export default Iconography; |
4 changes: 2 additions & 2 deletions
4
...components/Navigation/Navigation.tests.js → ...eguide/screens/Design/Iconography.test.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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
|
||
import Navigation from './Navigation'; | ||
import Iconography from './Iconography'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
render(<Navigation />, div); | ||
render(<Iconography />, div); | ||
}); |
Oops, something went wrong.