@@ -18,7 +18,7 @@ import useTranslate from '../helpers/useTranslate';
1818const useStyles = makeStyles ( {
1919 root : {
2020 backgroundImage : props =>
21- props . alpha < 1
21+ props . colorError || props . alpha < 1
2222 ? `
2323 linear-gradient(45deg, #ccc 25%, transparent 25%),
2424 linear-gradient(135deg, #ccc 25%, transparent 25%),
@@ -39,14 +39,22 @@ const useStyles = makeStyles({
3939 height : props => props . height ,
4040 '& div' : {
4141 content : '" "' ,
42- backgroundColor : props => props . backgroundColor || '#fff' ,
43- backgroundSize : '8px 8px' ,
42+ background : props =>
43+ props . colorError
44+ ? `repeating-linear-gradient(
45+ 135deg,
46+ transparent,
47+ transparent ${ props . width / 2 + 2 } px,
48+ #f44336 ${ props . width / 2 + 2 } px,
49+ #f44336 ${ props . width / 2 + 4 } px
50+ )`
51+ : 'none' ,
52+ backgroundColor : props => ( props . colorError ? 'transparent' : props . backgroundColor || '#fff' ) ,
4453 width : props => props . width ,
4554 minWidth : props => props . minWidth ,
4655 height : props => props . height ,
47- borderColor : props => props . borderColor || '#767676' ,
48- borderStyle : 'solid' ,
49- borderWidth : props => props . borderWidth || 0 ,
56+ border : props =>
57+ props . colorError ? '2px solid #f44336' : `${ props . borderWidth || 0 } px solid ${ props . borderColor || '#767676' } ` ,
5058 borderRadius : 4 ,
5159 padding : 0 ,
5260 } ,
@@ -98,6 +106,7 @@ const ColorButton = ({
98106 borderColor,
99107 borderWidth,
100108 alpha : a ,
109+ colorError : ! ! color . error ,
101110 ...cssColor ,
102111 } ) ;
103112 const component = (
0 commit comments