@ammarkhalidfarooq/dashboard-package 0.6.69 → 0.6.70

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
@@ -2095,17 +2095,82 @@ var ProgressBar = function ProgressBar(_ref8) {
2095
2095
  })]
2096
2096
  });
2097
2097
  };
2098
- var DonationTypeBarSvg = function DonationTypeBarSvg(_ref9) {
2099
- var _ref9$categories = _ref9.categories,
2100
- categories = _ref9$categories === void 0 ? [] : _ref9$categories,
2101
- _ref9$recurring = _ref9.recurring,
2102
- recurring = _ref9$recurring === void 0 ? [] : _ref9$recurring,
2103
- _ref9$oneTime = _ref9.oneTime,
2104
- oneTime = _ref9$oneTime === void 0 ? [] : _ref9$oneTime,
2105
- _ref9$recurringColor = _ref9.recurringColor,
2106
- recurringColor = _ref9$recurringColor === void 0 ? "#6366F1" : _ref9$recurringColor,
2107
- _ref9$oneTimeColor = _ref9.oneTimeColor,
2108
- oneTimeColor = _ref9$oneTimeColor === void 0 ? "#10B981" : _ref9$oneTimeColor;
2098
+ var DonorGeographyPanel = function DonorGeographyPanel(_ref9) {
2099
+ var _ref9$geoList = _ref9.geoList,
2100
+ geoList = _ref9$geoList === void 0 ? [] : _ref9$geoList,
2101
+ _ref9$totalDonors = _ref9.totalDonors,
2102
+ totalDonors = _ref9$totalDonors === void 0 ? 0 : _ref9$totalDonors,
2103
+ _ref9$barColor = _ref9.barColor,
2104
+ barColor = _ref9$barColor === void 0 ? "#6366F1" : _ref9$barColor;
2105
+ return /*#__PURE__*/jsx(Panel, {
2106
+ title: "Donor geography",
2107
+ subtitle: "Top countries \xB7 ".concat(formatNumber(totalDonors), " total"),
2108
+ children: (geoList.length ? geoList.slice(0, 6) : []).map(function (g, i) {
2109
+ var _g$percentage;
2110
+ return /*#__PURE__*/jsxs("div", {
2111
+ style: {
2112
+ padding: i < 5 ? "0 0 5px" : 0,
2113
+ marginBottom: i < 5 ? 5 : 0,
2114
+ borderBottom: i < 5 ? "1px solid #F3F4F6" : "none"
2115
+ },
2116
+ children: [/*#__PURE__*/jsxs("div", {
2117
+ style: {
2118
+ display: "flex",
2119
+ justifyContent: "space-between",
2120
+ alignItems: "center",
2121
+ gap: 6,
2122
+ marginBottom: 3
2123
+ },
2124
+ children: [/*#__PURE__*/jsx("span", {
2125
+ style: {
2126
+ fontSize: 9,
2127
+ color: "#374151",
2128
+ overflow: "hidden",
2129
+ textOverflow: "ellipsis",
2130
+ whiteSpace: "nowrap",
2131
+ minWidth: 0
2132
+ },
2133
+ children: g.country
2134
+ }), /*#__PURE__*/jsxs("span", {
2135
+ style: {
2136
+ fontSize: 9,
2137
+ fontWeight: 700,
2138
+ color: "#111827",
2139
+ flexShrink: 0
2140
+ },
2141
+ children: [formatNumber(g.value), " \xB7 ", formatNumber(g.percentage), "%"]
2142
+ })]
2143
+ }), /*#__PURE__*/jsx("div", {
2144
+ style: {
2145
+ height: 5,
2146
+ background: "#F3F4F6",
2147
+ borderRadius: 3,
2148
+ overflow: "hidden"
2149
+ },
2150
+ children: /*#__PURE__*/jsx("div", {
2151
+ style: {
2152
+ width: "".concat(Math.min(100, Math.max(0, Number((_g$percentage = g.percentage) !== null && _g$percentage !== void 0 ? _g$percentage : 0))), "%"),
2153
+ height: "100%",
2154
+ background: barColor,
2155
+ borderRadius: 3
2156
+ }
2157
+ })
2158
+ })]
2159
+ }, i);
2160
+ })
2161
+ });
2162
+ };
2163
+ var DonationTypeBarSvg = function DonationTypeBarSvg(_ref0) {
2164
+ var _ref0$categories = _ref0.categories,
2165
+ categories = _ref0$categories === void 0 ? [] : _ref0$categories,
2166
+ _ref0$recurring = _ref0.recurring,
2167
+ recurring = _ref0$recurring === void 0 ? [] : _ref0$recurring,
2168
+ _ref0$oneTime = _ref0.oneTime,
2169
+ oneTime = _ref0$oneTime === void 0 ? [] : _ref0$oneTime,
2170
+ _ref0$recurringColor = _ref0.recurringColor,
2171
+ recurringColor = _ref0$recurringColor === void 0 ? "#6366F1" : _ref0$recurringColor,
2172
+ _ref0$oneTimeColor = _ref0.oneTimeColor,
2173
+ oneTimeColor = _ref0$oneTimeColor === void 0 ? "#10B981" : _ref0$oneTimeColor;
2109
2174
  var width = 158;
2110
2175
  var height = 96;
2111
2176
  var padL = 30;
@@ -2226,12 +2291,12 @@ var DonationTypeBarSvg = function DonationTypeBarSvg(_ref9) {
2226
2291
  })]
2227
2292
  });
2228
2293
  };
2229
- var DonationTypePanel = function DonationTypePanel(_ref0) {
2230
- var donationTypeData = _ref0.donationTypeData,
2231
- _ref0$recurringColor = _ref0.recurringColor,
2232
- recurringColor = _ref0$recurringColor === void 0 ? "#6366F1" : _ref0$recurringColor,
2233
- _ref0$oneTimeColor = _ref0.oneTimeColor,
2234
- oneTimeColor = _ref0$oneTimeColor === void 0 ? "#10B981" : _ref0$oneTimeColor;
2294
+ var DonationTypePanel = function DonationTypePanel(_ref1) {
2295
+ var donationTypeData = _ref1.donationTypeData,
2296
+ _ref1$recurringColor = _ref1.recurringColor,
2297
+ recurringColor = _ref1$recurringColor === void 0 ? "#6366F1" : _ref1$recurringColor,
2298
+ _ref1$oneTimeColor = _ref1.oneTimeColor,
2299
+ oneTimeColor = _ref1$oneTimeColor === void 0 ? "#10B981" : _ref1$oneTimeColor;
2235
2300
  var _parseDonationTypeCha = parseDonationTypeChartData(donationTypeData),
2236
2301
  categories = _parseDonationTypeCha.categories,
2237
2302
  recurring = _parseDonationTypeCha.recurring,
@@ -2296,21 +2361,21 @@ var DonationTypePanel = function DonationTypePanel(_ref0) {
2296
2361
  })]
2297
2362
  });
2298
2363
  };
2299
- var AcceptanceRaisedPanel = function AcceptanceRaisedPanel(_ref1) {
2300
- var title = _ref1.title,
2301
- subtitle = _ref1.subtitle,
2302
- _ref1$acceptanceRate = _ref1.acceptanceRate,
2303
- acceptanceRate = _ref1$acceptanceRate === void 0 ? 0 : _ref1$acceptanceRate,
2304
- _ref1$acceptanceGrowt = _ref1.acceptanceGrowth,
2305
- acceptanceGrowth = _ref1$acceptanceGrowt === void 0 ? 0 : _ref1$acceptanceGrowt,
2306
- _ref1$raised = _ref1.raised,
2307
- raised = _ref1$raised === void 0 ? 0 : _ref1$raised,
2308
- _ref1$raisedGrowth = _ref1.raisedGrowth,
2309
- raisedGrowth = _ref1$raisedGrowth === void 0 ? 0 : _ref1$raisedGrowth,
2310
- _ref1$primaryColor = _ref1.primaryColor,
2311
- primaryColor = _ref1$primaryColor === void 0 ? "#6366F1" : _ref1$primaryColor,
2312
- _ref1$secondaryColor = _ref1.secondaryColor,
2313
- secondaryColor = _ref1$secondaryColor === void 0 ? "#88bfd290" : _ref1$secondaryColor;
2364
+ var AcceptanceRaisedPanel = function AcceptanceRaisedPanel(_ref10) {
2365
+ var title = _ref10.title,
2366
+ subtitle = _ref10.subtitle,
2367
+ _ref10$acceptanceRate = _ref10.acceptanceRate,
2368
+ acceptanceRate = _ref10$acceptanceRate === void 0 ? 0 : _ref10$acceptanceRate,
2369
+ _ref10$acceptanceGrow = _ref10.acceptanceGrowth,
2370
+ acceptanceGrowth = _ref10$acceptanceGrow === void 0 ? 0 : _ref10$acceptanceGrow,
2371
+ _ref10$raised = _ref10.raised,
2372
+ raised = _ref10$raised === void 0 ? 0 : _ref10$raised,
2373
+ _ref10$raisedGrowth = _ref10.raisedGrowth,
2374
+ raisedGrowth = _ref10$raisedGrowth === void 0 ? 0 : _ref10$raisedGrowth,
2375
+ _ref10$primaryColor = _ref10.primaryColor,
2376
+ primaryColor = _ref10$primaryColor === void 0 ? "#6366F1" : _ref10$primaryColor,
2377
+ _ref10$secondaryColor = _ref10.secondaryColor,
2378
+ secondaryColor = _ref10$secondaryColor === void 0 ? "#88bfd290" : _ref10$secondaryColor;
2314
2379
  return /*#__PURE__*/jsx(Panel, {
2315
2380
  title: title,
2316
2381
  subtitle: subtitle,
@@ -2436,15 +2501,15 @@ var AcceptanceRaisedPanel = function AcceptanceRaisedPanel(_ref1) {
2436
2501
  })
2437
2502
  });
2438
2503
  };
2439
- var KpiCard = function KpiCard(_ref10) {
2440
- var title = _ref10.title,
2441
- value = _ref10.value,
2442
- trend = _ref10.trend,
2443
- detail = _ref10.detail,
2444
- _ref10$variant = _ref10.variant,
2445
- variant = _ref10$variant === void 0 ? "secondary" : _ref10$variant,
2446
- _ref10$trendPositiveW = _ref10.trendPositiveWhenNegative,
2447
- trendPositiveWhenNegative = _ref10$trendPositiveW === void 0 ? false : _ref10$trendPositiveW;
2504
+ var KpiCard = function KpiCard(_ref11) {
2505
+ var title = _ref11.title,
2506
+ value = _ref11.value,
2507
+ trend = _ref11.trend,
2508
+ detail = _ref11.detail,
2509
+ _ref11$variant = _ref11.variant,
2510
+ variant = _ref11$variant === void 0 ? "secondary" : _ref11$variant,
2511
+ _ref11$trendPositiveW = _ref11.trendPositiveWhenNegative,
2512
+ trendPositiveWhenNegative = _ref11$trendPositiveW === void 0 ? false : _ref11$trendPositiveW;
2448
2513
  var displayTrend = withTrendArrow(trend);
2449
2514
  var isPrimary = variant === "primary";
2450
2515
  return /*#__PURE__*/jsxs("div", {
@@ -2495,12 +2560,12 @@ var KpiCard = function KpiCard(_ref10) {
2495
2560
  })]
2496
2561
  });
2497
2562
  };
2498
- var PageHeader = function PageHeader(_ref11) {
2499
- var dateLabel = _ref11.dateLabel,
2500
- generatedLabel = _ref11.generatedLabel,
2501
- activeFilters = _ref11.activeFilters,
2502
- page = _ref11.page,
2503
- windowLabel = _ref11.windowLabel;
2563
+ var PageHeader = function PageHeader(_ref12) {
2564
+ var dateLabel = _ref12.dateLabel,
2565
+ generatedLabel = _ref12.generatedLabel,
2566
+ activeFilters = _ref12.activeFilters,
2567
+ page = _ref12.page,
2568
+ windowLabel = _ref12.windowLabel;
2504
2569
  return /*#__PURE__*/jsxs("div", {
2505
2570
  style: {
2506
2571
  padding: "22px ".concat(MX, "px 12px"),
@@ -2606,9 +2671,9 @@ var PageHeader = function PageHeader(_ref11) {
2606
2671
  })]
2607
2672
  });
2608
2673
  };
2609
- var PageFooter = function PageFooter(_ref12) {
2610
- var generatedLabel = _ref12.generatedLabel,
2611
- page = _ref12.page;
2674
+ var PageFooter = function PageFooter(_ref13) {
2675
+ var generatedLabel = _ref13.generatedLabel,
2676
+ page = _ref13.page;
2612
2677
  return /*#__PURE__*/jsx("div", {
2613
2678
  style: {
2614
2679
  padding: "7px ".concat(MX, "px"),
@@ -2628,16 +2693,16 @@ var PageFooter = function PageFooter(_ref12) {
2628
2693
  };
2629
2694
 
2630
2695
  // ─── Main component ───────────────────────────────────────────────────────────
2631
- var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2696
+ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2632
2697
  var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _refundsRaw$refundRat, _refundsRaw$chargebac, _apiData$trafficSourc, _apiData$trafficSourc2, _apiData$trafficSourc3, _metricByTitle$NetRa, _metricByTitle$Total, _metricByTitle$Total2, _metricByTitle$Total3, _metricByTitle$AvgDo, _metricByTitle$AvgDo2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _metricByTitle$Conver2, _metricByTitle$Refund, _metricByTitle$Refund2, _refundsRaw$refundCou, _metricByTitle$Refund3, _mainChart$stacked, _refundsRaw$refundRat2, _ob$growthPercentage, _ob$peakDay, _up$acceptanceGrowth, _up$raisedGrowth, _dn$acceptanceGrowth, _dn$raisedGrowth, _refCard$growthPercen;
2633
- var _ref13$apiData = _ref13.apiData,
2634
- apiData = _ref13$apiData === void 0 ? {} : _ref13$apiData,
2635
- _ref13$dateName = _ref13.dateName,
2636
- dateName = _ref13$dateName === void 0 ? "Last Period" : _ref13$dateName,
2637
- _ref13$numberOfDays = _ref13.numberOfDays,
2638
- numberOfDays = _ref13$numberOfDays === void 0 ? 30 : _ref13$numberOfDays,
2639
- _ref13$activeFilters = _ref13.activeFilters,
2640
- activeFilters = _ref13$activeFilters === void 0 ? [] : _ref13$activeFilters;
2698
+ var _ref14$apiData = _ref14.apiData,
2699
+ apiData = _ref14$apiData === void 0 ? {} : _ref14$apiData,
2700
+ _ref14$dateName = _ref14.dateName,
2701
+ dateName = _ref14$dateName === void 0 ? "Last Period" : _ref14$dateName,
2702
+ _ref14$numberOfDays = _ref14.numberOfDays,
2703
+ numberOfDays = _ref14$numberOfDays === void 0 ? 30 : _ref14$numberOfDays,
2704
+ _ref14$activeFilters = _ref14.activeFilters,
2705
+ activeFilters = _ref14$activeFilters === void 0 ? [] : _ref14$activeFilters;
2641
2706
  var now = new Date();
2642
2707
  var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
2643
2708
  var windowLabel = "".concat(numberOfDays, "-day window");
@@ -2923,10 +2988,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2923
2988
  gap: 14,
2924
2989
  marginBottom: 6
2925
2990
  },
2926
- children: [["Email", C.cyan], ["Organic", C.emerald], ["Paid Ads", C.indigo]].map(function (_ref14) {
2927
- var _ref15 = _slicedToArray(_ref14, 2),
2928
- name = _ref15[0],
2929
- color = _ref15[1];
2991
+ children: [["Email", C.cyan], ["Organic", C.emerald], ["Paid Ads", C.indigo]].map(function (_ref15) {
2992
+ var _ref16 = _slicedToArray(_ref15, 2),
2993
+ name = _ref16[0],
2994
+ color = _ref16[1];
2930
2995
  return /*#__PURE__*/jsxs("div", {
2931
2996
  style: {
2932
2997
  display: "flex",
@@ -3150,32 +3215,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3150
3215
  donationTypeData: report.donationTypeData,
3151
3216
  recurringColor: C.indigo,
3152
3217
  oneTimeColor: C.emerald
3153
- }), /*#__PURE__*/jsx(Panel, {
3154
- title: "Donor geography",
3155
- subtitle: "Top countries \xB7 ".concat(formatNumber(totalDonors), " total"),
3156
- children: (geoList.length ? geoList.slice(0, 6) : []).map(function (g, i) {
3157
- return /*#__PURE__*/jsxs("div", {
3158
- style: {
3159
- display: "flex",
3160
- justifyContent: "space-between",
3161
- padding: "3.5px 0",
3162
- borderBottom: i < 5 ? "1px solid #F3F4F6" : "none"
3163
- },
3164
- children: [/*#__PURE__*/jsx("span", {
3165
- style: {
3166
- fontSize: 9,
3167
- color: "#374151"
3168
- },
3169
- children: g.country
3170
- }), /*#__PURE__*/jsxs("span", {
3171
- style: {
3172
- fontSize: 9,
3173
- color: "#6B7280"
3174
- },
3175
- children: [formatNumber(g.value), " \xB7 ", formatNumber(g.percentage), "%"]
3176
- })]
3177
- }, i);
3178
- })
3218
+ }), /*#__PURE__*/jsx(DonorGeographyPanel, {
3219
+ geoList: geoList,
3220
+ totalDonors: totalDonors,
3221
+ barColor: C.indigo
3179
3222
  }), /*#__PURE__*/jsxs(Panel, {
3180
3223
  title: "Refunds & chargebacks",
3181
3224
  subtitle: "Trust health \xB7 ".concat(numberOfDays, "-day window"),
@@ -3305,10 +3348,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3305
3348
  display: "flex",
3306
3349
  gap: 12
3307
3350
  },
3308
- children: [["Avg/day", d$((ob === null || ob === void 0 ? void 0 : ob.averagePerDay) || 0)], ["Peak day", d$((ob === null || ob === void 0 || (_ob$peakDay = ob.peakDay) === null || _ob$peakDay === void 0 ? void 0 : _ob$peakDay.amount) || 0)], ["Orders", formatNumber((ob === null || ob === void 0 ? void 0 : ob.totalOrders) || 0)]].map(function (_ref16) {
3309
- var _ref17 = _slicedToArray(_ref16, 2),
3310
- l = _ref17[0],
3311
- v = _ref17[1];
3351
+ children: [["Avg/day", d$((ob === null || ob === void 0 ? void 0 : ob.averagePerDay) || 0)], ["Peak day", d$((ob === null || ob === void 0 || (_ob$peakDay = ob.peakDay) === null || _ob$peakDay === void 0 ? void 0 : _ob$peakDay.amount) || 0)], ["Orders", formatNumber((ob === null || ob === void 0 ? void 0 : ob.totalOrders) || 0)]].map(function (_ref17) {
3352
+ var _ref18 = _slicedToArray(_ref17, 2),
3353
+ l = _ref18[0],
3354
+ v = _ref18[1];
3312
3355
  return /*#__PURE__*/jsxs("div", {
3313
3356
  children: [/*#__PURE__*/jsx("div", {
3314
3357
  style: {
@@ -3381,10 +3424,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3381
3424
  display: "flex",
3382
3425
  gap: 12
3383
3426
  },
3384
- children: [["Referrers", formatNumber((refCard === null || refCard === void 0 ? void 0 : refCard.totalReferrers) || 0)], ["Avg gift", d$((refCard === null || refCard === void 0 ? void 0 : refCard.averageGift) || 0)], ["Conv. rate", pct((refCard === null || refCard === void 0 ? void 0 : refCard.conversionRate) || 0, 1)]].map(function (_ref18) {
3385
- var _ref19 = _slicedToArray(_ref18, 2),
3386
- l = _ref19[0],
3387
- v = _ref19[1];
3427
+ children: [["Referrers", formatNumber((refCard === null || refCard === void 0 ? void 0 : refCard.totalReferrers) || 0)], ["Avg gift", d$((refCard === null || refCard === void 0 ? void 0 : refCard.averageGift) || 0)], ["Conv. rate", pct((refCard === null || refCard === void 0 ? void 0 : refCard.conversionRate) || 0, 1)]].map(function (_ref19) {
3428
+ var _ref20 = _slicedToArray(_ref19, 2),
3429
+ l = _ref20[0],
3430
+ v = _ref20[1];
3388
3431
  return /*#__PURE__*/jsxs("div", {
3389
3432
  children: [/*#__PURE__*/jsx("div", {
3390
3433
  style: {