Sha256: c696d471714a3df4334772c3d91a4cc762bb6848847f2a503cbccb38e0348426
Contents?: true
Size: 1.61 KB
Versions: 44
Compression:
Stored size: 1.61 KB
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { Body, Caption } from '../' import type { InputCallback } from '../types.js' import { spacing } from '../utilities/spacing.js' type TextareaProps = { className?: String, children?: Array<React.ReactChild>, data?: String, error?: String, id?: String, object?: String, method?: String, label?: String, placeholder?: String, value?: String, name?: String, rows?: Number, dark?: Boolean, resize: 'none' | 'both' | 'horizontal' | 'vertical', onChange?: InputCallback<HTMLTextAreaElement>, } const Textarea = ({ className, children, dark = false, resize = 'none', error, label, name, onChange = () => {}, placeholder, rows = 4, value, ...props }: TextareaProps) => { const textareaClass = `pb_textarea_kit${dark ? '_dark' : ''}` const errorClass = error ? 'error' : null const resizeClass = ` resize_${resize}` return ( <div className={classnames(textareaClass, className, errorClass, resizeClass, spacing(props))}> <Caption dark={dark} text={label} /> <If condition={children}> {children} <Else /> <textarea {...props} className={textareaClass} name={name} onChange={onChange} placeholder={placeholder} rows={rows} value={value} /> <If condition={error}> <Body dark={dark} status="negative" text={error} /> </If> </If> </div> ) } export default Textarea
Version data entries
44 entries across 44 versions & 1 rubygems