2016-09-12 15:14:07 +00:00
|
|
|
import styles from '../../../../styles';
|
|
|
|
|
|
|
|
|
|
const { color, font, padding } = styles;
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
containerStyles: {
|
|
|
|
|
marginTop: padding.base,
|
|
|
|
|
position: 'relative',
|
2016-09-23 18:04:01 +00:00
|
|
|
width: '100%',
|
2016-09-12 15:14:07 +00:00
|
|
|
},
|
2016-09-14 20:31:54 +00:00
|
|
|
errorStyles: {
|
2016-09-16 21:19:37 +00:00
|
|
|
color: color.alert,
|
2016-09-14 20:31:54 +00:00
|
|
|
fontSize: font.small,
|
|
|
|
|
textTransform: 'lowercase',
|
|
|
|
|
},
|
2016-09-23 18:04:01 +00:00
|
|
|
iconStyles: (value) => {
|
|
|
|
|
const baseStyles = {
|
|
|
|
|
position: 'absolute',
|
|
|
|
|
right: '6px',
|
|
|
|
|
top: '28px',
|
|
|
|
|
fontSize: '20px',
|
|
|
|
|
color: color.accentText,
|
|
|
|
|
};
|
|
|
|
|
if (value) {
|
|
|
|
|
return {
|
|
|
|
|
...baseStyles,
|
|
|
|
|
color: color.brand,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return baseStyles;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
iconErrorStyles: (error) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
return {
|
|
|
|
|
color: color.alert,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return false;
|
2016-09-12 15:14:07 +00:00
|
|
|
},
|
2016-09-14 20:31:54 +00:00
|
|
|
inputErrorStyles: (error) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
return {
|
2016-09-16 21:19:37 +00:00
|
|
|
borderBottomColor: color.alert,
|
2016-09-14 20:31:54 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {};
|
|
|
|
|
},
|
2016-09-23 18:04:01 +00:00
|
|
|
inputStyles: (value, type) => {
|
2016-09-12 15:14:07 +00:00
|
|
|
const baseStyles = {
|
|
|
|
|
borderLeft: 'none',
|
|
|
|
|
borderRight: 'none',
|
|
|
|
|
borderTop: 'none',
|
2016-09-23 18:04:01 +00:00
|
|
|
borderBottomWidth: '2px',
|
|
|
|
|
fontSize: '20px',
|
2016-09-12 15:14:07 +00:00
|
|
|
borderBottomStyle: 'solid',
|
2016-09-23 18:04:01 +00:00
|
|
|
borderBottomColor: color.brandUltralight,
|
2016-09-16 21:19:37 +00:00
|
|
|
color: color.accentText,
|
2016-09-23 18:04:01 +00:00
|
|
|
paddingRight: '30px',
|
|
|
|
|
opacity: '1',
|
|
|
|
|
textIndent: '1px',
|
|
|
|
|
position: 'relative',
|
|
|
|
|
width: '100%',
|
|
|
|
|
boxSizing: 'border-box',
|
2016-09-12 15:14:07 +00:00
|
|
|
':focus': {
|
|
|
|
|
outline: 'none',
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
2016-09-23 18:04:01 +00:00
|
|
|
if (type === 'password' && value) {
|
|
|
|
|
return {
|
|
|
|
|
...baseStyles,
|
|
|
|
|
letterSpacing: '7px',
|
|
|
|
|
color: color.textUltradark,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-12 15:14:07 +00:00
|
|
|
if (value) {
|
|
|
|
|
return {
|
|
|
|
|
...baseStyles,
|
2016-09-16 21:19:37 +00:00
|
|
|
color: color.textUltradark,
|
2016-09-12 15:14:07 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return baseStyles;
|
|
|
|
|
},
|
|
|
|
|
placeholderStyles: (value) => {
|
|
|
|
|
if (!value) return { visibility: 'hidden', height: '22px' };
|
|
|
|
|
|
|
|
|
|
return {
|
2016-09-16 21:19:37 +00:00
|
|
|
color: color.brand,
|
2016-09-12 15:14:07 +00:00
|
|
|
fontSize: font.small,
|
|
|
|
|
textTransform: 'lowercase',
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
};
|