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