UNPKG

semantic-ui-react

Version:
71 lines (54 loc) 2.22 kB
import _extends from 'babel-runtime/helpers/extends'; import cx from 'classnames'; import React, { PropTypes } from 'react'; import { customPropTypes, getElementType, getUnhandledProps, META, useKeyOnly } from '../../lib'; /** * A divider visually segments content into groups. */ function Divider(props) { var children = props.children, className = props.className, clearing = props.clearing, fitted = props.fitted, hidden = props.hidden, horizontal = props.horizontal, inverted = props.inverted, section = props.section, vertical = props.vertical; var classes = cx('ui', useKeyOnly(clearing, 'clearing'), useKeyOnly(fitted, 'fitted'), useKeyOnly(hidden, 'hidden'), useKeyOnly(horizontal, 'horizontal'), useKeyOnly(inverted, 'inverted'), useKeyOnly(section, 'section'), useKeyOnly(vertical, 'vertical'), 'divider', className); var rest = getUnhandledProps(Divider, props); var ElementType = getElementType(Divider, props); return React.createElement( ElementType, _extends({}, rest, { className: classes }), children ); } Divider.handledProps = ['as', 'children', 'className', 'clearing', 'fitted', 'hidden', 'horizontal', 'inverted', 'section', 'vertical']; Divider._meta = { name: 'Divider', type: META.TYPES.ELEMENT }; process.env.NODE_ENV !== "production" ? Divider.propTypes = { /** An element type to render as (string or function). */ as: customPropTypes.as, /** Primary content. */ children: PropTypes.node, /** Additional classes. */ className: PropTypes.string, /** Divider can clear the content above it. */ clearing: PropTypes.bool, /** Divider can be fitted without any space above or below it. */ fitted: PropTypes.bool, /** Divider can divide content without creating a dividing line. */ hidden: PropTypes.bool, /** Divider can segment content horizontally. */ horizontal: PropTypes.bool, /** Divider can have it's colours inverted. */ inverted: PropTypes.bool, /** Divider can provide greater margins to divide sections of content. */ section: PropTypes.bool, /** Divider can segment content vertically. */ vertical: PropTypes.bool } : void 0; export default Divider;