joyent-portal/packages/ui-toolkit/src/form/input.js

36 lines
660 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import BaseInput, { Stylable } from './base/input';
import Baseline from '../baseline';
const InputStyled = Baseline(BaseInput(Stylable('input')));
/**
* @example ./usage-input.md
*/
const Input = ({ children, ...rest }) => (
<InputStyled {...rest}>{children}</InputStyled>
);
export default Input;
Input.propTypes = {
/**
* Input type
*/
type: PropTypes.string,
/**
* Is the checkbox disabled ?
*/
disabled: PropTypes.bool,
/**
* Placeholder text for the Input
*/
placeholder: PropTypes.string
};
Input.defaultProps = {
type: 'text',
disabled: false
};