@ammarkhalidfarooq/dashboard-package 0.3.40 → 0.4.1
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 +355 -97
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +356 -98
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -798,19 +798,17 @@ var CardWrapper = function CardWrapper(_ref) {
|
|
|
798
798
|
children = _ref.children,
|
|
799
799
|
sx = _ref.sx;
|
|
800
800
|
return /*#__PURE__*/jsxRuntime.jsx(material.Card, {
|
|
801
|
-
sx: _objectSpread2({
|
|
802
|
-
width: "100%",
|
|
801
|
+
sx: _objectSpread2(_objectSpread2({
|
|
802
|
+
// width: "100%",
|
|
803
803
|
display: "flex",
|
|
804
804
|
flexDirection: "column",
|
|
805
805
|
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
806
806
|
borderRadius: 4,
|
|
807
|
-
border: "1px solid #f0f0f0"
|
|
807
|
+
border: "1px solid #f0f0f0"
|
|
808
|
+
}, sx), {}, {
|
|
808
809
|
height: "100%"
|
|
809
|
-
}
|
|
810
|
+
}),
|
|
810
811
|
children: /*#__PURE__*/jsxRuntime.jsxs(material.CardContent, {
|
|
811
|
-
sx: {
|
|
812
|
-
p: 3
|
|
813
|
-
},
|
|
814
812
|
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
815
813
|
variant: "subtitle2",
|
|
816
814
|
sx: {
|
|
@@ -2069,29 +2067,29 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
2069
2067
|
xs: 12,
|
|
2070
2068
|
md: 6,
|
|
2071
2069
|
children: /*#__PURE__*/jsxRuntime.jsx(DonorMixCard, {
|
|
2072
|
-
title: "
|
|
2073
|
-
subtitle: "Where
|
|
2070
|
+
title: "Source breakdown",
|
|
2071
|
+
subtitle: "Where organic visitors come from",
|
|
2074
2072
|
series: [40.8, 35.1, 14.2, 3.3],
|
|
2075
2073
|
labels: ["Meta Ads", "Google Ads", "TikTok", "Snapchat"],
|
|
2076
|
-
colors: ["#4267B2", "#4285F4", "#06510bff", "#
|
|
2074
|
+
colors: ["#4267B2", "#4285F4", "#06510bff", "#f2b61dff"],
|
|
2077
2075
|
centerLabel: "total spend",
|
|
2078
2076
|
centerValue: "$8.3K",
|
|
2079
2077
|
items: [{
|
|
2080
|
-
label: "
|
|
2078
|
+
label: "Google Search",
|
|
2081
2079
|
val: "40.8%",
|
|
2082
2080
|
color: "#4267B2"
|
|
2083
2081
|
}, {
|
|
2084
|
-
label: "
|
|
2082
|
+
label: "Direct",
|
|
2085
2083
|
val: "35.1%",
|
|
2086
2084
|
color: "#4285F4"
|
|
2087
2085
|
}, {
|
|
2088
|
-
label: "
|
|
2086
|
+
label: "Bing / Other",
|
|
2089
2087
|
val: "14.2%",
|
|
2090
2088
|
color: "#06510bff"
|
|
2091
2089
|
}, {
|
|
2092
|
-
label: "
|
|
2090
|
+
label: "Referalls",
|
|
2093
2091
|
val: "3.3%",
|
|
2094
|
-
color: "#
|
|
2092
|
+
color: "#f2b61dff"
|
|
2095
2093
|
}],
|
|
2096
2094
|
showBottomSummary: false,
|
|
2097
2095
|
sx: {
|
|
@@ -2108,19 +2106,217 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
2108
2106
|
xs: 12,
|
|
2109
2107
|
md: 6,
|
|
2110
2108
|
children: /*#__PURE__*/jsxRuntime.jsx(GeographyCard, {
|
|
2111
|
-
subtitle: "
|
|
2109
|
+
subtitle: "Top countries by organic traffic"
|
|
2112
2110
|
})
|
|
2113
2111
|
})]
|
|
2114
2112
|
})]
|
|
2115
2113
|
});
|
|
2116
2114
|
};
|
|
2117
2115
|
|
|
2116
|
+
var EmailTrendCard = function EmailTrendCard(_ref) {
|
|
2117
|
+
var title = _ref.title,
|
|
2118
|
+
subtitle = _ref.subtitle,
|
|
2119
|
+
value = _ref.value,
|
|
2120
|
+
trend = _ref.trend,
|
|
2121
|
+
series = _ref.series,
|
|
2122
|
+
colors = _ref.colors,
|
|
2123
|
+
_ref$yAxisMax = _ref.yAxisMax,
|
|
2124
|
+
yAxisMax = _ref$yAxisMax === void 0 ? 60 : _ref$yAxisMax,
|
|
2125
|
+
_ref$yAxisTickAmount = _ref.yAxisTickAmount,
|
|
2126
|
+
yAxisTickAmount = _ref$yAxisTickAmount === void 0 ? 3 : _ref$yAxisTickAmount,
|
|
2127
|
+
_ref$yAxisFormatter = _ref.yAxisFormatter,
|
|
2128
|
+
yAxisFormatter = _ref$yAxisFormatter === void 0 ? function (val) {
|
|
2129
|
+
return "".concat(val, "%");
|
|
2130
|
+
} : _ref$yAxisFormatter;
|
|
2131
|
+
var chartOptions = {
|
|
2132
|
+
chart: {
|
|
2133
|
+
type: "area",
|
|
2134
|
+
toolbar: {
|
|
2135
|
+
show: false
|
|
2136
|
+
},
|
|
2137
|
+
sparkline: {
|
|
2138
|
+
enabled: false
|
|
2139
|
+
},
|
|
2140
|
+
fontFamily: "Inter, sans-serif"
|
|
2141
|
+
},
|
|
2142
|
+
stroke: {
|
|
2143
|
+
curve: "smooth",
|
|
2144
|
+
width: 2,
|
|
2145
|
+
dashArray: series.map(function (s) {
|
|
2146
|
+
return s.dashed ? 5 : 0;
|
|
2147
|
+
})
|
|
2148
|
+
},
|
|
2149
|
+
fill: {
|
|
2150
|
+
type: "gradient",
|
|
2151
|
+
gradient: {
|
|
2152
|
+
shadeIntensity: 1,
|
|
2153
|
+
opacityFrom: 0.3,
|
|
2154
|
+
opacityTo: 0.8,
|
|
2155
|
+
stops: [0, 90, 100]
|
|
2156
|
+
}
|
|
2157
|
+
},
|
|
2158
|
+
colors: colors,
|
|
2159
|
+
xaxis: {
|
|
2160
|
+
categories: ["Apr 5", "Apr 12", "Apr 19", "Apr 26", "May 4"],
|
|
2161
|
+
labels: {
|
|
2162
|
+
show: true,
|
|
2163
|
+
style: {
|
|
2164
|
+
colors: 'rgba(0, 0, 0, 0.3)',
|
|
2165
|
+
fontSize: '10px'
|
|
2166
|
+
},
|
|
2167
|
+
offsetY: -5
|
|
2168
|
+
},
|
|
2169
|
+
axisBorder: {
|
|
2170
|
+
show: false
|
|
2171
|
+
},
|
|
2172
|
+
axisTicks: {
|
|
2173
|
+
show: false
|
|
2174
|
+
},
|
|
2175
|
+
position: 'bottom'
|
|
2176
|
+
},
|
|
2177
|
+
yaxis: {
|
|
2178
|
+
max: yAxisMax,
|
|
2179
|
+
tickAmount: yAxisTickAmount,
|
|
2180
|
+
labels: {
|
|
2181
|
+
show: true,
|
|
2182
|
+
style: {
|
|
2183
|
+
colors: 'rgba(0, 0, 0, 0.3)',
|
|
2184
|
+
fontSize: '10px'
|
|
2185
|
+
},
|
|
2186
|
+
formatter: yAxisFormatter
|
|
2187
|
+
}
|
|
2188
|
+
},
|
|
2189
|
+
grid: {
|
|
2190
|
+
show: true,
|
|
2191
|
+
borderColor: "rgba(0, 0, 0, 0.05)",
|
|
2192
|
+
strokeDashArray: 0,
|
|
2193
|
+
xaxis: {
|
|
2194
|
+
lines: {
|
|
2195
|
+
show: false
|
|
2196
|
+
}
|
|
2197
|
+
},
|
|
2198
|
+
yaxis: {
|
|
2199
|
+
lines: {
|
|
2200
|
+
show: true
|
|
2201
|
+
}
|
|
2202
|
+
},
|
|
2203
|
+
padding: {
|
|
2204
|
+
left: 10,
|
|
2205
|
+
right: 10,
|
|
2206
|
+
bottom: 0
|
|
2207
|
+
}
|
|
2208
|
+
},
|
|
2209
|
+
dataLabels: {
|
|
2210
|
+
enabled: false
|
|
2211
|
+
},
|
|
2212
|
+
legend: {
|
|
2213
|
+
show: series.length > 1,
|
|
2214
|
+
position: 'bottom',
|
|
2215
|
+
horizontalAlign: 'left',
|
|
2216
|
+
fontSize: '11px',
|
|
2217
|
+
fontFamily: 'Inter, sans-serif',
|
|
2218
|
+
offsetY: -5,
|
|
2219
|
+
markers: {
|
|
2220
|
+
width: 8,
|
|
2221
|
+
height: 8,
|
|
2222
|
+
radius: 12
|
|
2223
|
+
},
|
|
2224
|
+
itemMargin: {
|
|
2225
|
+
horizontal: 10,
|
|
2226
|
+
vertical: 0
|
|
2227
|
+
}
|
|
2228
|
+
},
|
|
2229
|
+
tooltip: {
|
|
2230
|
+
theme: 'light'
|
|
2231
|
+
}
|
|
2232
|
+
};
|
|
2233
|
+
return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
|
|
2234
|
+
sx: {
|
|
2235
|
+
p: 3,
|
|
2236
|
+
borderRadius: 4,
|
|
2237
|
+
border: "1px solid #f0f0f0",
|
|
2238
|
+
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
2239
|
+
bgcolor: "#fff",
|
|
2240
|
+
height: "100%",
|
|
2241
|
+
display: "flex",
|
|
2242
|
+
flexDirection: "column"
|
|
2243
|
+
},
|
|
2244
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
2245
|
+
sx: {
|
|
2246
|
+
mb: 1,
|
|
2247
|
+
textAlign: 'left'
|
|
2248
|
+
},
|
|
2249
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
2250
|
+
sx: {
|
|
2251
|
+
fontWeight: 700,
|
|
2252
|
+
fontSize: "18px",
|
|
2253
|
+
color: "#000"
|
|
2254
|
+
},
|
|
2255
|
+
children: title
|
|
2256
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
2257
|
+
sx: {
|
|
2258
|
+
fontSize: "12px",
|
|
2259
|
+
color: "rgba(0, 0, 0, 0.4)",
|
|
2260
|
+
fontWeight: 500
|
|
2261
|
+
},
|
|
2262
|
+
children: subtitle
|
|
2263
|
+
})]
|
|
2264
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
2265
|
+
sx: {
|
|
2266
|
+
display: "flex",
|
|
2267
|
+
alignItems: "center",
|
|
2268
|
+
gap: 1.5,
|
|
2269
|
+
mb: 1
|
|
2270
|
+
},
|
|
2271
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
2272
|
+
sx: {
|
|
2273
|
+
fontSize: "28px",
|
|
2274
|
+
fontWeight: 700,
|
|
2275
|
+
color: "#000"
|
|
2276
|
+
},
|
|
2277
|
+
children: value
|
|
2278
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
2279
|
+
sx: {
|
|
2280
|
+
bgcolor: "#ebfcf4",
|
|
2281
|
+
color: "#10b981",
|
|
2282
|
+
px: 1,
|
|
2283
|
+
py: 0.4,
|
|
2284
|
+
borderRadius: "100px",
|
|
2285
|
+
fontSize: "12px",
|
|
2286
|
+
fontWeight: 700,
|
|
2287
|
+
display: "flex",
|
|
2288
|
+
alignItems: "center",
|
|
2289
|
+
gap: 0.3
|
|
2290
|
+
},
|
|
2291
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2292
|
+
style: {
|
|
2293
|
+
fontSize: '10px'
|
|
2294
|
+
},
|
|
2295
|
+
children: "\u25B2"
|
|
2296
|
+
}), " ", trend]
|
|
2297
|
+
})]
|
|
2298
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
2299
|
+
sx: {
|
|
2300
|
+
flexGrow: 1,
|
|
2301
|
+
height: 150,
|
|
2302
|
+
ml: -2,
|
|
2303
|
+
mr: -1
|
|
2304
|
+
},
|
|
2305
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ReactApexChart, {
|
|
2306
|
+
options: chartOptions,
|
|
2307
|
+
series: series,
|
|
2308
|
+
type: "area",
|
|
2309
|
+
height: "100%"
|
|
2310
|
+
})
|
|
2311
|
+
})]
|
|
2312
|
+
});
|
|
2313
|
+
};
|
|
2314
|
+
|
|
2118
2315
|
var EmailSection = function EmailSection() {
|
|
2119
2316
|
var _useState = React.useState("Total raised"),
|
|
2120
2317
|
_useState2 = _slicedToArray(_useState, 2),
|
|
2121
2318
|
activeMetric = _useState2[0],
|
|
2122
2319
|
setActiveMetric = _useState2[1];
|
|
2123
|
-
var categories = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
2124
2320
|
var metricInfo = {
|
|
2125
2321
|
"Total raised": {
|
|
2126
2322
|
value: "$48,920",
|
|
@@ -2183,14 +2379,6 @@ var EmailSection = function EmailSection() {
|
|
|
2183
2379
|
data: [28, 32, 29, 34, 30, 30, 30.35]
|
|
2184
2380
|
}
|
|
2185
2381
|
};
|
|
2186
|
-
var selectedInfo = metricInfo[activeMetric];
|
|
2187
|
-
var mainChart = {
|
|
2188
|
-
label: activeMetric,
|
|
2189
|
-
value: selectedInfo.value,
|
|
2190
|
-
trend: selectedInfo.subValue,
|
|
2191
|
-
data: selectedInfo.data,
|
|
2192
|
-
categories: categories
|
|
2193
|
-
};
|
|
2194
2382
|
var renderCard = function renderCard(title) {
|
|
2195
2383
|
return /*#__PURE__*/jsxRuntime.jsx(DisplayCard, {
|
|
2196
2384
|
title: title,
|
|
@@ -2203,12 +2391,8 @@ var EmailSection = function EmailSection() {
|
|
|
2203
2391
|
isActive: activeMetric === title,
|
|
2204
2392
|
sx: {
|
|
2205
2393
|
flex: 1
|
|
2206
|
-
// border:
|
|
2207
|
-
// activeMetric === title
|
|
2208
|
-
// ? "2px solid rgb(99, 99, 230)"
|
|
2209
|
-
// : "2px solid #f0f0f0",
|
|
2210
2394
|
}
|
|
2211
|
-
});
|
|
2395
|
+
}, title);
|
|
2212
2396
|
};
|
|
2213
2397
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2214
2398
|
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
@@ -2227,20 +2411,72 @@ var EmailSection = function EmailSection() {
|
|
|
2227
2411
|
flexWrap: "wrap"
|
|
2228
2412
|
},
|
|
2229
2413
|
children: ["Open rate", "Clicks", "Unique Clicks", "Bounce rate", "Revenue per Click"].map(renderCard)
|
|
2230
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
2414
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Grid, {
|
|
2231
2415
|
container: true,
|
|
2232
2416
|
spacing: 3,
|
|
2233
2417
|
sx: {
|
|
2234
|
-
mt: 1
|
|
2418
|
+
mt: 1,
|
|
2419
|
+
mb: 8
|
|
2235
2420
|
},
|
|
2236
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
2237
|
-
item:
|
|
2238
|
-
|
|
2239
|
-
md:
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2421
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
2422
|
+
item: true,
|
|
2423
|
+
xs: 12,
|
|
2424
|
+
md: 4,
|
|
2425
|
+
children: /*#__PURE__*/jsxRuntime.jsx(EmailTrendCard, {
|
|
2426
|
+
title: "Open rate trend",
|
|
2427
|
+
subtitle: "Daily \xB7 30 days",
|
|
2428
|
+
value: "42.3%",
|
|
2429
|
+
trend: "2.1pp",
|
|
2430
|
+
series: [{
|
|
2431
|
+
name: 'Open Rate',
|
|
2432
|
+
data: [38, 42, 41, 43, 42.3]
|
|
2433
|
+
}],
|
|
2434
|
+
colors: ['rgb(99, 99, 230)'],
|
|
2435
|
+
yAxisMax: 53,
|
|
2436
|
+
yAxisTickAmount: 3
|
|
2437
|
+
})
|
|
2438
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
2439
|
+
item: true,
|
|
2440
|
+
xs: 12,
|
|
2441
|
+
md: 4,
|
|
2442
|
+
children: /*#__PURE__*/jsxRuntime.jsx(EmailTrendCard, {
|
|
2443
|
+
title: "Clicks trend",
|
|
2444
|
+
subtitle: "Total + unique \xB7 30 days",
|
|
2445
|
+
value: "1,612",
|
|
2446
|
+
trend: "14%",
|
|
2447
|
+
series: [{
|
|
2448
|
+
name: 'Total clicks',
|
|
2449
|
+
data: [56, 112, 80, 150, 112]
|
|
2450
|
+
}, {
|
|
2451
|
+
name: 'Unique clicks',
|
|
2452
|
+
data: [30, 70, 45, 100, 75],
|
|
2453
|
+
dashed: true
|
|
2454
|
+
}],
|
|
2455
|
+
colors: ['#10B981', '#10B981'],
|
|
2456
|
+
yAxisMax: 168,
|
|
2457
|
+
yAxisTickAmount: 3,
|
|
2458
|
+
yAxisFormatter: function yAxisFormatter(val) {
|
|
2459
|
+
return val;
|
|
2460
|
+
}
|
|
2461
|
+
})
|
|
2462
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
2463
|
+
item: true,
|
|
2464
|
+
xs: 12,
|
|
2465
|
+
md: 4,
|
|
2466
|
+
children: /*#__PURE__*/jsxRuntime.jsx(EmailTrendCard, {
|
|
2467
|
+
title: "Bounce rate trend",
|
|
2468
|
+
subtitle: "Daily \xB7 lower is better",
|
|
2469
|
+
value: "1.8%",
|
|
2470
|
+
trend: "0.3pp",
|
|
2471
|
+
series: [{
|
|
2472
|
+
name: 'Bounce Rate',
|
|
2473
|
+
data: [2.2, 1.9, 2.0, 1.7, 1.8]
|
|
2474
|
+
}],
|
|
2475
|
+
colors: ['#f2994a'],
|
|
2476
|
+
yAxisMax: 2.5,
|
|
2477
|
+
yAxisTickAmount: 3
|
|
2478
|
+
})
|
|
2479
|
+
})]
|
|
2244
2480
|
}), /*#__PURE__*/jsxRuntime.jsxs(material.Grid, {
|
|
2245
2481
|
container: true,
|
|
2246
2482
|
spacing: 3,
|
|
@@ -4254,24 +4490,43 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
|
|
|
4254
4490
|
},
|
|
4255
4491
|
children: row.val4
|
|
4256
4492
|
}), columns.length > 5 && /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4257
|
-
children: row.type === "trend" ? /*#__PURE__*/jsxRuntime.
|
|
4493
|
+
children: row.type === "trend" ? /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4258
4494
|
sx: {
|
|
4259
4495
|
display: "flex",
|
|
4260
4496
|
alignItems: "center",
|
|
4261
|
-
gap: 0.5
|
|
4262
|
-
color: row.trendType === "up" ? "#22C55E" : "#EF4444",
|
|
4263
|
-
fontSize: "12px",
|
|
4264
|
-
fontWeight: 600
|
|
4497
|
+
gap: 0.5
|
|
4265
4498
|
},
|
|
4266
|
-
children:
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
}
|
|
4274
|
-
|
|
4499
|
+
children: row.trendType === "up" ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4500
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4501
|
+
sx: {
|
|
4502
|
+
fontSize: "14px",
|
|
4503
|
+
color: "#22C55E"
|
|
4504
|
+
},
|
|
4505
|
+
children: "\u25B2"
|
|
4506
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4507
|
+
sx: {
|
|
4508
|
+
fontSize: "12px",
|
|
4509
|
+
color: "#22C55E",
|
|
4510
|
+
fontWeight: 700
|
|
4511
|
+
},
|
|
4512
|
+
children: row.trendLabel
|
|
4513
|
+
})]
|
|
4514
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4515
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4516
|
+
sx: {
|
|
4517
|
+
fontSize: "14px",
|
|
4518
|
+
color: "#EF4444"
|
|
4519
|
+
},
|
|
4520
|
+
children: "\u25BC"
|
|
4521
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
4522
|
+
sx: {
|
|
4523
|
+
fontSize: "12px",
|
|
4524
|
+
color: "#EF4444",
|
|
4525
|
+
fontWeight: 700
|
|
4526
|
+
},
|
|
4527
|
+
children: row.trendLabel
|
|
4528
|
+
})]
|
|
4529
|
+
})
|
|
4275
4530
|
}) : /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4276
4531
|
sx: {
|
|
4277
4532
|
display: "inline-block",
|
|
@@ -4912,8 +5167,27 @@ var MetricDonutCard = function MetricDonutCard(_ref) {
|
|
|
4912
5167
|
});
|
|
4913
5168
|
};
|
|
4914
5169
|
|
|
5170
|
+
function formatNumber(num) {
|
|
5171
|
+
if (num >= 1000000000) {
|
|
5172
|
+
return (num / 1000000000).toFixed(1).replace(/\.0$/, "") + "B";
|
|
5173
|
+
}
|
|
5174
|
+
if (num >= 1000000) {
|
|
5175
|
+
return (num / 1000000).toFixed(1).replace(/\.0$/, "") + "M";
|
|
5176
|
+
}
|
|
5177
|
+
if (num >= 1000) {
|
|
5178
|
+
return (num / 1000).toFixed(1).replace(/\.0$/, "") + "K";
|
|
5179
|
+
}
|
|
5180
|
+
return (num !== null && num !== void 0 ? num : 0).toString();
|
|
5181
|
+
}
|
|
5182
|
+
|
|
4915
5183
|
var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
4916
|
-
var
|
|
5184
|
+
var _donationTypeData$sum, _donationTypeData$sum2, _donationTypeData$sum3, _donationTypeData$sum4, _donationTypeData$sum5, _donationTypeData$sum6;
|
|
5185
|
+
var sx = _ref.sx,
|
|
5186
|
+
_ref$donationTypeData = _ref.donationTypeData,
|
|
5187
|
+
donationTypeData = _ref$donationTypeData === void 0 ? [] : _ref$donationTypeData;
|
|
5188
|
+
console.log("CHART DATA", donationTypeData);
|
|
5189
|
+
var recurringColor = (donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum = donationTypeData.summary) === null || _donationTypeData$sum === void 0 || (_donationTypeData$sum = _donationTypeData$sum.recurring) === null || _donationTypeData$sum === void 0 ? void 0 : _donationTypeData$sum.color) || "rgb(99, 99, 230)";
|
|
5190
|
+
var oneTimeColor = (donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum2 = donationTypeData.summary) === null || _donationTypeData$sum2 === void 0 || (_donationTypeData$sum2 = _donationTypeData$sum2.oneTime) === null || _donationTypeData$sum2 === void 0 ? void 0 : _donationTypeData$sum2.color) || "#10B981";
|
|
4917
5191
|
var chartOptions = {
|
|
4918
5192
|
chart: {
|
|
4919
5193
|
type: "bar",
|
|
@@ -4938,7 +5212,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
4938
5212
|
dataLabels: {
|
|
4939
5213
|
enabled: true,
|
|
4940
5214
|
formatter: function formatter(val) {
|
|
4941
|
-
return "$".concat(val
|
|
5215
|
+
return "$".concat(formatNumber(val));
|
|
4942
5216
|
},
|
|
4943
5217
|
offsetY: -22,
|
|
4944
5218
|
style: {
|
|
@@ -4953,7 +5227,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
4953
5227
|
colors: ["transparent"]
|
|
4954
5228
|
},
|
|
4955
5229
|
xaxis: {
|
|
4956
|
-
categories:
|
|
5230
|
+
categories: (donationTypeData === null || donationTypeData === void 0 ? void 0 : donationTypeData.categories) || [],
|
|
4957
5231
|
axisBorder: {
|
|
4958
5232
|
show: false
|
|
4959
5233
|
},
|
|
@@ -4973,7 +5247,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
4973
5247
|
tickAmount: 3,
|
|
4974
5248
|
labels: {
|
|
4975
5249
|
formatter: function formatter(val) {
|
|
4976
|
-
return
|
|
5250
|
+
return "$".concat(formatNumber(val));
|
|
4977
5251
|
},
|
|
4978
5252
|
style: {
|
|
4979
5253
|
colors: "rgba(0, 0, 0, 0.4)",
|
|
@@ -4984,7 +5258,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
4984
5258
|
fill: {
|
|
4985
5259
|
opacity: 1
|
|
4986
5260
|
},
|
|
4987
|
-
colors: [
|
|
5261
|
+
colors: [recurringColor, oneTimeColor],
|
|
4988
5262
|
grid: {
|
|
4989
5263
|
borderColor: "#f1f1f1",
|
|
4990
5264
|
strokeDashArray: 4,
|
|
@@ -5004,18 +5278,12 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
5004
5278
|
tooltip: {
|
|
5005
5279
|
y: {
|
|
5006
5280
|
formatter: function formatter(val) {
|
|
5007
|
-
return "$".concat(val
|
|
5281
|
+
return "$".concat(formatNumber(val));
|
|
5008
5282
|
}
|
|
5009
5283
|
}
|
|
5010
5284
|
}
|
|
5011
5285
|
};
|
|
5012
|
-
var series = [
|
|
5013
|
-
name: "Recurring",
|
|
5014
|
-
data: [9.2, 11.8, 13.4, 4.9]
|
|
5015
|
-
}, {
|
|
5016
|
-
name: "One-time",
|
|
5017
|
-
data: [32.4, 41.2, 46.8, 14.3]
|
|
5018
|
-
}];
|
|
5286
|
+
var series = (donationTypeData === null || donationTypeData === void 0 ? void 0 : donationTypeData.series) || [];
|
|
5019
5287
|
return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
|
|
5020
5288
|
sx: _objectSpread2({
|
|
5021
5289
|
bgcolor: "#fff",
|
|
@@ -5075,14 +5343,14 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
5075
5343
|
color: "rgba(0, 0, 0, 0.5)",
|
|
5076
5344
|
fontWeight: 500
|
|
5077
5345
|
},
|
|
5078
|
-
children:
|
|
5079
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
5346
|
+
children: donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum3 = donationTypeData.summary) === null || _donationTypeData$sum3 === void 0 || (_donationTypeData$sum3 = _donationTypeData$sum3.recurring) === null || _donationTypeData$sum3 === void 0 ? void 0 : _donationTypeData$sum3.label
|
|
5347
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Typography, {
|
|
5080
5348
|
sx: {
|
|
5081
5349
|
fontSize: "13px",
|
|
5082
5350
|
fontWeight: 600,
|
|
5083
5351
|
color: "#000"
|
|
5084
5352
|
},
|
|
5085
|
-
children: "$
|
|
5353
|
+
children: ["$", formatNumber((donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum4 = donationTypeData.summary) === null || _donationTypeData$sum4 === void 0 || (_donationTypeData$sum4 = _donationTypeData$sum4.recurring) === null || _donationTypeData$sum4 === void 0 ? void 0 : _donationTypeData$sum4.total) || 0)]
|
|
5086
5354
|
})]
|
|
5087
5355
|
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
5088
5356
|
sx: {
|
|
@@ -5103,14 +5371,14 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
5103
5371
|
color: "rgba(0, 0, 0, 0.5)",
|
|
5104
5372
|
fontWeight: 500
|
|
5105
5373
|
},
|
|
5106
|
-
children:
|
|
5107
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
5374
|
+
children: donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum5 = donationTypeData.summary) === null || _donationTypeData$sum5 === void 0 || (_donationTypeData$sum5 = _donationTypeData$sum5.oneTime) === null || _donationTypeData$sum5 === void 0 ? void 0 : _donationTypeData$sum5.label
|
|
5375
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Typography, {
|
|
5108
5376
|
sx: {
|
|
5109
5377
|
fontSize: "13px",
|
|
5110
5378
|
fontWeight: 600,
|
|
5111
5379
|
color: "#000"
|
|
5112
5380
|
},
|
|
5113
|
-
children: "$
|
|
5381
|
+
children: ["$", formatNumber((donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum6 = donationTypeData.summary) === null || _donationTypeData$sum6 === void 0 || (_donationTypeData$sum6 = _donationTypeData$sum6.oneTime) === null || _donationTypeData$sum6 === void 0 ? void 0 : _donationTypeData$sum6.total) || 0)]
|
|
5114
5382
|
})]
|
|
5115
5383
|
})]
|
|
5116
5384
|
})]
|
|
@@ -5244,7 +5512,7 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
|
|
|
5244
5512
|
return /*#__PURE__*/jsxRuntime.jsxs(material.Card, {
|
|
5245
5513
|
sx: _objectSpread2({
|
|
5246
5514
|
bgcolor: "#fff",
|
|
5247
|
-
borderRadius:
|
|
5515
|
+
borderRadius: 4,
|
|
5248
5516
|
border: "1px solid #f0f0f0",
|
|
5249
5517
|
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
5250
5518
|
p: 3,
|
|
@@ -5403,7 +5671,8 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
|
|
|
5403
5671
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
5404
5672
|
sx: {
|
|
5405
5673
|
height: 160,
|
|
5406
|
-
width: "100%"
|
|
5674
|
+
width: "100%",
|
|
5675
|
+
flexShrink: 0
|
|
5407
5676
|
},
|
|
5408
5677
|
children: /*#__PURE__*/jsxRuntime.jsx(ReactApexChart, {
|
|
5409
5678
|
options: chartOptions,
|
|
@@ -5415,19 +5684,6 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
|
|
|
5415
5684
|
});
|
|
5416
5685
|
};
|
|
5417
5686
|
|
|
5418
|
-
function formatNumber(num) {
|
|
5419
|
-
if (num >= 1000000000) {
|
|
5420
|
-
return (num / 1000000000).toFixed(1).replace(/\.0$/, "") + "B";
|
|
5421
|
-
}
|
|
5422
|
-
if (num >= 1000000) {
|
|
5423
|
-
return (num / 1000000).toFixed(1).replace(/\.0$/, "") + "M";
|
|
5424
|
-
}
|
|
5425
|
-
if (num >= 1000) {
|
|
5426
|
-
return (num / 1000).toFixed(1).replace(/\.0$/, "") + "K";
|
|
5427
|
-
}
|
|
5428
|
-
return (num !== null && num !== void 0 ? num : 0).toString();
|
|
5429
|
-
}
|
|
5430
|
-
|
|
5431
5687
|
var OverallSection = function OverallSection(_ref) {
|
|
5432
5688
|
var _apiData$totalRaisedP, _apiData$netRaisedCar, _apiData$netRaisedPre, _apiData$averageDonat, _apiData$averageDonat2, _apiData$roasCard, _apiData$roasCardPrev;
|
|
5433
5689
|
var _ref$apiData = _ref.apiData,
|
|
@@ -5441,6 +5697,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5441
5697
|
_useState2 = _slicedToArray(_useState, 2),
|
|
5442
5698
|
activeMetric = _useState2[0],
|
|
5443
5699
|
setActiveMetric = _useState2[1];
|
|
5700
|
+
var donationTypeData = (apiData === null || apiData === void 0 ? void 0 : apiData.donationType) || [];
|
|
5444
5701
|
var allCharts = [].concat(_toConsumableArray(primaryCharts), _toConsumableArray(secondaryCharts), _toConsumableArray(tertiaryCharts), _toConsumableArray(quaternaryCharts));
|
|
5445
5702
|
var getExtendedCharts = function getExtendedCharts() {
|
|
5446
5703
|
var charts = _toConsumableArray(allCharts);
|
|
@@ -5479,7 +5736,6 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5479
5736
|
}
|
|
5480
5737
|
return charts;
|
|
5481
5738
|
};
|
|
5482
|
-
console.log("API DATA", apiData);
|
|
5483
5739
|
var metricInfo = {
|
|
5484
5740
|
"Total Raised": {
|
|
5485
5741
|
value: "$".concat(formatNumber(apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedCard)) || "$240.9K",
|
|
@@ -5822,6 +6078,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5822
6078
|
value: selectedInfo.value,
|
|
5823
6079
|
trend: selectedInfo.subValue
|
|
5824
6080
|
});
|
|
6081
|
+
console.log("Donation Type Data", donationTypeData);
|
|
5825
6082
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
5826
6083
|
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
5827
6084
|
sx: {
|
|
@@ -5910,7 +6167,8 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5910
6167
|
container: true,
|
|
5911
6168
|
spacing: 3,
|
|
5912
6169
|
sx: {
|
|
5913
|
-
mt: 2
|
|
6170
|
+
mt: 2,
|
|
6171
|
+
alignItems: "stretch"
|
|
5914
6172
|
},
|
|
5915
6173
|
children: [/*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
5916
6174
|
item: true,
|
|
@@ -5918,8 +6176,9 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5918
6176
|
md: 3,
|
|
5919
6177
|
children: /*#__PURE__*/jsxRuntime.jsx(DonationTypeBarChart, {
|
|
5920
6178
|
sx: {
|
|
5921
|
-
|
|
5922
|
-
}
|
|
6179
|
+
height: 330
|
|
6180
|
+
},
|
|
6181
|
+
donationTypeData: donationTypeData
|
|
5923
6182
|
})
|
|
5924
6183
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
5925
6184
|
item: true,
|
|
@@ -5927,7 +6186,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5927
6186
|
md: 3,
|
|
5928
6187
|
children: /*#__PURE__*/jsxRuntime.jsx(PaidDonorGeographyCard, {
|
|
5929
6188
|
sx: {
|
|
5930
|
-
|
|
6189
|
+
height: 330
|
|
5931
6190
|
}
|
|
5932
6191
|
})
|
|
5933
6192
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
@@ -5936,7 +6195,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5936
6195
|
md: 3,
|
|
5937
6196
|
children: /*#__PURE__*/jsxRuntime.jsx(RefundsChargebacksCard, {
|
|
5938
6197
|
sx: {
|
|
5939
|
-
|
|
6198
|
+
height: 330
|
|
5940
6199
|
}
|
|
5941
6200
|
})
|
|
5942
6201
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
@@ -5945,7 +6204,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5945
6204
|
md: 3,
|
|
5946
6205
|
children: /*#__PURE__*/jsxRuntime.jsx(TrafficSourceCard, {
|
|
5947
6206
|
sx: {
|
|
5948
|
-
|
|
6207
|
+
height: 330
|
|
5949
6208
|
}
|
|
5950
6209
|
})
|
|
5951
6210
|
})]
|
|
@@ -5953,8 +6212,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5953
6212
|
container: true,
|
|
5954
6213
|
spacing: 3,
|
|
5955
6214
|
sx: {
|
|
5956
|
-
mt: 1
|
|
5957
|
-
mb: 2
|
|
6215
|
+
mt: 1
|
|
5958
6216
|
},
|
|
5959
6217
|
children: [/*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
5960
6218
|
item: true,
|