Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
import React from 'react'
import { omit } from '@skava/modules/___dist/utils/omit'
import { defaultProps, omitKeys } from './fixture'
import { TextAreaProps, PassThroughTextAreaProps, StandardTextAreaProps } from './typings'
import { TextAreaWrap } from './styled'

export function toPlaceholder(props: TextAreaProps): string {
  return props.placeholder || props.placeHolder
}
export function toPassThrough(props: TextAreaProps) {
  return omit(props, omitKeys)
}
export function toAttributes(props: TextAreaProps) {
  const remaining = toPassThrough(props)
  const placeholder = toPlaceholder(props)
  const Wrap = toWrap(props)

  return {
    ...remaining,
    Wrap,
    placeholder,
  }
}
// @todo renderWrap too or render for textarea
export function toWrap(props: TextAreaProps) {
  return props.nowrap === true ? React.Fragment : TextAreaWrap
}