UNPKG

@coreui/react

Version:

UI Components Library for React.js

38 lines (35 loc) 1.2 kB
import { __rest, __assign } from '../../node_modules/tslib/tslib.es6.js'; import React, { forwardRef } from 'react'; import PropTypes from 'prop-types'; import classNames from '../../_virtual/index.js'; var BREAKPOINTS = [ 'xxl', 'xl', 'lg', 'md', 'sm', 'fluid', ]; var CContainer = forwardRef(function (_a, ref) { var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]); var repsonsiveClassNames = []; BREAKPOINTS.forEach(function (bp) { var breakpoint = rest[bp]; delete rest[bp]; breakpoint && repsonsiveClassNames.push("container-".concat(bp)); }); return (React.createElement("div", __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