@ammarkhalidfarooq/dashboard-package 0.6.57 → 0.6.58

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
@@ -1614,17 +1614,67 @@ var signed = function signed(v) {
1614
1614
  var n = Number(v !== null && v !== void 0 ? v : 0);
1615
1615
  return "".concat(n >= 0 ? "+" : "").concat(n.toFixed(2)).concat(suffix);
1616
1616
  };
1617
+ var TREND_UP = "#0B8F61";
1618
+ var TREND_DOWN = "#ef4444";
1619
+ var resolveTrendColor = function resolveTrendColor(trendText) {
1620
+ var trendPositiveWhenNegative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1621
+ return getTrendColor(trendText, trendPositiveWhenNegative ? {
1622
+ up: TREND_DOWN,
1623
+ down: TREND_UP,
1624
+ neutral: TREND_UP
1625
+ } : {
1626
+ up: TREND_UP,
1627
+ down: TREND_DOWN,
1628
+ neutral: TREND_UP
1629
+ });
1630
+ };
1631
+ var withTrendArrow = function withTrendArrow(text) {
1632
+ var str = String(text !== null && text !== void 0 ? text : "").trim();
1633
+ if (!str || str.includes("▼") || str.includes("▲")) return str;
1634
+ var arrow = getTrendArrow(str);
1635
+ return arrow ? "".concat(arrow, " ").concat(str) : str;
1636
+ };
1637
+ var formatArrowTrend = function formatArrowTrend(value) {
1638
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
1639
+ _ref$suffix = _ref.suffix,
1640
+ suffix = _ref$suffix === void 0 ? "%" : _ref$suffix,
1641
+ _ref$decimals = _ref.decimals,
1642
+ decimals = _ref$decimals === void 0 ? 1 : _ref$decimals,
1643
+ _ref$label = _ref.label,
1644
+ label = _ref$label === void 0 ? "" : _ref$label;
1645
+ var n = Number(value !== null && value !== void 0 ? value : 0);
1646
+ var arrow = n >= 0 ? "▲" : "▼";
1647
+ var labelSuffix = label ? " ".concat(label) : "";
1648
+ if (suffix === "pp") return "".concat(arrow, " ").concat(Math.abs(n).toFixed(2), "pp").concat(labelSuffix);
1649
+ if (suffix === "x") return "".concat(arrow, " ").concat(Math.abs(n).toFixed(1), "x").concat(labelSuffix);
1650
+ return "".concat(arrow, " ").concat(Math.abs(n).toFixed(decimals), "%").concat(labelSuffix);
1651
+ };
1652
+ var TrendText = function TrendText(_ref2) {
1653
+ var children = _ref2.children,
1654
+ _ref2$invert = _ref2.invert,
1655
+ invert = _ref2$invert === void 0 ? false : _ref2$invert,
1656
+ _ref2$style = _ref2.style,
1657
+ style = _ref2$style === void 0 ? {} : _ref2$style;
1658
+ var text = withTrendArrow(children);
1659
+ return /*#__PURE__*/jsx("span", {
1660
+ style: _objectSpread2({
1661
+ fontWeight: 600,
1662
+ color: resolveTrendColor(text, invert)
1663
+ }, style),
1664
+ children: text
1665
+ });
1666
+ };
1617
1667
 
1618
1668
  // ─── SVG line sparkline ───────────────────────────────────────────────────────
1619
- var Sparkline = function Sparkline(_ref) {
1620
- var _ref$data = _ref.data,
1621
- data = _ref$data === void 0 ? [] : _ref$data,
1622
- _ref$color = _ref.color,
1623
- color = _ref$color === void 0 ? "#6366F1" : _ref$color,
1624
- _ref$width = _ref.width,
1625
- width = _ref$width === void 0 ? 120 : _ref$width,
1626
- _ref$height = _ref.height,
1627
- height = _ref$height === void 0 ? 40 : _ref$height;
1669
+ var Sparkline = function Sparkline(_ref3) {
1670
+ var _ref3$data = _ref3.data,
1671
+ data = _ref3$data === void 0 ? [] : _ref3$data,
1672
+ _ref3$color = _ref3.color,
1673
+ color = _ref3$color === void 0 ? "#6366F1" : _ref3$color,
1674
+ _ref3$width = _ref3.width,
1675
+ width = _ref3$width === void 0 ? 120 : _ref3$width,
1676
+ _ref3$height = _ref3.height,
1677
+ height = _ref3$height === void 0 ? 40 : _ref3$height;
1628
1678
  var vals = data.length >= 2 ? data : [0, 0];
1629
1679
  var max = Math.max.apply(Math, _toConsumableArray(vals).concat([0]));
1630
1680
  var min = Math.min.apply(Math, _toConsumableArray(vals).concat([0]));
@@ -1677,15 +1727,15 @@ var Sparkline = function Sparkline(_ref) {
1677
1727
  };
1678
1728
 
1679
1729
  // ─── SVG multi-series line chart ──────────────────────────────────────────────
1680
- var LineChart = function LineChart(_ref2) {
1681
- var _ref2$series = _ref2.series,
1682
- series = _ref2$series === void 0 ? [] : _ref2$series,
1683
- _ref2$categories = _ref2.categories,
1684
- categories = _ref2$categories === void 0 ? [] : _ref2$categories,
1685
- _ref2$width = _ref2.width,
1686
- width = _ref2$width === void 0 ? CW : _ref2$width,
1687
- _ref2$height = _ref2.height,
1688
- height = _ref2$height === void 0 ? 180 : _ref2$height;
1730
+ var LineChart = function LineChart(_ref4) {
1731
+ var _ref4$series = _ref4.series,
1732
+ series = _ref4$series === void 0 ? [] : _ref4$series,
1733
+ _ref4$categories = _ref4.categories,
1734
+ categories = _ref4$categories === void 0 ? [] : _ref4$categories,
1735
+ _ref4$width = _ref4.width,
1736
+ width = _ref4$width === void 0 ? CW : _ref4$width,
1737
+ _ref4$height = _ref4.height,
1738
+ height = _ref4$height === void 0 ? 180 : _ref4$height;
1689
1739
  var allVals = series.flatMap(function (s) {
1690
1740
  return s.data || [];
1691
1741
  });
@@ -1782,13 +1832,13 @@ var LineChart = function LineChart(_ref2) {
1782
1832
  };
1783
1833
 
1784
1834
  // ─── SVG donut ────────────────────────────────────────────────────────────────
1785
- var Donut = function Donut(_ref3) {
1786
- var _ref3$segments = _ref3.segments,
1787
- segments = _ref3$segments === void 0 ? [] : _ref3$segments,
1788
- _ref3$size = _ref3.size,
1789
- size = _ref3$size === void 0 ? 88 : _ref3$size,
1790
- centerVal = _ref3.centerVal,
1791
- centerLabel = _ref3.centerLabel;
1835
+ var Donut = function Donut(_ref5) {
1836
+ var _ref5$segments = _ref5.segments,
1837
+ segments = _ref5$segments === void 0 ? [] : _ref5$segments,
1838
+ _ref5$size = _ref5.size,
1839
+ size = _ref5$size === void 0 ? 88 : _ref5$size,
1840
+ centerVal = _ref5.centerVal,
1841
+ centerLabel = _ref5.centerLabel;
1792
1842
  var total = segments.reduce(function (s, g) {
1793
1843
  return s + (g.value || 0);
1794
1844
  }, 0) || 1;
@@ -1846,11 +1896,11 @@ var Donut = function Donut(_ref3) {
1846
1896
  };
1847
1897
 
1848
1898
  // ─── Shared primitives ────────────────────────────────────────────────────────
1849
- var Divider = function Divider(_ref4) {
1850
- var _ref4$mt = _ref4.mt,
1851
- mt = _ref4$mt === void 0 ? 0 : _ref4$mt,
1852
- _ref4$mb = _ref4.mb,
1853
- mb = _ref4$mb === void 0 ? 0 : _ref4$mb;
1899
+ var Divider = function Divider(_ref6) {
1900
+ var _ref6$mt = _ref6.mt,
1901
+ mt = _ref6$mt === void 0 ? 0 : _ref6$mt,
1902
+ _ref6$mb = _ref6.mb,
1903
+ mb = _ref6$mb === void 0 ? 0 : _ref6$mb;
1854
1904
  return /*#__PURE__*/jsx("div", {
1855
1905
  style: {
1856
1906
  borderTop: "1px solid #E5EAF1",
@@ -1859,13 +1909,13 @@ var Divider = function Divider(_ref4) {
1859
1909
  }
1860
1910
  });
1861
1911
  };
1862
- var Panel = function Panel(_ref5) {
1863
- var children = _ref5.children,
1864
- title = _ref5.title,
1865
- subtitle = _ref5.subtitle,
1866
- action = _ref5.action,
1867
- _ref5$style = _ref5.style,
1868
- style = _ref5$style === void 0 ? {} : _ref5$style;
1912
+ var Panel = function Panel(_ref7) {
1913
+ var children = _ref7.children,
1914
+ title = _ref7.title,
1915
+ subtitle = _ref7.subtitle,
1916
+ action = _ref7.action,
1917
+ _ref7$style = _ref7.style,
1918
+ style = _ref7$style === void 0 ? {} : _ref7$style;
1869
1919
  return /*#__PURE__*/jsxs("div", {
1870
1920
  style: _objectSpread2({
1871
1921
  border: "1px solid ".concat(THEME.panelBorder),
@@ -1914,11 +1964,11 @@ var Panel = function Panel(_ref5) {
1914
1964
  }), children]
1915
1965
  });
1916
1966
  };
1917
- var MiniTable = function MiniTable(_ref6) {
1918
- var _ref6$head = _ref6.head,
1919
- head = _ref6$head === void 0 ? [] : _ref6$head,
1920
- _ref6$rows = _ref6.rows,
1921
- rows = _ref6$rows === void 0 ? [] : _ref6$rows;
1967
+ var MiniTable = function MiniTable(_ref8) {
1968
+ var _ref8$head = _ref8.head,
1969
+ head = _ref8$head === void 0 ? [] : _ref8$head,
1970
+ _ref8$rows = _ref8.rows,
1971
+ rows = _ref8$rows === void 0 ? [] : _ref8$rows;
1922
1972
  return /*#__PURE__*/jsxs("table", {
1923
1973
  style: {
1924
1974
  width: "100%",
@@ -1969,14 +2019,16 @@ var MiniTable = function MiniTable(_ref6) {
1969
2019
  })]
1970
2020
  });
1971
2021
  };
1972
- var KpiCard = function KpiCard(_ref7) {
1973
- var title = _ref7.title,
1974
- value = _ref7.value,
1975
- trend = _ref7.trend,
1976
- detail = _ref7.detail,
1977
- _ref7$variant = _ref7.variant,
1978
- variant = _ref7$variant === void 0 ? "secondary" : _ref7$variant;
1979
- var neg = "".concat(trend).trim().startsWith("-");
2022
+ var KpiCard = function KpiCard(_ref9) {
2023
+ var title = _ref9.title,
2024
+ value = _ref9.value,
2025
+ trend = _ref9.trend,
2026
+ detail = _ref9.detail,
2027
+ _ref9$variant = _ref9.variant,
2028
+ variant = _ref9$variant === void 0 ? "secondary" : _ref9$variant,
2029
+ _ref9$trendPositiveWh = _ref9.trendPositiveWhenNegative,
2030
+ trendPositiveWhenNegative = _ref9$trendPositiveWh === void 0 ? false : _ref9$trendPositiveWh;
2031
+ var displayTrend = withTrendArrow(trend);
1980
2032
  var isPrimary = variant === "primary";
1981
2033
  return /*#__PURE__*/jsxs("div", {
1982
2034
  style: {
@@ -2013,9 +2065,9 @@ var KpiCard = function KpiCard(_ref7) {
2013
2065
  style: {
2014
2066
  fontSize: 10.5,
2015
2067
  fontWeight: 600,
2016
- color: neg ? "#DC2626" : "#16A34A"
2068
+ color: resolveTrendColor(displayTrend, trendPositiveWhenNegative)
2017
2069
  },
2018
- children: trend
2070
+ children: displayTrend
2019
2071
  }), /*#__PURE__*/jsx("div", {
2020
2072
  style: {
2021
2073
  fontSize: 8.5,
@@ -2026,11 +2078,11 @@ var KpiCard = function KpiCard(_ref7) {
2026
2078
  })]
2027
2079
  });
2028
2080
  };
2029
- var StatPair = function StatPair(_ref8) {
2030
- var label = _ref8.label,
2031
- val = _ref8.val,
2032
- trend = _ref8.trend;
2033
- var neg = "".concat(trend).trim().startsWith("-");
2081
+ var StatPair = function StatPair(_ref0) {
2082
+ var label = _ref0.label,
2083
+ val = _ref0.val,
2084
+ trend = _ref0.trend;
2085
+ var displayTrend = withTrendArrow(trend);
2034
2086
  return /*#__PURE__*/jsxs("div", {
2035
2087
  style: {
2036
2088
  marginBottom: 6
@@ -2059,19 +2111,19 @@ var StatPair = function StatPair(_ref8) {
2059
2111
  style: {
2060
2112
  fontSize: 9.5,
2061
2113
  fontWeight: 600,
2062
- color: neg ? "#DC2626" : "#16A34A"
2114
+ color: resolveTrendColor(displayTrend)
2063
2115
  },
2064
- children: trend
2116
+ children: displayTrend
2065
2117
  })]
2066
2118
  })]
2067
2119
  });
2068
2120
  };
2069
- var PageHeader = function PageHeader(_ref9) {
2070
- var dateLabel = _ref9.dateLabel,
2071
- generatedLabel = _ref9.generatedLabel,
2072
- activeFilters = _ref9.activeFilters,
2073
- page = _ref9.page,
2074
- windowLabel = _ref9.windowLabel;
2121
+ var PageHeader = function PageHeader(_ref1) {
2122
+ var dateLabel = _ref1.dateLabel,
2123
+ generatedLabel = _ref1.generatedLabel,
2124
+ activeFilters = _ref1.activeFilters,
2125
+ page = _ref1.page,
2126
+ windowLabel = _ref1.windowLabel;
2075
2127
  return /*#__PURE__*/jsxs("div", {
2076
2128
  style: {
2077
2129
  padding: "22px ".concat(MX, "px 12px"),
@@ -2177,9 +2229,9 @@ var PageHeader = function PageHeader(_ref9) {
2177
2229
  })]
2178
2230
  });
2179
2231
  };
2180
- var PageFooter = function PageFooter(_ref0) {
2181
- var generatedLabel = _ref0.generatedLabel,
2182
- page = _ref0.page;
2232
+ var PageFooter = function PageFooter(_ref10) {
2233
+ var generatedLabel = _ref10.generatedLabel,
2234
+ page = _ref10.page;
2183
2235
  return /*#__PURE__*/jsx("div", {
2184
2236
  style: {
2185
2237
  padding: "7px ".concat(MX, "px"),
@@ -2199,16 +2251,16 @@ var PageFooter = function PageFooter(_ref0) {
2199
2251
  };
2200
2252
 
2201
2253
  // ─── Main component ───────────────────────────────────────────────────────────
2202
- var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2203
- var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _refundsRaw$refundRat, _refundsRaw$chargebac, _apiData$trafficSourc2, _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, _ob$peakDay;
2204
- var _ref1$apiData = _ref1.apiData,
2205
- apiData = _ref1$apiData === void 0 ? {} : _ref1$apiData,
2206
- _ref1$dateName = _ref1.dateName,
2207
- dateName = _ref1$dateName === void 0 ? "Last Period" : _ref1$dateName,
2208
- _ref1$numberOfDays = _ref1.numberOfDays,
2209
- numberOfDays = _ref1$numberOfDays === void 0 ? 30 : _ref1$numberOfDays,
2210
- _ref1$activeFilters = _ref1.activeFilters,
2211
- activeFilters = _ref1$activeFilters === void 0 ? [] : _ref1$activeFilters;
2254
+ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref11, ref) {
2255
+ var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _refundsRaw$refundRat, _refundsRaw$chargebac, _apiData$trafficSourc2, _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, _ref14, _refundsRaw$refundRat2, _ob$growthPercentage, _ob$peakDay, _refCard$growthPercen;
2256
+ var _ref11$apiData = _ref11.apiData,
2257
+ apiData = _ref11$apiData === void 0 ? {} : _ref11$apiData,
2258
+ _ref11$dateName = _ref11.dateName,
2259
+ dateName = _ref11$dateName === void 0 ? "Last Period" : _ref11$dateName,
2260
+ _ref11$numberOfDays = _ref11.numberOfDays,
2261
+ numberOfDays = _ref11$numberOfDays === void 0 ? 30 : _ref11$numberOfDays,
2262
+ _ref11$activeFilters = _ref11.activeFilters,
2263
+ activeFilters = _ref11$activeFilters === void 0 ? [] : _ref11$activeFilters;
2212
2264
  var now = new Date();
2213
2265
  var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
2214
2266
  var windowLabel = "".concat(numberOfDays, "-day window");
@@ -2279,7 +2331,8 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2279
2331
  totalMix = donorMix.totalMix,
2280
2332
  newPct = donorMix.newPct,
2281
2333
  retPct = donorMix.retPct,
2282
- mixAvgGift = donorMix.avgGift;
2334
+ mixAvgGift = donorMix.avgGift,
2335
+ donorMixPrev = donorMix.donorMixPrev;
2283
2336
  var recData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.recurringBarChartData) ? apiData.recurringBarChartData : [];
2284
2337
  var recurringTotal = recData.length ? recData.reduce(function (s, i) {
2285
2338
  return s + Number(i.recurring || i.recurringAmount || 0);
@@ -2487,7 +2540,8 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2487
2540
  title: "Refund Rate",
2488
2541
  value: pct(refundRate, 2),
2489
2542
  trend: ((_metricByTitle$Refund = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund === void 0 ? void 0 : _metricByTitle$Refund.trend) || signed((refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundRateChange) || -0.3, "pp"),
2490
- detail: ((_metricByTitle$Refund2 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund2 === void 0 ? void 0 : _metricByTitle$Refund2.detail) || "".concat(formatNumber((_refundsRaw$refundCou = refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundCount) !== null && _refundsRaw$refundCou !== void 0 ? _refundsRaw$refundCou : 2), " refunds this period")
2543
+ detail: ((_metricByTitle$Refund2 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund2 === void 0 ? void 0 : _metricByTitle$Refund2.detail) || "".concat(formatNumber((_refundsRaw$refundCou = refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundCount) !== null && _refundsRaw$refundCou !== void 0 ? _refundsRaw$refundCou : 2), " refunds this period"),
2544
+ trendPositiveWhenNegative: (_metricByTitle$Refund3 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund3 === void 0 ? void 0 : _metricByTitle$Refund3.trendPositiveWhenNegative
2491
2545
  })]
2492
2546
  }), /*#__PURE__*/jsxs("div", {
2493
2547
  style: {
@@ -2534,11 +2588,11 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2534
2588
  }), /*#__PURE__*/jsx("span", {
2535
2589
  style: {
2536
2590
  marginLeft: 8,
2537
- fontSize: 10.5,
2538
- fontWeight: 600,
2539
- color: "#16A34A"
2591
+ fontSize: 10.5
2540
2592
  },
2541
- children: mainChart.trend
2593
+ children: /*#__PURE__*/jsx(TrendText, {
2594
+ children: mainChart.trend
2595
+ })
2542
2596
  })]
2543
2597
  })]
2544
2598
  }), /*#__PURE__*/jsx("div", {
@@ -2547,10 +2601,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2547
2601
  gap: 14,
2548
2602
  marginBottom: 6
2549
2603
  },
2550
- children: [["Email", C.cyan], ["Organic", C.emerald], ["Paid Ads", C.indigo]].map(function (_ref10) {
2551
- var _ref11 = _slicedToArray(_ref10, 2),
2552
- name = _ref11[0],
2553
- color = _ref11[1];
2604
+ children: [["Email", C.cyan], ["Organic", C.emerald], ["Paid Ads", C.indigo]].map(function (_ref12) {
2605
+ var _ref13 = _slicedToArray(_ref12, 2),
2606
+ name = _ref13[0],
2607
+ color = _ref13[1];
2554
2608
  return /*#__PURE__*/jsxs("div", {
2555
2609
  style: {
2556
2610
  display: "flex",
@@ -2704,13 +2758,17 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2704
2758
  color: "#9CA3AF"
2705
2759
  },
2706
2760
  children: "Avg gift"
2707
- }), /*#__PURE__*/jsxs("div", {
2761
+ }), /*#__PURE__*/jsx("div", {
2708
2762
  style: {
2709
2763
  fontSize: 9,
2710
- color: "#16A34A",
2711
2764
  marginTop: 1
2712
2765
  },
2713
- children: [signed((growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) || 8.4), " vs last month"]
2766
+ children: /*#__PURE__*/jsx(TrendText, {
2767
+ style: {
2768
+ fontSize: 9
2769
+ },
2770
+ children: "".concat(Number((_ref14 = donorMixPrev !== null && donorMixPrev !== void 0 ? donorMixPrev : growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _ref14 !== void 0 ? _ref14 : 0).toFixed(2), "% vs pp")
2771
+ })
2714
2772
  })]
2715
2773
  })]
2716
2774
  })
@@ -2865,10 +2923,17 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2865
2923
  }), /*#__PURE__*/jsx("div", {
2866
2924
  style: {
2867
2925
  fontSize: 9,
2868
- color: "#DC2626",
2869
2926
  fontWeight: 600
2870
2927
  },
2871
- children: signed((refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundRateChange) || -0.3, "pp")
2928
+ children: /*#__PURE__*/jsx(TrendText, {
2929
+ invert: true,
2930
+ style: {
2931
+ fontSize: 9
2932
+ },
2933
+ children: formatArrowTrend((_refundsRaw$refundRat2 = refundsRaw === null || refundsRaw === void 0 ? void 0 : refundsRaw.refundRateChange) !== null && _refundsRaw$refundRat2 !== void 0 ? _refundsRaw$refundRat2 : 0, {
2934
+ suffix: "pp"
2935
+ })
2936
+ })
2872
2937
  })]
2873
2938
  }), /*#__PURE__*/jsxs("div", {
2874
2939
  children: [/*#__PURE__*/jsx("div", {
@@ -2931,14 +2996,20 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2931
2996
  color: "#111827"
2932
2997
  },
2933
2998
  children: d$((ob === null || ob === void 0 ? void 0 : ob.totalRevenue) || 0)
2934
- }), /*#__PURE__*/jsxs("div", {
2999
+ }), /*#__PURE__*/jsx("div", {
2935
3000
  style: {
2936
3001
  fontSize: 10,
2937
- color: "#16A34A",
2938
3002
  fontWeight: 600,
2939
3003
  marginBottom: 5
2940
3004
  },
2941
- children: [signed((ob === null || ob === void 0 ? void 0 : ob.growthPercentage) || 8.7), " vs last month"]
3005
+ children: /*#__PURE__*/jsx(TrendText, {
3006
+ style: {
3007
+ fontSize: 10
3008
+ },
3009
+ children: formatArrowTrend((_ob$growthPercentage = ob === null || ob === void 0 ? void 0 : ob.growthPercentage) !== null && _ob$growthPercentage !== void 0 ? _ob$growthPercentage : 0, {
3010
+ label: "vs pp"
3011
+ })
3012
+ })
2942
3013
  }), /*#__PURE__*/jsx(Sparkline, {
2943
3014
  data: obData.length ? obData : [0, 1],
2944
3015
  color: C.indigo,
@@ -2952,10 +3023,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2952
3023
  display: "flex",
2953
3024
  gap: 12
2954
3025
  },
2955
- 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 (_ref12) {
2956
- var _ref13 = _slicedToArray(_ref12, 2),
2957
- l = _ref13[0],
2958
- v = _ref13[1];
3026
+ 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 (_ref15) {
3027
+ var _ref16 = _slicedToArray(_ref15, 2),
3028
+ l = _ref16[0],
3029
+ v = _ref16[1];
2959
3030
  return /*#__PURE__*/jsxs("div", {
2960
3031
  children: [/*#__PURE__*/jsx("div", {
2961
3032
  style: {
@@ -3002,11 +3073,11 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
3002
3073
  children: [/*#__PURE__*/jsx(StatPair, {
3003
3074
  label: "Acceptance",
3004
3075
  val: pct((up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0, 1),
3005
- trend: signed(up === null || up === void 0 ? void 0 : up.acceptanceGrowth)
3076
+ trend: formatArrowTrend(up === null || up === void 0 ? void 0 : up.acceptanceGrowth)
3006
3077
  }), /*#__PURE__*/jsx(StatPair, {
3007
3078
  label: "Raised",
3008
3079
  val: d$((up === null || up === void 0 ? void 0 : up.raised) || 0),
3009
- trend: signed(up === null || up === void 0 ? void 0 : up.raisedGrowth)
3080
+ trend: formatArrowTrend(up === null || up === void 0 ? void 0 : up.raisedGrowth)
3010
3081
  })]
3011
3082
  })]
3012
3083
  })
@@ -3037,11 +3108,11 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
3037
3108
  children: [/*#__PURE__*/jsx(StatPair, {
3038
3109
  label: "Acceptance",
3039
3110
  val: pct((dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0, 1),
3040
- trend: signed(dn === null || dn === void 0 ? void 0 : dn.acceptanceGrowth)
3111
+ trend: formatArrowTrend(dn === null || dn === void 0 ? void 0 : dn.acceptanceGrowth)
3041
3112
  }), /*#__PURE__*/jsx(StatPair, {
3042
3113
  label: "Raised",
3043
3114
  val: d$((dn === null || dn === void 0 ? void 0 : dn.raised) || 0),
3044
- trend: signed(dn === null || dn === void 0 ? void 0 : dn.raisedGrowth)
3115
+ trend: formatArrowTrend(dn === null || dn === void 0 ? void 0 : dn.raisedGrowth)
3045
3116
  })]
3046
3117
  })]
3047
3118
  })
@@ -3055,14 +3126,20 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
3055
3126
  color: "#111827"
3056
3127
  },
3057
3128
  children: d$((refCard === null || refCard === void 0 ? void 0 : refCard.totalRevenue) || 0)
3058
- }), /*#__PURE__*/jsxs("div", {
3129
+ }), /*#__PURE__*/jsx("div", {
3059
3130
  style: {
3060
3131
  fontSize: 10,
3061
- color: "#16A34A",
3062
3132
  fontWeight: 600,
3063
3133
  marginBottom: 5
3064
3134
  },
3065
- children: [signed((refCard === null || refCard === void 0 ? void 0 : refCard.growthPercentage) || 9.1), " vs last month"]
3135
+ children: /*#__PURE__*/jsx(TrendText, {
3136
+ style: {
3137
+ fontSize: 10
3138
+ },
3139
+ children: formatArrowTrend((_refCard$growthPercen = refCard === null || refCard === void 0 ? void 0 : refCard.growthPercentage) !== null && _refCard$growthPercen !== void 0 ? _refCard$growthPercen : 0, {
3140
+ label: "vs pp"
3141
+ })
3142
+ })
3066
3143
  }), /*#__PURE__*/jsx(Sparkline, {
3067
3144
  data: refData.length ? refData : [0, 1],
3068
3145
  color: C.emerald,
@@ -3076,10 +3153,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
3076
3153
  display: "flex",
3077
3154
  gap: 12
3078
3155
  },
3079
- 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 (_ref14) {
3080
- var _ref15 = _slicedToArray(_ref14, 2),
3081
- l = _ref15[0],
3082
- v = _ref15[1];
3156
+ 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 (_ref17) {
3157
+ var _ref18 = _slicedToArray(_ref17, 2),
3158
+ l = _ref18[0],
3159
+ v = _ref18[1];
3083
3160
  return /*#__PURE__*/jsxs("div", {
3084
3161
  children: [/*#__PURE__*/jsx("div", {
3085
3162
  style: {