@ammarkhalidfarooq/dashboard-package 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -576,31 +576,37 @@ var RenderChartCard = function RenderChartCard(_ref) {
576
576
  _ref$md = _ref.md,
577
577
  md = _ref$md === void 0 ? 4 : _ref$md,
578
578
  _ref$type = _ref.type,
579
- type = _ref$type === void 0 ? "area" : _ref$type;
579
+ type = _ref$type === void 0 ? "area" : _ref$type,
580
+ _ref$sx = _ref.sx,
581
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
582
+ _ref$cardSx = _ref.cardSx,
583
+ cardSx = _ref$cardSx === void 0 ? {} : _ref$cardSx,
584
+ _ref$contentSx = _ref.contentSx,
585
+ contentSx = _ref$contentSx === void 0 ? {} : _ref$contentSx;
580
586
  return /*#__PURE__*/jsx(Grid, {
581
587
  item: true,
582
588
  xs: 12,
583
589
  md: md,
584
- sx: {
590
+ sx: _objectSpread2({
585
591
  display: "flex",
586
592
  paddingTop: "0px !important"
587
- },
593
+ }, sx),
588
594
  children: /*#__PURE__*/jsx(Card, {
589
- sx: {
595
+ sx: _objectSpread2({
590
596
  width: "100%",
591
597
  display: "flex",
592
598
  flexDirection: "column",
593
599
  boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
594
600
  borderRadius: 4,
595
601
  border: "1px solid #f0f0f0"
596
- },
602
+ }, cardSx),
597
603
  children: /*#__PURE__*/jsxs(CardContent, {
598
- sx: {
604
+ sx: _objectSpread2({
599
605
  p: item.exportMode ? 2 : 3,
600
606
  flexGrow: 1,
601
607
  display: "flex",
602
608
  flexDirection: "column"
603
- },
609
+ }, contentSx),
604
610
  children: [/*#__PURE__*/jsxs(Box, {
605
611
  sx: {
606
612
  display: "flex",
@@ -903,24 +909,29 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
903
909
  gridTemplateColumns = _ref$gridTemplateColu === void 0 ? "3fr 1fr 1.5fr 0.8fr 1fr " : _ref$gridTemplateColu,
904
910
  height = _ref.height,
905
911
  _ref$compact = _ref.compact,
906
- compact = _ref$compact === void 0 ? false : _ref$compact;
912
+ compact = _ref$compact === void 0 ? false : _ref$compact,
913
+ _ref$sx = _ref.sx,
914
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
915
+ _ref$headerSx = _ref.headerSx,
916
+ headerSx = _ref$headerSx === void 0 ? {} : _ref$headerSx,
917
+ _ref$tableSx = _ref.tableSx,
918
+ tableSx = _ref$tableSx === void 0 ? {} : _ref$tableSx;
907
919
  return /*#__PURE__*/jsxs(Box, {
908
- sx: {
920
+ sx: _objectSpread2({
909
921
  bgcolor: "#fff",
910
922
  borderRadius: compact ? 3 : 4,
911
923
  border: "1px solid #f0f0f0",
912
924
  boxShadow: compact ? "0 2px 12px rgba(0,0,0,0.05)" : "0 4px 24px rgba(0,0,0,0.06)",
913
925
  p: compact ? 1.5 : 3,
914
926
  height: height
915
- // height: "100%",
916
- },
927
+ }, sx),
917
928
  children: [/*#__PURE__*/jsxs(Box, {
918
- sx: {
929
+ sx: _objectSpread2({
919
930
  display: "flex",
920
931
  justifyContent: "space-between",
921
932
  alignItems: "flex-start",
922
933
  mb: compact ? 1.25 : 3
923
- },
934
+ }, headerSx),
924
935
  children: [/*#__PURE__*/jsxs(Box, {
925
936
  children: [/*#__PURE__*/jsx(Typography, {
926
937
  sx: {
@@ -948,9 +959,9 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
948
959
  children: actionLabel
949
960
  })]
950
961
  }), /*#__PURE__*/jsx(Box, {
951
- sx: {
962
+ sx: _objectSpread2({
952
963
  overflowX: compact ? "hidden" : "auto"
953
- },
964
+ }, tableSx),
954
965
  children: /*#__PURE__*/jsxs(Box, {
955
966
  sx: {
956
967
  minWidth: compact ? 0 : "600px"
@@ -1156,9 +1167,19 @@ var MetricCard$1 = function MetricCard(_ref) {
1156
1167
  active = _ref.active,
1157
1168
  warning = _ref.warning,
1158
1169
  error = _ref.error,
1159
- onClick = _ref.onClick;
1170
+ onClick = _ref.onClick,
1171
+ _ref$sx = _ref.sx,
1172
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
1173
+ _ref$titleSx = _ref.titleSx,
1174
+ titleSx = _ref$titleSx === void 0 ? {} : _ref$titleSx,
1175
+ _ref$valueSx = _ref.valueSx,
1176
+ valueSx = _ref$valueSx === void 0 ? {} : _ref$valueSx,
1177
+ _ref$captionSx = _ref.captionSx,
1178
+ captionSx = _ref$captionSx === void 0 ? {} : _ref$captionSx,
1179
+ _ref$avatarSx = _ref.avatarSx,
1180
+ avatarSx = _ref$avatarSx === void 0 ? {} : _ref$avatarSx;
1160
1181
  return /*#__PURE__*/jsxs(Box, {
1161
- sx: {
1182
+ sx: _objectSpread2({
1162
1183
  bgcolor: "#fff",
1163
1184
  border: "1.5px solid ".concat(active ? "#4F46E5" : warning ? "#F3B33D" : error ? "#ef4444" : "#F1F1F5"),
1164
1185
  borderRadius: "16px",
@@ -1170,45 +1191,43 @@ var MetricCard$1 = function MetricCard(_ref) {
1170
1191
  paddingBottom: "10px !important",
1171
1192
  height: 92,
1172
1193
  boxShadow: "0 14px 30px rgba(21, 26, 45, 0.06)"
1173
- },
1194
+ }, sx),
1174
1195
  onClick: onClick,
1175
1196
  children: [/*#__PURE__*/jsxs(Stack, {
1176
1197
  direction: "row",
1177
1198
  justifyContent: "space-between",
1178
1199
  alignItems: "center",
1179
1200
  children: [/*#__PURE__*/jsx(Typography, {
1180
- sx: {
1201
+ sx: _objectSpread2({
1181
1202
  color: active ? "#818CF8" : "#999EAA",
1182
1203
  fontSize: 13,
1183
1204
  fontWeight: 500,
1184
1205
  letterSpacing: 0
1185
- },
1206
+ }, titleSx),
1186
1207
  children: title
1187
1208
  }), /*#__PURE__*/jsx(Avatar, {
1188
- sx: {
1209
+ sx: _objectSpread2({
1189
1210
  width: 30,
1190
1211
  height: 30,
1191
1212
  bgcolor: warning ? "#FFF3CF" : error ? "#fee2e2" : "#EEF2FF",
1192
1213
  color: warning ? "#B45309" : error ? "#ef4444" : "#4F46E5"
1193
- },
1214
+ }, avatarSx),
1194
1215
  children: icon
1195
1216
  })]
1196
1217
  }), /*#__PURE__*/jsx(Typography, {
1197
- sx: {
1198
- // mt: 0.3,
1218
+ sx: _objectSpread2({
1199
1219
  fontSize: 22,
1200
1220
  fontWeight: 700,
1201
1221
  color: active ? "#4F46E5" : "#050509",
1202
1222
  lineHeight: 1.15
1203
- },
1223
+ }, valueSx),
1204
1224
  children: value
1205
1225
  }), /*#__PURE__*/jsx(Typography, {
1206
- sx: {
1207
- // mt: 1.05,
1226
+ sx: _objectSpread2({
1208
1227
  fontSize: 12,
1209
1228
  fontWeight: 500,
1210
- color: caption.includes("failed") ? "#4F46E5" : error ? "#ef4444" : "#0B8F61"
1211
- },
1229
+ color: caption !== null && caption !== void 0 && caption.includes("failed") ? "#4F46E5" : error ? "#ef4444" : "#0B8F61"
1230
+ }, captionSx),
1212
1231
  children: caption
1213
1232
  })]
1214
1233
  });
@@ -14569,7 +14588,7 @@ var OverallSection = function OverallSection(_ref) {
14569
14588
  warning: false
14570
14589
  },
14571
14590
  "Net Raised": {
14572
- value: "$".concat(formatNumber(apiData === null || apiData === void 0 || (_apiData$overviewStat4 = apiData.overviewStats) === null || _apiData$overviewStat4 === void 0 || (_apiData$overviewStat4 = _apiData$overviewStat4.overview) === null || _apiData$overviewStat4 === void 0 ? void 0 : _apiData$overviewStat4.netRevenue)),
14591
+ value: "$".concat(formatNumber((apiData === null || apiData === void 0 || (_apiData$overviewStat4 = apiData.overviewStats) === null || _apiData$overviewStat4 === void 0 || (_apiData$overviewStat4 = _apiData$overviewStat4.overview) === null || _apiData$overviewStat4 === void 0 ? void 0 : _apiData$overviewStat4.netRevenue).toFixed(2))),
14573
14592
  subValue: "".concat(Number((_apiData$overviewStat5 = apiData === null || apiData === void 0 || (_apiData$overviewStat6 = apiData.overviewStats) === null || _apiData$overviewStat6 === void 0 || (_apiData$overviewStat6 = _apiData$overviewStat6.overview.growthPercentage) === null || _apiData$overviewStat6 === void 0 ? void 0 : _apiData$overviewStat6.netRevenue) !== null && _apiData$overviewStat5 !== void 0 ? _apiData$overviewStat5 : 0).toFixed(2), "% vs ").concat(dateName !== null && dateName !== void 0 ? dateName : "previous period"),
14574
14593
  label: "Net Raised",
14575
14594
  icon: /*#__PURE__*/jsx(FavoriteOutlined, {}),
@@ -14587,7 +14606,7 @@ var OverallSection = function OverallSection(_ref) {
14587
14606
  warning: false
14588
14607
  },
14589
14608
  "Avg donation": {
14590
- value: "$".concat(formatNumber(apiData === null || apiData === void 0 || (_apiData$overviewStat0 = apiData.overviewStats) === null || _apiData$overviewStat0 === void 0 || (_apiData$overviewStat0 = _apiData$overviewStat0.overview) === null || _apiData$overviewStat0 === void 0 ? void 0 : _apiData$overviewStat0.overallAVGDonations)),
14609
+ value: "$".concat(formatNumber((apiData === null || apiData === void 0 || (_apiData$overviewStat0 = apiData.overviewStats) === null || _apiData$overviewStat0 === void 0 || (_apiData$overviewStat0 = _apiData$overviewStat0.overview) === null || _apiData$overviewStat0 === void 0 ? void 0 : _apiData$overviewStat0.overallAVGDonations).toFixed(2))),
14591
14610
  subValue: "".concat(Number((_apiData$overviewStat1 = apiData === null || apiData === void 0 || (_apiData$overviewStat10 = apiData.overviewStats) === null || _apiData$overviewStat10 === void 0 || (_apiData$overviewStat10 = _apiData$overviewStat10.overview.growthPercentage) === null || _apiData$overviewStat10 === void 0 ? void 0 : _apiData$overviewStat10.overallAVGDonations) !== null && _apiData$overviewStat1 !== void 0 ? _apiData$overviewStat1 : 0).toFixed(2), "% vs ").concat(dateName !== null && dateName !== void 0 ? dateName : "last month"),
14592
14611
  label: "Average Donation Amount",
14593
14612
  icon: /*#__PURE__*/jsx(PaidOutlined, {}),
@@ -14596,7 +14615,7 @@ var OverallSection = function OverallSection(_ref) {
14596
14615
  warning: false
14597
14616
  },
14598
14617
  "ROAS": {
14599
- value: "".concat(formatNumber((_apiData$roasCard = apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) !== null && _apiData$roasCard !== void 0 ? _apiData$roasCard : 0), "x"),
14618
+ value: "".concat(formatNumber(((_apiData$roasCard = apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) !== null && _apiData$roasCard !== void 0 ? _apiData$roasCard : 0).toFixed(2)), "x"),
14600
14619
  subValue: "".concat(Number((_apiData$roasCardPrev = apiData === null || apiData === void 0 ? void 0 : apiData.roasCardPrev) !== null && _apiData$roasCardPrev !== void 0 ? _apiData$roasCardPrev : 0).toFixed(2), "x vs ").concat(dateName !== null && dateName !== void 0 ? dateName : "last month"),
14601
14620
  label: "ROAS",
14602
14621
  icon: /*#__PURE__*/jsx(TrendingUp, {}),
@@ -14605,7 +14624,7 @@ var OverallSection = function OverallSection(_ref) {
14605
14624
  warning: false
14606
14625
  },
14607
14626
  "Conversion": {
14608
- value: "".concat(formatNumber(apiData === null || apiData === void 0 || (_apiData$overviewStat11 = apiData.overviewStats) === null || _apiData$overviewStat11 === void 0 || (_apiData$overviewStat11 = _apiData$overviewStat11.overview) === null || _apiData$overviewStat11 === void 0 ? void 0 : _apiData$overviewStat11.conversionRate), "%") || "0.0%",
14627
+ value: "".concat(formatNumber((apiData === null || apiData === void 0 || (_apiData$overviewStat11 = apiData.overviewStats) === null || _apiData$overviewStat11 === void 0 || (_apiData$overviewStat11 = _apiData$overviewStat11.overview) === null || _apiData$overviewStat11 === void 0 ? void 0 : _apiData$overviewStat11.conversionRate).toFixed(2)), "%") || "0.0%",
14609
14628
  subValue: "".concat(((_apiData$overviewStat12 = apiData === null || apiData === void 0 || (_apiData$overviewStat13 = apiData.overviewStats) === null || _apiData$overviewStat13 === void 0 || (_apiData$overviewStat13 = _apiData$overviewStat13.overview) === null || _apiData$overviewStat13 === void 0 || (_apiData$overviewStat13 = _apiData$overviewStat13.growthPercentage) === null || _apiData$overviewStat13 === void 0 ? void 0 : _apiData$overviewStat13.conversionRate) !== null && _apiData$overviewStat12 !== void 0 ? _apiData$overviewStat12 : 0).toFixed(2), "%") || "0%",
14610
14629
  label: "Conversion Rate",
14611
14630
  icon: /*#__PURE__*/jsx(Adjust, {}),