Sha256: 30d2045f16b560f820cf83810161a43cccf422db5cf7ef25e78a36ced4455746

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

import React from 'react'
import PropTypes from "prop-types"
import classnames from 'classnames'
import {Caption} from "../"

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 TextInput extends React.Component {
  render() {
    const {
      className,
      name,
      label,
      placeholder,
      type,
      value
    } = this.props

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

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

TextInput.propTypes = propTypes
TextInput.defaultProps = defaultProps

export default TextInput

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
playbook_ui-2.9.9 app/pb_kits/playbook/pb_text_input/_text_input.jsx
playbook_ui-2.9.8 app/pb_kits/playbook/pb_text_input/_text_input.jsx