Skip to content

Commit 8e9d503

Browse files
authored
feat(icons): add collections icons for bolt and star (#1338)
* feat(icons): add collections icons for bolt and star * feat(icons): remove selected prop from collections icons
1 parent fbb51a7 commit 8e9d503

File tree

10 files changed

+152
-36
lines changed

10 files changed

+152
-36
lines changed

src/icons/collections/IconCollections.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,14 @@ type Props = {
99
className?: string,
1010
color?: string,
1111
height?: number,
12-
selected?: boolean,
1312
/** A text-only string describing the icon if it's not purely decorative for accessibility */
1413
title?: string | React.Element<any>,
1514
width?: number,
1615
};
1716

18-
const IconCollections = ({
19-
className = '',
20-
color = bdlNeutral03,
21-
height = 32,
22-
selected = false,
23-
title,
24-
width = 32,
25-
}: Props) => (
17+
const IconCollections = ({ className = '', color = bdlNeutral03, height = 32, title, width = 32 }: Props) => (
2618
<AccessibleSVG
27-
className={classNames('bdl-IconCollections', className, {
28-
'is-selected': selected,
29-
})}
19+
className={classNames('bdl-IconCollections', className)}
3020
height={height}
3121
title={title}
3222
viewBox="0 0 32 32"

src/icons/collections/IconCollectionsAdd.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,14 @@ type Props = {
99
className?: string,
1010
color?: string,
1111
height?: number,
12-
selected?: boolean,
1312
/** A text-only string describing the icon if it's not purely decorative for accessibility */
1413
title?: string | React.Element<any>,
1514
width?: number,
1615
};
1716

18-
const IconCollectionsAdd = ({
19-
className = '',
20-
color = bdlNeutral03,
21-
height = 32,
22-
selected = false,
23-
title,
24-
width = 32,
25-
}: Props) => (
17+
const IconCollectionsAdd = ({ className = '', color = bdlNeutral03, height = 32, title, width = 32 }: Props) => (
2618
<AccessibleSVG
27-
className={classNames('bdl-IconCollectionsAdd', className, {
28-
'is-selected': selected,
29-
})}
19+
className={classNames('bdl-IconCollectionsAdd', className)}
3020
height={height}
3121
title={title}
3222
viewBox="0 0 32 32"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// @flow
2+
import * as React from 'react';
3+
import classNames from 'classnames';
4+
5+
import AccessibleSVG from '../accessible-svg';
6+
import { bdlNeutral03 } from '../../styles/variables';
7+
8+
type Props = {
9+
className?: string,
10+
color?: string,
11+
height?: number,
12+
/** A text-only string describing the icon if it's not purely decorative for accessibility */
13+
title?: string | React.Element<any>,
14+
width?: number,
15+
};
16+
17+
const IconCollectionsBolt = ({ className = '', color = bdlNeutral03, height = 32, title, width = 32 }: Props) => (
18+
<AccessibleSVG
19+
className={classNames('bdl-IconCollectionsBolt', className)}
20+
height={height}
21+
title={title}
22+
viewBox="0 0 32 32"
23+
width={width}
24+
>
25+
<g className="fill-color" fill={color} fillRule="evenodd">
26+
<path d="M24 12.876h-4.187l.065-8.476L14 14.011h4.187l-.065 8.389z" />
27+
<path
28+
fillRule="nonzero"
29+
d="M7.896 0h21.642A2.462 2.462 0 0 1 32 2.462v21.642a2.462 2.462 0 0 1-2.462 2.462H7.896a2.462 2.462 0 0 1-2.462-2.462V2.462A2.462 2.462 0 0 1 7.896 0zm.615 23.49h20.412V3.076H8.511v20.412zM1.509 13.282c.834 0 1.51.676 1.51 1.51V26.52a2.462 2.462 0 0 0 2.461 2.46h11.728a1.51 1.51 0 0 1 0 3.019H4.923A4.923 4.923 0 0 1 0 27.077V14.792a1.51 1.51 0 0 1 1.51-1.509z"
30+
/>
31+
</g>
32+
</AccessibleSVG>
33+
);
34+
35+
export default IconCollectionsBolt;

src/icons/collections/IconCollectionsFilled.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,14 @@ type Props = {
99
className?: string,
1010
color?: string,
1111
height?: number,
12-
selected?: boolean,
1312
/** A text-only string describing the icon if it's not purely decorative for accessibility */
1413
title?: string | React.Element<any>,
1514
width?: number,
1615
};
1716

18-
const IconCollectionsFilled = ({
19-
className = '',
20-
color = bdlNeutral03,
21-
height = 32,
22-
selected = false,
23-
title,
24-
width = 32,
25-
}: Props) => (
17+
const IconCollectionsFilled = ({ className = '', color = bdlNeutral03, height = 32, title, width = 32 }: Props) => (
2618
<AccessibleSVG
27-
className={classNames('bdl-IconCollectionsFilled', className, {
28-
'is-selected': selected,
29-
})}
19+
className={classNames('bdl-IconCollectionsFilled', className)}
3020
height={height}
3121
title={title}
3222
viewBox="0 0 32 32"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// @flow
2+
import * as React from 'react';
3+
import classNames from 'classnames';
4+
5+
import AccessibleSVG from '../accessible-svg';
6+
import { bdlNeutral03 } from '../../styles/variables';
7+
8+
type Props = {
9+
className?: string,
10+
color?: string,
11+
height?: number,
12+
/** A text-only string describing the icon if it's not purely decorative for accessibility */
13+
title?: string | React.Element<any>,
14+
width?: number,
15+
};
16+
17+
const IconCollectionsStar = ({ className = '', color = bdlNeutral03, height = 32, title, width = 32 }: Props) => (
18+
<AccessibleSVG
19+
className={classNames('bdl-IconCollectionsStar', className)}
20+
height={height}
21+
title={title}
22+
viewBox="0 0 32 32"
23+
width={width}
24+
>
25+
<path
26+
className="fill-color"
27+
d="M7.896 0h21.642A2.462 2.462 0 0 1 32 2.462v21.642a2.462 2.462 0 0 1-2.462 2.462H7.896a2.462 2.462 0 0 1-2.462-2.462V2.462A2.462 2.462 0 0 1 7.896 0zm.615 23.49h20.412V3.076H8.511v20.412zm6.646-2.932c-.691.378-1.486-.258-1.35-1.081l.672-4.07-2.852-2.888c-.575-.583-.268-1.625.513-1.743l3.97-.6 1.769-3.724c.349-.736 1.323-.736 1.672 0l1.77 3.725 3.969.6c.781.117 1.088 1.159.513 1.742l-2.852 2.888.672 4.07c.136.823-.659 1.46-1.35 1.081l-3.558-1.944-3.558 1.944zM1.51 13.283c.834 0 1.51.676 1.51 1.51V26.52a2.462 2.462 0 0 0 2.46 2.46h11.728a1.51 1.51 0 0 1 0 3.019H4.923A4.923 4.923 0 0 1 0 27.077V14.792a1.51 1.51 0 0 1 1.51-1.509z"
28+
fill={color}
29+
fillRule="nonzero"
30+
/>
31+
</AccessibleSVG>
32+
);
33+
34+
export default IconCollectionsStar;

src/icons/collections/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const IconsExample = require('../../../examples/src/IconsExample').default;
55
const IconCollections = require('./IconCollections').default;
66
const IconCollectionsFilled = require('./IconCollectionsFilled').default;
77
const IconCollectionsAdd = require('./IconCollectionsAdd').default;
8+
const IconCollectionsStar = require('./IconCollectionsStar').default;
9+
const IconCollectionsBolt = require('./IconCollectionsBolt').default;
810

911
const icons = [
1012
{
@@ -19,6 +21,14 @@ const icons = [
1921
name: 'IconCollectionsAdd',
2022
component: IconCollectionsAdd,
2123
},
24+
{
25+
name: 'IconCollectionsStar',
26+
component: IconCollectionsStar,
27+
},
28+
{
29+
name: 'IconCollectionsBolt',
30+
component: IconCollectionsBolt,
31+
},
2232
];
2333

2434
<IconsExample icons={icons} />
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
3+
import IconCollectionsBolt from '../IconCollectionsBolt';
4+
5+
describe('icons/collections/IconCollectionsBolt', () => {
6+
const getWrapper = (props = {}) => shallow(<IconCollectionsBolt {...props} />);
7+
8+
test('should correctly render default icon', () => {
9+
const wrapper = getWrapper();
10+
11+
expect(wrapper).toMatchSnapshot();
12+
});
13+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
3+
import IconCollectionsStar from '../IconCollectionsStar';
4+
5+
describe('icons/collections/IconCollectionsStar', () => {
6+
const getWrapper = (props = {}) => shallow(<IconCollectionsStar {...props} />);
7+
8+
test('should correctly render default icon', () => {
9+
const wrapper = getWrapper();
10+
11+
expect(wrapper).toMatchSnapshot();
12+
});
13+
});
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`icons/collections/IconCollectionsBolt should correctly render default icon 1`] = `
4+
<AccessibleSVG
5+
className="bdl-IconCollectionsBolt"
6+
height={32}
7+
viewBox="0 0 32 32"
8+
width={32}
9+
>
10+
<g
11+
className="fill-color"
12+
fill="#909090"
13+
fillRule="evenodd"
14+
>
15+
<path
16+
d="M24 12.876h-4.187l.065-8.476L14 14.011h4.187l-.065 8.389z"
17+
/>
18+
<path
19+
d="M7.896 0h21.642A2.462 2.462 0 0 1 32 2.462v21.642a2.462 2.462 0 0 1-2.462 2.462H7.896a2.462 2.462 0 0 1-2.462-2.462V2.462A2.462 2.462 0 0 1 7.896 0zm.615 23.49h20.412V3.076H8.511v20.412zM1.509 13.282c.834 0 1.51.676 1.51 1.51V26.52a2.462 2.462 0 0 0 2.461 2.46h11.728a1.51 1.51 0 0 1 0 3.019H4.923A4.923 4.923 0 0 1 0 27.077V14.792a1.51 1.51 0 0 1 1.51-1.509z"
20+
fillRule="nonzero"
21+
/>
22+
</g>
23+
</AccessibleSVG>
24+
`;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`icons/collections/IconCollectionsStar should correctly render default icon 1`] = `
4+
<AccessibleSVG
5+
className="bdl-IconCollectionsStar"
6+
height={32}
7+
viewBox="0 0 32 32"
8+
width={32}
9+
>
10+
<path
11+
className="fill-color"
12+
d="M7.896 0h21.642A2.462 2.462 0 0 1 32 2.462v21.642a2.462 2.462 0 0 1-2.462 2.462H7.896a2.462 2.462 0 0 1-2.462-2.462V2.462A2.462 2.462 0 0 1 7.896 0zm.615 23.49h20.412V3.076H8.511v20.412zm6.646-2.932c-.691.378-1.486-.258-1.35-1.081l.672-4.07-2.852-2.888c-.575-.583-.268-1.625.513-1.743l3.97-.6 1.769-3.724c.349-.736 1.323-.736 1.672 0l1.77 3.725 3.969.6c.781.117 1.088 1.159.513 1.742l-2.852 2.888.672 4.07c.136.823-.659 1.46-1.35 1.081l-3.558-1.944-3.558 1.944zM1.51 13.283c.834 0 1.51.676 1.51 1.51V26.52a2.462 2.462 0 0 0 2.46 2.46h11.728a1.51 1.51 0 0 1 0 3.019H4.923A4.923 4.923 0 0 1 0 27.077V14.792a1.51 1.51 0 0 1 1.51-1.509z"
13+
fill="#909090"
14+
fillRule="nonzero"
15+
/>
16+
</AccessibleSVG>
17+
`;

0 commit comments

Comments
 (0)