@ammarkhalidfarooq/dashboard-package 0.6.127 → 0.6.129

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
@@ -1,5 +1,5 @@
1
1
  import React, { Suspense, lazy, useState, useRef, useEffect, useMemo } from 'react';
2
- import { Box, Button, Menu, MenuItem, useTheme, useMediaQuery, Grid, Card, CardContent, Typography, IconButton, ThemeProvider, CircularProgress, Avatar, LinearProgress, Stack, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Skeleton } from '@mui/material';
2
+ import { Box, Button, Menu, MenuItem, useTheme, useMediaQuery, Grid, Card, CardContent, Typography, IconButton, ThemeProvider, CircularProgress, LinearProgress, Stack, Avatar, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Skeleton } from '@mui/material';
3
3
  import { MoreHoriz, TrendingDown, TrendingUp, MoreVert, Check, InfoOutlined, Settings, PeopleAltOutlined, RequestQuoteOutlined, PaidOutlined, PersonOutlined, IndeterminateCheckBoxOutlined, FavoriteOutlined, SearchOutlined, HighlightOff, Email } from '@mui/icons-material';
4
4
  import { createTheme } from '@mui/material/styles';
5
5
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -7,6 +7,7 @@ import Grid$1 from '@mui/material/Grid';
7
7
  import Box$1 from '@mui/material/Box';
8
8
  import Typography$1 from '@mui/material/Typography';
9
9
  import ReactApexChart from 'react-apexcharts';
10
+ import { SiSnapchat, SiYoutube, SiTiktok, SiGoogleads, SiMeta } from 'react-icons/si';
10
11
 
11
12
  var theme = createTheme({
12
13
  cssVariables: true,
@@ -1127,32 +1128,37 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1127
1128
  alignItems: "center",
1128
1129
  gap: 1.5
1129
1130
  },
1130
- children: [row.id && /*#__PURE__*/jsx(Avatar, {
1131
+ children: [(row.icon || row.id) && /*#__PURE__*/jsx(Box, {
1131
1132
  sx: {
1132
- width: compact ? 22 : 28,
1133
- height: compact ? 22 : 28,
1134
- fontSize: compact ? "8px" : "10px",
1135
- fontWeight: 700,
1136
- bgcolor: row.avatarBg || "#F3F4F6",
1137
- color: "rgb(99, 99, 230)"
1138
- },
1139
- children: row.id
1140
- }), row.icon && /*#__PURE__*/jsx(Box, {
1141
- sx: {
1142
- color: row.iconColor || "inherit",
1133
+ width: compact ? 22 : 32,
1134
+ height: compact ? 22 : 32,
1135
+ borderRadius: "50%",
1136
+ bgcolor: "#fff",
1137
+ border: "2px solid ".concat(row.avatarBorder || row.avatarBg || "#E5E7EB"),
1143
1138
  display: "flex",
1144
- alignItems: "center"
1139
+ alignItems: "center",
1140
+ justifyContent: "center",
1141
+ flexShrink: 0,
1142
+ boxSizing: "border-box",
1143
+ filter: row.comingSoon ? "grayscale(1)" : "none",
1144
+ opacity: row.comingSoon ? 0.55 : 1
1145
1145
  },
1146
- children: /*#__PURE__*/jsx(row.icon, {
1146
+ children: row.icon ? /*#__PURE__*/jsx(row.icon, {
1147
+ size: compact ? 12 : 16,
1148
+ color: row.iconColor || row.avatarBorder || row.avatarBg
1149
+ }) : /*#__PURE__*/jsx(Typography, {
1147
1150
  sx: {
1148
- fontSize: "18px"
1149
- }
1151
+ fontSize: compact ? "8px" : "10px",
1152
+ fontWeight: 700,
1153
+ color: row.avatarColor || "#111"
1154
+ },
1155
+ children: row.id
1150
1156
  })
1151
1157
  }), /*#__PURE__*/jsx(Typography, {
1152
1158
  sx: {
1153
1159
  fontSize: compact ? "10px" : "12px",
1154
1160
  fontWeight: 700,
1155
- color: "#000"
1161
+ color: row.comingSoon ? "#9CA3AF" : "#000"
1156
1162
  },
1157
1163
  children: row.name
1158
1164
  })]
@@ -1160,7 +1166,7 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1160
1166
  sx: {
1161
1167
  fontSize: compact ? "10px" : "13px",
1162
1168
  fontWeight: 600,
1163
- color: "#000",
1169
+ color: row.comingSoon ? "#9CA3AF" : "#000",
1164
1170
  textAlign: "left"
1165
1171
  },
1166
1172
  children: row.val1
@@ -1199,7 +1205,7 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1199
1205
  sx: {
1200
1206
  fontSize: "13px",
1201
1207
  fontWeight: 600,
1202
- color: "#000",
1208
+ color: row.comingSoon ? "#9CA3AF" : "#000",
1203
1209
  textAlign: "left"
1204
1210
  },
1205
1211
  children: row.val2
@@ -1207,7 +1213,7 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1207
1213
  sx: {
1208
1214
  fontSize: compact ? "10px" : "13px",
1209
1215
  fontWeight: row.highlightVal3 ? 700 : 500,
1210
- color: row.highlightVal3 ? row.val3Color || "#22C55E" : "#000",
1216
+ color: row.comingSoon ? "#9CA3AF" : row.highlightVal3 ? row.val3Color || "#22C55E" : "#000",
1211
1217
  textAlign: "left"
1212
1218
  },
1213
1219
  children: row.val3
@@ -1215,12 +1221,26 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1215
1221
  sx: {
1216
1222
  fontSize: "13px",
1217
1223
  fontWeight: 500,
1218
- color: "#000",
1224
+ color: row.comingSoon ? "#9CA3AF" : "#000",
1219
1225
  textAlign: "left"
1220
1226
  },
1221
1227
  children: row.val4
1222
1228
  }), columns.length > 5 && /*#__PURE__*/jsx(Box, {
1223
- children: row.type === "trend" ? /*#__PURE__*/jsx(Box, {
1229
+ children: row.comingSoon ? /*#__PURE__*/jsx(Box, {
1230
+ sx: {
1231
+ display: "inline-block",
1232
+ px: compact ? 1 : 1.5,
1233
+ py: compact ? 0.25 : 0.5,
1234
+ borderRadius: "100px",
1235
+ bgcolor: "#F3F4F6",
1236
+ color: "#9CA3AF",
1237
+ fontSize: compact ? "9px" : "11px",
1238
+ fontWeight: 700,
1239
+ textAlign: "center",
1240
+ whiteSpace: "nowrap"
1241
+ },
1242
+ children: "Coming Soon"
1243
+ }) : row.type === "trend" ? /*#__PURE__*/jsx(Box, {
1224
1244
  sx: {
1225
1245
  display: "flex",
1226
1246
  alignItems: "center",
@@ -3756,9 +3776,9 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref34, ref) {
3756
3776
  });
3757
3777
  ExportPdfLayout.displayName = "ExportPdfLayout";
3758
3778
 
3759
- /**
3760
- * Captures [data-export-page] elements and saves a multi-page PDF.
3761
- * Each page uses a custom size matching the captured content so nothing is cropped.
3779
+ /**
3780
+ * Captures [data-export-page] elements and saves a multi-page PDF.
3781
+ * Each page uses a custom size matching the captured content so nothing is cropped.
3762
3782
  */
3763
3783
  function exportReportPdf(_x, _x2) {
3764
3784
  return _exportReportPdf.apply(this, arguments);
@@ -4649,6 +4669,7 @@ var DonorMixCard = function DonorMixCard(_ref) {
4649
4669
  sx: {
4650
4670
  display: "flex",
4651
4671
  justifyContent: "space-between",
4672
+ alignItems: "center",
4652
4673
  mb: idx === items.length - 1 ? showBottomSummary ? compact ? 0.5 : 0 : 0 : compact ? 0.5 : 0
4653
4674
  },
4654
4675
  children: [/*#__PURE__*/jsxs(Box, {
@@ -4661,18 +4682,32 @@ var DonorMixCard = function DonorMixCard(_ref) {
4661
4682
  sx: {
4662
4683
  width: 10,
4663
4684
  height: 10,
4664
- bgcolor: item.color,
4685
+ bgcolor: item.comingSoon ? "#D1D5DB" : item.color,
4665
4686
  borderRadius: "2px"
4666
4687
  }
4667
4688
  }), /*#__PURE__*/jsx(Typography, {
4668
4689
  sx: {
4669
4690
  fontSize: compact ? "10px" : "13px",
4670
4691
  fontWeight: 500,
4671
- color: "rgba(0, 0, 0, 0.4)"
4692
+ color: item.comingSoon ? "#9CA3AF" : "rgba(0, 0, 0, 0.4)"
4672
4693
  },
4673
4694
  children: item.label
4674
4695
  })]
4675
- }), /*#__PURE__*/jsx(Typography, {
4696
+ }), item.comingSoon ? /*#__PURE__*/jsx(Box, {
4697
+ sx: {
4698
+ display: "inline-flex",
4699
+ alignItems: "center",
4700
+ px: 1,
4701
+ py: 0.2,
4702
+ borderRadius: "100px",
4703
+ bgcolor: "#F3F4F6",
4704
+ color: "#9CA3AF",
4705
+ fontSize: "10px",
4706
+ fontWeight: 700,
4707
+ whiteSpace: "nowrap"
4708
+ },
4709
+ children: "Coming Soon"
4710
+ }) : /*#__PURE__*/jsx(Typography, {
4676
4711
  sx: {
4677
4712
  fontSize: compact ? "10px" : "13px",
4678
4713
  fontWeight: 700,
@@ -6463,11 +6498,14 @@ var TopCampaignsConvRateCard = function TopCampaignsConvRateCard(_ref7) {
6463
6498
  };
6464
6499
  var getCampaignInitials$2 = function getCampaignInitials() {
6465
6500
  var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
6466
- var words = name.trim().split(/\s+/).filter(Boolean);
6501
+ var words = name.match(/[A-Za-z]+/g) || [];
6467
6502
  if (words.length >= 2) {
6468
6503
  return (words[0][0] + words[1][0]).toUpperCase();
6469
6504
  }
6470
- return name.slice(0, 2).toUpperCase() || "—";
6505
+ if (words.length === 1) {
6506
+ return words[0].slice(0, 2).toUpperCase();
6507
+ }
6508
+ return "—";
6471
6509
  };
6472
6510
  var TopPerformingCampaignsCard = function TopPerformingCampaignsCard(_ref8) {
6473
6511
  var _ref8$data = _ref8.data,
@@ -6561,16 +6599,23 @@ var TopPerformingCampaignsCard = function TopPerformingCampaignsCard(_ref8) {
6561
6599
  alignItems: "center",
6562
6600
  gap: 1.5
6563
6601
  },
6564
- children: [/*#__PURE__*/jsx(Box, {
6602
+ children: [/*#__PURE__*/jsx(Avatar, {
6603
+ src: item.image || item.avatar || item.logo || item.thumbnail || item.campaignImage || undefined,
6604
+ alt: item.name,
6605
+ imgProps: {
6606
+ style: {
6607
+ width: "100%",
6608
+ height: "100%",
6609
+ objectFit: "cover"
6610
+ }
6611
+ },
6565
6612
  sx: {
6566
6613
  width: 24,
6567
6614
  height: 24,
6615
+ flexShrink: 0,
6568
6616
  borderRadius: "50%",
6569
6617
  bgcolor: "#c1cfde71",
6570
6618
  color: "#3431e4ff",
6571
- display: "flex",
6572
- alignItems: "center",
6573
- justifyContent: "center",
6574
6619
  fontSize: "10px",
6575
6620
  fontWeight: 700
6576
6621
  },
@@ -9090,14 +9135,14 @@ var AbandonedDonationRecovery = function AbandonedDonationRecovery() {
9090
9135
  });
9091
9136
  };
9092
9137
 
9093
- /**
9094
- * Theme colors for server components
9095
- *
9096
- * These are plain JavaScript objects that can be safely imported
9097
- * in both server and client components without triggering
9098
- * client-only code in server components.
9099
- *
9100
- * For client components, use the full theme from @/config/customTheme
9138
+ /**
9139
+ * Theme colors for server components
9140
+ *
9141
+ * These are plain JavaScript objects that can be safely imported
9142
+ * in both server and client components without triggering
9143
+ * client-only code in server components.
9144
+ *
9145
+ * For client components, use the full theme from @/config/customTheme
9101
9146
  */
9102
9147
 
9103
9148
  var themeColors = {
@@ -18191,28 +18236,44 @@ var formatKpi$2 = function formatKpi(value) {
18191
18236
  var CHANNEL_STYLES = {
18192
18237
  "Meta Ads": {
18193
18238
  id: "M",
18194
- avatarBg: "#4267B2",
18195
- color: "#4267B2"
18239
+ icon: SiMeta,
18240
+ avatarBg: "#1877F2",
18241
+ avatarBorder: "#1877F2",
18242
+ color: "#1877F2",
18243
+ comingSoon: false
18196
18244
  },
18197
18245
  "Google Ads": {
18198
18246
  id: "G",
18247
+ icon: SiGoogleads,
18199
18248
  avatarBg: "#4285F4",
18200
- color: "#4285F4"
18249
+ avatarBorder: "#4285F4",
18250
+ color: "#4285F4",
18251
+ comingSoon: true
18201
18252
  },
18202
18253
  "TikTok Ads": {
18203
18254
  id: "T",
18255
+ icon: SiTiktok,
18204
18256
  avatarBg: "#000000",
18205
- color: "#cd249dff"
18257
+ avatarBorder: "#000000",
18258
+ color: "#000000",
18259
+ comingSoon: true
18206
18260
  },
18207
18261
  YouTube: {
18208
18262
  id: "Y",
18263
+ icon: SiYoutube,
18209
18264
  avatarBg: "#FF0000",
18210
- color: "#FF0000"
18265
+ avatarBorder: "#FF0000",
18266
+ color: "#FF0000",
18267
+ comingSoon: true
18211
18268
  },
18212
18269
  Snapchat: {
18213
18270
  id: "S",
18271
+ icon: SiSnapchat,
18214
18272
  avatarBg: "#FFFC00",
18215
- color: "#FFFC00"
18273
+ avatarBorder: "#FFFC00",
18274
+ iconColor: "#8A6D00",
18275
+ color: "#FFFC00",
18276
+ comingSoon: true
18216
18277
  }
18217
18278
  };
18218
18279
  var formatGrowth$2 = function formatGrowth(value) {
@@ -18240,7 +18301,8 @@ var getChannelStyle = function getChannelStyle() {
18240
18301
  return CHANNEL_STYLES[channel] || {
18241
18302
  id: channel.slice(0, 1).toUpperCase() || "?",
18242
18303
  avatarBg: "#F3F4F6",
18243
- color: "#6366F1"
18304
+ color: "#6366F1",
18305
+ comingSoon: true
18244
18306
  };
18245
18307
  };
18246
18308
  var mapChannelTrend = function mapChannelTrend(trend) {
@@ -18294,7 +18356,8 @@ var buildEmptySpendAllocation = function buildEmptySpendAllocation() {
18294
18356
  return {
18295
18357
  label: channel,
18296
18358
  val: "0.0%",
18297
- color: CHANNEL_STYLES[channel].color
18359
+ color: CHANNEL_STYLES[channel].color,
18360
+ comingSoon: CHANNEL_STYLES[channel].comingSoon
18298
18361
  };
18299
18362
  })
18300
18363
  };
@@ -18493,7 +18556,11 @@ var PaidSection = function PaidSection(_ref) {
18493
18556
  var roas = Number((_item$roas = item.roas) !== null && _item$roas !== void 0 ? _item$roas : 0);
18494
18557
  return _objectSpread2({
18495
18558
  id: style.id,
18559
+ icon: style.icon,
18496
18560
  avatarBg: style.avatarBg,
18561
+ avatarBorder: style.avatarBorder,
18562
+ iconColor: style.iconColor || style.avatarBorder,
18563
+ comingSoon: style.comingSoon,
18497
18564
  name: item.channel,
18498
18565
  val1: "$".concat(formatNumber((_item$spend = item.spend) !== null && _item$spend !== void 0 ? _item$spend : 0)),
18499
18566
  val2: "$".concat(formatNumber((_item$revenue = item.revenue) !== null && _item$revenue !== void 0 ? _item$revenue : 0)),
@@ -18519,7 +18586,8 @@ var PaidSection = function PaidSection(_ref) {
18519
18586
  val: "".concat(Number((_item$percentage = item.percentage) !== null && _item$percentage !== void 0 ? _item$percentage : 0).toFixed(1), "%"),
18520
18587
  color: style.color,
18521
18588
  spend: (_item$spend2 = item.spend) !== null && _item$spend2 !== void 0 ? _item$spend2 : 0,
18522
- percentage: (_item$percentage2 = item.percentage) !== null && _item$percentage2 !== void 0 ? _item$percentage2 : 0
18589
+ percentage: (_item$percentage2 = item.percentage) !== null && _item$percentage2 !== void 0 ? _item$percentage2 : 0,
18590
+ comingSoon: style.comingSoon
18523
18591
  };
18524
18592
  });
18525
18593
  return {
@@ -18538,11 +18606,13 @@ var PaidSection = function PaidSection(_ref) {
18538
18606
  items: items.map(function (_ref1) {
18539
18607
  var label = _ref1.label,
18540
18608
  val = _ref1.val,
18541
- color = _ref1.color;
18609
+ color = _ref1.color,
18610
+ comingSoon = _ref1.comingSoon;
18542
18611
  return {
18543
18612
  label: label,
18544
18613
  val: val,
18545
- color: color
18614
+ color: color,
18615
+ comingSoon: comingSoon
18546
18616
  };
18547
18617
  })
18548
18618
  };