Sha256: a48fd86a28a387895620bf53e8a8ce45fed0c29e70156904899216e414879615
Contents?: true
Size: 1.16 KB
Versions: 61
Compression:
Stored size: 1.16 KB
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, shrink: boolean, flex: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'none', className: string, overflow?: "auto" | "hidden" | "initial" | "inherit" | "scroll" | "visible", } const FlexItem = (props: FlexItemPropTypes) => { const { children, className, fixedSize, grow, overflow = null, shrink, flex } = props const growClass = grow === true ? 'grow' : '' const flexClass = flex !== 'none' ? `flex_${flex}` : '' const overflowClass = overflow ? `overflow_${overflow}` : '' const shrinkClass = shrink === true ? 'shrink' : '' const fixedStyle = fixedSize !== undefined ? { flexBasis: `${fixedSize}` } : null return ( <div className={classnames(buildCss('pb_flex_item_kit', growClass, shrinkClass, flexClass), overflowClass, globalProps(props), className)} style={fixedStyle} > {children} </div> ) } export default FlexItem
Version data entries
61 entries across 61 versions & 1 rubygems