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