UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

38 lines (35 loc) 1.16 kB
import { __rest } from '../../node_modules/tslib/tslib.es6.js'; import React, { forwardRef } from 'react'; import PropTypes from 'prop-types'; import classNames from '../../_virtual/index.js'; const BREAKPOINTS = [ 'xxl', 'xl', 'lg', 'md', 'sm', 'fluid', ]; const CContainer = forwardRef((_a, ref) => { var { children, className } = _a, rest = __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: classNames(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'; export { CContainer }; //# sourceMappingURL=CContainer.js.map