@ammarkhalidfarooq/dashboard-package 0.3.34 → 0.3.36
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 +127 -33
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +127 -33
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -795,9 +795,10 @@ var statusValue = function statusValue(value) {
|
|
|
795
795
|
var CardWrapper = function CardWrapper(_ref) {
|
|
796
796
|
var title = _ref.title,
|
|
797
797
|
subtitle = _ref.subtitle,
|
|
798
|
-
children = _ref.children
|
|
798
|
+
children = _ref.children,
|
|
799
|
+
sx = _ref.sx;
|
|
799
800
|
return /*#__PURE__*/jsxRuntime.jsx(material.Card, {
|
|
800
|
-
sx: {
|
|
801
|
+
sx: _objectSpread2({
|
|
801
802
|
width: "100%",
|
|
802
803
|
display: "flex",
|
|
803
804
|
flexDirection: "column",
|
|
@@ -805,7 +806,7 @@ var CardWrapper = function CardWrapper(_ref) {
|
|
|
805
806
|
borderRadius: 4,
|
|
806
807
|
border: "1px solid #f0f0f0",
|
|
807
808
|
height: "100%"
|
|
808
|
-
},
|
|
809
|
+
}, sx),
|
|
809
810
|
children: /*#__PURE__*/jsxRuntime.jsxs(material.CardContent, {
|
|
810
811
|
sx: {
|
|
811
812
|
p: 3
|
|
@@ -1089,16 +1090,15 @@ var KeywordsCard = function KeywordsCard() {
|
|
|
1089
1090
|
children: item.clicks
|
|
1090
1091
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
1091
1092
|
sx: {
|
|
1092
|
-
width: "40px",
|
|
1093
|
-
height: "30px",
|
|
1094
1093
|
textAlign: "left"
|
|
1095
1094
|
},
|
|
1096
1095
|
children: /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
1097
1096
|
sx: {
|
|
1097
|
+
width: "40px",
|
|
1098
1098
|
bgcolor: "#ebf2ffb1",
|
|
1099
1099
|
color: "#3431e4",
|
|
1100
1100
|
// px: 0.5,
|
|
1101
|
-
|
|
1101
|
+
p: 0.5,
|
|
1102
1102
|
borderRadius: "100px",
|
|
1103
1103
|
fontSize: "11px",
|
|
1104
1104
|
fontWeight: 700,
|
|
@@ -1653,9 +1653,9 @@ var TopPerformingCampaignsCard = function TopPerformingCampaignsCard() {
|
|
|
1653
1653
|
bgcolor: "#48d8d620",
|
|
1654
1654
|
color: "#157c3bff",
|
|
1655
1655
|
// px: 1,
|
|
1656
|
-
|
|
1656
|
+
p: 0.5,
|
|
1657
1657
|
width: "40px",
|
|
1658
|
-
height: "25px",
|
|
1658
|
+
// height: "25px",
|
|
1659
1659
|
borderRadius: "100px",
|
|
1660
1660
|
fontSize: "11px",
|
|
1661
1661
|
fontWeight: 700,
|
|
@@ -1667,7 +1667,8 @@ var TopPerformingCampaignsCard = function TopPerformingCampaignsCard() {
|
|
|
1667
1667
|
})]
|
|
1668
1668
|
});
|
|
1669
1669
|
};
|
|
1670
|
-
var PaidDonorGeographyCard = function PaidDonorGeographyCard() {
|
|
1670
|
+
var PaidDonorGeographyCard = function PaidDonorGeographyCard(_ref3) {
|
|
1671
|
+
var sx = _ref3.sx;
|
|
1671
1672
|
var data = [{
|
|
1672
1673
|
country: "United States",
|
|
1673
1674
|
value: "78 · 36%",
|
|
@@ -1696,6 +1697,7 @@ var PaidDonorGeographyCard = function PaidDonorGeographyCard() {
|
|
|
1696
1697
|
return /*#__PURE__*/jsxRuntime.jsx(CardWrapper, {
|
|
1697
1698
|
title: "Paid donor geography",
|
|
1698
1699
|
subtitle: "Where ad-acquired donors come from",
|
|
1700
|
+
sx: sx,
|
|
1699
1701
|
children: data.map(function (item, index) {
|
|
1700
1702
|
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
1701
1703
|
sx: {
|
|
@@ -4321,9 +4323,10 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
4321
4323
|
color: "#94A3B8"
|
|
4322
4324
|
}] : _ref$data,
|
|
4323
4325
|
_ref$total = _ref.total,
|
|
4324
|
-
total = _ref$total === void 0 ? "$240.9K" : _ref$total
|
|
4326
|
+
total = _ref$total === void 0 ? "$240.9K" : _ref$total,
|
|
4327
|
+
sx = _ref.sx;
|
|
4325
4328
|
return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
|
|
4326
|
-
sx: {
|
|
4329
|
+
sx: _objectSpread2({
|
|
4327
4330
|
p: 3,
|
|
4328
4331
|
borderRadius: 4,
|
|
4329
4332
|
border: "1px solid #f0f0f0",
|
|
@@ -4332,7 +4335,7 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
4332
4335
|
// height: "100%",
|
|
4333
4336
|
display: "flex",
|
|
4334
4337
|
flexDirection: "column"
|
|
4335
|
-
},
|
|
4338
|
+
}, sx),
|
|
4336
4339
|
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4337
4340
|
sx: {},
|
|
4338
4341
|
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
@@ -4534,7 +4537,25 @@ var MetricSparklineCard = function MetricSparklineCard(_ref) {
|
|
|
4534
4537
|
},
|
|
4535
4538
|
colors: [chartColor],
|
|
4536
4539
|
tooltip: {
|
|
4537
|
-
enabled:
|
|
4540
|
+
enabled: true,
|
|
4541
|
+
theme: "light",
|
|
4542
|
+
x: {
|
|
4543
|
+
show: false
|
|
4544
|
+
},
|
|
4545
|
+
y: {
|
|
4546
|
+
formatter: function formatter(val) {
|
|
4547
|
+
if (title !== null && title !== void 0 && title.toLowerCase().includes("revenue")) {
|
|
4548
|
+
return "$".concat(val.toLocaleString());
|
|
4549
|
+
}
|
|
4550
|
+
if (title !== null && title !== void 0 && title.toLowerCase().includes("rate") || title !== null && title !== void 0 && title.toLowerCase().includes("bounce")) {
|
|
4551
|
+
return "".concat(val, "%");
|
|
4552
|
+
}
|
|
4553
|
+
return val.toLocaleString();
|
|
4554
|
+
}
|
|
4555
|
+
},
|
|
4556
|
+
marker: {
|
|
4557
|
+
show: false
|
|
4558
|
+
}
|
|
4538
4559
|
}
|
|
4539
4560
|
};
|
|
4540
4561
|
var series = [{
|
|
@@ -4717,7 +4738,16 @@ var MetricDonutCard = function MetricDonutCard(_ref) {
|
|
|
4717
4738
|
lineCap: "butt"
|
|
4718
4739
|
},
|
|
4719
4740
|
colors: [chartColors[0]],
|
|
4720
|
-
labels: ["accepted"]
|
|
4741
|
+
labels: ["accepted"],
|
|
4742
|
+
tooltip: {
|
|
4743
|
+
enabled: true,
|
|
4744
|
+
theme: "dark",
|
|
4745
|
+
y: {
|
|
4746
|
+
formatter: function formatter(val) {
|
|
4747
|
+
return "".concat(val, "%");
|
|
4748
|
+
}
|
|
4749
|
+
}
|
|
4750
|
+
}
|
|
4721
4751
|
};
|
|
4722
4752
|
var series = [acceptanceRate];
|
|
4723
4753
|
return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
|
|
@@ -4882,7 +4912,8 @@ var MetricDonutCard = function MetricDonutCard(_ref) {
|
|
|
4882
4912
|
});
|
|
4883
4913
|
};
|
|
4884
4914
|
|
|
4885
|
-
var DonationTypeBarChart = function DonationTypeBarChart() {
|
|
4915
|
+
var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
4916
|
+
var sx = _ref.sx;
|
|
4886
4917
|
var chartOptions = {
|
|
4887
4918
|
chart: {
|
|
4888
4919
|
type: "bar",
|
|
@@ -4986,14 +5017,13 @@ var DonationTypeBarChart = function DonationTypeBarChart() {
|
|
|
4986
5017
|
data: [32.4, 41.2, 46.8, 14.3]
|
|
4987
5018
|
}];
|
|
4988
5019
|
return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
|
|
4989
|
-
sx: {
|
|
5020
|
+
sx: _objectSpread2({
|
|
4990
5021
|
bgcolor: "#fff",
|
|
4991
5022
|
borderRadius: 4,
|
|
4992
5023
|
border: "1px solid #f0f0f0",
|
|
4993
5024
|
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
4994
5025
|
p: 3
|
|
4995
|
-
|
|
4996
|
-
},
|
|
5026
|
+
}, sx),
|
|
4997
5027
|
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
4998
5028
|
sx: {
|
|
4999
5029
|
display: "flex",
|
|
@@ -5102,7 +5132,8 @@ var DonationTypeBarChart = function DonationTypeBarChart() {
|
|
|
5102
5132
|
});
|
|
5103
5133
|
};
|
|
5104
5134
|
|
|
5105
|
-
var RefundsChargebacksCard = function RefundsChargebacksCard() {
|
|
5135
|
+
var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
|
|
5136
|
+
var sx = _ref.sx;
|
|
5106
5137
|
var chartOptions = {
|
|
5107
5138
|
chart: {
|
|
5108
5139
|
type: "area",
|
|
@@ -5211,7 +5242,7 @@ var RefundsChargebacksCard = function RefundsChargebacksCard() {
|
|
|
5211
5242
|
data: [0.1, 0.2, 0.1, 0.15, 0.1, 0.2, 0.1, 0.15, 0.1]
|
|
5212
5243
|
}];
|
|
5213
5244
|
return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
|
|
5214
|
-
sx: {
|
|
5245
|
+
sx: _objectSpread2({
|
|
5215
5246
|
bgcolor: "#fff",
|
|
5216
5247
|
borderRadius: "24px",
|
|
5217
5248
|
border: "1px solid #f0f0f0",
|
|
@@ -5220,7 +5251,7 @@ var RefundsChargebacksCard = function RefundsChargebacksCard() {
|
|
|
5220
5251
|
// height: "100%",
|
|
5221
5252
|
display: "flex",
|
|
5222
5253
|
flexDirection: "column"
|
|
5223
|
-
},
|
|
5254
|
+
}, sx),
|
|
5224
5255
|
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
5225
5256
|
sx: {
|
|
5226
5257
|
mb: 0
|
|
@@ -5480,8 +5511,8 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5480
5511
|
label: "ROAS",
|
|
5481
5512
|
icon: iconsMaterial.TrendingUp
|
|
5482
5513
|
},
|
|
5483
|
-
Conversion: {
|
|
5484
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.
|
|
5514
|
+
"Conversion": {
|
|
5515
|
+
value: (apiData === null || apiData === void 0 ? void 0 : apiData.conversionCard) || "1.7%",
|
|
5485
5516
|
subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.conversionSub) || "215 / 12.4K",
|
|
5486
5517
|
label: "Conversion Rate",
|
|
5487
5518
|
icon: iconsMaterial.Adjust
|
|
@@ -5687,14 +5718,61 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5687
5718
|
});
|
|
5688
5719
|
}
|
|
5689
5720
|
}
|
|
5690
|
-
if (activeMetric === "
|
|
5691
|
-
var
|
|
5692
|
-
var _hasStackedData4 = (
|
|
5721
|
+
if (activeMetric === "Conversion") {
|
|
5722
|
+
var conversionData = apiData === null || apiData === void 0 ? void 0 : apiData.conversion;
|
|
5723
|
+
var _hasStackedData4 = (conversionData === null || conversionData === void 0 ? void 0 : conversionData.paidAds) || (conversionData === null || conversionData === void 0 ? void 0 : conversionData.email) || (conversionData === null || conversionData === void 0 ? void 0 : conversionData.organic);
|
|
5693
5724
|
if (_hasStackedData4) {
|
|
5694
|
-
var _categories4 = ((
|
|
5725
|
+
var _categories4 = ((conversionData === null || conversionData === void 0 ? void 0 : conversionData.organic) || (conversionData === null || conversionData === void 0 ? void 0 : conversionData.paidAds) || (conversionData === null || conversionData === void 0 ? void 0 : conversionData.email) || []).map(function (item) {
|
|
5695
5726
|
return item.date;
|
|
5696
5727
|
});
|
|
5697
5728
|
var _series4 = [{
|
|
5729
|
+
name: "Paid Ads",
|
|
5730
|
+
data: ((conversionData === null || conversionData === void 0 ? void 0 : conversionData.paidAds) || []).map(function (item) {
|
|
5731
|
+
return item.value;
|
|
5732
|
+
})
|
|
5733
|
+
}, {
|
|
5734
|
+
name: "Organic",
|
|
5735
|
+
data: ((conversionData === null || conversionData === void 0 ? void 0 : conversionData.organic) || []).map(function (item) {
|
|
5736
|
+
return item.value;
|
|
5737
|
+
})
|
|
5738
|
+
}, {
|
|
5739
|
+
name: "Email",
|
|
5740
|
+
data: ((conversionData === null || conversionData === void 0 ? void 0 : conversionData.email) || []).map(function (item) {
|
|
5741
|
+
return item.value;
|
|
5742
|
+
})
|
|
5743
|
+
}];
|
|
5744
|
+
mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
|
|
5745
|
+
label: "Conversion Rate",
|
|
5746
|
+
data: undefined,
|
|
5747
|
+
series: _series4,
|
|
5748
|
+
categories: _categories4,
|
|
5749
|
+
stacked: true,
|
|
5750
|
+
colors: ["#6366F1", "#10B981", "#06B6D4"],
|
|
5751
|
+
hideControls: true
|
|
5752
|
+
});
|
|
5753
|
+
} else if (Array.isArray(conversionData) && conversionData.length > 0) {
|
|
5754
|
+
mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
|
|
5755
|
+
label: "Conversion Rate",
|
|
5756
|
+
data: conversionData.map(function (item) {
|
|
5757
|
+
return item.value;
|
|
5758
|
+
}),
|
|
5759
|
+
categories: conversionData.map(function (item) {
|
|
5760
|
+
return item.date;
|
|
5761
|
+
}),
|
|
5762
|
+
series: undefined,
|
|
5763
|
+
stacked: false,
|
|
5764
|
+
hideControls: true
|
|
5765
|
+
});
|
|
5766
|
+
}
|
|
5767
|
+
}
|
|
5768
|
+
if (activeMetric === "Avg donation") {
|
|
5769
|
+
var avgData = apiData === null || apiData === void 0 ? void 0 : apiData.averageDonations;
|
|
5770
|
+
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);
|
|
5771
|
+
if (_hasStackedData5) {
|
|
5772
|
+
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) {
|
|
5773
|
+
return item.date;
|
|
5774
|
+
});
|
|
5775
|
+
var _series5 = [{
|
|
5698
5776
|
name: "Paid Ads",
|
|
5699
5777
|
data: ((avgData === null || avgData === void 0 ? void 0 : avgData.paidAds) || []).map(function (item) {
|
|
5700
5778
|
return item.value;
|
|
@@ -5713,8 +5791,8 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5713
5791
|
mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
|
|
5714
5792
|
label: "Average donation trend",
|
|
5715
5793
|
data: undefined,
|
|
5716
|
-
series:
|
|
5717
|
-
categories:
|
|
5794
|
+
series: _series5,
|
|
5795
|
+
categories: _categories5,
|
|
5718
5796
|
stacked: true,
|
|
5719
5797
|
colors: ["#6366F1", "#10B981", "#06B6D4"],
|
|
5720
5798
|
hideControls: true
|
|
@@ -5878,22 +5956,38 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5878
5956
|
item: true,
|
|
5879
5957
|
xs: 12,
|
|
5880
5958
|
md: 3,
|
|
5881
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DonationTypeBarChart, {
|
|
5959
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DonationTypeBarChart, {
|
|
5960
|
+
sx: {
|
|
5961
|
+
minHeight: 330
|
|
5962
|
+
}
|
|
5963
|
+
})
|
|
5882
5964
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
5883
5965
|
item: true,
|
|
5884
5966
|
xs: 12,
|
|
5885
5967
|
md: 3,
|
|
5886
|
-
children: /*#__PURE__*/jsxRuntime.jsx(PaidDonorGeographyCard, {
|
|
5968
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PaidDonorGeographyCard, {
|
|
5969
|
+
sx: {
|
|
5970
|
+
minHeight: 330
|
|
5971
|
+
}
|
|
5972
|
+
})
|
|
5887
5973
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
5888
5974
|
item: true,
|
|
5889
5975
|
xs: 12,
|
|
5890
5976
|
md: 3,
|
|
5891
|
-
children: /*#__PURE__*/jsxRuntime.jsx(RefundsChargebacksCard, {
|
|
5977
|
+
children: /*#__PURE__*/jsxRuntime.jsx(RefundsChargebacksCard, {
|
|
5978
|
+
sx: {
|
|
5979
|
+
minHeight: 330
|
|
5980
|
+
}
|
|
5981
|
+
})
|
|
5892
5982
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
5893
5983
|
item: true,
|
|
5894
5984
|
xs: 12,
|
|
5895
5985
|
md: 3,
|
|
5896
|
-
children: /*#__PURE__*/jsxRuntime.jsx(TrafficSourceCard, {
|
|
5986
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TrafficSourceCard, {
|
|
5987
|
+
sx: {
|
|
5988
|
+
minHeight: 330
|
|
5989
|
+
}
|
|
5990
|
+
})
|
|
5897
5991
|
})]
|
|
5898
5992
|
}), /*#__PURE__*/jsxRuntime.jsxs(material.Grid, {
|
|
5899
5993
|
container: true,
|