@ammarkhalidfarooq/dashboard-package 0.4.97 → 0.4.99

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.cjs.js CHANGED
@@ -5271,7 +5271,7 @@ var MetricCard = function MetricCard(_ref) {
5271
5271
  };
5272
5272
 
5273
5273
  var OverallSection = function OverallSection(_ref) {
5274
- var _apiData$overviewStat, _apiData$totalRaisedP, _apiData$overviewStat2, _apiData$netRaisedPre, _apiData$overviewStat3, _apiData$overviewStat4, _apiData$averageDonat, _apiData$roasCard, _apiData$roasCardPrev, _orderBumpData$chart, _orderBumpData$peakDa, _orderBumpData$peakDa2;
5274
+ var _apiData$overviewStat, _apiData$overviewStat2, _apiData$overviewStat3, _apiData$overviewStat4, _apiData$overviewStat5, _apiData$overviewStat6, _apiData$overviewStat7, _apiData$overviewStat8, _apiData$overviewStat9, _apiData$overviewStat0, _apiData$overviewStat1, _apiData$overviewStat10, _apiData$roasCard, _apiData$roasCardPrev, _orderBumpData$chart, _orderBumpData$peakDa, _orderBumpData$peakDa2, _referralData$chartDa;
5275
5275
  var _ref$apiData = _ref.apiData,
5276
5276
  apiData = _ref$apiData === void 0 ? {} : _ref$apiData,
5277
5277
  primaryCharts = _ref.primaryCharts,
@@ -5289,6 +5289,7 @@ var OverallSection = function OverallSection(_ref) {
5289
5289
  var orderBumpData = (apiData === null || apiData === void 0 ? void 0 : apiData.orderBumpDetails) || [];
5290
5290
  var upsellData = (apiData === null || apiData === void 0 ? void 0 : apiData.upSellDetails) || [];
5291
5291
  var downsellData = (apiData === null || apiData === void 0 ? void 0 : apiData.downSellDetails) || [];
5292
+ var referralData = (apiData === null || apiData === void 0 ? void 0 : apiData.referralDetails) || [];
5292
5293
  var refundsChargebacksData = (apiData === null || apiData === void 0 ? void 0 : apiData.refundAndChargeBacks) || [];
5293
5294
  var allCharts = [].concat(_toConsumableArray(primaryCharts), _toConsumableArray(secondaryCharts), _toConsumableArray(tertiaryCharts), _toConsumableArray(quaternaryCharts));
5294
5295
  var getExtendedCharts = function getExtendedCharts() {
@@ -5331,7 +5332,7 @@ var OverallSection = function OverallSection(_ref) {
5331
5332
  var metricInfo = {
5332
5333
  "Total Raised": {
5333
5334
  value: "$".concat(formatNumber(apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 || (_apiData$overviewStat = _apiData$overviewStat.overview) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.totalRevenue)) || "$240.9K",
5334
- subValue: "".concat(Number((_apiData$totalRaisedP = apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedPrev) !== null && _apiData$totalRaisedP !== void 0 ? _apiData$totalRaisedP : 0).toFixed(2), "% vs ").concat(dateName || "last month"),
5335
+ subValue: "".concat(Number((_apiData$overviewStat2 = apiData === null || apiData === void 0 || (_apiData$overviewStat3 = apiData.overviewStats) === null || _apiData$overviewStat3 === void 0 || (_apiData$overviewStat3 = _apiData$overviewStat3.overview) === null || _apiData$overviewStat3 === void 0 || (_apiData$overviewStat3 = _apiData$overviewStat3.growthPercentage) === null || _apiData$overviewStat3 === void 0 ? void 0 : _apiData$overviewStat3.totalRevenue) !== null && _apiData$overviewStat2 !== void 0 ? _apiData$overviewStat2 : 0).toFixed(2), "% vs ").concat(dateName || "last month"),
5335
5336
  label: "Total Raised",
5336
5337
  icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PaidOutlined, {}),
5337
5338
  money: true,
@@ -5339,8 +5340,8 @@ var OverallSection = function OverallSection(_ref) {
5339
5340
  warning: false
5340
5341
  },
5341
5342
  "Net Raised": {
5342
- value: "$".concat(formatNumber(apiData === null || apiData === void 0 || (_apiData$overviewStat2 = apiData.overviewStats) === null || _apiData$overviewStat2 === void 0 || (_apiData$overviewStat2 = _apiData$overviewStat2.overview) === null || _apiData$overviewStat2 === void 0 ? void 0 : _apiData$overviewStat2.netRevenue)),
5343
- subValue: "".concat(Number((_apiData$netRaisedPre = apiData === null || apiData === void 0 ? void 0 : apiData.netRaisedPrev) !== null && _apiData$netRaisedPre !== void 0 ? _apiData$netRaisedPre : 0).toFixed(2), "% vs ").concat(dateName !== null && dateName !== void 0 ? dateName : "previous period"),
5343
+ 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)),
5344
+ 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"),
5344
5345
  label: "Net Raised",
5345
5346
  icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.FavoriteOutlined, {}),
5346
5347
  money: true,
@@ -5348,8 +5349,8 @@ var OverallSection = function OverallSection(_ref) {
5348
5349
  warning: false
5349
5350
  },
5350
5351
  "Total Donors": {
5351
- value: (apiData === null || apiData === void 0 || (_apiData$overviewStat3 = apiData.overviewStats) === null || _apiData$overviewStat3 === void 0 || (_apiData$overviewStat3 = _apiData$overviewStat3.overview) === null || _apiData$overviewStat3 === void 0 ? void 0 : _apiData$overviewStat3.totalDonations) || "215",
5352
- subValue: "".concat(apiData === null || apiData === void 0 ? void 0 : apiData.totalDonorsPrev, " new") || "31 new",
5352
+ value: (apiData === null || apiData === void 0 || (_apiData$overviewStat7 = apiData.overviewStats) === null || _apiData$overviewStat7 === void 0 || (_apiData$overviewStat7 = _apiData$overviewStat7.overview) === null || _apiData$overviewStat7 === void 0 ? void 0 : _apiData$overviewStat7.totalDonations) || "215",
5353
+ subValue: "".concat(Number((_apiData$overviewStat8 = apiData === null || apiData === void 0 || (_apiData$overviewStat9 = apiData.overviewStats) === null || _apiData$overviewStat9 === void 0 || (_apiData$overviewStat9 = _apiData$overviewStat9.overview.growthPercentage) === null || _apiData$overviewStat9 === void 0 ? void 0 : _apiData$overviewStat9.totalDonations) !== null && _apiData$overviewStat8 !== void 0 ? _apiData$overviewStat8 : 0).toFixed(2), "%") || "31 new",
5353
5354
  label: "Total Donors",
5354
5355
  icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PeopleAltOutlined, {}),
5355
5356
  money: false,
@@ -5357,8 +5358,8 @@ var OverallSection = function OverallSection(_ref) {
5357
5358
  warning: false
5358
5359
  },
5359
5360
  "Avg donation": {
5360
- 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.overallAVGDonations)),
5361
- subValue: "".concat(Number((_apiData$averageDonat = apiData === null || apiData === void 0 ? void 0 : apiData.averageDonationsCardPrev) !== null && _apiData$averageDonat !== void 0 ? _apiData$averageDonat : 0).toFixed(2), "% vs ").concat(dateName !== null && dateName !== void 0 ? dateName : "last month"),
5361
+ 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)),
5362
+ 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"),
5362
5363
  label: "Average Donation Amount",
5363
5364
  icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PaidOutlined, {}),
5364
5365
  money: true,
@@ -5459,8 +5460,8 @@ var OverallSection = function OverallSection(_ref) {
5459
5460
  return c.label === selectedInfo.label;
5460
5461
  }) || primaryCharts[0];
5461
5462
  if (activeMetric === "Total Raised") {
5462
- var _apiData$overviewStat5;
5463
- var stackedData = apiData === null || apiData === void 0 || (_apiData$overviewStat5 = apiData.overviewStats) === null || _apiData$overviewStat5 === void 0 ? void 0 : _apiData$overviewStat5.totalRaised;
5463
+ var _apiData$overviewStat11;
5464
+ var stackedData = apiData === null || apiData === void 0 || (_apiData$overviewStat11 = apiData.overviewStats) === null || _apiData$overviewStat11 === void 0 ? void 0 : _apiData$overviewStat11.totalRaised;
5464
5465
  var hasStackedData = (stackedData === null || stackedData === void 0 ? void 0 : stackedData.paidAds) || (stackedData === null || stackedData === void 0 ? void 0 : stackedData.email) || (stackedData === null || stackedData === void 0 ? void 0 : stackedData.organic);
5465
5466
  if (hasStackedData) {
5466
5467
  var categories = ((stackedData === null || stackedData === void 0 ? void 0 : stackedData.organic) || (stackedData === null || stackedData === void 0 ? void 0 : stackedData.paidAds) || (stackedData === null || stackedData === void 0 ? void 0 : stackedData.email) || []).map(function (item) {
@@ -5499,8 +5500,8 @@ var OverallSection = function OverallSection(_ref) {
5499
5500
  }
5500
5501
  }
5501
5502
  if (activeMetric === "Net Raised") {
5502
- var _apiData$overviewStat6;
5503
- var netData = apiData === null || apiData === void 0 || (_apiData$overviewStat6 = apiData.overviewStats) === null || _apiData$overviewStat6 === void 0 ? void 0 : _apiData$overviewStat6.netRaised;
5503
+ var _apiData$overviewStat12;
5504
+ var netData = apiData === null || apiData === void 0 || (_apiData$overviewStat12 = apiData.overviewStats) === null || _apiData$overviewStat12 === void 0 ? void 0 : _apiData$overviewStat12.netRaised;
5504
5505
  var _hasStackedData = (netData === null || netData === void 0 ? void 0 : netData.paidAds) || (netData === null || netData === void 0 ? void 0 : netData.email) || (netData === null || netData === void 0 ? void 0 : netData.organic);
5505
5506
  if (_hasStackedData) {
5506
5507
  var _categories = ((netData === null || netData === void 0 ? void 0 : netData.organic) || (netData === null || netData === void 0 ? void 0 : netData.paidAds) || (netData === null || netData === void 0 ? void 0 : netData.email) || []).map(function (item) {
@@ -5547,8 +5548,8 @@ var OverallSection = function OverallSection(_ref) {
5547
5548
  }
5548
5549
  }
5549
5550
  if (activeMetric === "Total Donors") {
5550
- var _apiData$overviewStat7;
5551
- var donorsData = apiData === null || apiData === void 0 || (_apiData$overviewStat7 = apiData.overviewStats) === null || _apiData$overviewStat7 === void 0 ? void 0 : _apiData$overviewStat7.totalDonations;
5551
+ var _apiData$overviewStat13;
5552
+ var donorsData = apiData === null || apiData === void 0 || (_apiData$overviewStat13 = apiData.overviewStats) === null || _apiData$overviewStat13 === void 0 ? void 0 : _apiData$overviewStat13.totalDonations;
5552
5553
  var _hasStackedData2 = (donorsData === null || donorsData === void 0 ? void 0 : donorsData.paidAds) || (donorsData === null || donorsData === void 0 ? void 0 : donorsData.email) || (donorsData === null || donorsData === void 0 ? void 0 : donorsData.organic);
5553
5554
  if (_hasStackedData2) {
5554
5555
  var _categories2 = ((donorsData === null || donorsData === void 0 ? void 0 : donorsData.organic) || (donorsData === null || donorsData === void 0 ? void 0 : donorsData.paidAds) || (donorsData === null || donorsData === void 0 ? void 0 : donorsData.email) || []).map(function (item) {
@@ -5689,8 +5690,8 @@ var OverallSection = function OverallSection(_ref) {
5689
5690
  }
5690
5691
  }
5691
5692
  if (activeMetric === "Avg donation") {
5692
- var _apiData$overviewStat8;
5693
- var avgData = apiData === null || apiData === void 0 || (_apiData$overviewStat8 = apiData.overviewStats) === null || _apiData$overviewStat8 === void 0 ? void 0 : _apiData$overviewStat8.avgDonations;
5693
+ var _apiData$overviewStat14;
5694
+ var avgData = apiData === null || apiData === void 0 || (_apiData$overviewStat14 = apiData.overviewStats) === null || _apiData$overviewStat14 === void 0 ? void 0 : _apiData$overviewStat14.avgDonations;
5694
5695
  var _hasStackedData5 = (avgData === null || avgData === void 0 ? void 0 : avgData.paidAds) || (avgData === null || avgData === void 0 ? void 0 : avgData.email) || (avgData === null || avgData === void 0 ? void 0 : avgData.organic);
5695
5696
  if (_hasStackedData5) {
5696
5697
  var _categories5 = ((avgData === null || avgData === void 0 ? void 0 : avgData.organic) || (avgData === null || avgData === void 0 ? void 0 : avgData.paidAds) || (avgData === null || avgData === void 0 ? void 0 : avgData.email) || []).map(function (item) {
@@ -5925,18 +5926,20 @@ var OverallSection = function OverallSection(_ref) {
5925
5926
  }), /*#__PURE__*/jsxRuntime.jsx(MetricSparklineCard, {
5926
5927
  title: "Referrals",
5927
5928
  subtitle: "Revenue trend \xB7 last 30 days",
5928
- value: "$22.7K",
5929
- trend: "\u25B2 9.1% vs last month",
5930
- chartData: [1500, 1700, 1600, 2200, 1900, 2400, 2270],
5929
+ value: "$".concat(formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.totalRevenue) || 0)),
5930
+ trend: "\u25B2 ".concat((referralData === null || referralData === void 0 ? void 0 : referralData.growthPercentage) || 0, "% vs last month"),
5931
+ chartData: (referralData === null || referralData === void 0 || (_referralData$chartDa = referralData.chartData) === null || _referralData$chartDa === void 0 ? void 0 : _referralData$chartDa.map(function (item) {
5932
+ return item.revenue;
5933
+ })) || [],
5931
5934
  footerMetrics: [{
5932
5935
  label: "Referrers",
5933
- value: "38"
5936
+ value: formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.totalReferrers) || 0)
5934
5937
  }, {
5935
5938
  label: "Avg gift",
5936
- value: "$598"
5939
+ value: "$".concat(formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.averageGift) || 0))
5937
5940
  }, {
5938
5941
  label: "Conv. rate",
5939
- value: "27.5%"
5942
+ value: "".concat(formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.conversionRate) || 0), "%")
5940
5943
  }],
5941
5944
  sx: {
5942
5945
  maxHeight: 280