/* @flow */ import React, { forwardRef } from 'react' import classnames from 'classnames' import { Body, Caption } from '../' import { globalProps } from '../utilities/globalProps.js' import { buildAriaProps, buildDataProps, } from '../utilities/props' type TextInputProps = { aria?: object, className: string, data?: object, dark?: boolean, disabled?: boolean, error?: string, id?: string, name: string, label: string, onBlur: (String) => void, onChange: (String) => void, placeholder: string, required?: boolean, type: string, value: string | number, children: Node, } const TextInput = ( props: TextInputProps, ref: React.ElementRef<"input"> ) => { const { aria = {}, className, data = {}, dark = false, disabled, error, id, name, label, onBlur = () => {}, onChange = () => {}, placeholder, required, type = 'text', value = '', children = null, } = props const ariaProps = buildAriaProps(aria) const dataProps = buildDataProps(data) const css = classnames([ 'pb_text_input_kit', error ? 'error' : null, globalProps(props), className, ]) return (
{children}
) } export default forwardRef(TextInput)