@lightspeed/cirrus-icon
Advanced tools
Comparing version 3.6.0 to 3.7.0
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="3.7.0"></a> | ||
# [3.7.0](https://github.com/lightspeedretail/cirrus/compare/@lightspeed/cirrus-icon@3.6.0...@lightspeed/cirrus-icon@3.7.0) (2017-12-14) | ||
### Features | ||
* add spinner component ([#295](https://github.com/lightspeedretail/cirrus/issues/295)) ([839f7e0](https://github.com/lightspeedretail/cirrus/commit/839f7e0)) | ||
<a name="3.6.0"></a> | ||
@@ -8,0 +19,0 @@ # [3.6.0](https://github.com/lightspeedretail/cirrus/compare/@lightspeed/cirrus-icon@3.5.0...@lightspeed/cirrus-icon@3.6.0) (2017-12-14) |
12
index.js
@@ -9,4 +9,9 @@ import React from 'react'; | ||
const Icon = ({ name, size = '1rem', color, ...rest }) => { | ||
const iconClasses = cn('cr-icon', `cr-icon-${name}`); | ||
import styles from './Icon.scss'; | ||
const baseClass = 'cr-icon'; | ||
const Icon = ({ name, size = '1rem', color, className, ...rest }) => { | ||
const classNames = cn(styles[baseClass], `${styles[baseClass]}-${name}`, className); | ||
const iconSize = fontSizeAliases[size] || size; | ||
@@ -18,3 +23,3 @@ | ||
viewBox: '0 0 16 16', | ||
className: iconClasses, | ||
className: classNames, | ||
style: { | ||
@@ -40,2 +45,3 @@ width: iconSize, | ||
color: PropTypes.string, | ||
className: PropTypes.string, | ||
}; | ||
@@ -42,0 +48,0 @@ |
{ | ||
"name": "@lightspeed/cirrus-icon", | ||
"version": "3.6.0", | ||
"version": "3.7.0", | ||
"description": "Cirrus Icon Component", | ||
@@ -5,0 +5,0 @@ "author": "Lightspeed", |
@@ -79,13 +79,14 @@ # Icon | ||
| Prop | Type | Description | | ||
| --------------- | ------------ | ------------------------------------------------ | | ||
| `name` | `string` | Name of the icon | | ||
| `size` | `string` | Default 1rem, can be set to any custom value | | ||
| `color` | `string` | Applied on the svg `fill` property | | ||
| `baseColor` | `string` | Applied on the base paths `fill` property | | ||
| `baseColor1` | `string` | Applied on the base-1 path `fill` property | | ||
| `baseColor2` | `string` | Applied on the base-2 path `fill` property | | ||
| `detailsColor` | `string` | Applied on the details paths `fill` property | | ||
| `detailsColor1` | `string` | Applied on the details-1 path `fill` property | | ||
| `detailsColor2` | `string` | Applied on the details-2 path `fill` property | | ||
| Prop | Type | Description | | ||
| --------------- | ------------ | ------------------------------------------------------- | | ||
| `className` | `string` | Custom className to add in addition to the default ones | | ||
| `name` | `string` | Name of the icon | | ||
| `size` | `string` | Default 1rem, can be set to any custom value | | ||
| `color` | `string` | Applied on the svg `fill` property | | ||
| `baseColor` | `string` | Applied on the base paths `fill` property | | ||
| `baseColor1` | `string` | Applied on the base-1 path `fill` property | | ||
| `baseColor2` | `string` | Applied on the base-2 path `fill` property | | ||
| `detailsColor` | `string` | Applied on the details paths `fill` property | | ||
| `detailsColor1` | `string` | Applied on the details-1 path `fill` property | | ||
| `detailsColor2` | `string` | Applied on the details-2 path `fill` property | | ||
@@ -92,0 +93,0 @@ #### Example |
133
257300
2830