Skip to content

Commit 1d887a1

Browse files
committed
Removed defaultProps.
1 parent bc9a0e1 commit 1d887a1

19 files changed

Lines changed: 218 additions & 192 deletions

File tree

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"@storybook/addon-knobs": "^3.2.0",
6262
"@storybook/addon-options": "^3.2.4",
6363
"@storybook/react": "^3.2.4",
64-
"babel-cli": "^6.8.0",
64+
"babel-cli": "^6.10.4",
6565
"babel-core": "^6.10.4",
6666
"babel-jest": "^20.0.3",
6767
"babel-loader": "^6.2.1",
@@ -72,6 +72,7 @@
7272
"babel-register": "^6.5.2",
7373
"chai": "^3.3.0",
7474
"chai-spies": "^0.7.1",
75+
"chalk": "^2.4.2",
7576
"css-loader": "^0.24.0",
7677
"enzyme": "2.8.2",
7778
"event-stream": "^3.3.1",
@@ -87,13 +88,13 @@
8788
"normalize.css": "^4.1.1",
8889
"npm": "^5.3.0",
8990
"object-assign": "^4.1.0",
90-
"react": "^15.3.2",
91-
"react-addons-test-utils": "^0.14.0 || ^15.0.0",
91+
"react": "^15.5.4",
92+
"react-addons-test-utils": "15.6.2",
9293
"react-context": "0.0.3",
93-
"react-dom": "^0.14.0 || ^15.0.0",
94+
"react-dom": "^15.5.4",
9495
"react-hot-loader": "^1.2.8",
9596
"react-mark": "0.0.4",
96-
"react-test-renderer": "^15.3.2",
97+
"react-test-renderer": "^15.5.4",
9798
"remarkable": "^1.6.0",
9899
"require-dir": "^0.3.0",
99100
"rimraf": "^2.5.0",
@@ -102,6 +103,9 @@
102103
"webpack": "^1.11.0",
103104
"webpack-dev-server": "^1.10.1"
104105
},
106+
"overrides": {
107+
"chalk": "^2.4.2"
108+
},
105109
"files": [
106110
"lib",
107111
"es"

src/components/alpha/Alpha.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@ import reactCSS from 'reactcss'
44
import { ColorWrap, Alpha } from '../common'
55
import AlphaPointer from './AlphaPointer'
66

7-
export const AlphaPicker = ({ rgb, hsl, width, height, onChange, direction, style,
8-
renderers, pointer, className = '' }) => {
7+
export const AlphaPicker = ({
8+
rgb,
9+
hsl,
10+
width = '316px',
11+
height = '16px',
12+
onChange,
13+
direction = 'horizontal',
14+
style,
15+
renderers,
16+
pointer = AlphaPointer,
17+
className = ''
18+
}) => {
919
const styles = reactCSS({
1020
'default': {
1121
picker: {
@@ -35,11 +45,4 @@ export const AlphaPicker = ({ rgb, hsl, width, height, onChange, direction, styl
3545
)
3646
}
3747

38-
AlphaPicker.defaultProps = {
39-
width: '316px',
40-
height: '16px',
41-
direction: 'horizontal',
42-
pointer: AlphaPointer,
43-
}
44-
4548
export default ColorWrap(AlphaPicker)

src/components/block/Block.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,17 @@ import * as color from '../../helpers/color'
77
import { ColorWrap, EditableInput, Checkboard } from '../common'
88
import BlockSwatches from './BlockSwatches'
99

10-
export const Block = ({ onChange, onSwatchHover, hex, colors, width, triangle,
11-
styles: passedStyles = {}, className = '' }) => {
10+
export const Block = ({
11+
onChange,
12+
onSwatchHover,
13+
hex,
14+
colors = ['#D9E3F0', '#F47373', '#697689', '#37D67A', '#2CCCE4', '#555555',
15+
'#dce775', '#ff8a65', '#ba68c8'],
16+
width = 170,
17+
triangle = 'top',
18+
styles: passedStyles = {},
19+
className = ''
20+
}) => {
1221
const transparent = hex === 'transparent'
1322
const handleChange = (hexCode, e) => {
1423
color.isValidHex(hexCode) && onChange({
@@ -106,12 +115,4 @@ Block.propTypes = {
106115
styles: PropTypes.object,
107116
}
108117

109-
Block.defaultProps = {
110-
width: 170,
111-
colors: ['#D9E3F0', '#F47373', '#697689', '#37D67A', '#2CCCE4', '#555555',
112-
'#dce775', '#ff8a65', '#ba68c8'],
113-
triangle: 'top',
114-
styles: {},
115-
}
116-
117118
export default ColorWrap(Block)

src/components/chrome/Chrome.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,19 @@ import ChromeFields from './ChromeFields'
88
import ChromePointer from './ChromePointer'
99
import ChromePointerCircle from './ChromePointerCircle'
1010

11-
export const Chrome = ({ width, onChange, disableAlpha, rgb, hsl, hsv, hex, renderers,
12-
styles: passedStyles = {}, className = '', defaultView }) => {
11+
export const Chrome = ({
12+
width = 225,
13+
onChange,
14+
disableAlpha = false,
15+
rgb,
16+
hsl,
17+
hsv,
18+
hex,
19+
renderers,
20+
styles: passedStyles = {},
21+
className = '',
22+
defaultView
23+
}) => {
1324
const styles = reactCSS(merge({
1425
'default': {
1526
picker: {
@@ -155,10 +166,4 @@ Chrome.propTypes = {
155166
]),
156167
}
157168

158-
Chrome.defaultProps = {
159-
width: 225,
160-
disableAlpha: false,
161-
styles: {},
162-
}
163-
164169
export default ColorWrap(Chrome)

src/components/circle/Circle.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,23 @@ import * as material from 'material-colors'
88
import { ColorWrap } from '../common'
99
import CircleSwatch from './CircleSwatch'
1010

11-
export const Circle = ({ width, onChange, onSwatchHover, colors, hex, circleSize,
12-
styles: passedStyles = {}, circleSpacing, className = '' }) => {
11+
export const Circle = ({
12+
width = 252,
13+
onChange,
14+
onSwatchHover,
15+
colors = [
16+
material.red['500'], material.pink['500'], material.purple['500'],
17+
material.deepPurple['500'], material.indigo['500'], material.blue['500'],
18+
material.lightBlue['500'], material.cyan['500'], material.teal['500'],
19+
material.green['500'], material.lightGreen['500'], material.lime['500'],
20+
material.yellow['500'], material.amber['500'], material.orange['500'],
21+
material.deepOrange['500'], material.brown['500'], material.blueGrey['500']],
22+
hex,
23+
circleSize = 28,
24+
styles: passedStyles = {},
25+
circleSpacing = 14,
26+
className = ''
27+
}) => {
1328
const styles = reactCSS(merge({
1429
'default': {
1530
card: {
@@ -48,17 +63,4 @@ Circle.propTypes = {
4863
styles: PropTypes.object,
4964
}
5065

51-
Circle.defaultProps = {
52-
width: 252,
53-
circleSize: 28,
54-
circleSpacing: 14,
55-
colors: [material.red['500'], material.pink['500'], material.purple['500'],
56-
material.deepPurple['500'], material.indigo['500'], material.blue['500'],
57-
material.lightBlue['500'], material.cyan['500'], material.teal['500'],
58-
material.green['500'], material.lightGreen['500'], material.lime['500'],
59-
material.yellow['500'], material.amber['500'], material.orange['500'],
60-
material.deepOrange['500'], material.brown['500'], material.blueGrey['500']],
61-
styles: {},
62-
}
63-
6466
export default ColorWrap(Circle)

src/components/circle/CircleSwatch.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@ import reactCSS, { handleHover } from 'reactcss'
33

44
import { Swatch } from '../common'
55

6-
export const CircleSwatch = ({ color, onClick, onSwatchHover, hover, active,
7-
circleSize, circleSpacing }) => {
6+
export const CircleSwatch = ({
7+
color,
8+
onClick,
9+
onSwatchHover,
10+
hover,
11+
active,
12+
circleSize = 28,
13+
circleSpacing = 14
14+
}) => {
815
const styles = reactCSS({
916
'default': {
1017
swatch: {
@@ -47,9 +54,4 @@ export const CircleSwatch = ({ color, onClick, onSwatchHover, hover, active,
4754
)
4855
}
4956

50-
CircleSwatch.defaultProps = {
51-
circleSize: 28,
52-
circleSpacing: 14,
53-
}
54-
5557
export default handleHover(CircleSwatch)

src/components/common/Checkboard.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import React, { isValidElement } from 'react'
22
import reactCSS from 'reactcss'
33
import * as checkboard from '../../helpers/checkboard'
44

5-
export const Checkboard = ({ white, grey, size, renderers, borderRadius, boxShadow, children }) => {
5+
export const Checkboard = ({
6+
white = 'transparent',
7+
grey = 'rgba(0,0,0,.08)',
8+
size = 8,
9+
renderers = {},
10+
borderRadius,
11+
boxShadow,
12+
children }) => {
613
const styles = reactCSS({
714
'default': {
815
grid: {
@@ -16,11 +23,4 @@ export const Checkboard = ({ white, grey, size, renderers, borderRadius, boxShad
1623
return isValidElement(children)?React.cloneElement(children, { ...children.props, style: {...children.props.style,...styles.grid}}):<div style={styles.grid}/>;
1724
}
1825

19-
Checkboard.defaultProps = {
20-
size: 8,
21-
white: 'transparent',
22-
grey: 'rgba(0,0,0,.08)',
23-
renderers: {},
24-
}
25-
2626
export default Checkboard

src/components/common/ColorWrap.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export const ColorWrap = (Picker) => {
6262
}
6363

6464
ColorPicker.defaultProps = {
65-
...Picker.defaultProps,
6665
color: {
6766
h: 250,
6867
s: 0.50,

src/components/common/Raised.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ import PropTypes from 'prop-types'
33
import reactCSS from 'reactcss'
44
import merge from 'lodash/merge'
55

6-
export const Raised = ({ zDepth, radius, background, children,
7-
styles: passedStyles = {} }) => {
6+
export const Raised = ({
7+
zDepth = 1,
8+
radius = 2,
9+
background = '#fff',
10+
children,
11+
styles: passedStyles = {}
12+
}) => {
813
const styles = reactCSS(merge({
914
'default': {
1015
wrap: {
@@ -81,11 +86,4 @@ Raised.propTypes = {
8186
styles: PropTypes.object,
8287
}
8388

84-
Raised.defaultProps = {
85-
background: '#fff',
86-
zDepth: 1,
87-
radius: 2,
88-
styles: {},
89-
}
90-
9189
export default Raised

src/components/compact/Compact.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,21 @@ import { ColorWrap, Raised } from '../common'
99
import CompactColor from './CompactColor'
1010
import CompactFields from './CompactFields'
1111

12-
export const Compact = ({ onChange, onSwatchHover, colors, hex, rgb,
13-
styles: passedStyles = {}, className = '' }) => {
12+
export const Compact = ({
13+
onChange,
14+
onSwatchHover,
15+
colors = ['#4D4D4D', '#999999', '#FFFFFF', '#F44E3B', '#FE9200', '#FCDC00',
16+
'#DBDF00', '#A4DD00', '#68CCCA', '#73D8FF', '#AEA1FF', '#FDA1FF',
17+
'#333333', '#808080', '#cccccc', '#D33115', '#E27300', '#FCC400',
18+
'#B0BC00', '#68BC00', '#16A5A5', '#009CE0', '#7B64FF', '#FA28FF',
19+
'#000000', '#666666', '#B3B3B3', '#9F0500', '#C45100', '#FB9E00',
20+
'#808900', '#194D33', '#0C797D', '#0062B1', '#653294', '#AB149E',
21+
],
22+
hex,
23+
rgb,
24+
styles: passedStyles = {},
25+
className = ''
26+
}) => {
1427
const styles = reactCSS(merge({
1528
'default': {
1629
Compact: {
@@ -66,15 +79,4 @@ Compact.propTypes = {
6679
styles: PropTypes.object,
6780
}
6881

69-
Compact.defaultProps = {
70-
colors: ['#4D4D4D', '#999999', '#FFFFFF', '#F44E3B', '#FE9200', '#FCDC00',
71-
'#DBDF00', '#A4DD00', '#68CCCA', '#73D8FF', '#AEA1FF', '#FDA1FF',
72-
'#333333', '#808080', '#cccccc', '#D33115', '#E27300', '#FCC400',
73-
'#B0BC00', '#68BC00', '#16A5A5', '#009CE0', '#7B64FF', '#FA28FF',
74-
'#000000', '#666666', '#B3B3B3', '#9F0500', '#C45100', '#FB9E00',
75-
'#808900', '#194D33', '#0C797D', '#0062B1', '#653294', '#AB149E',
76-
],
77-
styles: {},
78-
}
79-
8082
export default ColorWrap(Compact)

0 commit comments

Comments
 (0)