Sha256: fafcb43158609221147d6dd39cf57de37d0adafd756f0a89aa53192ef92f2af0

Contents?: true

Size: 779 Bytes

Versions: 7

Compression:

Stored size: 779 Bytes

Contents

/* @flow */
import React from 'react'
import classnames from 'classnames'
import { buildCss } from '../utilities/props'
import { globalProps } from '../utilities/globalProps.js'
type FlexItemPropTypes = {
  children: Array<React.ReactNode> | React.ReactNode,
  fixedSize: String,
  grow: Boolean,
  className: String,
}

const FlexItem = (props: FlexItemPropTypes) => {
  const { children, className, fixedSize, grow } = props
  const growClass = grow === true ? 'grow' : ''
  const fixedStyle =
    fixedSize !== undefined ? { flexBasis: `${fixedSize}` } : null

  return (
    <div
        className={classnames(buildCss('pb_flex_item_kit', growClass), className, globalProps(props))}
        style={fixedStyle}
    >
      {children}
    </div>
  )
}

export default FlexItem

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/pb_flex/_flex_item.jsx
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/pb_flex/_flex_item.jsx
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/pb_flex/_flex_item.jsx
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/pb_flex/_flex_item.jsx
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/pb_flex/_flex_item.jsx
playbook_ui-6.1.0 app/pb_kits/playbook/pb_flex/_flex_item.jsx
playbook_ui-6.0.1.pre.alpha6 app/pb_kits/playbook/pb_flex/_flex_item.jsx