Sha256: 108765cb5e54e4b39761258dfd07435675d2e6599243fa070a07325c634e9e3a

Contents?: true

Size: 1.07 KB

Versions: 15

Compression:

Stored size: 1.07 KB

Contents

import React from 'react';
import PropTypes from "prop-types";
import classnames from 'classnames';
import Caption from "../pb_caption/_caption.jsx";

const propTypes = {
  className: PropTypes.string,
  name: PropTypes.string,
  label: PropTypes.string,
  placeholder: PropTypes.string,
  type: PropTypes.string,
  value: PropTypes.oneOfType([
      PropTypes.string,
      PropTypes.number
  ])
};

const defaultProps = {
  type: "text"
};

class Input extends React.Component {
  render() {
    const {
      className,
      name,
      label,
      placeholder,
      type,
      value
    } = this.props;

    const css = classnames([
      `input_field`,
      className,
    ])

    return (
      <div className="pb_input">
        <Caption text={label} />
        <div className="input_wrapper">
          <input className={css}
              name={name}
              placeholder={placeholder}
              type={type}
              value={value}
          />
        </div>
      </div>
    )
  }
}

Input.propTypes = propTypes;
Input.defaultProps = defaultProps;

export default Input;

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
playbook_ui-2.9.1 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.9.0 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.8.9 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.8.8 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.8.7 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.8.6 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.8.5 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.8.4 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.8.3 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.8.1 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.7.2 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.7.1 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.7.0 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.6.0 app/pb_kits/playbook/pb_input/_input.jsx
playbook_ui-2.5.0 app/pb_kits/playbook/pb_input/_input.jsx