UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

40 lines (36 loc) 1.19 kB
'use strict'; var tslib_es6 = require('../../node_modules/tslib/tslib.es6.js'); var React = require('react'); var PropTypes = require('prop-types'); var index = require('../../_virtual/index.js'); const BREAKPOINTS = [ 'xxl', 'xl', 'lg', 'md', 'sm', 'fluid', ]; const CContainer = React.forwardRef((_a, ref) => { var { children, className } = _a, rest = tslib_es6.__rest(_a, ["children", "className"]); const repsonsiveClassNames = []; BREAKPOINTS.forEach((bp) => { const breakpoint = rest[bp]; delete rest[bp]; breakpoint && repsonsiveClassNames.push(`container-${bp}`); }); return (React.createElement("div", Object.assign({ className: index.default(repsonsiveClassNames.length > 0 ? repsonsiveClassNames : 'container', className) }, rest, { ref: ref }), children)); }); CContainer.propTypes = { children: PropTypes.node, className: PropTypes.string, sm: PropTypes.bool, md: PropTypes.bool, lg: PropTypes.bool, xl: PropTypes.bool, xxl: PropTypes.bool, fluid: PropTypes.bool, }; CContainer.displayName = 'CContainer'; exports.CContainer = CContainer; //# sourceMappingURL=CContainer.js.map