UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

40 lines (37 loc) 2.02 kB
import { __rest } from '../../node_modules/tslib/tslib.es6.js'; import React, { forwardRef } from 'react'; import PropTypes from 'prop-types'; import { CCard } from '../card/CCard.js'; import { CCardBody } from '../card/CCardBody.js'; import { CCardFooter } from '../card/CCardFooter.js'; import '../card/CCardGroup.js'; import '../card/CCardHeader.js'; import '../card/CCardImage.js'; import '../card/CCardImageOverlay.js'; import '../card/CCardLink.js'; import '../card/CCardSubtitle.js'; import '../card/CCardText.js'; import '../card/CCardTitle.js'; import { colorPropType } from '../../props.js'; const CWidgetStatsF = forwardRef((_a, ref) => { var { className, color, footer, icon, padding = true, title, value } = _a, rest = __rest(_a, ["className", "color", "footer", "icon", "padding", "title", "value"]); return (React.createElement(CCard, Object.assign({ className: className }, rest, { ref: ref }), React.createElement(CCardBody, { className: `d-flex align-items-center ${padding === false && 'p-0'}` }, React.createElement("div", { className: `me-3 text-white bg-${color} ${padding ? 'p-3' : 'p-4'}` }, icon), React.createElement("div", null, React.createElement("div", { className: `fs-6 fw-semibold text-${color}` }, value), React.createElement("div", { className: "text-body-secondary text-uppercase fw-semibold small" }, title))), footer && React.createElement(CCardFooter, null, footer))); }); CWidgetStatsF.propTypes = { className: PropTypes.string, color: colorPropType, footer: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), icon: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), padding: PropTypes.bool, title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), value: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.number]), }; CWidgetStatsF.displayName = 'CWidgetStatsF'; export { CWidgetStatsF }; //# sourceMappingURL=CWidgetStatsF.js.map