Skip to content

Commit 3dded61

Browse files
authored
feat(icons): update to new globe icon and add new globe tinycon (#1217)
BREAKING CHANGE: update to new globe icon which uses 20x20 by default instead of 16x16 and introduced new globe tinycon
1 parent 7f13237 commit 3dded61

File tree

5 files changed

+96
-7
lines changed

5 files changed

+96
-7
lines changed

src/icons/general/IconGlobe.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import * as React from 'react';
33

44
import AccessibleSVG from '../accessible-svg';
5+
import { bdlNeutral03 } from '../../styles/variables';
56

67
type Props = {
78
className?: string,
@@ -12,18 +13,18 @@ type Props = {
1213
width?: number,
1314
};
1415

15-
const IconGlobe = ({ className = '', color = '#000', height = 16, title, width = 16 }: Props) => (
16+
const IconGlobe = ({ className = '', color = bdlNeutral03, height = 20, title, width = 20 }: Props) => (
1617
<AccessibleSVG
1718
className={`icon-globe ${className}`}
1819
height={height}
1920
title={title}
20-
viewBox="0 0 16 16"
21+
viewBox="0 0 20 20"
2122
width={width}
2223
>
23-
<circle className="fill-color" cx="8" cy="8" fill={color} r="8" />
2424
<path
25-
d="M8 1.5C4.4 1.5 1.5 4.4 1.5 8s2.9 6.5 6.5 6.5 6.5-2.9 6.5-6.5S11.6 1.5 8 1.5zm-.7 11.7c-2.5-.4-4.5-2.5-4.5-5.2 0-.4.1-.8.1-1.2L6 9.9v.7c0 .7.6 1.3 1.3 1.3v1.3zm4.5-1.7c-.2-.5-.7-.9-1.2-.9h-.7v-2c0-.3-.2-.6-.6-.6H5.4V6.7h1.3c.4 0 .7-.3.7-.7V4.8h1.3c.7 0 1.3-.6 1.3-1.3v-.3c1.9.8 3.2 2.6 3.2 4.8 0 1.4-.5 2.6-1.4 3.5z"
26-
fill="#FFF"
25+
className="fill-color"
26+
d="M10 0A9.98 9.98 0 0 0 0 10a9.98 9.98 0 0 0 10 10 9.98 9.98 0 0 0 10-10A9.98 9.98 0 0 0 10 0zM8.923 18C5.077 17.385 2 14.154 2 10c0-.615.154-1.23.154-1.846l4.77 4.77V14c0 1.077.922 2 2 2v2zm6.923-2.615C15.538 14.615 14.77 14 14 14h-1.077v-3.077c0-.461-.308-.923-.923-.923H6V8h2c.615 0 1.077-.462 1.077-1.077V5.077h2c1.077 0 2-.923 2-2v-.462C16 3.846 18 6.615 18 10c0 2.154-.77 4-2.154 5.385z"
27+
fill={color}
2728
/>
2829
</AccessibleSVG>
2930
);
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// @flow
2+
import * as React from 'react';
3+
4+
import AccessibleSVG from '../accessible-svg';
5+
import { bdlBoxBlue } from '../../styles/variables';
6+
7+
type Props = {
8+
className?: string,
9+
color?: string,
10+
height?: number,
11+
/** A text-only string describing the icon if it's not purely decorative for accessibility */
12+
title?: string | React.Element<any>,
13+
width?: number,
14+
};
15+
16+
const IconGlobeTinycon = ({ className = '', color = bdlBoxBlue, height = 16, title, width = 16 }: Props) => (
17+
<AccessibleSVG
18+
className={`icon-globe ${className}`}
19+
height={height}
20+
title={title}
21+
viewBox="0 0 16 16"
22+
width={width}
23+
>
24+
<g fill="none">
25+
<path
26+
className="fill-color"
27+
d="M8 .5A7.484 7.484 0 0 0 .5 8c0 4.155 3.345 7.5 7.5 7.5 4.155 0 7.5-3.345 7.5-7.5C15.5 3.845 12.155.5 8 .5z"
28+
stroke={color}
29+
/>
30+
<path
31+
className="fill-color"
32+
d="M12 12.061c-.107-.28-.512-1.308-1.268-1.883-.187-.142-.718-.217-1.592-.226V8.365c0-.794-.578-.794-1.019-.794H4.594V5.983H6.11c.44 0 .757.065.757-.397V4.395h1.515c.772 0 1.841-.309 1.841-1.9-3.778-.89-6.391.344-7.84 3.703L5.407 9.38l-.07.282a1.482 1.482 0 0 0 1.53 1.835l.586 2.487c1.21-.034 2.087-.166 2.633-.397.464-.196 1.101-.705 1.913-1.526z"
33+
fill={color}
34+
stroke={color}
35+
strokeWidth=".766"
36+
strokeLinejoin="round"
37+
/>
38+
</g>
39+
</AccessibleSVG>
40+
);
41+
42+
export default IconGlobeTinycon;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```
2+
<IconGlobeTinycon />
3+
```

src/icons/general/__tests__/IconGlobe-test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React from 'react';
22

3+
import { white } from '../../../styles/variables';
4+
35
import IconGlobe from '../IconGlobe';
46

57
describe('icons/general/IconGlobe', () => {
@@ -10,12 +12,12 @@ describe('icons/general/IconGlobe', () => {
1012
});
1113

1214
test('should correctly render icon with specified color', () => {
13-
const color = '#ffffff';
15+
const color = white;
1416
const wrapper = shallow(<IconGlobe color={color} />);
1517

1618
expect(
1719
wrapper
18-
.find('circle')
20+
.find('path')
1921
.at(0)
2022
.prop('fill'),
2123
).toEqual(color);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import React from 'react';
2+
3+
import { white } from '../../../styles/variables';
4+
5+
import IconGlobeTinycon from '../IconGlobeTinycon';
6+
7+
describe('icons/general/IconGlobeTinycon', () => {
8+
test('should correctly render default icon', () => {
9+
const wrapper = shallow(<IconGlobeTinycon />);
10+
11+
expect(wrapper.hasClass('icon-globe')).toEqual(true);
12+
});
13+
14+
test('should correctly render icon with specified color', () => {
15+
const color = white;
16+
const wrapper = shallow(<IconGlobeTinycon color={color} />);
17+
18+
expect(
19+
wrapper
20+
.find('path')
21+
.at(0)
22+
.prop('stroke'),
23+
).toEqual(color);
24+
});
25+
26+
test('should correctly render icon with specified width and height', () => {
27+
const width = 16;
28+
const height = 17;
29+
const wrapper = shallow(<IconGlobeTinycon height={height} width={width} />);
30+
31+
expect(wrapper.find('AccessibleSVG').prop('width')).toEqual(width);
32+
expect(wrapper.find('AccessibleSVG').prop('height')).toEqual(height);
33+
});
34+
35+
test('should correctly render icon with title', () => {
36+
const title = 'fool';
37+
const wrapper = shallow(<IconGlobeTinycon title={title} />);
38+
39+
expect(wrapper.find('AccessibleSVG').prop('title')).toEqual(title);
40+
});
41+
});

0 commit comments

Comments
 (0)