react-oui-icons
Advanced tools
Comparing version 2.0.5 to 2.1.0
@@ -9,2 +9,5 @@ # Change Log | ||
## Unreleased | ||
## 2.1.0 - 2018-05-08 | ||
- [Fix] Set default fill to currentColor, not black | ||
- [Feature] Allow ellipse shape output in the build script (#31) | ||
@@ -11,0 +14,0 @@ ## 2.0.4 - 2018-03-22 |
{ | ||
"name": "react-oui-icons", | ||
"version": "2.0.5", | ||
"version": "2.1.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "src/index.js", |
@@ -35,2 +35,5 @@ import PropTypes from 'prop-types'; | ||
} | ||
else if(prop.name === 'ellipse') { | ||
return <ellipse {...prop.attrs} key={ `ellipse-${index}` } /> | ||
} | ||
else if(prop.name === 'g') { | ||
@@ -49,3 +52,3 @@ return buildSvg(prop.childs) | ||
description = 'icon', | ||
fill = 'black', | ||
fill = 'currentColor', | ||
name, | ||
@@ -55,3 +58,3 @@ role, | ||
stroke = 'none', | ||
style | ||
style = {} | ||
}) => { | ||
@@ -69,6 +72,8 @@ const icon = findIcon(`${name}`); | ||
const iconStyles = style; | ||
iconStyles['fill'] = fill; | ||
const svgClass = `oui-icon display--inline oui-icon--${sizeNumber}` | ||
const props = { | ||
className: svgClass, | ||
fill, | ||
height: sizeNumber, | ||
@@ -78,3 +83,3 @@ name: `${name}`, | ||
stroke, | ||
style, | ||
style: iconStyles, | ||
viewBox: icon.attrs.viewBox, | ||
@@ -81,0 +86,0 @@ width: sizeNumber |
@@ -16,4 +16,4 @@ import React from 'react' | ||
it('name prop is equal to ab', () => { | ||
const component = shallow(<Icon | ||
name="ab" | ||
const component = shallow(<Icon | ||
name="ab" | ||
/>); | ||
@@ -33,12 +33,23 @@ expect(component.props().name).toEqual('ab'); | ||
it('style is equal to obj with color style', () => { | ||
const component = shallow( | ||
<Icon | ||
name="ab" | ||
size="medium" | ||
style={ {'color': 'tomato'} } | ||
/>); | ||
expect(component.props().style).toEqual({'color': 'tomato'}); | ||
}); | ||
it('fill is equal tomato', () => { | ||
const component = shallow( | ||
<Icon | ||
name="ab" | ||
size="medium" | ||
fill="tomato" | ||
/>); | ||
expect(component.props().style).toEqual({"fill": "tomato"}); | ||
}); | ||
it('style is equal to obj with color style and does not affect fill', () => { | ||
const component = shallow( | ||
<Icon | ||
name="ab" | ||
size="medium" | ||
fill="tomato" | ||
style={ { "color": "blue"} } | ||
/>); | ||
expect(component.props().style).toEqual({"color": "blue", "fill": "tomato"}); | ||
}); | ||
it('role prop is equal to ab icon', () => { | ||
@@ -70,6 +81,6 @@ const component = shallow( | ||
}); | ||
// | ||
// | ||
// const component = shallow(<Icon name='bell' />) | ||
// console.log(component); | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
347481
5568