Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions src/Forms/FormInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { INPUT_TYPES } from '../utils/constants';
import PropTypes from 'prop-types';
import React from 'react';

const FormInput = ({ state, className, ...props }) => {
const FormInput = ({ state, className, disabled, id, name, placeholder, readOnly, type, value, ...props }) => {
const formInputClasses = classnames(
'fd-form__control',
{
Expand All @@ -15,7 +15,14 @@ const FormInput = ({ state, className, ...props }) => {
return (
<input
{...props}
className={formInputClasses} />
className={formInputClasses}
disabled={disabled}
id={id}
name={name}
placeholder={placeholder}
readOnly={readOnly}
type={type}
value={value} />
);
};

Expand All @@ -24,12 +31,20 @@ FormInput.displayName = 'FormInput';
FormInput.propTypes = {
className: PropTypes.string,
disabled: PropTypes.bool,
id: PropTypes.string,
name: PropTypes.string,
placeholder: PropTypes.string,
readOnly: PropTypes.bool,
state: PropTypes.oneOf(INPUT_TYPES)
state: PropTypes.oneOf(INPUT_TYPES),
type: PropTypes.string,
value: PropTypes.string
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FormInput.propDescriptions = {
state: 'Sets the state of the input. Can be left empty for default styles.'
name: 'Value for the `name` attribute on the input.',
state: 'Sets the state of the input. Can be left empty for default styles.',
type: 'Value for the `type` attribute on the input.',
value: 'Value for the `value` attribute on the input.'
};

export default FormInput;