Skip to content

Commit

Permalink
Merge pull request #683 from appnexus/678-beaker-icon
Browse files Browse the repository at this point in the history
Add Beaker Icon
  • Loading branch information
ogupte authored Jan 11, 2017
2 parents d7d9c95 + dd89213 commit 3f1dcd0
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/components/Icon/BeakerIcon/BeakerIcon.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import _ from 'lodash';
import React from 'react';
import Icon from '../Icon';
import { lucidClassNames } from '../../../util/style-helpers';
import { createClass } from '../../../util/component-types';

const cx = lucidClassNames.bind('&-BeakerIcon');

/**
*
* {"categories": ["visual design", "icons"], "extend": "Icon", "madeFrom": ["Icon"]}
*
* A Beaker icon.
*/
const BeakerIcon = createClass({
displayName: 'BeakerIcon',
propTypes: {
...Icon.propTypes,
},

render() {
const {
className,
...passThroughs
} = this.props;

return (
<Icon
{...passThroughs}
{..._.pick(passThroughs, _.keys(Icon.propTypes))}
className={cx('&', className)}
>
<path opacity='0.4' d='M4.034,11.33C4.015,11.383,4,11.439,4,11.5C4,11.775,4.224,12,4.5,12h7c0.276,0,0.5-0.225,0.5-0.5 c0-0.061-0.015-0.117-0.034-0.17l-0.14-0.203L10.369,9H5.63l-1.457,2.127L4.034,11.33z'/>
<path d='M12.748,10.67l-0.013-0.02L10,6.715V3h0.301c0.276,0,0.5-0.224,0.5-0.5S10.577,2,10.301,2H5.7C5.424,2,5.2,2.224,5.2,2.5 S5.424,3,5.7,3H6v3.715L3.265,10.65l-0.013,0.02C3.093,10.908,3,11.193,3,11.5c0,0.336,0.114,0.643,0.301,0.893 C3.575,12.76,4.008,13,4.5,13h7c0.492,0,0.925-0.24,1.199-0.607C12.886,12.143,13,11.836,13,11.5 C13,11.193,12.907,10.908,12.748,10.67z M7,7V3h2v4l1.369,2l1.457,2.127l0.14,0.203C11.985,11.383,12,11.439,12,11.5 c0,0.275-0.224,0.5-0.5,0.5h-7C4.224,12,4,11.775,4,11.5c0-0.061,0.015-0.117,0.034-0.17l0.14-0.203L5.63,9L7,7z'/>
</Icon>
);
},
});

export default BeakerIcon;
8 changes: 8 additions & 0 deletions src/components/Icon/BeakerIcon/BeakerIcon.spec.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { icons, common } from '../../../util/generic-tests';

import BeakerIcon from './BeakerIcon';

describe('BeakerIcon', () => {
common(BeakerIcon);
icons(BeakerIcon);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
exports[`BeakerIcon [common] example testing should match snapshot(s) for 1.default 1`] = `
<Icon
aspectRatio="xMidYMid meet"
className="lucid-BeakerIcon"
isBadge={false}
isDisabled={false}
size={16}
viewBox="0 0 16 16">
<path
d="M4.034,11.33C4.015,11.383,4,11.439,4,11.5C4,11.775,4.224,12,4.5,12h7c0.276,0,0.5-0.225,0.5-0.5 c0-0.061-0.015-0.117-0.034-0.17l-0.14-0.203L10.369,9H5.63l-1.457,2.127L4.034,11.33z"
opacity="0.4" />
<path
d="M12.748,10.67l-0.013-0.02L10,6.715V3h0.301c0.276,0,0.5-0.224,0.5-0.5S10.577,2,10.301,2H5.7C5.424,2,5.2,2.224,5.2,2.5 S5.424,3,5.7,3H6v3.715L3.265,10.65l-0.013,0.02C3.093,10.908,3,11.193,3,11.5c0,0.336,0.114,0.643,0.301,0.893 C3.575,12.76,4.008,13,4.5,13h7c0.492,0,0.925-0.24,1.199-0.607C12.886,12.143,13,11.836,13,11.5 C13,11.193,12.907,10.908,12.748,10.67z M7,7V3h2v4l1.369,2l1.457,2.127l0.14,0.203C11.985,11.383,12,11.439,12,11.5 c0,0.275-0.224,0.5-0.5,0.5h-7C4.224,12,4,11.775,4,11.5c0-0.061,0.015-0.117,0.034-0.17l0.14-0.203L5.63,9L7,7z" />
</Icon>
`;

exports[`BeakerIcon [common] example testing should match snapshot(s) for 2.clickable 1`] = `
<Icon
aspectRatio="xMidYMid meet"
className="lucid-BeakerIcon"
isBadge={false}
isClickable={true}
isDisabled={false}
size={16}
viewBox="0 0 16 16">
<path
d="M4.034,11.33C4.015,11.383,4,11.439,4,11.5C4,11.775,4.224,12,4.5,12h7c0.276,0,0.5-0.225,0.5-0.5 c0-0.061-0.015-0.117-0.034-0.17l-0.14-0.203L10.369,9H5.63l-1.457,2.127L4.034,11.33z"
opacity="0.4" />
<path
d="M12.748,10.67l-0.013-0.02L10,6.715V3h0.301c0.276,0,0.5-0.224,0.5-0.5S10.577,2,10.301,2H5.7C5.424,2,5.2,2.224,5.2,2.5 S5.424,3,5.7,3H6v3.715L3.265,10.65l-0.013,0.02C3.093,10.908,3,11.193,3,11.5c0,0.336,0.114,0.643,0.301,0.893 C3.575,12.76,4.008,13,4.5,13h7c0.492,0,0.925-0.24,1.199-0.607C12.886,12.143,13,11.836,13,11.5 C13,11.193,12.907,10.908,12.748,10.67z M7,7V3h2v4l1.369,2l1.457,2.127l0.14,0.203C11.985,11.383,12,11.439,12,11.5 c0,0.275-0.224,0.5-0.5,0.5h-7C4.224,12,4,11.775,4,11.5c0-0.061,0.015-0.117,0.034-0.17l0.14-0.203L5.63,9L7,7z" />
</Icon>
`;

exports[`BeakerIcon [common] example testing should match snapshot(s) for 3.disabled 1`] = `
<Icon
aspectRatio="xMidYMid meet"
className="lucid-BeakerIcon"
isBadge={false}
isDisabled={true}
size={16}
viewBox="0 0 16 16">
<path
d="M4.034,11.33C4.015,11.383,4,11.439,4,11.5C4,11.775,4.224,12,4.5,12h7c0.276,0,0.5-0.225,0.5-0.5 c0-0.061-0.015-0.117-0.034-0.17l-0.14-0.203L10.369,9H5.63l-1.457,2.127L4.034,11.33z"
opacity="0.4" />
<path
d="M12.748,10.67l-0.013-0.02L10,6.715V3h0.301c0.276,0,0.5-0.224,0.5-0.5S10.577,2,10.301,2H5.7C5.424,2,5.2,2.224,5.2,2.5 S5.424,3,5.7,3H6v3.715L3.265,10.65l-0.013,0.02C3.093,10.908,3,11.193,3,11.5c0,0.336,0.114,0.643,0.301,0.893 C3.575,12.76,4.008,13,4.5,13h7c0.492,0,0.925-0.24,1.199-0.607C12.886,12.143,13,11.836,13,11.5 C13,11.193,12.907,10.908,12.748,10.67z M7,7V3h2v4l1.369,2l1.457,2.127l0.14,0.203C11.985,11.383,12,11.439,12,11.5 c0,0.275-0.224,0.5-0.5,0.5h-7C4.224,12,4,11.775,4,11.5c0-0.061,0.015-0.117,0.034-0.17l0.14-0.203L5.63,9L7,7z" />
</Icon>
`;
8 changes: 8 additions & 0 deletions src/components/Icon/BeakerIcon/examples/1.default.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import { BeakerIcon } from '../../../../index';

export default React.createClass({
render() {
return <BeakerIcon />;
},
});
8 changes: 8 additions & 0 deletions src/components/Icon/BeakerIcon/examples/2.clickable.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import { BeakerIcon } from '../../../../index';

export default React.createClass({
render() {
return <BeakerIcon isClickable />;
},
});
8 changes: 8 additions & 0 deletions src/components/Icon/BeakerIcon/examples/3.disabled.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import { BeakerIcon } from '../../../../index';

export default React.createClass({
render() {
return <BeakerIcon isDisabled />;
},
});
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import Banner from './components/Banner/Banner';
import Bar from './components/Bar/Bar';
import BarChart from './components/BarChart/BarChart';
import Bars from './components/Bars/Bars';
import BeakerIcon from './components/Icon/BeakerIcon/BeakerIcon';
import BellIcon from './components/Icon/BellIcon/BellIcon';
import Breadcrumb from './components/Breadcrumb/Breadcrumb';
import Button from './components/Button/Button';
Expand Down Expand Up @@ -188,6 +189,7 @@ export {
Bar,
BarChart,
Bars,
BeakerIcon,
BellIcon,
Breadcrumb,
Button,
Expand Down

0 comments on commit 3f1dcd0

Please sign in to comment.