1import React from 'react';
2import PropTypes from 'prop-types';
23 // validated component props (if wrapped)
34 const _disabled = disabled === true ? 'br-gray-30' : '';
36 const s = getStyles(styleManifest, format, size);
38 // This enables all children of this component to share the state of this
40 const childrenWithProps = React.Children.map(children, child =>
41 React.cloneElement(child, { displayPass, displayFailure, focussed })
45 <div className={'rel'}>
47 className={`bw-2 flex bs-solid ${s} ${validationClassnames} ${_disabled} ${className}`}
48 onChange={e => onChange(e)}
49 onFocus={e => onFocus(e)}
50 onBlur={e => onBlur(e)}
51 placeholder={placeholder}
65 displayFailure === true && isValidated === true
66 ? <div className={'yellow text-600 h-6 mt-1'}>{error}</div>
74const getStyles = (m, t, s) => `${m[t][s] || ''}`;
76const styleManifest = {
86 disabled: PropTypes.bool,
87 onChange: PropTypes.func,
88 onBlur: PropTypes.func,
89 onFocus: PropTypes.func,
90 className: PropTypes.string,
91 children: PropTypes.node,
92 autoFocus: PropTypes.bool,
93 maxLength: PropTypes.number,
94 readOnly: PropTypes.bool,
95 name: PropTypes.string,
96 value: PropTypes.string,
97 row: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
98 col: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
99 isSelected: PropTypes.bool,
100 hasBeenSelected: PropTypes.bool,
101 hasSubmitted: PropTypes.bool,
102 displayPass: PropTypes.bool,
103 displayFailure: PropTypes.bool,
104 error: PropTypes.string,
105 validationClassnames: PropTypes.string,
109TextArea.defaultProps = {
118 hasBeenSelected: false,
121 displayFailure: false,
125 validationClassnames: 'br-gray-50 f-br-blue outline-blue',
129export default TextArea;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list