Skip to content

Commit a889d7a

Browse files
authored
fix: forminput state proptype is now oneOf, not string (#453)
* forminput state proptype now oneOf InputTypes, not string * removed '' default per previous discussion on empty string in a prev PR
1 parent e6fa7fb commit a889d7a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Forms/FormInput.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import classnames from 'classnames';
2+
import { INPUT_TYPES } from '../utils/constants';
23
import PropTypes from 'prop-types';
34
import React from 'react';
45

@@ -22,7 +23,7 @@ FormInput.displayName = 'FormInput';
2223

2324
FormInput.propTypes = {
2425
className: PropTypes.string,
25-
state: PropTypes.string
26+
state: PropTypes.oneOf(INPUT_TYPES)
2627
};
2728

2829
FormInput.propDescriptions = {

src/utils/constants.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ export const BADGE_MODIFIERS = [
1616
'filled'
1717
];
1818

19+
export const INPUT_TYPES = [
20+
'normal',
21+
'valid',
22+
'invalid',
23+
'warning',
24+
'help',
25+
'disabled',
26+
'readonly'
27+
];
28+
1929
export const LABEL_TYPES = [
2030
'success',
2131
'warning',

0 commit comments

Comments
 (0)