From f70cb49091fa287433342b173783ae0b5be9a312 Mon Sep 17 00:00:00 2001 From: Claudivan Filho Date: Tue, 11 Sep 2018 14:47:21 -0300 Subject: [PATCH 1/6] Add IconBars component --- CHANGELOG.md | 2 ++ react/IconBars.js | 3 ++ react/components/icon/Bars/index.js | 47 +++++++++++++++++++++++++++++ react/components/icon/README.md | 5 +++ 4 files changed, 57 insertions(+) create mode 100644 react/IconBars.js create mode 100644 react/components/icon/Bars/index.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 509fe04c9..6dbde646b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- `IconBars` component ### Added diff --git a/react/IconBars.js b/react/IconBars.js new file mode 100644 index 000000000..c5c17d306 --- /dev/null +++ b/react/IconBars.js @@ -0,0 +1,3 @@ +import Bars from './components/icon/Bars/index' + +export default Bars diff --git a/react/components/icon/Bars/index.js b/react/components/icon/Bars/index.js new file mode 100644 index 000000000..9c3480e88 --- /dev/null +++ b/react/components/icon/Bars/index.js @@ -0,0 +1,47 @@ +import React, { PureComponent } from 'react' +import PropTypes from 'prop-types' +import { calcIconSize, baseClassname } from '../utils' + +const iconBase = { + width: 18, + height: 12, +} + +class Bars extends PureComponent { + render() { + const { color, size, block } = this.props + const newSize = calcIconSize(iconBase, size) + + return ( + + + + ) + } +} + +Bars.defaultProps = { + color: 'currentColor', + size: 20, + block: false, +} + +Bars.propTypes = { + color: PropTypes.string, + size: PropTypes.number, + block: PropTypes.bool, +} + +export default Bars diff --git a/react/components/icon/README.md b/react/components/icon/README.md index 2d8df689f..d36b5ec00 100644 --- a/react/components/icon/README.md +++ b/react/components/icon/README.md @@ -4,6 +4,7 @@ Usage: `import from '@vtex/styleguide/lib const ArrowBack = require('./ArrowBack').default const ArrowDown = require('./ArrowDown').default const ArrowUp = require('./ArrowUp').default +const Bars = require('./Bars').default const CaretDown = require('./CaretDown').default const CaretLeft = require('./CaretLeft').default const CaretRight = require('./CaretRight').default @@ -202,6 +203,10 @@ const demoLabel = 'pb3 code c-muted-1 f6'
Warning (solid)
+ +
Bars
+ + From 6470f5fc3f672835cb80ca9f6c9fef2f8c2253c0 Mon Sep 17 00:00:00 2001 From: Claudivan Filho Date: Tue, 11 Sep 2018 15:23:01 -0300 Subject: [PATCH 2/6] Add IconUser component --- CHANGELOG.md | 2 +- react/IconUser.js | 3 ++ react/components/icon/README.md | 6 ++- react/components/icon/User/index.js | 65 +++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 react/IconUser.js create mode 100644 react/components/icon/User/index.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dbde646b..8969df717 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Added -- `IconBars` component +- `IconBars` and `IconUser` components ### Added diff --git a/react/IconUser.js b/react/IconUser.js new file mode 100644 index 000000000..cc4fb110c --- /dev/null +++ b/react/IconUser.js @@ -0,0 +1,3 @@ +import User from './components/icon/User/index' + +export default User diff --git a/react/components/icon/README.md b/react/components/icon/README.md index d36b5ec00..f7bf62a02 100644 --- a/react/components/icon/README.md +++ b/react/components/icon/README.md @@ -31,6 +31,7 @@ const Success = require('./Success').default const Upload = require('./Upload').default const VisibilityOff = require('./VisibilityOff').default const VisibilityOn = require('./VisibilityOn').default +const User = require('./User').default const Warning = require('./Warning').default const demoSize = 20 @@ -207,7 +208,10 @@ const demoLabel = 'pb3 code c-muted-1 f6'
Bars
- + +
User
+ + diff --git a/react/components/icon/User/index.js b/react/components/icon/User/index.js new file mode 100644 index 000000000..891ac7a71 --- /dev/null +++ b/react/components/icon/User/index.js @@ -0,0 +1,65 @@ +import React, { PureComponent } from 'react' +import PropTypes from 'prop-types' +import { calcIconSize, baseClassname } from '../utils' + +const iconBase = { + width: 44, + height: 44, +} + +class User extends PureComponent { + render() { + const { color, size, block } = this.props + const newSize = calcIconSize(iconBase, size) + + return ( + + + + + + ) + } +} + +User.defaultProps = { + color: 'currentColor', + size: 20, + block: false, +} + +User.propTypes = { + color: PropTypes.string, + size: PropTypes.number, + block: PropTypes.bool, +} + +export default User From 6090aae3ff3d76dbee34b2e3913716e57291dc10 Mon Sep 17 00:00:00 2001 From: Claudivan Filho Date: Tue, 11 Sep 2018 15:53:37 -0300 Subject: [PATCH 3/6] Add IconShoppingCart component --- CHANGELOG.md | 2 +- react/IconShoppingCart.js | 3 ++ react/components/icon/README.md | 7 ++++ react/components/icon/ShoppingCart/index.js | 44 +++++++++++++++++++++ react/components/icon/User/index.js | 2 +- 5 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 react/IconShoppingCart.js create mode 100644 react/components/icon/ShoppingCart/index.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 8969df717..17262e28d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Added -- `IconBars` and `IconUser` components +- `IconBars`, `IconUser` and `IconShoppingCart` components ### Added diff --git a/react/IconShoppingCart.js b/react/IconShoppingCart.js new file mode 100644 index 000000000..c58607d73 --- /dev/null +++ b/react/IconShoppingCart.js @@ -0,0 +1,3 @@ +import ShoppingCart from './components/icon/ShoppingCart/index' + +export default ShoppingCart diff --git a/react/components/icon/README.md b/react/components/icon/README.md index f7bf62a02..3cc25c1c3 100644 --- a/react/components/icon/README.md +++ b/react/components/icon/README.md @@ -27,6 +27,7 @@ const Link = require('./Link').default const Plus = require('./Plus').default const Save = require('./Save').default const Search = require('./Search').default +const ShoppingCart = require('./ShoppingCart').default const Success = require('./Success').default const Upload = require('./Upload').default const VisibilityOff = require('./VisibilityOff').default @@ -213,6 +214,12 @@ const demoLabel = 'pb3 code c-muted-1 f6' + + +
Shopping Cart
+ + + ``` diff --git a/react/components/icon/ShoppingCart/index.js b/react/components/icon/ShoppingCart/index.js new file mode 100644 index 000000000..c9dd76696 --- /dev/null +++ b/react/components/icon/ShoppingCart/index.js @@ -0,0 +1,44 @@ +import React, { PureComponent } from 'react' +import PropTypes from 'prop-types' +import { calcIconSize, baseClassname } from '../utils' + +const iconBase = { + width: 44, + height: 44, +} + +class ShoppingCart extends PureComponent { + render() { + const { color, size, block } = this.props + const newSize = calcIconSize(iconBase, size) + + return ( + + + + + + ) + } +} + +ShoppingCart.defaultProps = { + color: 'currentColor', + size: 20, + block: false, +} + +ShoppingCart.propTypes = { + color: PropTypes.string, + size: PropTypes.number, + block: PropTypes.bool, +} + +export default ShoppingCart diff --git a/react/components/icon/User/index.js b/react/components/icon/User/index.js index 891ac7a71..70a77371b 100644 --- a/react/components/icon/User/index.js +++ b/react/components/icon/User/index.js @@ -18,7 +18,7 @@ class User extends PureComponent { width={newSize.width} height={newSize.height} viewBox="0 0 44 44" - fill="transparent" + fill="none" xmlns="http://www.w3.org/2000/svg" > Date: Fri, 21 Sep 2018 10:35:05 -0300 Subject: [PATCH 4/6] Add solid prop to User and ShoppingCart icon --- react/components/icon/README.md | 8 ++++++ react/components/icon/ShoppingCart/index.js | 30 ++++++++++++++++++++- react/components/icon/User/index.js | 26 +++++++++++++++++- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/react/components/icon/README.md b/react/components/icon/README.md index 3cc25c1c3..1a13a32df 100644 --- a/react/components/icon/README.md +++ b/react/components/icon/README.md @@ -215,10 +215,18 @@ const demoLabel = 'pb3 code c-muted-1 f6' + +
User (solid)
+ +
Shopping Cart
+ +
Shopping Cart (solid)
+ + diff --git a/react/components/icon/ShoppingCart/index.js b/react/components/icon/ShoppingCart/index.js index c9dd76696..67bd52c63 100644 --- a/react/components/icon/ShoppingCart/index.js +++ b/react/components/icon/ShoppingCart/index.js @@ -9,9 +9,35 @@ const iconBase = { class ShoppingCart extends PureComponent { render() { - const { color, size, block } = this.props + const { color, size, block, solid } = this.props const newSize = calcIconSize(iconBase, size) + if (solid) { + return ( + + + + + + ) + } + return ( + + + + ) + } + return ( Date: Wed, 26 Sep 2018 14:47:52 -0300 Subject: [PATCH 5/6] Update icon/README.md --- react/components/icon/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react/components/icon/README.md b/react/components/icon/README.md index 1a13a32df..40a8e009c 100644 --- a/react/components/icon/README.md +++ b/react/components/icon/README.md @@ -213,8 +213,6 @@ const demoLabel = 'pb3 code c-muted-1 f6'
User
- -
User (solid)
@@ -223,6 +221,8 @@ const demoLabel = 'pb3 code c-muted-1 f6'
Shopping Cart
+ +
Shopping Cart (solid)
From 144ce7658ba10e7f011b2aa12e05c49d21191d01 Mon Sep 17 00:00:00 2001 From: claudivanfilho Date: Thu, 27 Sep 2018 09:04:16 -0300 Subject: [PATCH 6/6] Use filled icons as default in UserIcon and ShoppingCartIcon --- react/components/icon/README.md | 10 ---- react/components/icon/ShoppingCart/index.js | 47 ++++++------------- react/components/icon/User/index.js | 52 +++------------------ 3 files changed, 20 insertions(+), 89 deletions(-) diff --git a/react/components/icon/README.md b/react/components/icon/README.md index 40a8e009c..d0e0d5bc0 100644 --- a/react/components/icon/README.md +++ b/react/components/icon/README.md @@ -213,21 +213,11 @@ const demoLabel = 'pb3 code c-muted-1 f6'
User
- -
User (solid)
- -
Shopping Cart
- - -
Shopping Cart (solid)
- - - ``` diff --git a/react/components/icon/ShoppingCart/index.js b/react/components/icon/ShoppingCart/index.js index 67bd52c63..d5389444d 100644 --- a/react/components/icon/ShoppingCart/index.js +++ b/react/components/icon/ShoppingCart/index.js @@ -9,47 +9,30 @@ const iconBase = { class ShoppingCart extends PureComponent { render() { - const { color, size, block, solid } = this.props + const { color, size, block } = this.props const newSize = calcIconSize(iconBase, size) - if (solid) { - return ( - - - - - - ) - } - return ( - - - + + + ) } @@ -59,14 +42,12 @@ ShoppingCart.defaultProps = { color: 'currentColor', size: 20, block: false, - solid: false, } ShoppingCart.propTypes = { color: PropTypes.string, size: PropTypes.number, block: PropTypes.bool, - solid: PropTypes.bool, } export default ShoppingCart diff --git a/react/components/icon/User/index.js b/react/components/icon/User/index.js index a5319cf5d..cca7df6cb 100644 --- a/react/components/icon/User/index.js +++ b/react/components/icon/User/index.js @@ -9,63 +9,25 @@ const iconBase = { class User extends PureComponent { render() { - const { color, size, block, solid } = this.props + const { color, size, block } = this.props const newSize = calcIconSize(iconBase, size) - if (solid) { - return ( - - - - - ) - } - return ( - ) @@ -76,14 +38,12 @@ User.defaultProps = { color: 'currentColor', size: 20, block: false, - solid: false, } User.propTypes = { color: PropTypes.string, size: PropTypes.number, block: PropTypes.bool, - solid: PropTypes.bool, } export default User