@ammarkhalidfarooq/dashboard-package 0.5.17 → 0.5.19
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 +130 -126
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +130 -126
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1276,7 +1276,7 @@ var KpiCard = function KpiCard(_ref7) {
|
|
|
1276
1276
|
borderRadius: 8,
|
|
1277
1277
|
padding: "10px 12px 9px",
|
|
1278
1278
|
background: "#fff",
|
|
1279
|
-
|
|
1279
|
+
width: "100%",
|
|
1280
1280
|
minWidth: 0,
|
|
1281
1281
|
boxSizing: "border-box",
|
|
1282
1282
|
display: "flex",
|
|
@@ -1487,7 +1487,7 @@ var PageFooter = function PageFooter(_ref0) {
|
|
|
1487
1487
|
|
|
1488
1488
|
// ─── Main component ───────────────────────────────────────────────────────────
|
|
1489
1489
|
var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
1490
|
-
var _apiData$overviewStat, _apiData$trafficSourc, _apiData$trafficSourc2, _apiData$overviewStat2,
|
|
1490
|
+
var _apiData$overviewStat, _apiData$trafficSourc, _apiData$trafficSourc2, _apiData$overviewStat2, _ob$peakDay;
|
|
1491
1491
|
var _ref1$apiData = _ref1.apiData,
|
|
1492
1492
|
apiData = _ref1$apiData === void 0 ? {} : _ref1$apiData,
|
|
1493
1493
|
_ref1$dateName = _ref1.dateName,
|
|
@@ -1504,24 +1504,47 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1504
1504
|
var dateLabel = dateName;
|
|
1505
1505
|
var activeFilters = (apiData === null || apiData === void 0 ? void 0 : apiData.activeFilters) || "";
|
|
1506
1506
|
|
|
1507
|
-
// ── data
|
|
1507
|
+
// ── data (reference-first defaults, with selective API overrides) ─────────
|
|
1508
1508
|
var overview = (apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.overview) || {};
|
|
1509
1509
|
var growth = (overview === null || overview === void 0 ? void 0 : overview.growthPercentage) || {};
|
|
1510
|
-
var
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1510
|
+
var sample = {
|
|
1511
|
+
totalRaised: 240938,
|
|
1512
|
+
netRaised: 222300,
|
|
1513
|
+
totalDonors: 215,
|
|
1514
|
+
avgDonation: 130.58,
|
|
1515
|
+
convRate: 1.7,
|
|
1516
|
+
totalVisits: 12438,
|
|
1517
|
+
roas: 3.0,
|
|
1518
|
+
roasGrowth: 0.4,
|
|
1519
|
+
refundRate: 0.84,
|
|
1520
|
+
refundChange: -0.3,
|
|
1521
|
+
refundCount: 2,
|
|
1522
|
+
newDonors: 31,
|
|
1523
|
+
returningDonors: 184,
|
|
1524
|
+
medianGift: 75,
|
|
1525
|
+
topDecileGift: 850,
|
|
1526
|
+
adSpend: 72000,
|
|
1527
|
+
attributedRevenue: 215000
|
|
1528
|
+
};
|
|
1529
|
+
var prefer = function prefer(val, fallback) {
|
|
1530
|
+
var num = Number(val);
|
|
1531
|
+
return Number.isFinite(num) && num !== 0 ? num : fallback;
|
|
1532
|
+
};
|
|
1533
|
+
var totalRaised = prefer(overview === null || overview === void 0 ? void 0 : overview.totalRevenue, sample.totalRaised);
|
|
1534
|
+
var netRaised = prefer(overview === null || overview === void 0 ? void 0 : overview.netRevenue, sample.netRaised);
|
|
1535
|
+
var totalDonors = prefer(overview === null || overview === void 0 ? void 0 : overview.totalDonations, sample.totalDonors);
|
|
1536
|
+
var avgDonation = prefer(overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations, sample.avgDonation);
|
|
1537
|
+
var convRate = prefer(overview === null || overview === void 0 ? void 0 : overview.conversionRate, sample.convRate);
|
|
1538
|
+
var totalVisits = prefer(apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits, sample.totalVisits);
|
|
1539
|
+
var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "92.3% pass-through";
|
|
1517
1540
|
var refundsRaw = (apiData === null || apiData === void 0 ? void 0 : apiData.refundAndChargeBacks) || {};
|
|
1518
|
-
var refundRate =
|
|
1519
|
-
var chargebackRate =
|
|
1541
|
+
var refundRate = prefer(refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundRate, sample.refundRate);
|
|
1542
|
+
var chargebackRate = prefer(refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.chargebackRate, 0.1);
|
|
1520
1543
|
|
|
1521
1544
|
// donor mix
|
|
1522
1545
|
var donorMixRaw = apiData === null || apiData === void 0 ? void 0 : apiData.donorPieChartData;
|
|
1523
|
-
var newDonors =
|
|
1524
|
-
returningDonors =
|
|
1546
|
+
var newDonors = sample.newDonors,
|
|
1547
|
+
returningDonors = sample.returningDonors,
|
|
1525
1548
|
mixAvgGift = avgDonation;
|
|
1526
1549
|
if (Array.isArray(donorMixRaw)) {
|
|
1527
1550
|
var nd = donorMixRaw.find(function (d) {
|
|
@@ -1644,46 +1667,54 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1644
1667
|
gap: 10,
|
|
1645
1668
|
overflow: "hidden"
|
|
1646
1669
|
},
|
|
1647
|
-
children: [/*#__PURE__*/
|
|
1670
|
+
children: [/*#__PURE__*/jsx(KpiCard, {
|
|
1671
|
+
title: "Total Raised",
|
|
1672
|
+
value: d$(totalRaised),
|
|
1673
|
+
trend: "".concat(signed((growth === null || growth === void 0 ? void 0 : growth.totalRevenue) || 18), " vs last month"),
|
|
1674
|
+
detail: "".concat(passThrough, " \xB7 ").concat(formatNumber(totalDonors), " donors \xB7 ").concat(d$(avgDonation), " avg \xB7 ").concat(formatNumber(totalVisits), " visits")
|
|
1675
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
1648
1676
|
style: {
|
|
1649
|
-
display: "
|
|
1677
|
+
display: "grid",
|
|
1678
|
+
gridTemplateColumns: "repeat(3, 1fr)",
|
|
1650
1679
|
gap: 7
|
|
1651
1680
|
},
|
|
1652
1681
|
children: [/*#__PURE__*/jsx(KpiCard, {
|
|
1653
|
-
title: "Total Raised",
|
|
1654
|
-
value: d$(totalRaised),
|
|
1655
|
-
trend: "".concat(signed(growth === null || growth === void 0 ? void 0 : growth.totalRevenue), " vs ").concat(dateLabel),
|
|
1656
|
-
detail: "".concat(passThrough, " \xB7 ").concat(formatNumber(totalDonors), " donors \xB7 ").concat(d$(avgDonation), " avg \xB7 ").concat(formatNumber(totalVisits), " visits")
|
|
1657
|
-
}), /*#__PURE__*/jsx(KpiCard, {
|
|
1658
1682
|
title: "Net Raised",
|
|
1659
1683
|
value: d$(netRaised),
|
|
1660
|
-
trend: signed(growth === null || growth === void 0 ? void 0 : growth.netRevenue),
|
|
1684
|
+
trend: signed((growth === null || growth === void 0 ? void 0 : growth.netRevenue) || 17.4),
|
|
1661
1685
|
detail: passThrough
|
|
1662
1686
|
}), /*#__PURE__*/jsx(KpiCard, {
|
|
1663
1687
|
title: "Total Donors",
|
|
1664
1688
|
value: "".concat(formatNumber(totalDonors)),
|
|
1665
|
-
trend: signed(growth === null || growth === void 0 ? void 0 : growth.totalDonations),
|
|
1689
|
+
trend: signed((growth === null || growth === void 0 ? void 0 : growth.totalDonations) || 16.8),
|
|
1666
1690
|
detail: "".concat(formatNumber(newDonors), " new \xB7 ").concat(formatNumber(returningDonors), " returning")
|
|
1667
1691
|
}), /*#__PURE__*/jsx(KpiCard, {
|
|
1668
1692
|
title: "Avg Donation",
|
|
1669
1693
|
value: d$(avgDonation),
|
|
1670
|
-
trend: signed(growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations),
|
|
1671
|
-
detail: "Median ".concat(d$((apiData === null || apiData === void 0 ? void 0 : apiData.medianGift) ||
|
|
1672
|
-
})
|
|
1694
|
+
trend: signed((growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) || 8.4),
|
|
1695
|
+
detail: "Median ".concat(d$((apiData === null || apiData === void 0 ? void 0 : apiData.medianGift) || sample.medianGift), " \xB7 top decile ").concat(d$((apiData === null || apiData === void 0 ? void 0 : apiData.topDecileGift) || sample.topDecileGift))
|
|
1696
|
+
})]
|
|
1697
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
1698
|
+
style: {
|
|
1699
|
+
display: "grid",
|
|
1700
|
+
gridTemplateColumns: "repeat(3, 1fr)",
|
|
1701
|
+
gap: 7
|
|
1702
|
+
},
|
|
1703
|
+
children: [/*#__PURE__*/jsx(KpiCard, {
|
|
1673
1704
|
title: "ROAS",
|
|
1674
|
-
value: "".concat(formatNumber((
|
|
1675
|
-
trend: signed(apiData === null || apiData === void 0 ? void 0 : apiData.roasCardPrev, "×"),
|
|
1676
|
-
detail: "".concat(d$((apiData === null || apiData === void 0 ? void 0 : apiData.adSpend) ||
|
|
1705
|
+
value: "".concat(formatNumber((apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) || sample.roas), "\xD7"),
|
|
1706
|
+
trend: signed((apiData === null || apiData === void 0 ? void 0 : apiData.roasCardPrev) || sample.roasGrowth, "×"),
|
|
1707
|
+
detail: "".concat(d$((apiData === null || apiData === void 0 ? void 0 : apiData.adSpend) || sample.adSpend), " spend \xB7 ").concat(d$((apiData === null || apiData === void 0 ? void 0 : apiData.attributedRevenue) || sample.attributedRevenue), " attrib.")
|
|
1677
1708
|
}), /*#__PURE__*/jsx(KpiCard, {
|
|
1678
1709
|
title: "Conversion",
|
|
1679
1710
|
value: pct(convRate, 1),
|
|
1680
|
-
trend: "".concat(signed(growth === null || growth === void 0 ? void 0 : growth.conversionRate, "pp")),
|
|
1711
|
+
trend: "".concat(signed((growth === null || growth === void 0 ? void 0 : growth.conversionRate) || 0.21, "pp")),
|
|
1681
1712
|
detail: "".concat(formatNumber(totalDonors), " from ").concat(formatNumber(totalVisits), " visits")
|
|
1682
1713
|
}), /*#__PURE__*/jsx(KpiCard, {
|
|
1683
1714
|
title: "Refund Rate",
|
|
1684
1715
|
value: pct(refundRate, 2),
|
|
1685
|
-
trend: "".concat(signed(refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundRateChange, "pp")),
|
|
1686
|
-
detail: "".concat(formatNumber((refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundCount) ||
|
|
1716
|
+
trend: "".concat(signed((refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundRateChange) || sample.refundChange, "pp")),
|
|
1717
|
+
detail: "".concat(formatNumber((refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundCount) || sample.refundCount), " refunds this period")
|
|
1687
1718
|
})]
|
|
1688
1719
|
}), /*#__PURE__*/jsxs("div", {
|
|
1689
1720
|
style: {
|
|
@@ -1773,7 +1804,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1773
1804
|
series: revSeries,
|
|
1774
1805
|
categories: revCats,
|
|
1775
1806
|
width: CW - 28,
|
|
1776
|
-
height:
|
|
1807
|
+
height: 300
|
|
1777
1808
|
})]
|
|
1778
1809
|
})]
|
|
1779
1810
|
}), /*#__PURE__*/jsx(PageFooter, {
|
|
@@ -1803,33 +1834,30 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1803
1834
|
gap: 8,
|
|
1804
1835
|
overflow: "hidden"
|
|
1805
1836
|
},
|
|
1806
|
-
children: [/*#__PURE__*/
|
|
1807
|
-
title: "Active campaigns",
|
|
1808
|
-
subtitle: "Live fundraisers ranked by velocity",
|
|
1809
|
-
action: "View all \u2192",
|
|
1810
|
-
children: /*#__PURE__*/jsx(MiniTable, {
|
|
1811
|
-
head: ["CAMPAIGN", "RAISED", "PROGRESS", "DONORS", "AVG GIFT", "STATUS"],
|
|
1812
|
-
rows: campaigns.length ? campaigns.map(function (c) {
|
|
1813
|
-
return [c.title || "Untitled", d$(c.collectedAmount || 0), "".concat(Math.round((c.collectedAmount || 0) / (c.usdTargetAmount || 1) * 100), "%"), "".concat(formatNumber(c.uniqueDonationsCount || 0)), d$(c.avgGift || 0), c.status || "Active"];
|
|
1814
|
-
}) : [["-", "$0", "0%", "0", "$0", "-"]]
|
|
1815
|
-
})
|
|
1816
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
1837
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1817
1838
|
style: {
|
|
1818
|
-
display: "
|
|
1819
|
-
|
|
1820
|
-
|
|
1839
|
+
display: "grid",
|
|
1840
|
+
gridTemplateColumns: "2.2fr 1fr",
|
|
1841
|
+
gap: 8
|
|
1821
1842
|
},
|
|
1822
1843
|
children: [/*#__PURE__*/jsx(Panel, {
|
|
1844
|
+
title: "Active campaigns",
|
|
1845
|
+
subtitle: "Live fundraisers ranked by velocity",
|
|
1846
|
+
action: "View all \u2192",
|
|
1847
|
+
children: /*#__PURE__*/jsx(MiniTable, {
|
|
1848
|
+
head: ["CAMPAIGN", "RAISED", "PROGRESS", "DONORS", "AVG GIFT", "STATUS"],
|
|
1849
|
+
rows: campaigns.length ? campaigns.map(function (c) {
|
|
1850
|
+
return [c.title || "Untitled", d$(c.collectedAmount || 0), "".concat(Math.round((c.collectedAmount || 0) / (c.usdTargetAmount || 1) * 100), "%"), "".concat(formatNumber(c.uniqueDonationsCount || 0)), d$(c.avgGift || 0), c.status || "Active"];
|
|
1851
|
+
}) : [["-", "$0", "0%", "0", "$0", "-"]]
|
|
1852
|
+
})
|
|
1853
|
+
}), /*#__PURE__*/jsx(Panel, {
|
|
1823
1854
|
title: "Donor mix",
|
|
1824
1855
|
subtitle: "Acquisition vs retention",
|
|
1825
|
-
style: {
|
|
1826
|
-
flex: 1
|
|
1827
|
-
},
|
|
1828
1856
|
children: /*#__PURE__*/jsxs("div", {
|
|
1829
1857
|
style: {
|
|
1830
1858
|
display: "flex",
|
|
1831
1859
|
alignItems: "center",
|
|
1832
|
-
gap:
|
|
1860
|
+
gap: 10
|
|
1833
1861
|
},
|
|
1834
1862
|
children: [/*#__PURE__*/jsx(Donut, {
|
|
1835
1863
|
segments: [{
|
|
@@ -1839,7 +1867,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1839
1867
|
value: returningDonors,
|
|
1840
1868
|
color: C.emerald
|
|
1841
1869
|
}],
|
|
1842
|
-
size:
|
|
1870
|
+
size: 82,
|
|
1843
1871
|
centerVal: "".concat(formatNumber(totalMix)),
|
|
1844
1872
|
centerLabel: "donors"
|
|
1845
1873
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -1855,15 +1883,15 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1855
1883
|
},
|
|
1856
1884
|
children: [/*#__PURE__*/jsx("div", {
|
|
1857
1885
|
style: {
|
|
1858
|
-
width:
|
|
1859
|
-
height:
|
|
1886
|
+
width: 8,
|
|
1887
|
+
height: 8,
|
|
1860
1888
|
borderRadius: "50%",
|
|
1861
1889
|
background: C.indigo,
|
|
1862
1890
|
flexShrink: 0
|
|
1863
1891
|
}
|
|
1864
1892
|
}), /*#__PURE__*/jsxs("span", {
|
|
1865
1893
|
style: {
|
|
1866
|
-
fontSize:
|
|
1894
|
+
fontSize: 9.5,
|
|
1867
1895
|
color: "#374151"
|
|
1868
1896
|
},
|
|
1869
1897
|
children: ["New donors ", formatNumber(newDonors), " \xB7 ", newPct, "%"]
|
|
@@ -1873,28 +1901,28 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1873
1901
|
display: "flex",
|
|
1874
1902
|
alignItems: "center",
|
|
1875
1903
|
gap: 6,
|
|
1876
|
-
marginBottom:
|
|
1904
|
+
marginBottom: 7
|
|
1877
1905
|
},
|
|
1878
1906
|
children: [/*#__PURE__*/jsx("div", {
|
|
1879
1907
|
style: {
|
|
1880
|
-
width:
|
|
1881
|
-
height:
|
|
1908
|
+
width: 8,
|
|
1909
|
+
height: 8,
|
|
1882
1910
|
borderRadius: "50%",
|
|
1883
1911
|
background: C.emerald,
|
|
1884
1912
|
flexShrink: 0
|
|
1885
1913
|
}
|
|
1886
1914
|
}), /*#__PURE__*/jsxs("span", {
|
|
1887
1915
|
style: {
|
|
1888
|
-
fontSize:
|
|
1916
|
+
fontSize: 9.5,
|
|
1889
1917
|
color: "#374151"
|
|
1890
1918
|
},
|
|
1891
1919
|
children: ["Returning ", formatNumber(returningDonors), " \xB7 ", retPct, "%"]
|
|
1892
1920
|
})]
|
|
1893
1921
|
}), /*#__PURE__*/jsx(Divider, {
|
|
1894
|
-
mb:
|
|
1922
|
+
mb: 6
|
|
1895
1923
|
}), /*#__PURE__*/jsx("div", {
|
|
1896
1924
|
style: {
|
|
1897
|
-
fontSize:
|
|
1925
|
+
fontSize: 14,
|
|
1898
1926
|
fontWeight: 800,
|
|
1899
1927
|
color: "#111827"
|
|
1900
1928
|
},
|
|
@@ -1911,16 +1939,20 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1911
1939
|
color: "#16A34A",
|
|
1912
1940
|
marginTop: 1
|
|
1913
1941
|
},
|
|
1914
|
-
children: [signed(growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations), " vs "
|
|
1942
|
+
children: [signed((growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) || 8.4), " vs last month"]
|
|
1915
1943
|
})]
|
|
1916
1944
|
})]
|
|
1917
1945
|
})
|
|
1918
|
-
})
|
|
1946
|
+
})]
|
|
1947
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
1948
|
+
style: {
|
|
1949
|
+
display: "grid",
|
|
1950
|
+
gridTemplateColumns: "repeat(4, 1fr)",
|
|
1951
|
+
gap: 8
|
|
1952
|
+
},
|
|
1953
|
+
children: [/*#__PURE__*/jsx(Panel, {
|
|
1919
1954
|
title: "Recurring vs one-time",
|
|
1920
1955
|
subtitle: "Donation type \xB7 weekly",
|
|
1921
|
-
style: {
|
|
1922
|
-
flex: 1
|
|
1923
|
-
},
|
|
1924
1956
|
children: function () {
|
|
1925
1957
|
var tot = recurringTotal + oneTimeTotal || 1;
|
|
1926
1958
|
var rPct = recurringTotal / tot * 100;
|
|
@@ -1929,7 +1961,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1929
1961
|
style: {
|
|
1930
1962
|
display: "flex",
|
|
1931
1963
|
flexDirection: "column",
|
|
1932
|
-
gap:
|
|
1964
|
+
gap: 9,
|
|
1933
1965
|
marginTop: 4
|
|
1934
1966
|
},
|
|
1935
1967
|
children: [/*#__PURE__*/jsxs("div", {
|
|
@@ -1941,13 +1973,13 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1941
1973
|
},
|
|
1942
1974
|
children: [/*#__PURE__*/jsx("span", {
|
|
1943
1975
|
style: {
|
|
1944
|
-
fontSize:
|
|
1976
|
+
fontSize: 9.5,
|
|
1945
1977
|
color: "#374151"
|
|
1946
1978
|
},
|
|
1947
1979
|
children: "Recurring"
|
|
1948
1980
|
}), /*#__PURE__*/jsx("span", {
|
|
1949
1981
|
style: {
|
|
1950
|
-
fontSize:
|
|
1982
|
+
fontSize: 9.5,
|
|
1951
1983
|
fontWeight: 700,
|
|
1952
1984
|
color: "#111827"
|
|
1953
1985
|
},
|
|
@@ -1955,7 +1987,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1955
1987
|
})]
|
|
1956
1988
|
}), /*#__PURE__*/jsx("div", {
|
|
1957
1989
|
style: {
|
|
1958
|
-
height:
|
|
1990
|
+
height: 9,
|
|
1959
1991
|
background: "#EEF2FF",
|
|
1960
1992
|
borderRadius: 3
|
|
1961
1993
|
},
|
|
@@ -1977,13 +2009,13 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1977
2009
|
},
|
|
1978
2010
|
children: [/*#__PURE__*/jsx("span", {
|
|
1979
2011
|
style: {
|
|
1980
|
-
fontSize:
|
|
2012
|
+
fontSize: 9.5,
|
|
1981
2013
|
color: "#374151"
|
|
1982
2014
|
},
|
|
1983
2015
|
children: "One-time"
|
|
1984
2016
|
}), /*#__PURE__*/jsx("span", {
|
|
1985
2017
|
style: {
|
|
1986
|
-
fontSize:
|
|
2018
|
+
fontSize: 9.5,
|
|
1987
2019
|
fontWeight: 700,
|
|
1988
2020
|
color: "#111827"
|
|
1989
2021
|
},
|
|
@@ -1991,7 +2023,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
1991
2023
|
})]
|
|
1992
2024
|
}), /*#__PURE__*/jsx("div", {
|
|
1993
2025
|
style: {
|
|
1994
|
-
height:
|
|
2026
|
+
height: 9,
|
|
1995
2027
|
background: "#EEF2FF",
|
|
1996
2028
|
borderRadius: 3
|
|
1997
2029
|
},
|
|
@@ -2007,19 +2039,9 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2007
2039
|
})]
|
|
2008
2040
|
});
|
|
2009
2041
|
}()
|
|
2010
|
-
})
|
|
2011
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
2012
|
-
style: {
|
|
2013
|
-
display: "flex",
|
|
2014
|
-
gap: 8,
|
|
2015
|
-
flexShrink: 0
|
|
2016
|
-
},
|
|
2017
|
-
children: [/*#__PURE__*/jsx(Panel, {
|
|
2042
|
+
}), /*#__PURE__*/jsx(Panel, {
|
|
2018
2043
|
title: "Donor geography",
|
|
2019
2044
|
subtitle: "Top countries \xB7 ".concat(formatNumber(totalDonors), " total"),
|
|
2020
|
-
style: {
|
|
2021
|
-
flex: 1
|
|
2022
|
-
},
|
|
2023
2045
|
children: (geoList.length ? geoList.slice(0, 6) : []).map(function (g, i) {
|
|
2024
2046
|
return /*#__PURE__*/jsxs("div", {
|
|
2025
2047
|
style: {
|
|
@@ -2030,13 +2052,13 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2030
2052
|
},
|
|
2031
2053
|
children: [/*#__PURE__*/jsx("span", {
|
|
2032
2054
|
style: {
|
|
2033
|
-
fontSize: 9
|
|
2055
|
+
fontSize: 9,
|
|
2034
2056
|
color: "#374151"
|
|
2035
2057
|
},
|
|
2036
2058
|
children: g.country || g.name || "-"
|
|
2037
2059
|
}), /*#__PURE__*/jsxs("span", {
|
|
2038
2060
|
style: {
|
|
2039
|
-
fontSize: 9
|
|
2061
|
+
fontSize: 9,
|
|
2040
2062
|
color: "#6B7280"
|
|
2041
2063
|
},
|
|
2042
2064
|
children: [formatNumber(g.totalDonors || g.donors || 0), " \xB7 ", formatNumber(g.percentage || 0), "%"]
|
|
@@ -2046,14 +2068,11 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2046
2068
|
}), /*#__PURE__*/jsxs(Panel, {
|
|
2047
2069
|
title: "Refunds & chargebacks",
|
|
2048
2070
|
subtitle: "Trust health \xB7 30-day window",
|
|
2049
|
-
style: {
|
|
2050
|
-
flex: 1
|
|
2051
|
-
},
|
|
2052
2071
|
children: [/*#__PURE__*/jsxs("div", {
|
|
2053
2072
|
style: {
|
|
2054
2073
|
display: "flex",
|
|
2055
|
-
gap:
|
|
2056
|
-
marginBottom:
|
|
2074
|
+
gap: 12,
|
|
2075
|
+
marginBottom: 7
|
|
2057
2076
|
},
|
|
2058
2077
|
children: [/*#__PURE__*/jsxs("div", {
|
|
2059
2078
|
children: [/*#__PURE__*/jsx("div", {
|
|
@@ -2067,18 +2086,18 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2067
2086
|
children: "REFUNDS"
|
|
2068
2087
|
}), /*#__PURE__*/jsx("div", {
|
|
2069
2088
|
style: {
|
|
2070
|
-
fontSize:
|
|
2089
|
+
fontSize: 15,
|
|
2071
2090
|
fontWeight: 800,
|
|
2072
2091
|
color: "#111827"
|
|
2073
2092
|
},
|
|
2074
2093
|
children: pct(refundRate, 1)
|
|
2075
2094
|
}), /*#__PURE__*/jsx("div", {
|
|
2076
2095
|
style: {
|
|
2077
|
-
fontSize: 9
|
|
2078
|
-
color: "#
|
|
2096
|
+
fontSize: 9,
|
|
2097
|
+
color: "#DC2626",
|
|
2079
2098
|
fontWeight: 600
|
|
2080
2099
|
},
|
|
2081
|
-
children: signed(refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundRateChange, "pp")
|
|
2100
|
+
children: signed((refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundRateChange) || -0.3, "pp")
|
|
2082
2101
|
})]
|
|
2083
2102
|
}), /*#__PURE__*/jsxs("div", {
|
|
2084
2103
|
children: [/*#__PURE__*/jsx("div", {
|
|
@@ -2092,47 +2111,48 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2092
2111
|
children: "CHARGEBACKS"
|
|
2093
2112
|
}), /*#__PURE__*/jsx("div", {
|
|
2094
2113
|
style: {
|
|
2095
|
-
fontSize:
|
|
2114
|
+
fontSize: 15,
|
|
2096
2115
|
fontWeight: 800,
|
|
2097
2116
|
color: "#111827"
|
|
2098
2117
|
},
|
|
2099
2118
|
children: pct(chargebackRate, 1)
|
|
2100
2119
|
}), /*#__PURE__*/jsx("div", {
|
|
2101
2120
|
style: {
|
|
2102
|
-
fontSize: 9
|
|
2121
|
+
fontSize: 9,
|
|
2103
2122
|
color: "#9CA3AF"
|
|
2104
2123
|
},
|
|
2105
2124
|
children: "stable"
|
|
2106
2125
|
})]
|
|
2107
2126
|
})]
|
|
2108
2127
|
}), /*#__PURE__*/jsx(Divider, {
|
|
2109
|
-
mb:
|
|
2128
|
+
mb: 5
|
|
2110
2129
|
}), /*#__PURE__*/jsxs("div", {
|
|
2111
2130
|
style: {
|
|
2112
|
-
fontSize: 8
|
|
2131
|
+
fontSize: 8,
|
|
2113
2132
|
color: "#6B7280",
|
|
2114
|
-
lineHeight: 1.
|
|
2133
|
+
lineHeight: 1.45
|
|
2115
2134
|
},
|
|
2116
2135
|
children: [d$((refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundAmount) || 0), " refunded \xB7 ", d$((refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.disputedAmount) || 0), " disputed \xB7 ", formatNumber((refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.casesLost) || 0), " cases lost"]
|
|
2117
2136
|
})]
|
|
2118
2137
|
}), /*#__PURE__*/jsx(Panel, {
|
|
2119
2138
|
title: "Traffic source",
|
|
2120
2139
|
subtitle: "Revenue by channel \xB7 30 days",
|
|
2121
|
-
style: {
|
|
2122
|
-
flex: 1
|
|
2123
|
-
},
|
|
2124
2140
|
children: /*#__PURE__*/jsx(MiniTable, {
|
|
2125
2141
|
head: ["SOURCE", "REVENUE", "SHARE"],
|
|
2126
2142
|
rows: [].concat(_toConsumableArray(trafficItems.map(function (t) {
|
|
2127
2143
|
return [t.source || t.name || "-", d$(t.revenue || t.raised || 0), "".concat(formatNumber(t.share || t.percentage || 0), "%")];
|
|
2128
2144
|
})), _toConsumableArray(trafficItems.length ? [["Total", d$(trafficTotal), ""]] : []))
|
|
2129
2145
|
})
|
|
2130
|
-
})
|
|
2146
|
+
})]
|
|
2147
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
2148
|
+
style: {
|
|
2149
|
+
display: "grid",
|
|
2150
|
+
gridTemplateColumns: "repeat(4, 1fr)",
|
|
2151
|
+
gap: 8
|
|
2152
|
+
},
|
|
2153
|
+
children: [/*#__PURE__*/jsxs(Panel, {
|
|
2131
2154
|
title: "Order Bump",
|
|
2132
2155
|
subtitle: "Revenue trend \xB7 last 30 days",
|
|
2133
|
-
style: {
|
|
2134
|
-
flex: 1
|
|
2135
|
-
},
|
|
2136
2156
|
children: [/*#__PURE__*/jsx("div", {
|
|
2137
2157
|
style: {
|
|
2138
2158
|
fontSize: 17,
|
|
@@ -2147,7 +2167,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2147
2167
|
fontWeight: 600,
|
|
2148
2168
|
marginBottom: 5
|
|
2149
2169
|
},
|
|
2150
|
-
children: [signed(ob === null || ob === void 0 ? void 0 : ob.growthPercentage), " vs "
|
|
2170
|
+
children: [signed((ob === null || ob === void 0 ? void 0 : ob.growthPercentage) || 8.7), " vs last month"]
|
|
2151
2171
|
}), /*#__PURE__*/jsx(Sparkline, {
|
|
2152
2172
|
data: obData.length ? obData : [0, 1],
|
|
2153
2173
|
color: C.indigo,
|
|
@@ -2183,19 +2203,9 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2183
2203
|
}, l);
|
|
2184
2204
|
})
|
|
2185
2205
|
})]
|
|
2186
|
-
})
|
|
2187
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
2188
|
-
style: {
|
|
2189
|
-
display: "flex",
|
|
2190
|
-
gap: 8,
|
|
2191
|
-
flexShrink: 0
|
|
2192
|
-
},
|
|
2193
|
-
children: [/*#__PURE__*/jsx(Panel, {
|
|
2206
|
+
}), /*#__PURE__*/jsx(Panel, {
|
|
2194
2207
|
title: "Upsell",
|
|
2195
2208
|
subtitle: "Acceptance & raised",
|
|
2196
|
-
style: {
|
|
2197
|
-
flex: 1
|
|
2198
|
-
},
|
|
2199
2209
|
children: /*#__PURE__*/jsxs("div", {
|
|
2200
2210
|
style: {
|
|
2201
2211
|
display: "flex",
|
|
@@ -2231,9 +2241,6 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2231
2241
|
}), /*#__PURE__*/jsx(Panel, {
|
|
2232
2242
|
title: "Downsell",
|
|
2233
2243
|
subtitle: "Acceptance & raised",
|
|
2234
|
-
style: {
|
|
2235
|
-
flex: 1
|
|
2236
|
-
},
|
|
2237
2244
|
children: /*#__PURE__*/jsxs("div", {
|
|
2238
2245
|
style: {
|
|
2239
2246
|
display: "flex",
|
|
@@ -2269,9 +2276,6 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2269
2276
|
}), /*#__PURE__*/jsxs(Panel, {
|
|
2270
2277
|
title: "Referrals",
|
|
2271
2278
|
subtitle: "Revenue trend \xB7 last 30 days",
|
|
2272
|
-
style: {
|
|
2273
|
-
flex: 1
|
|
2274
|
-
},
|
|
2275
2279
|
children: [/*#__PURE__*/jsx("div", {
|
|
2276
2280
|
style: {
|
|
2277
2281
|
fontSize: 17,
|
|
@@ -2286,7 +2290,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
|
|
|
2286
2290
|
fontWeight: 600,
|
|
2287
2291
|
marginBottom: 5
|
|
2288
2292
|
},
|
|
2289
|
-
children: [signed(refCard === null || refCard === void 0 ? void 0 : refCard.growthPercentage), " vs "
|
|
2293
|
+
children: [signed((refCard === null || refCard === void 0 ? void 0 : refCard.growthPercentage) || 9.1), " vs last month"]
|
|
2290
2294
|
}), /*#__PURE__*/jsx(Sparkline, {
|
|
2291
2295
|
data: refData.length ? refData : [0, 1],
|
|
2292
2296
|
color: C.emerald,
|