@ammarkhalidfarooq/dashboard-package 0.4.43 → 0.4.45

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
@@ -5926,65 +5926,100 @@ var PaidSection = function PaidSection() {
5926
5926
  var categories = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
5927
5927
  var metricInfo = {
5928
5928
  "Total Spent": {
5929
- value: "$80,313",
5929
+ value: "$".concat(formatNumber(80313)),
5930
5930
  subValue: "12% vs last month",
5931
5931
  chartLabel: "Daily Spend",
5932
5932
  data: [800, 950, 700, 1100, 900, 1200, 1300],
5933
- icon: IndeterminateCheckBoxOutlined
5933
+ icon: /*#__PURE__*/jsx(IndeterminateCheckBoxOutlined, {}),
5934
+ money: true,
5935
+ error: false,
5936
+ warning: false
5934
5937
  },
5935
5938
  "Revinue Raised": {
5936
- value: "$240,398",
5939
+ value: "$".concat(formatNumber(240398)),
5937
5940
  subValue: "12% vs last month",
5938
5941
  chartLabel: "Daily Revenue",
5939
5942
  data: [3200, 4100, 2800, 5600, 4200, 6100, 7500],
5940
- icon: PaidOutlined
5943
+ icon: /*#__PURE__*/jsx(PaidOutlined, {}),
5944
+ money: true,
5945
+ error: false,
5946
+ warning: false
5941
5947
  },
5942
5948
  ROAS: {
5943
5949
  value: "3.0",
5944
5950
  subValue: "12% vs last month",
5945
5951
  chartLabel: "ROAS Trend",
5946
5952
  data: [2.5, 3.1, 2.8, 4.2, 3.8, 4.5, 5.2],
5947
- icon: TrendingUp
5953
+ icon: /*#__PURE__*/jsx(TrendingUp, {}),
5954
+ money: false,
5955
+ error: false,
5956
+ warning: false
5948
5957
  },
5949
5958
  "Cost per donor": {
5950
- value: "$373",
5959
+ value: "$".concat(formatNumber(373)),
5951
5960
  subValue: "12% vs last month",
5952
5961
  chartLabel: "CPA Trend",
5953
5962
  data: [350, 380, 360, 410, 390, 370, 373],
5954
- icon: PersonOutlined
5963
+ icon: /*#__PURE__*/jsx(PersonOutlined, {}),
5964
+ money: true,
5965
+ error: false,
5966
+ warning: false
5955
5967
  },
5956
5968
  "Conversion rate": {
5957
5969
  value: "3.1%",
5958
5970
  subValue: "12% vs last month",
5959
5971
  chartLabel: "Conversion Rate",
5960
5972
  data: [2.8, 3.0, 2.9, 3.4, 3.2, 3.1, 3.1],
5961
- icon: Adjust
5973
+ icon: /*#__PURE__*/jsx(Adjust, {}),
5974
+ money: false,
5975
+ error: false,
5976
+ warning: false
5962
5977
  },
5963
5978
  "Avg donation": {
5964
- value: "$130.58",
5979
+ value: "$".concat(formatNumber(130.58)),
5965
5980
  subValue: "12% vs last month",
5966
5981
  chartLabel: "Average Donation",
5967
5982
  data: [120, 135, 125, 140, 130, 128, 130.58],
5968
- icon: PaidOutlined
5983
+ icon: /*#__PURE__*/jsx(PaidOutlined, {}),
5984
+ money: true,
5985
+ error: false,
5986
+ warning: false
5969
5987
  }
5970
5988
  };
5971
5989
  var renderCard = function renderCard(title) {
5972
- return /*#__PURE__*/jsx(DisplayCard, {
5990
+ return /*#__PURE__*/jsx(MetricCard
5991
+ // key={title}
5992
+ , {
5973
5993
  title: title,
5974
- value: metricInfo[title].value,
5975
- subValue: metricInfo[title].subValue,
5994
+ value: metricInfo[title].money ? metricInfo[title].value : metricInfo[title].value,
5995
+ caption: metricInfo[title].subValue,
5976
5996
  icon: metricInfo[title].icon,
5997
+ error: metricInfo[title].error,
5998
+ active: activeMetric === title,
5977
5999
  onClick: function onClick() {
5978
6000
  return setActiveMetric(title);
5979
6001
  },
5980
- isActive: activeMetric === title,
5981
- sx: {
5982
- // border:
5983
- // activeMetric === title
5984
- // ? "2px solid rgb(99, 99, 230)"
5985
- // : "2px solid #f0f0f0",
5986
- }
5987
- }, title);
6002
+ sx: metricInfo[title].error ? {
6003
+ border: "2px solid #ef4444",
6004
+ bgcolor: "#fffafa"
6005
+ } : {}
6006
+ })
6007
+ // <DisplayCard
6008
+ // key={title}
6009
+ // title={title}
6010
+ // value={metricInfo[title].value}
6011
+ // subValue={metricInfo[title].subValue}
6012
+ // icon={metricInfo[title].icon}
6013
+ // onClick={() => setActiveMetric(title)}
6014
+ // isActive={activeMetric === title}
6015
+ // sx={{
6016
+ // // border:
6017
+ // // activeMetric === title
6018
+ // // ? "2px solid rgb(99, 99, 230)"
6019
+ // // : "2px solid #f0f0f0",
6020
+ // }}
6021
+ // />
6022
+ ;
5988
6023
  };
5989
6024
  var selectedInfo = metricInfo[activeMetric];
5990
6025
  var mainChart = {
@@ -6203,40 +6238,58 @@ var OrganicSection = function OrganicSection(_ref) {
6203
6238
  var categories = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
6204
6239
  var metricInfo = {
6205
6240
  "Organic Users": {
6206
- value: (apiData === null || apiData === void 0 ? void 0 : apiData.totalRaised) || "$240.9K",
6241
+ value: "".concat(formatNumber(8420)),
6207
6242
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedTrend) || "18% vs last month",
6208
6243
  data: [3200, 4100, 2800, 5600, 4200, 6100, 7500],
6209
- icon: PeopleAltOutlined
6244
+ icon: /*#__PURE__*/jsx(PeopleAltOutlined, {}),
6245
+ money: false,
6246
+ warning: false,
6247
+ error: false
6210
6248
  },
6211
6249
  "Search Clicks": {
6212
- value: (apiData === null || apiData === void 0 ? void 0 : apiData.netRaised) || "$222.3K",
6250
+ value: "".concat(formatNumber(5842)),
6213
6251
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.netRaisedSub) || "92.3% pass-through",
6214
6252
  data: [1500, 1800, 1600, 2200, 2000, 2400, 2800],
6215
- icon: SearchOutlined
6253
+ icon: /*#__PURE__*/jsx(SearchOutlined, {}),
6254
+ money: false,
6255
+ warning: false,
6256
+ error: false
6216
6257
  },
6217
6258
  Donations: {
6218
- value: (apiData === null || apiData === void 0 ? void 0 : apiData.totalDonors) || "215",
6259
+ value: "".concat(formatNumber(420)),
6219
6260
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedTrend) || "18% vs last month",
6220
6261
  data: [15, 22, 18, 30, 25, 35, 42],
6221
- icon: FavoriteOutlined
6262
+ icon: /*#__PURE__*/jsx(FavoriteOutlined, {}),
6263
+ money: false,
6264
+ warning: false,
6265
+ error: false
6222
6266
  },
6223
6267
  "Conversion Rate": {
6224
6268
  value: "3.1%",
6225
6269
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.avgDonationTrend) || "8.4% vs last month",
6226
6270
  data: [2.5, 2.7, 2.6, 3.1, 3.0, 2.9, 3.1],
6227
- icon: Adjust
6271
+ icon: /*#__PURE__*/jsx(Adjust, {}),
6272
+ money: false,
6273
+ warning: false,
6274
+ error: false
6228
6275
  },
6229
6276
  "Revenue raised": {
6230
- value: (apiData === null || apiData === void 0 ? void 0 : apiData.roas) || "3.0x",
6277
+ value: "$".concat(formatNumber(240398)),
6231
6278
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.roasTrend) || "0.4x vs last month",
6232
6279
  data: [2.5, 3.1, 2.8, 4.2, 3.8, 4.5, 5.2],
6233
- icon: PaidOutlined
6280
+ icon: /*#__PURE__*/jsx(PaidOutlined, {}),
6281
+ money: true,
6282
+ warning: false,
6283
+ error: false
6234
6284
  },
6235
6285
  "Avg donation": {
6236
- value: (apiData === null || apiData === void 0 ? void 0 : apiData.conversion) || "1.7%",
6286
+ value: "$".concat(formatNumber(130.58)),
6237
6287
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedTrend) || "18% vs last month",
6238
6288
  data: [110, 125, 120, 135, 130, 128, 130.58],
6239
- icon: PaidOutlined
6289
+ icon: /*#__PURE__*/jsx(PaidOutlined, {}),
6290
+ money: true,
6291
+ warning: false,
6292
+ error: false
6240
6293
  }
6241
6294
  };
6242
6295
  var selectedInfo = metricInfo[activeMetric];
@@ -6256,23 +6309,40 @@ var OrganicSection = function OrganicSection(_ref) {
6256
6309
  flexWrap: "wrap"
6257
6310
  },
6258
6311
  children: Object.keys(metricInfo).map(function (title) {
6259
- return /*#__PURE__*/jsx(DisplayCard, {
6312
+ return /*#__PURE__*/jsx(MetricCard
6313
+ // key={title}
6314
+ , {
6260
6315
  title: title,
6261
- value: metricInfo[title].value,
6262
- subValue: metricInfo[title].subValue,
6316
+ value: metricInfo[title].money ? metricInfo[title].value : metricInfo[title].value,
6317
+ caption: metricInfo[title].subValue,
6263
6318
  icon: metricInfo[title].icon,
6319
+ error: metricInfo[title].error,
6320
+ active: activeMetric === title,
6264
6321
  onClick: function onClick() {
6265
6322
  return setActiveMetric(title);
6266
6323
  },
6267
- isActive: activeMetric === title,
6268
- sx: {
6269
- flex: 1
6270
- // border:
6271
- // activeMetric === title
6272
- // ? "2px solid rgb(99, 99, 230)"
6273
- // : "2px solid #f0f0f0",
6274
- }
6275
- }, title);
6324
+ sx: metricInfo[title].error ? {
6325
+ border: "2px solid #ef4444",
6326
+ bgcolor: "#fffafa"
6327
+ } : {}
6328
+ })
6329
+ // <DisplayCard
6330
+ // key={title}
6331
+ // title={title}
6332
+ // value={metricInfo[title].value}
6333
+ // subValue={metricInfo[title].subValue}
6334
+ // icon={metricInfo[title].icon}
6335
+ // onClick={() => setActiveMetric(title)}
6336
+ // isActive={activeMetric === title}
6337
+ // sx={{
6338
+ // flex: 1,
6339
+ // // border:
6340
+ // // activeMetric === title
6341
+ // // ? "2px solid rgb(99, 99, 230)"
6342
+ // // : "2px solid #f0f0f0",
6343
+ // }}
6344
+ // />
6345
+ ;
6276
6346
  })
6277
6347
  }), /*#__PURE__*/jsxs(Grid, {
6278
6348
  container: true,