@ammarkhalidfarooq/dashboard-package 0.4.91 → 0.4.93
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 +31 -31
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +31 -31
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -3043,14 +3043,14 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
3043
3043
|
_ref$trafficSourceDat = _ref.trafficSourceData,
|
|
3044
3044
|
trafficSourceData = _ref$trafficSourceDat === void 0 ? [] : _ref$trafficSourceDat,
|
|
3045
3045
|
_ref$total = _ref.total,
|
|
3046
|
-
total = _ref$total === void 0 ? "$
|
|
3046
|
+
total = _ref$total === void 0 ? "$0" : _ref$total,
|
|
3047
3047
|
sx = _ref.sx;
|
|
3048
3048
|
var paidAdsColor = "rgb(99, 99, 230)";
|
|
3049
3049
|
var organicColor = "#10B981";
|
|
3050
3050
|
var emailColor = "#0EA5E9";
|
|
3051
3051
|
var directColor = "#94A3B8";
|
|
3052
|
-
var getSourceColor = function getSourceColor(
|
|
3053
|
-
switch (
|
|
3052
|
+
var getSourceColor = function getSourceColor(source) {
|
|
3053
|
+
switch (source) {
|
|
3054
3054
|
case "Paid Ads":
|
|
3055
3055
|
return paidAdsColor;
|
|
3056
3056
|
case "Organic":
|
|
@@ -3070,12 +3070,10 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
3070
3070
|
border: "1px solid #f0f0f0",
|
|
3071
3071
|
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
3072
3072
|
bgcolor: "#fff",
|
|
3073
|
-
// height: "100%",
|
|
3074
3073
|
display: "flex",
|
|
3075
3074
|
flexDirection: "column"
|
|
3076
3075
|
}, sx),
|
|
3077
3076
|
children: [/*#__PURE__*/jsxs(Box, {
|
|
3078
|
-
sx: {},
|
|
3079
3077
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
3080
3078
|
sx: {
|
|
3081
3079
|
fontWeight: 700,
|
|
@@ -3106,8 +3104,7 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
3106
3104
|
fontSize: "12px",
|
|
3107
3105
|
fontWeight: 700,
|
|
3108
3106
|
color: "rgba(0, 0, 0, 0.3)",
|
|
3109
|
-
letterSpacing: "0.05em"
|
|
3110
|
-
textAlign: "left"
|
|
3107
|
+
letterSpacing: "0.05em"
|
|
3111
3108
|
},
|
|
3112
3109
|
children: "SOURCE"
|
|
3113
3110
|
}), /*#__PURE__*/jsx(Typography, {
|
|
@@ -3115,8 +3112,7 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
3115
3112
|
fontSize: "12px",
|
|
3116
3113
|
fontWeight: 700,
|
|
3117
3114
|
color: "rgba(0, 0, 0, 0.3)",
|
|
3118
|
-
letterSpacing: "0.05em"
|
|
3119
|
-
textAlign: "left"
|
|
3115
|
+
letterSpacing: "0.05em"
|
|
3120
3116
|
},
|
|
3121
3117
|
children: "REVENUE"
|
|
3122
3118
|
}), /*#__PURE__*/jsx(Typography, {
|
|
@@ -3130,38 +3126,42 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
3130
3126
|
children: "SHARE"
|
|
3131
3127
|
})]
|
|
3132
3128
|
}), /*#__PURE__*/jsx(Box, {
|
|
3133
|
-
children: trafficSourceData.map(function (item, index) {
|
|
3134
|
-
var
|
|
3129
|
+
children: trafficSourceData === null || trafficSourceData === void 0 ? void 0 : trafficSourceData.map(function (item, index) {
|
|
3130
|
+
var shareValue = Number(item.share || 0);
|
|
3135
3131
|
return /*#__PURE__*/jsxs(Box, {
|
|
3136
3132
|
sx: {
|
|
3137
3133
|
display: "grid",
|
|
3138
3134
|
gridTemplateColumns: "2.5fr 1.5fr 2fr",
|
|
3139
3135
|
gap: 2,
|
|
3140
|
-
py: 0.
|
|
3136
|
+
py: 0.75,
|
|
3141
3137
|
alignItems: "center"
|
|
3142
|
-
// borderBottom:
|
|
3143
|
-
// index === trafficSourceData.length - 1 ? "none" : "1px solid #f5f5f5",
|
|
3144
3138
|
},
|
|
3145
3139
|
children: [/*#__PURE__*/jsxs(Box, {
|
|
3146
3140
|
sx: {
|
|
3147
3141
|
display: "flex",
|
|
3148
3142
|
alignItems: "center",
|
|
3149
|
-
gap: 1
|
|
3143
|
+
gap: 1,
|
|
3144
|
+
minWidth: 0
|
|
3150
3145
|
},
|
|
3151
3146
|
children: [/*#__PURE__*/jsx(Box, {
|
|
3152
3147
|
sx: {
|
|
3153
3148
|
width: 10,
|
|
3154
3149
|
height: 10,
|
|
3155
|
-
bgcolor: getSourceColor(item.
|
|
3156
|
-
borderRadius: "2px"
|
|
3150
|
+
bgcolor: getSourceColor(item.source),
|
|
3151
|
+
borderRadius: "2px",
|
|
3152
|
+
flexShrink: 0
|
|
3157
3153
|
}
|
|
3158
3154
|
}), /*#__PURE__*/jsx(Typography, {
|
|
3159
3155
|
sx: {
|
|
3160
3156
|
fontSize: "14px",
|
|
3161
3157
|
fontWeight: 600,
|
|
3162
|
-
color: "rgba(0, 0, 0, 0.7)"
|
|
3158
|
+
color: "rgba(0, 0, 0, 0.7)",
|
|
3159
|
+
overflow: "hidden",
|
|
3160
|
+
textOverflow: "ellipsis",
|
|
3161
|
+
whiteSpace: "nowrap"
|
|
3163
3162
|
},
|
|
3164
|
-
|
|
3163
|
+
title: item.source,
|
|
3164
|
+
children: item.source
|
|
3165
3165
|
})]
|
|
3166
3166
|
}), /*#__PURE__*/jsxs(Typography, {
|
|
3167
3167
|
sx: {
|
|
@@ -3184,35 +3184,33 @@ var TrafficSourceCard = function TrafficSourceCard(_ref) {
|
|
|
3184
3184
|
},
|
|
3185
3185
|
children: /*#__PURE__*/jsx(LinearProgress, {
|
|
3186
3186
|
variant: "determinate",
|
|
3187
|
-
value:
|
|
3187
|
+
value: Math.max(shareValue, 0),
|
|
3188
3188
|
sx: {
|
|
3189
3189
|
height: 6,
|
|
3190
3190
|
borderRadius: 3,
|
|
3191
3191
|
bgcolor: "#F3F4F6",
|
|
3192
3192
|
"& .MuiLinearProgress-bar": {
|
|
3193
3193
|
borderRadius: 3,
|
|
3194
|
-
bgcolor: getSourceColor(item.
|
|
3194
|
+
bgcolor: getSourceColor(item.source)
|
|
3195
3195
|
}
|
|
3196
3196
|
}
|
|
3197
3197
|
})
|
|
3198
|
-
}), /*#__PURE__*/
|
|
3198
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
3199
3199
|
sx: {
|
|
3200
3200
|
fontSize: "14px",
|
|
3201
3201
|
fontWeight: 700,
|
|
3202
3202
|
color: "#000",
|
|
3203
|
-
minWidth: "
|
|
3203
|
+
minWidth: "40px",
|
|
3204
3204
|
textAlign: "right"
|
|
3205
3205
|
},
|
|
3206
|
-
children:
|
|
3206
|
+
children: shareValue < 1 && shareValue > 0 ? "".concat(shareValue.toFixed(2), "%") : "".concat(shareValue.toFixed(0), "%")
|
|
3207
3207
|
})]
|
|
3208
3208
|
})]
|
|
3209
|
-
}, index);
|
|
3209
|
+
}, "".concat(item.source, "-").concat(index));
|
|
3210
3210
|
})
|
|
3211
3211
|
}), /*#__PURE__*/jsxs(Box, {
|
|
3212
3212
|
sx: {
|
|
3213
|
-
mt: 0,
|
|
3214
3213
|
pt: 2,
|
|
3215
|
-
// borderTop: "1px solid #f0f0f0",
|
|
3216
3214
|
display: "flex",
|
|
3217
3215
|
justifyContent: "space-between",
|
|
3218
3216
|
alignItems: "center"
|
|
@@ -5285,11 +5283,11 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5285
5283
|
setActiveMetric = _useState2[1];
|
|
5286
5284
|
var donationTypeData = (apiData === null || apiData === void 0 ? void 0 : apiData.recurringBarChartData) || [];
|
|
5287
5285
|
var donorGeographyData = (apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography) || [];
|
|
5288
|
-
var trafficSourceData = (apiData === null || apiData === void 0 ? void 0 : apiData.
|
|
5286
|
+
var trafficSourceData = (apiData === null || apiData === void 0 ? void 0 : apiData.trafficSourceData) || [];
|
|
5289
5287
|
var orderBumpData = (apiData === null || apiData === void 0 ? void 0 : apiData.orderBumpData1) || [];
|
|
5290
5288
|
var upsellData = (apiData === null || apiData === void 0 ? void 0 : apiData.upsellData1) || [];
|
|
5291
5289
|
var downsellData = (apiData === null || apiData === void 0 ? void 0 : apiData.downsellData1) || [];
|
|
5292
|
-
(apiData === null || apiData === void 0 ? void 0 : apiData.refundAndChargeBacks) || [];
|
|
5290
|
+
var refundsChargebacksData = (apiData === null || apiData === void 0 ? void 0 : apiData.refundAndChargeBacks) || [];
|
|
5293
5291
|
var allCharts = [].concat(_toConsumableArray(primaryCharts), _toConsumableArray(secondaryCharts), _toConsumableArray(tertiaryCharts), _toConsumableArray(quaternaryCharts));
|
|
5294
5292
|
var getExtendedCharts = function getExtendedCharts() {
|
|
5295
5293
|
var charts = _toConsumableArray(allCharts);
|
|
@@ -5866,12 +5864,14 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5866
5864
|
}), /*#__PURE__*/jsx(RefundsChargebacksCard, {
|
|
5867
5865
|
sx: {
|
|
5868
5866
|
maxHeight: 280
|
|
5869
|
-
}
|
|
5867
|
+
},
|
|
5868
|
+
refundsChargebacksData: refundsChargebacksData
|
|
5870
5869
|
}), /*#__PURE__*/jsx(TrafficSourceCard, {
|
|
5871
5870
|
sx: {
|
|
5872
5871
|
maxHeight: 280
|
|
5873
5872
|
},
|
|
5874
|
-
trafficSourceData: trafficSourceData
|
|
5873
|
+
trafficSourceData: trafficSourceData,
|
|
5874
|
+
total: "$".concat(formatNumber((trafficSourceData === null || trafficSourceData === void 0 ? void 0 : trafficSourceData.totalRevenue) || 0))
|
|
5875
5875
|
}), /*#__PURE__*/jsx(MetricSparklineCard, {
|
|
5876
5876
|
title: "Order Bump",
|
|
5877
5877
|
subtitle: "Revenue trend \xB7 last 30 days",
|