@ammarkhalidfarooq/dashboard-package 0.3.23 → 0.3.24

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
@@ -254,7 +254,9 @@ var RevenueChart = function RevenueChart(_ref) {
254
254
  type = _ref$type === void 0 ? "area" : _ref$type,
255
255
  _ref$id = _ref.id,
256
256
  id = _ref$id === void 0 ? "revenue-chart" : _ref$id,
257
- colors = _ref.colors;
257
+ colors = _ref.colors,
258
+ _ref$showLegend = _ref.showLegend,
259
+ showLegend = _ref$showLegend === void 0 ? true : _ref$showLegend;
258
260
  var theme = useTheme();
259
261
  var isRadial = type === 'donut' || type === 'pie';
260
262
 
@@ -292,7 +294,7 @@ var RevenueChart = function RevenueChart(_ref) {
292
294
  enabled: true
293
295
  },
294
296
  legend: {
295
- show: true,
297
+ show: showLegend,
296
298
  position: 'bottom',
297
299
  horizontalAlign: 'center'
298
300
  },
@@ -371,7 +373,7 @@ var RevenueChart = function RevenueChart(_ref) {
371
373
  enabled: false
372
374
  },
373
375
  legend: {
374
- show: stacked || series && series.length > 1,
376
+ show: showLegend && (stacked || series && series.length > 1),
375
377
  position: 'top',
376
378
  horizontalAlign: 'left'
377
379
  },
@@ -537,33 +539,75 @@ var RenderChartCard = function RenderChartCard(_ref) {
537
539
  },
538
540
  children: _typeof(item.subValue) === 'object' && item.subValue !== null ? JSON.stringify(item.subValue) : item.subValue
539
541
  })]
540
- }), /*#__PURE__*/jsxs(Box, {
542
+ }), /*#__PURE__*/jsx(Box, {
541
543
  sx: {
542
544
  display: "flex",
543
- gap: 1
545
+ gap: 1,
546
+ alignItems: "center"
544
547
  },
545
- children: [item.showSelector && /*#__PURE__*/jsx(MetricSelector, {
546
- metric: metric,
547
- onMetricChange: setMetric,
548
- options: ["Revenue", "Donations"]
549
- }), /*#__PURE__*/jsx(IconButton, {
548
+ children: item.hideControls ? /*#__PURE__*/jsx(Box, {
550
549
  sx: {
551
- border: "1px solid #E9E9EB",
552
- borderRadius: "8px",
553
- color: "#000",
554
- height: "40px",
555
- width: "40px",
556
- "&:hover": {
557
- borderColor: "primary.main",
558
- bgcolor: "rgba(99, 99, 230, 0.04)"
559
- }
550
+ display: "flex",
551
+ gap: 2,
552
+ alignItems: "center"
560
553
  },
561
- children: /*#__PURE__*/jsx(MoreHoriz, {
562
- sx: {
563
- fontSize: "1.2rem"
564
- }
554
+ children: [{
555
+ label: "Paid Ads",
556
+ color: "#6366F1"
557
+ }, {
558
+ label: "Organic",
559
+ color: "#10B981"
560
+ }, {
561
+ label: "Email",
562
+ color: "#06B6D4"
563
+ }].map(function (leg) {
564
+ return /*#__PURE__*/jsxs(Box, {
565
+ sx: {
566
+ display: "flex",
567
+ alignItems: "center",
568
+ gap: 0.5
569
+ },
570
+ children: [/*#__PURE__*/jsx(Box, {
571
+ sx: {
572
+ width: 8,
573
+ height: 8,
574
+ borderRadius: "50%",
575
+ bgcolor: leg.color
576
+ }
577
+ }), /*#__PURE__*/jsx(Typography, {
578
+ sx: {
579
+ fontSize: "12px",
580
+ color: "rgba(0,0,0,0.6)",
581
+ fontWeight: 500
582
+ },
583
+ children: leg.label
584
+ })]
585
+ }, leg.label);
565
586
  })
566
- })]
587
+ }) : /*#__PURE__*/jsxs(Fragment, {
588
+ children: [item.showSelector && /*#__PURE__*/jsx(MetricSelector, {
589
+ metric: metric,
590
+ onMetricChange: setMetric,
591
+ options: ["Revenue", "Donations"]
592
+ }), /*#__PURE__*/jsx(IconButton, {
593
+ sx: {
594
+ border: "1px solid #E9E9EB",
595
+ borderRadius: "8px",
596
+ color: "#000",
597
+ height: "40px",
598
+ width: "40px",
599
+ "&:hover": {
600
+ borderColor: "primary.main",
601
+ bgcolor: "rgba(99, 99, 230, 0.04)"
602
+ }
603
+ },
604
+ children: /*#__PURE__*/jsx(MoreHoriz, {
605
+ sx: {
606
+ fontSize: "1.2rem"
607
+ }
608
+ })
609
+ })]
610
+ })
567
611
  })]
568
612
  }), /*#__PURE__*/jsx(Box, {
569
613
  sx: {
@@ -579,7 +623,8 @@ var RenderChartCard = function RenderChartCard(_ref) {
579
623
  height: isPrimary ? 250 : 200,
580
624
  stacked: item.stacked,
581
625
  type: type || item.type || "area",
582
- colors: item.colors
626
+ colors: item.colors,
627
+ showLegend: !item.hideControls
583
628
  })
584
629
  }), item.footer && /*#__PURE__*/jsxs(Box, {
585
630
  sx: {
@@ -4884,7 +4929,8 @@ var OverallSection = function OverallSection(_ref) {
4884
4929
  series: series,
4885
4930
  categories: categories,
4886
4931
  stacked: true,
4887
- colors: ["#6366F1", "#10B981", "#06B6D4"]
4932
+ colors: ["#6366F1", "#10B981", "#06B6D4"],
4933
+ hideControls: true
4888
4934
  });
4889
4935
  }
4890
4936
  }