@ammarkhalidfarooq/dashboard-package 0.6.122 → 0.6.124

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,7 +1,7 @@
1
1
  import React, { Suspense, lazy, useState, useRef, useEffect, useMemo } from 'react';
2
- import { Box, Button, Menu, MenuItem, 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, Avatar, LinearProgress, Stack, 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
- import { createTheme, useTheme } from '@mui/material/styles';
4
+ import { createTheme } from '@mui/material/styles';
5
5
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
6
  import Grid$1 from '@mui/material/Grid';
7
7
  import Box$1 from '@mui/material/Box';
@@ -462,8 +462,9 @@ var RevenueChart = function RevenueChart(_ref) {
462
462
  _ref$showLegend = _ref.showLegend,
463
463
  showLegend = _ref$showLegend === void 0 ? true : _ref$showLegend,
464
464
  _ref$isAmount = _ref.isAmount,
465
- isAmount = _ref$isAmount === void 0 ? false : _ref$isAmount;
466
- var theme = useTheme();
465
+ isAmount = _ref$isAmount === void 0 ? false : _ref$isAmount,
466
+ _ref$xAxisTickAmount = _ref.xAxisTickAmount,
467
+ xAxisTickAmount = _ref$xAxisTickAmount === void 0 ? 5 : _ref$xAxisTickAmount;
467
468
  var isRadial = type === 'donut' || type === 'pie';
468
469
  var isCurrency = isAmount || (metric === null || metric === void 0 ? void 0 : metric.toLowerCase()) === 'revenue';
469
470
  var isPercent = (metric === null || metric === void 0 ? void 0 : metric.toLowerCase()) === 'percent';
@@ -488,7 +489,7 @@ var RevenueChart = function RevenueChart(_ref) {
488
489
  enabled: false
489
490
  }
490
491
  },
491
- colors: colors || [theme.palette.primary.main, '#4B4BC2', '#7E7EE6', '#A3A3F0', '#C8C8FA'],
492
+ colors: colors || ['#4F46E5', '#4B4BC2', '#7E7EE6', '#A3A3F0', '#C8C8FA'],
492
493
  tooltip: {
493
494
  theme: 'light',
494
495
  y: {
@@ -559,7 +560,7 @@ var RevenueChart = function RevenueChart(_ref) {
559
560
  axisTicks: {
560
561
  show: false
561
562
  },
562
- tickAmount: 5,
563
+ tickAmount: xAxisTickAmount,
563
564
  labels: {
564
565
  rotate: 0,
565
566
  rotateAlways: false,
@@ -657,6 +658,8 @@ var RenderChartCard = function RenderChartCard(_ref) {
657
658
  cardSx = _ref$cardSx === void 0 ? {} : _ref$cardSx,
658
659
  _ref$contentSx = _ref.contentSx,
659
660
  contentSx = _ref$contentSx === void 0 ? {} : _ref$contentSx;
661
+ var theme = useTheme();
662
+ var isMobile = useMediaQuery(theme.breakpoints.down("sm"));
660
663
  var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
661
664
  var trendText = item.trend || "18%";
662
665
  var trendColor = getTrendColor(trendText, {
@@ -812,7 +815,7 @@ var RenderChartCard = function RenderChartCard(_ref) {
812
815
  },
813
816
  children: [{
814
817
  label: "Paid Ads",
815
- color: "#6366F1"
818
+ color: "#4F46E5"
816
819
  }, {
817
820
  label: "Organic",
818
821
  color: "#10B981"
@@ -884,7 +887,8 @@ var RenderChartCard = function RenderChartCard(_ref) {
884
887
  stacked: item.stacked,
885
888
  type: type || item.type || "area",
886
889
  colors: item.colors,
887
- showLegend: !item.hideControls
890
+ showLegend: !item.hideControls,
891
+ xAxisTickAmount: isMobile ? 3 : 5
888
892
  }), item.hideControls && item.series && /*#__PURE__*/jsx(Box, {
889
893
  sx: {
890
894
  display: {
@@ -898,7 +902,7 @@ var RenderChartCard = function RenderChartCard(_ref) {
898
902
  },
899
903
  children: [{
900
904
  label: "Paid Ads",
901
- color: "#6366F1"
905
+ color: "#4F46E5"
902
906
  }, {
903
907
  label: "Organic",
904
908
  color: "#10B981"
@@ -17925,7 +17929,7 @@ var OverallSection = function OverallSection(_ref) {
17925
17929
  series: series,
17926
17930
  categories: categories,
17927
17931
  stacked: true,
17928
- colors: ["#6366F1", "#10B981", "#06B6D4"],
17932
+ colors: ["#4F46E5", "#10B981", "#06B6D4"],
17929
17933
  hideControls: true,
17930
17934
  stroke: {
17931
17935
  curve: "smooth",
@@ -17948,7 +17952,7 @@ var OverallSection = function OverallSection(_ref) {
17948
17952
  series: _series,
17949
17953
  categories: _categories,
17950
17954
  stacked: true,
17951
- colors: ["#6366F1", "#10B981", "#06B6D4"],
17955
+ colors: ["#4F46E5", "#10B981", "#06B6D4"],
17952
17956
  hideControls: true
17953
17957
  });
17954
17958
  } else if (Array.isArray(netData) && netData.length > 0) {
@@ -17980,7 +17984,7 @@ var OverallSection = function OverallSection(_ref) {
17980
17984
  series: _series2,
17981
17985
  categories: _categories2,
17982
17986
  stacked: true,
17983
- colors: ["#6366F1", "#10B981", "#06B6D4"],
17987
+ colors: ["#4F46E5", "#10B981", "#06B6D4"],
17984
17988
  hideControls: true
17985
17989
  });
17986
17990
  } else if (Array.isArray(donorsData) && donorsData.length > 0) {
@@ -18012,7 +18016,7 @@ var OverallSection = function OverallSection(_ref) {
18012
18016
  series: _series3,
18013
18017
  categories: _categories3,
18014
18018
  stacked: true,
18015
- colors: ["#6366F1", "#10B981", "#06B6D4"],
18019
+ colors: ["#4F46E5", "#10B981", "#06B6D4"],
18016
18020
  hideControls: true
18017
18021
  });
18018
18022
  } else if (Array.isArray(roasData) && roasData.length > 0) {
@@ -18044,7 +18048,7 @@ var OverallSection = function OverallSection(_ref) {
18044
18048
  series: _series4,
18045
18049
  categories: _categories4,
18046
18050
  stacked: true,
18047
- colors: ["#6366F1", "#10B981", "#06B6D4"],
18051
+ colors: ["#4F46E5", "#10B981", "#06B6D4"],
18048
18052
  hideControls: true
18049
18053
  });
18050
18054
  } else if (Array.isArray(conversionData) && conversionData.length > 0) {
@@ -18076,7 +18080,7 @@ var OverallSection = function OverallSection(_ref) {
18076
18080
  series: _series5,
18077
18081
  categories: _categories5,
18078
18082
  stacked: true,
18079
- colors: ["#6366F1", "#10B981", "#06B6D4"],
18083
+ colors: ["#4F46E5", "#10B981", "#06B6D4"],
18080
18084
  hideControls: true
18081
18085
  });
18082
18086
  } else if (Array.isArray(avgData) && avgData.length > 0) {
@@ -19881,7 +19885,7 @@ var EmailSection = function EmailSection(_ref) {
19881
19885
  data: hasEmailOverview && openRateTrend.data.length > 0 ? openRateTrend.data : [0]
19882
19886
  }],
19883
19887
  categories: hasEmailOverview && openRateTrend.categories.length > 0 ? openRateTrend.categories : ["—"],
19884
- colors: ["rgb(99, 99, 230)"],
19888
+ colors: ["#4F46E5"],
19885
19889
  yAxisMax: computeYAxisMax(openRateTrend.data, 5),
19886
19890
  yAxisTickAmount: 3
19887
19891
  })