@ammarkhalidfarooq/dashboard-package 0.6.23 → 0.6.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/MetricCard.cjs.js +34 -6
- package/dist/MetricCard.cjs.js.map +1 -1
- package/dist/MetricCard.es.js +34 -6
- package/dist/MetricCard.es.js.map +1 -1
- package/dist/RenderChartCard.cjs.js +45 -5
- package/dist/RenderChartCard.cjs.js.map +1 -1
- package/dist/RenderChartCard.es.js +45 -5
- package/dist/RenderChartCard.es.js.map +1 -1
- package/dist/index.cjs.js +123 -76
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +124 -77
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/MetricCard.cjs.js
CHANGED
|
@@ -47,6 +47,33 @@ function _toPropertyKey(t) {
|
|
|
47
47
|
return "symbol" == typeof i ? i : i + "";
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
var TREND_UP_COLOR = "#22C55E";
|
|
51
|
+
var TREND_DOWN_COLOR = "#EF4444";
|
|
52
|
+
function getTrendDirection(valueOrText) {
|
|
53
|
+
var text = String(valueOrText !== null && valueOrText !== void 0 ? valueOrText : "").trim();
|
|
54
|
+
if (text.includes("▼")) return "down";
|
|
55
|
+
if (text.includes("▲")) return "up";
|
|
56
|
+
var match = text.match(/-?\d+(\.\d+)?/);
|
|
57
|
+
if (!match) return "neutral";
|
|
58
|
+
var n = Number(match[0]);
|
|
59
|
+
if (n < 0) return "down";
|
|
60
|
+
if (n > 0) return "up";
|
|
61
|
+
return "neutral";
|
|
62
|
+
}
|
|
63
|
+
function getTrendColor(valueOrText) {
|
|
64
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
65
|
+
_ref$up = _ref.up,
|
|
66
|
+
up = _ref$up === void 0 ? TREND_UP_COLOR : _ref$up,
|
|
67
|
+
_ref$down = _ref.down,
|
|
68
|
+
down = _ref$down === void 0 ? TREND_DOWN_COLOR : _ref$down,
|
|
69
|
+
_ref$neutral = _ref.neutral,
|
|
70
|
+
neutral = _ref$neutral === void 0 ? up : _ref$neutral;
|
|
71
|
+
var direction = getTrendDirection(valueOrText);
|
|
72
|
+
if (direction === "down") return down;
|
|
73
|
+
if (direction === "up") return up;
|
|
74
|
+
return neutral;
|
|
75
|
+
}
|
|
76
|
+
|
|
50
77
|
var MetricCard = function MetricCard(_ref) {
|
|
51
78
|
var title = _ref.title,
|
|
52
79
|
value = _ref.value,
|
|
@@ -68,12 +95,13 @@ var MetricCard = function MetricCard(_ref) {
|
|
|
68
95
|
avatarSx = _ref$avatarSx === void 0 ? {} : _ref$avatarSx;
|
|
69
96
|
var captionText = String(caption !== null && caption !== void 0 ? caption : "");
|
|
70
97
|
var isPercentCaption = captionText.includes("%");
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
|
|
98
|
+
var trendDirection = isPercentCaption ? getTrendDirection(captionText) : "neutral";
|
|
99
|
+
var hasTrendArrow = captionText.includes("▼") || captionText.includes("▲");
|
|
100
|
+
var trendPrefix = hasTrendArrow || !isPercentCaption ? "" : trendDirection === "down" ? "▼ " : trendDirection === "up" ? "▲ " : "";
|
|
101
|
+
var captionColor = captionText.includes("failed") ? "#4F46E5" : error ? "#ef4444" : isPercentCaption ? getTrendColor(captionText, {
|
|
102
|
+
up: "#0B8F61",
|
|
103
|
+
down: "#ef4444"
|
|
104
|
+
}) : "#0B8F61";
|
|
77
105
|
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
78
106
|
sx: _objectSpread2({
|
|
79
107
|
bgcolor: "#fff",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricCard.cjs.js","sources":["../src/components/advanced/MetricCard/index.jsx"],"sourcesContent":["import { Avatar, Box, Stack, Typography } from \"@mui/material\";\r\n\r\n\r\nconst MetricCard = ({\r\n title,\r\n value,\r\n caption,\r\n icon,\r\n active,\r\n warning,\r\n error,\r\n onClick,\r\n sx = {},\r\n titleSx = {},\r\n valueSx = {},\r\n captionSx = {},\r\n avatarSx = {},\r\n}) => {\r\n const captionText = String(caption ?? \"\");\r\n const isPercentCaption = captionText.includes(\"%\");\r\n const
|
|
1
|
+
{"version":3,"file":"MetricCard.cjs.js","sources":["../src/config/helper.js","../src/components/advanced/MetricCard/index.jsx"],"sourcesContent":["export const TREND_UP_COLOR = \"#22C55E\";\r\nexport const TREND_DOWN_COLOR = \"#EF4444\";\r\n\r\nexport function getTrendDirection(valueOrText) {\r\n const text = String(valueOrText ?? \"\").trim();\r\n if (text.includes(\"▼\")) return \"down\";\r\n if (text.includes(\"▲\")) return \"up\";\r\n\r\n const match = text.match(/-?\\d+(\\.\\d+)?/);\r\n if (!match) return \"neutral\";\r\n\r\n const n = Number(match[0]);\r\n if (n < 0) return \"down\";\r\n if (n > 0) return \"up\";\r\n return \"neutral\";\r\n}\r\n\r\nexport function getTrendColor(\r\n valueOrText,\r\n { up = TREND_UP_COLOR, down = TREND_DOWN_COLOR, neutral = up } = {}\r\n) {\r\n const direction = getTrendDirection(valueOrText);\r\n if (direction === \"down\") return down;\r\n if (direction === \"up\") return up;\r\n return neutral;\r\n}\r\n\r\nexport function getTrendArrow(valueOrText) {\r\n const direction = getTrendDirection(valueOrText);\r\n if (direction === \"down\") return \"▼\";\r\n if (direction === \"up\") return \"▲\";\r\n return \"\";\r\n}\r\n\r\nexport function formatNumber(num) {\r\n if (num >= 1_000_000_000) {\r\n return (num / 1_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"B\";\r\n }\r\n\r\n if (num >= 1_000_000) {\r\n return (num / 1_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"M\";\r\n }\r\n\r\n if (num >= 1_000) {\r\n return (num / 1_000).toFixed(1).replace(/\\.0$/, \"\") + \"K\";\r\n }\r\n\r\n return (num ?? 0).toString();\r\n}","import { Avatar, Box, Stack, Typography } from \"@mui/material\";\r\nimport { getTrendColor, getTrendDirection } from \"../../../config/helper\";\r\n\r\n\r\nconst MetricCard = ({\r\n title,\r\n value,\r\n caption,\r\n icon,\r\n active,\r\n warning,\r\n error,\r\n onClick,\r\n sx = {},\r\n titleSx = {},\r\n valueSx = {},\r\n captionSx = {},\r\n avatarSx = {},\r\n}) => {\r\n const captionText = String(caption ?? \"\");\r\n const isPercentCaption = captionText.includes(\"%\");\r\n const trendDirection = isPercentCaption ? getTrendDirection(captionText) : \"neutral\";\r\n const hasTrendArrow = captionText.includes(\"▼\") || captionText.includes(\"▲\");\r\n const trendPrefix =\r\n hasTrendArrow || !isPercentCaption\r\n ? \"\"\r\n : trendDirection === \"down\"\r\n ? \"▼ \"\r\n : trendDirection === \"up\"\r\n ? \"▲ \"\r\n : \"\";\r\n const captionColor = captionText.includes(\"failed\")\r\n ? \"#4F46E5\"\r\n : error\r\n ? \"#ef4444\"\r\n : isPercentCaption\r\n ? getTrendColor(captionText, { up: \"#0B8F61\", down: \"#ef4444\" })\r\n : \"#0B8F61\";\r\n\r\n return (\r\n <Box\r\n sx={{\r\n bgcolor: \"#fff\",\r\n border: `1.5px solid ${active ? \"#4F46E5\" : warning ? \"#F3B33D\" : error ? \"#ef4444\" : \"#F1F1F5\"}`,\r\n borderRadius: \"16px\",\r\n p: { xs: 1.75, md: 2 },\r\n paddingTop: \"10px !important\", paddingBottom: \"10px !important\",\r\n height: 92,\r\n boxShadow: \"0 14px 30px rgba(21, 26, 45, 0.06)\",\r\n ...sx,\r\n }}\r\n onClick={onClick}\r\n >\r\n <Stack\r\n direction=\"row\"\r\n justifyContent=\"space-between\"\r\n alignItems=\"center\"\r\n >\r\n <Typography\r\n sx={{\r\n color: active ? \"#818CF8\" : \"#999EAA\",\r\n fontSize: 13,\r\n fontWeight: 500,\r\n letterSpacing: 0,\r\n ...titleSx,\r\n }}\r\n >\r\n {title}\r\n </Typography>\r\n <Avatar\r\n sx={{\r\n width: 30,\r\n height: 30,\r\n bgcolor: warning ? \"#FFF3CF\" : error ? \"#fee2e2\" : \"#EEF2FF\",\r\n color: warning ? \"#B45309\" : error ? \"#ef4444\" : \"#4F46E5\",\r\n ...avatarSx,\r\n }}\r\n >\r\n {icon}\r\n </Avatar>\r\n </Stack>\r\n <Typography\r\n sx={{\r\n fontSize: 22,\r\n fontWeight: 700,\r\n color: active ? \"#4F46E5\" : \"#050509\",\r\n lineHeight: 1.15,\r\n ...valueSx,\r\n }}\r\n >\r\n {value}\r\n </Typography>\r\n <Typography\r\n sx={{\r\n fontSize: 12,\r\n fontWeight: 500,\r\n color: captionColor,\r\n ...captionSx,\r\n }}\r\n >\r\n {`${trendPrefix}${captionText}`}\r\n </Typography>\r\n </Box>\r\n );\r\n};\r\n\r\nexport default MetricCard;\r\n"],"names":["TREND_UP_COLOR","TREND_DOWN_COLOR","getTrendDirection","valueOrText","text","String","trim","includes","match","n","Number","getTrendColor","_ref","arguments","length","undefined","_ref$up","up","_ref$down","down","_ref$neutral","neutral","direction","MetricCard","title","value","caption","icon","active","warning","error","onClick","_ref$sx","sx","_ref$titleSx","titleSx","_ref$valueSx","valueSx","_ref$captionSx","captionSx","_ref$avatarSx","avatarSx","captionText","isPercentCaption","trendDirection","hasTrendArrow","trendPrefix","captionColor","_jsxs","Box","_objectSpread","bgcolor","border","concat","borderRadius","p","xs","md","paddingTop","paddingBottom","height","boxShadow","children","Stack","justifyContent","alignItems","_jsx","Typography","color","fontSize","fontWeight","letterSpacing","Avatar","width","lineHeight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,cAAc,GAAG,SAAS;AAChC,IAAMC,gBAAgB,GAAG,SAAS;AAElC,SAASC,iBAAiBA,CAACC,WAAW,EAAE;AAC7C,EAAA,IAAMC,IAAI,GAAGC,MAAM,CAACF,WAAW,KAAA,IAAA,IAAXA,WAAW,KAAA,MAAA,GAAXA,WAAW,GAAI,EAAE,CAAC,CAACG,IAAI,EAAE;EAC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A,KACnB,CAAC;AAAA,GACV,CAAC;AAEV;;;;"}
|
package/dist/MetricCard.es.js
CHANGED
|
@@ -45,6 +45,33 @@ function _toPropertyKey(t) {
|
|
|
45
45
|
return "symbol" == typeof i ? i : i + "";
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
var TREND_UP_COLOR = "#22C55E";
|
|
49
|
+
var TREND_DOWN_COLOR = "#EF4444";
|
|
50
|
+
function getTrendDirection(valueOrText) {
|
|
51
|
+
var text = String(valueOrText !== null && valueOrText !== void 0 ? valueOrText : "").trim();
|
|
52
|
+
if (text.includes("▼")) return "down";
|
|
53
|
+
if (text.includes("▲")) return "up";
|
|
54
|
+
var match = text.match(/-?\d+(\.\d+)?/);
|
|
55
|
+
if (!match) return "neutral";
|
|
56
|
+
var n = Number(match[0]);
|
|
57
|
+
if (n < 0) return "down";
|
|
58
|
+
if (n > 0) return "up";
|
|
59
|
+
return "neutral";
|
|
60
|
+
}
|
|
61
|
+
function getTrendColor(valueOrText) {
|
|
62
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
63
|
+
_ref$up = _ref.up,
|
|
64
|
+
up = _ref$up === void 0 ? TREND_UP_COLOR : _ref$up,
|
|
65
|
+
_ref$down = _ref.down,
|
|
66
|
+
down = _ref$down === void 0 ? TREND_DOWN_COLOR : _ref$down,
|
|
67
|
+
_ref$neutral = _ref.neutral,
|
|
68
|
+
neutral = _ref$neutral === void 0 ? up : _ref$neutral;
|
|
69
|
+
var direction = getTrendDirection(valueOrText);
|
|
70
|
+
if (direction === "down") return down;
|
|
71
|
+
if (direction === "up") return up;
|
|
72
|
+
return neutral;
|
|
73
|
+
}
|
|
74
|
+
|
|
48
75
|
var MetricCard = function MetricCard(_ref) {
|
|
49
76
|
var title = _ref.title,
|
|
50
77
|
value = _ref.value,
|
|
@@ -66,12 +93,13 @@ var MetricCard = function MetricCard(_ref) {
|
|
|
66
93
|
avatarSx = _ref$avatarSx === void 0 ? {} : _ref$avatarSx;
|
|
67
94
|
var captionText = String(caption !== null && caption !== void 0 ? caption : "");
|
|
68
95
|
var isPercentCaption = captionText.includes("%");
|
|
69
|
-
var
|
|
70
|
-
var
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
96
|
+
var trendDirection = isPercentCaption ? getTrendDirection(captionText) : "neutral";
|
|
97
|
+
var hasTrendArrow = captionText.includes("▼") || captionText.includes("▲");
|
|
98
|
+
var trendPrefix = hasTrendArrow || !isPercentCaption ? "" : trendDirection === "down" ? "▼ " : trendDirection === "up" ? "▲ " : "";
|
|
99
|
+
var captionColor = captionText.includes("failed") ? "#4F46E5" : error ? "#ef4444" : isPercentCaption ? getTrendColor(captionText, {
|
|
100
|
+
up: "#0B8F61",
|
|
101
|
+
down: "#ef4444"
|
|
102
|
+
}) : "#0B8F61";
|
|
75
103
|
return /*#__PURE__*/jsxs(Box, {
|
|
76
104
|
sx: _objectSpread2({
|
|
77
105
|
bgcolor: "#fff",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricCard.es.js","sources":["../src/components/advanced/MetricCard/index.jsx"],"sourcesContent":["import { Avatar, Box, Stack, Typography } from \"@mui/material\";\r\n\r\n\r\nconst MetricCard = ({\r\n title,\r\n value,\r\n caption,\r\n icon,\r\n active,\r\n warning,\r\n error,\r\n onClick,\r\n sx = {},\r\n titleSx = {},\r\n valueSx = {},\r\n captionSx = {},\r\n avatarSx = {},\r\n}) => {\r\n const captionText = String(caption ?? \"\");\r\n const isPercentCaption = captionText.includes(\"%\");\r\n const
|
|
1
|
+
{"version":3,"file":"MetricCard.es.js","sources":["../src/config/helper.js","../src/components/advanced/MetricCard/index.jsx"],"sourcesContent":["export const TREND_UP_COLOR = \"#22C55E\";\r\nexport const TREND_DOWN_COLOR = \"#EF4444\";\r\n\r\nexport function getTrendDirection(valueOrText) {\r\n const text = String(valueOrText ?? \"\").trim();\r\n if (text.includes(\"▼\")) return \"down\";\r\n if (text.includes(\"▲\")) return \"up\";\r\n\r\n const match = text.match(/-?\\d+(\\.\\d+)?/);\r\n if (!match) return \"neutral\";\r\n\r\n const n = Number(match[0]);\r\n if (n < 0) return \"down\";\r\n if (n > 0) return \"up\";\r\n return \"neutral\";\r\n}\r\n\r\nexport function getTrendColor(\r\n valueOrText,\r\n { up = TREND_UP_COLOR, down = TREND_DOWN_COLOR, neutral = up } = {}\r\n) {\r\n const direction = getTrendDirection(valueOrText);\r\n if (direction === \"down\") return down;\r\n if (direction === \"up\") return up;\r\n return neutral;\r\n}\r\n\r\nexport function getTrendArrow(valueOrText) {\r\n const direction = getTrendDirection(valueOrText);\r\n if (direction === \"down\") return \"▼\";\r\n if (direction === \"up\") return \"▲\";\r\n return \"\";\r\n}\r\n\r\nexport function formatNumber(num) {\r\n if (num >= 1_000_000_000) {\r\n return (num / 1_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"B\";\r\n }\r\n\r\n if (num >= 1_000_000) {\r\n return (num / 1_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"M\";\r\n }\r\n\r\n if (num >= 1_000) {\r\n return (num / 1_000).toFixed(1).replace(/\\.0$/, \"\") + \"K\";\r\n }\r\n\r\n return (num ?? 0).toString();\r\n}","import { Avatar, Box, Stack, Typography } from \"@mui/material\";\r\nimport { getTrendColor, getTrendDirection } from \"../../../config/helper\";\r\n\r\n\r\nconst MetricCard = ({\r\n title,\r\n value,\r\n caption,\r\n icon,\r\n active,\r\n warning,\r\n error,\r\n onClick,\r\n sx = {},\r\n titleSx = {},\r\n valueSx = {},\r\n captionSx = {},\r\n avatarSx = {},\r\n}) => {\r\n const captionText = String(caption ?? \"\");\r\n const isPercentCaption = captionText.includes(\"%\");\r\n const trendDirection = isPercentCaption ? getTrendDirection(captionText) : \"neutral\";\r\n const hasTrendArrow = captionText.includes(\"▼\") || captionText.includes(\"▲\");\r\n const trendPrefix =\r\n hasTrendArrow || !isPercentCaption\r\n ? \"\"\r\n : trendDirection === \"down\"\r\n ? \"▼ \"\r\n : trendDirection === \"up\"\r\n ? \"▲ \"\r\n : \"\";\r\n const captionColor = captionText.includes(\"failed\")\r\n ? \"#4F46E5\"\r\n : error\r\n ? \"#ef4444\"\r\n : isPercentCaption\r\n ? getTrendColor(captionText, { up: \"#0B8F61\", down: \"#ef4444\" })\r\n : \"#0B8F61\";\r\n\r\n return (\r\n <Box\r\n sx={{\r\n bgcolor: \"#fff\",\r\n border: `1.5px solid ${active ? \"#4F46E5\" : warning ? \"#F3B33D\" : error ? \"#ef4444\" : \"#F1F1F5\"}`,\r\n borderRadius: \"16px\",\r\n p: { xs: 1.75, md: 2 },\r\n paddingTop: \"10px !important\", paddingBottom: \"10px !important\",\r\n height: 92,\r\n boxShadow: \"0 14px 30px rgba(21, 26, 45, 0.06)\",\r\n ...sx,\r\n }}\r\n onClick={onClick}\r\n >\r\n <Stack\r\n direction=\"row\"\r\n justifyContent=\"space-between\"\r\n alignItems=\"center\"\r\n >\r\n <Typography\r\n sx={{\r\n color: active ? \"#818CF8\" : \"#999EAA\",\r\n fontSize: 13,\r\n fontWeight: 500,\r\n letterSpacing: 0,\r\n ...titleSx,\r\n }}\r\n >\r\n {title}\r\n </Typography>\r\n <Avatar\r\n sx={{\r\n width: 30,\r\n height: 30,\r\n bgcolor: warning ? \"#FFF3CF\" : error ? \"#fee2e2\" : \"#EEF2FF\",\r\n color: warning ? \"#B45309\" : error ? \"#ef4444\" : \"#4F46E5\",\r\n ...avatarSx,\r\n }}\r\n >\r\n {icon}\r\n </Avatar>\r\n </Stack>\r\n <Typography\r\n sx={{\r\n fontSize: 22,\r\n fontWeight: 700,\r\n color: active ? \"#4F46E5\" : \"#050509\",\r\n lineHeight: 1.15,\r\n ...valueSx,\r\n }}\r\n >\r\n {value}\r\n </Typography>\r\n <Typography\r\n sx={{\r\n fontSize: 12,\r\n fontWeight: 500,\r\n color: captionColor,\r\n ...captionSx,\r\n }}\r\n >\r\n {`${trendPrefix}${captionText}`}\r\n </Typography>\r\n </Box>\r\n );\r\n};\r\n\r\nexport default MetricCard;\r\n"],"names":["TREND_UP_COLOR","TREND_DOWN_COLOR","getTrendDirection","valueOrText","text","String","trim","includes","match","n","Number","getTrendColor","_ref","arguments","length","undefined","_ref$up","up","_ref$down","down","_ref$neutral","neutral","direction","MetricCard","title","value","caption","icon","active","warning","error","onClick","_ref$sx","sx","_ref$titleSx","titleSx","_ref$valueSx","valueSx","_ref$captionSx","captionSx","_ref$avatarSx","avatarSx","captionText","isPercentCaption","trendDirection","hasTrendArrow","trendPrefix","captionColor","_jsxs","Box","_objectSpread","bgcolor","border","concat","borderRadius","p","xs","md","paddingTop","paddingBottom","height","boxShadow","children","Stack","justifyContent","alignItems","_jsx","Typography","color","fontSize","fontWeight","letterSpacing","Avatar","width","lineHeight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,cAAc,GAAG,SAAS;AAChC,IAAMC,gBAAgB,GAAG,SAAS;AAElC,SAASC,iBAAiBA,CAACC,WAAW,EAAE;AAC7C,EAAA,IAAMC,IAAI,GAAGC,MAAM,CAACF,WAAW,KAAA,IAAA,IAAXA,WAAW,KAAA,MAAA,GAAXA,WAAW,GAAI,EAAE,CAAC,CAACG,IAAI,EAAE;EAC7C,IAAIF,IAAI,CAACG,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,MAAM;EACrC,IAAIH,IAAI,CAACG,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,IAAI;AAEnC,EAAA,IAAMC,KAAK,GAAGJ,IAAI,CAACI,KAAK,CAAC,eAAe,CAAC;AACzC,EAAA,IAAI,CAACA,KAAK,EAAE,OAAO,SAAS;EAE5B,IAAMC,CAAC,GAAGC,MAAM,CAACF,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1B,EAAA,IAAIC,CAAC,GAAG,CAAC,EAAE,OAAO,MAAM;AACxB,EAAA,IAAIA,CAAC,GAAG,CAAC,EAAE,OAAO,IAAI;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G,SAAS,GAAGC,KAAK,GAAG,SAAS,GAAG,SAAS;UAC5DsC,KAAK,EAAEvC,OAAO,GAAG,SAAS,GAAGC,KAAK,GAAG,SAAS,GAAG;AAAS,SAAA,EACvDW,QAAQ,CACX;AAAAqB,QAAAA,QAAA,EAEDnC;AAAI,OACC,CAAC;AAAA,KACJ,CAAC,eACRuC,GAAA,CAACC,UAAU,EAAA;AACTlC,MAAAA,EAAE,EAAAiB,cAAA,CAAA;AACAmB,QAAAA,QAAQ,EAAE,EAAE;AACZC,QAAAA,UAAU,EAAE,GAAG;AACfF,QAAAA,KAAK,EAAExC,MAAM,GAAG,SAAS,GAAG,SAAS;AACrC8C,QAAAA,UAAU,EAAE;AAAI,OAAA,EACbrC,OAAO,CACV;AAAAyB,MAAAA,QAAA,EAEDrC;AAAK,KACI,CAAC,eACXyC,GAAA,CAACC,UAAU,EAAA;AACTlC,MAAAA,EAAE,EAAAiB,cAAA,CAAA;AACAmB,QAAAA,QAAQ,EAAE,EAAE;AACZC,QAAAA,UAAU,EAAE,GAAG;AACfF,QAAAA,KAAK,EAAErB;AAAY,OAAA,EAChBR,SAAS,CACZ;AAAAuB,MAAAA,QAAA,KAAAT,MAAA,CAEEP,WAAW,CAAA,CAAAO,MAAA,CAAGX,WAAW;AAAA,KACnB,CAAC;AAAA,GACV,CAAC;AAEV;;;;"}
|
|
@@ -367,6 +367,39 @@ var MetricSelector = function MetricSelector(_ref) {
|
|
|
367
367
|
});
|
|
368
368
|
};
|
|
369
369
|
|
|
370
|
+
var TREND_UP_COLOR = "#22C55E";
|
|
371
|
+
var TREND_DOWN_COLOR = "#EF4444";
|
|
372
|
+
function getTrendDirection(valueOrText) {
|
|
373
|
+
var text = String(valueOrText !== null && valueOrText !== void 0 ? valueOrText : "").trim();
|
|
374
|
+
if (text.includes("▼")) return "down";
|
|
375
|
+
if (text.includes("▲")) return "up";
|
|
376
|
+
var match = text.match(/-?\d+(\.\d+)?/);
|
|
377
|
+
if (!match) return "neutral";
|
|
378
|
+
var n = Number(match[0]);
|
|
379
|
+
if (n < 0) return "down";
|
|
380
|
+
if (n > 0) return "up";
|
|
381
|
+
return "neutral";
|
|
382
|
+
}
|
|
383
|
+
function getTrendColor(valueOrText) {
|
|
384
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
385
|
+
_ref$up = _ref.up,
|
|
386
|
+
up = _ref$up === void 0 ? TREND_UP_COLOR : _ref$up,
|
|
387
|
+
_ref$down = _ref.down,
|
|
388
|
+
down = _ref$down === void 0 ? TREND_DOWN_COLOR : _ref$down,
|
|
389
|
+
_ref$neutral = _ref.neutral,
|
|
390
|
+
neutral = _ref$neutral === void 0 ? up : _ref$neutral;
|
|
391
|
+
var direction = getTrendDirection(valueOrText);
|
|
392
|
+
if (direction === "down") return down;
|
|
393
|
+
if (direction === "up") return up;
|
|
394
|
+
return neutral;
|
|
395
|
+
}
|
|
396
|
+
function getTrendArrow(valueOrText) {
|
|
397
|
+
var direction = getTrendDirection(valueOrText);
|
|
398
|
+
if (direction === "down") return "▼";
|
|
399
|
+
if (direction === "up") return "▲";
|
|
400
|
+
return "";
|
|
401
|
+
}
|
|
402
|
+
|
|
370
403
|
var RenderChartCard = function RenderChartCard(_ref) {
|
|
371
404
|
var item = _ref.item,
|
|
372
405
|
index = _ref.index,
|
|
@@ -389,6 +422,13 @@ var RenderChartCard = function RenderChartCard(_ref) {
|
|
|
389
422
|
_ref$contentSx = _ref.contentSx,
|
|
390
423
|
contentSx = _ref$contentSx === void 0 ? {} : _ref$contentSx;
|
|
391
424
|
var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
|
|
425
|
+
var trendText = item.trend || "18%";
|
|
426
|
+
var trendColor = getTrendColor(trendText, {
|
|
427
|
+
up: "#054835ff",
|
|
428
|
+
down: "#EF4444"
|
|
429
|
+
});
|
|
430
|
+
var trendArrow = getTrendArrow(trendText);
|
|
431
|
+
var trendBadgeBg = trendColor === "#EF4444" ? "#fee2e2" : "#8df3be9a";
|
|
392
432
|
return /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
393
433
|
item: true,
|
|
394
434
|
xs: 12,
|
|
@@ -459,17 +499,17 @@ var RenderChartCard = function RenderChartCard(_ref) {
|
|
|
459
499
|
display: "flex",
|
|
460
500
|
alignItems: "center",
|
|
461
501
|
gap: 0.5,
|
|
462
|
-
bgcolor:
|
|
463
|
-
color:
|
|
502
|
+
bgcolor: trendBadgeBg,
|
|
503
|
+
color: trendColor,
|
|
464
504
|
px: 1,
|
|
465
505
|
py: 0.5,
|
|
466
506
|
borderRadius: "100px",
|
|
467
507
|
fontSize: "12px",
|
|
468
508
|
fontWeight: 600
|
|
469
509
|
},
|
|
470
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
471
|
-
children:
|
|
472
|
-
}), item.trend
|
|
510
|
+
children: [trendArrow && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
511
|
+
children: trendArrow
|
|
512
|
+
}), trendText === "18%" && !item.trend ? "18% vs last month" : trendText]
|
|
473
513
|
})]
|
|
474
514
|
})]
|
|
475
515
|
}) : /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderChartCard.cjs.js","sources":["../src/components/RevenueChart.jsx","../src/components/MetricSelector.jsx","../src/components/UI/RenderChartCard/index.jsx"],"sourcesContent":["import React from 'react';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport { useTheme } from '@mui/material/styles';\r\n\r\nconst RevenueChart = ({ metric, data, series, categories, height = 350, stacked = false, type = \"area\", id = \"revenue-chart\", colors, showLegend = true }) => {\r\n const theme = useTheme();\r\n\r\n const isRadial = type === 'donut' || type === 'pie';\r\n\r\n // Base options common to all charts\r\n const baseOptions = {\r\n chart: {\r\n id: id,\r\n type: type,\r\n toolbar: { show: false },\r\n sparkline: { enabled: false },\r\n animations: { enabled: false }\r\n },\r\n colors: colors || [theme.palette.primary.main, '#4B4BC2', '#7E7EE6', '#A3A3F0', '#C8C8FA'],\r\n tooltip: {\r\n theme: 'light',\r\n y: {\r\n formatter: (value) => (metric?.toLowerCase() === 'revenue') ? `$${(value || 0).toLocaleString()}` : (value || 0)\r\n }\r\n }\r\n };\r\n\r\n const radialOptions = {\r\n ...baseOptions,\r\n labels: categories || [],\r\n stroke: { width: 0 },\r\n dataLabels: { enabled: true },\r\n legend: {\r\n show: showLegend,\r\n position: 'bottom',\r\n horizontalAlign: 'center'\r\n },\r\n plotOptions: {\r\n pie: {\r\n donut: {\r\n size: '70%',\r\n labels: {\r\n show: true,\r\n total: {\r\n show: true,\r\n label: 'Total',\r\n formatter: function (w) {\r\n const sum = w.globals.seriesTotals.reduce((a, b) => a + b, 0);\r\n return metric === 'Revenue' ? `$${Math.round(sum).toLocaleString()}` : Math.round(sum).toLocaleString();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n const linearOptions = {\r\n ...baseOptions,\r\n chart: {\r\n ...baseOptions.chart,\r\n stacked: stacked\r\n },\r\n stroke: {\r\n curve: 'smooth',\r\n width: type === 'bar' ? 0 : 2\r\n },\r\n fill: {\r\n type: type === 'line' ? 'solid' : 'gradient',\r\n opacity: type === 'line' ? 0 : 1,\r\n gradient: type === 'line' ? undefined : {\r\n shadeIntensity: 1,\r\n opacityFrom: 0.8,\r\n opacityTo: 0.4,\r\n stops: [0, 100]\r\n }\r\n },\r\n xaxis: {\r\n type: 'category',\r\n categories: categories || [],\r\n axisBorder: { show: false },\r\n axisTicks: { show: false },\r\n tickAmount: 5,\r\n labels: {\r\n rotate: 0,\r\n rotateAlways: false,\r\n hideOverlappingLabels: true,\r\n style: { colors: '#A1A1A8', fontSize: '12px' },\r\n formatter: (val) => {\r\n return val;\r\n }\r\n }\r\n },\r\n yaxis: {\r\n show: true,\r\n labels: {\r\n style: { colors: '#A1A1A8', fontSize: '12px' },\r\n formatter: (value) => (metric?.toLowerCase() === 'revenue') ? `$${(value || 0).toLocaleString()}` : (value || 0)\r\n }\r\n },\r\n grid: {\r\n show: true,\r\n borderColor: '#f1f1f1',\r\n strokeDashArray: 4,\r\n position: 'back'\r\n },\r\n dataLabels: { enabled: false },\r\n legend: {\r\n show: showLegend && (stacked || (series && series.length > 1)),\r\n position: 'top',\r\n horizontalAlign: 'left'\r\n },\r\n plotOptions: {\r\n bar: {\r\n borderRadius: 4,\r\n columnWidth: '60%'\r\n }\r\n }\r\n };\r\n\r\n const chartOptions = isRadial ? radialOptions : linearOptions;\r\n\r\n // Ensure series is in the correct format for the chart type\r\n let chartSeries = [];\r\n if (isRadial) {\r\n // For donut/pie, series must be a simple array of numbers\r\n const processedData = Array.isArray(data) ? data.map(v => (typeof v === 'object' && v !== null) ? v.value : v) : [];\r\n chartSeries = processedData.length > 0 ? processedData : (series?.[0]?.data || []);\r\n } else {\r\n // For bar/line/area, series must be an array of objects [{ name: '', data: [] }]\r\n const processedData = Array.isArray(data) ? data.map(v => (typeof v === 'object' && v !== null) ? v.value : v) : [];\r\n chartSeries = Array.isArray(series) ? series : [\r\n {\r\n name: metric || \"Value\",\r\n data: processedData\r\n }\r\n ];\r\n }\r\n\r\n return (\r\n <ReactApexChart\r\n key={`${id}-${type}-${chartSeries.length}`}\r\n options={chartOptions}\r\n series={chartSeries}\r\n type={type}\r\n height={height}\r\n width=\"100%\"\r\n />\r\n );\r\n};\r\n\r\nexport default RevenueChart;\r\n","import React from 'react';\r\nimport { Button, Menu, MenuItem, Box } from '@mui/material';\r\nimport { MoreHoriz as MoreHorizIcon } from '@mui/icons-material';\r\n\r\nconst MetricSelector = ({ metric, onMetricChange, options = ['Revenue', 'Donations'], label = \"Metric\" }) => {\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n const open = Boolean(anchorEl);\r\n\r\n const handleClick = (event) => {\r\n setAnchorEl(event.currentTarget);\r\n };\r\n\r\n const handleClose = (value) => {\r\n if (typeof value === 'string') {\r\n onMetricChange(value);\r\n }\r\n setAnchorEl(null);\r\n };\r\n\r\n return (\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n <Button\r\n id=\"metric-button\"\r\n aria-controls={open ? 'metric-menu' : undefined}\r\n aria-haspopup=\"true\"\r\n aria-expanded={open ? 'true' : undefined}\r\n onClick={handleClick}\r\n variant=\"outlined\"\r\n sx={{ \r\n borderRadius: '8px', \r\n borderColor: '#E9E9EB', \r\n color: '#000', \r\n textTransform: 'none',\r\n fontWeight: 600,\r\n px: 2,\r\n height: '40px',\r\n '&:hover': {\r\n borderColor: 'primary.main',\r\n bgcolor: 'rgba(99, 99, 230, 0.04)'\r\n }\r\n }}\r\n >\r\n {label}: {metric}\r\n </Button>\r\n <Menu\r\n id=\"metric-menu\"\r\n anchorEl={anchorEl}\r\n open={open}\r\n onClose={() => handleClose()}\r\n MenuListProps={{\r\n 'aria-labelledby': 'metric-button',\r\n }}\r\n PaperProps={{\r\n sx: {\r\n borderRadius: '8px',\r\n mt: 1,\r\n boxShadow: '0 4px 12px rgba(0,0,0,0.1)',\r\n minWidth: '150px'\r\n }\r\n }}\r\n >\r\n {options.map((option) => (\r\n <MenuItem \r\n key={option} \r\n onClick={() => handleClose(option)} \r\n sx={{ fontWeight: metric === option ? 700 : 400 }}\r\n >\r\n {option}\r\n </MenuItem>\r\n ))}\r\n </Menu>\r\n </Box>\r\n );\r\n};\r\n\r\nexport default MetricSelector;\r\n","import {\r\n Box,\r\n Card,\r\n CardContent,\r\n Grid,\r\n IconButton,\r\n Typography,\r\n} from \"@mui/material\";\r\nimport RevenueChart from \"../../RevenueChart\";\r\nimport { MoreHoriz as MoreHorizIcon } from \"@mui/icons-material\";\r\nimport MetricSelector from \"../../MetricSelector\";\r\n\r\nconst RenderChartCard = ({\r\n item,\r\n index,\r\n isPrimary = false,\r\n isPremium = false,\r\n metric,\r\n setMetric,\r\n md = 4,\r\n numberOfDays = 30,\r\n type = \"area\",\r\n sx = {},\r\n cardSx = {},\r\n contentSx = {},\r\n}) => {\r\n const daysLabel = `${numberOfDays} day${numberOfDays === 1 ? \"\" : \"s\"}`;\r\n return (\r\n <Grid\r\n item\r\n xs={12}\r\n md={md}\r\n key={item.label + index}\r\n sx={{ display: \"flex\", paddingTop: \"0px !important\", ...sx }}\r\n >\r\n <Card\r\n sx={{\r\n width: \"100%\",\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n boxShadow: \"0 4px 24px rgba(0,0,0,0.06)\",\r\n borderRadius: 4,\r\n border: \"1px solid #f0f0f0\",\r\n ...cardSx,\r\n }}\r\n >\r\n <CardContent\r\n sx={{\r\n p: item.exportMode ? 2 : 3,\r\n flexGrow: 1,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n ...contentSx,\r\n }}\r\n >\r\n <Box\r\n sx={{\r\n display: \"flex\",\r\n justifyContent: \"space-between\",\r\n alignItems: \"flex-start\",\r\n mb: item.exportMode ? 2 : isPremium ? 3 : 2,\r\n }}\r\n >\r\n {isPremium ? (\r\n <Box sx={{ textAlign: \"left\" }}>\r\n <Typography\r\n sx={{\r\n color: \"#000000\",\r\n fontWeight: 700,\r\n fontSize: \"18px\",\r\n mb: 0.2,\r\n }}\r\n >\r\n {item.label}\r\n </Typography>\r\n <Typography\r\n variant=\"caption\"\r\n sx={{\r\n color: \"rgba(0, 0, 0, 0.4)\",\r\n fontWeight: 400,\r\n display: \"block\",\r\n mb: 1.5,\r\n }}\r\n >\r\n {item.subtitle || `Last ${daysLabel} · daily aggregation`}\r\n </Typography>\r\n\r\n <Box sx={{ display: \"flex\", alignItems: \"center\", gap: 1.5 }}>\r\n {item.value && (\r\n <Typography\r\n sx={{ fontWeight: 700, color: \"#000000\", fontSize: \"28px\" }}\r\n >\r\n {typeof item.value === 'object' && item.value !== null\r\n ? (item.value.value !== undefined ? item.value.value : JSON.stringify(item.value))\r\n : item.value}\r\n </Typography>\r\n )}\r\n {(item.trend || \"18%\") && (\r\n <Box\r\n sx={{\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n gap: 0.5,\r\n bgcolor: \"#8df3be9a\",\r\n color: \"#054835ff\",\r\n px: 1,\r\n py: 0.5,\r\n borderRadius: \"100px\",\r\n fontSize: \"12px\",\r\n fontWeight: 600,\r\n }}\r\n >\r\n <span>▲</span>\r\n {item.trend || \"18% vs last month\"}\r\n </Box>\r\n )}\r\n </Box>\r\n </Box>\r\n ) : (\r\n <Box sx={{ textAlign: \"left\" }}>\r\n <Typography\r\n variant=\"subtitle2\"\r\n sx={{\r\n color: \"#000000\",\r\n fontWeight: 600,\r\n textTransform: \"uppercase\",\r\n letterSpacing: \"0.5px\",\r\n mb: 0.5,\r\n }}\r\n >\r\n {item.label}\r\n </Typography>\r\n {item.value && (\r\n <Typography\r\n variant=\"subtitle2\"\r\n sx={{ fontWeight: 600, color: \"#000000\", mb: 0.5 }}\r\n >\r\n {typeof item.value === 'object' && item.value !== null\r\n ? (item.value.value !== undefined ? item.value.value : JSON.stringify(item.value))\r\n : item.value}\r\n </Typography>\r\n )}\r\n {item.subValue && (\r\n <Typography\r\n variant=\"subtitle2\"\r\n sx={{ color: \"#000000\", fontWeight: 600 }}\r\n >\r\n {typeof item.subValue === 'object' && item.subValue !== null\r\n ? JSON.stringify(item.subValue)\r\n : item.subValue}\r\n </Typography>\r\n )}\r\n </Box>\r\n )}\r\n\r\n <Box sx={{ display: \"flex\", gap: 1, alignItems: \"center\" }}>\r\n {item.hideControls ? (\r\n item.series && (\r\n <Box\r\n sx={{\r\n display: item.exportMode ? \"flex\" : { xs: \"none\", sm: \"flex\" },\r\n gap: 2,\r\n alignItems: \"center\",\r\n }}\r\n >\r\n {[\r\n { label: \"Paid Ads\", color: \"#6366F1\" },\r\n { label: \"Organic\", color: \"#10B981\" },\r\n { label: \"Email\", color: \"#06B6D4\" },\r\n ].map((leg) => (\r\n <Box\r\n key={leg.label}\r\n sx={{ display: \"flex\", alignItems: \"center\", gap: 0.5 }}\r\n >\r\n <Box\r\n sx={{\r\n width: 8,\r\n height: 8,\r\n borderRadius: \"50%\",\r\n bgcolor: leg.color,\r\n }}\r\n />\r\n <Typography\r\n sx={{\r\n fontSize: \"12px\",\r\n color: \"rgba(0,0,0,0.6)\",\r\n fontWeight: 500,\r\n }}\r\n >\r\n {leg.label}\r\n </Typography>\r\n </Box>\r\n ))}\r\n </Box>\r\n )\r\n) : (\r\n <>\r\n {item.showSelector && (\r\n <MetricSelector\r\n metric={metric}\r\n onMetricChange={setMetric}\r\n options={[\"Revenue\", \"Donations\"]}\r\n />\r\n )}\r\n <IconButton\r\n sx={{\r\n border: \"1px solid #E9E9EB\",\r\n borderRadius: \"8px\",\r\n color: \"#000\",\r\n height: \"40px\",\r\n width: \"40px\",\r\n \"&:hover\": {\r\n borderColor: \"primary.main\",\r\n bgcolor: \"rgba(99, 99, 230, 0.04)\",\r\n },\r\n }}\r\n >\r\n <MoreHorizIcon sx={{ fontSize: \"1.2rem\" }} />\r\n </IconButton>\r\n </>\r\n )}\r\n </Box>\r\n </Box>\r\n\r\n <Box sx={{ flexGrow: 1, minHeight: isPrimary ? \"250px\" : \"200px\" }}>\r\n <RevenueChart\r\n id={`${item.label}-${index}`}\r\n metric={\r\n item.label.includes(\"Rate\") ||\r\n item.label.includes(\"Performance\") ||\r\n item.label.includes(\"source\") ||\r\n item.label === \"URL\"\r\n ? \"Percent\"\r\n : item.stacked\r\n ? item.label.includes(\"Traffic\")\r\n ? \"Visitors\"\r\n : \"Donors\"\r\n : metric\r\n }\r\n data={item.data}\r\n series={item.series}\r\n categories={item.categories}\r\n height={item.height || (isPrimary ? 250 : 200)}\r\n stacked={item.stacked}\r\n type={type || item.type || \"area\"}\r\n colors={item.colors}\r\n showLegend={!item.hideControls}\r\n />\r\n {item.hideControls && item.series && (\r\n <Box\r\n sx={{\r\n display: { xs: \"flex\", sm: \"none\" },\r\n justifyContent: \"center\",\r\n gap: 2,\r\n flexWrap: \"wrap\",\r\n mt: 1.5,\r\n }}\r\n >\r\n {[\r\n { label: \"Paid Ads\", color: \"#6366F1\" },\r\n { label: \"Organic\", color: \"#10B981\" },\r\n { label: \"Email\", color: \"#06B6D4\" },\r\n ].map((leg) => (\r\n <Box\r\n key={leg.label}\r\n sx={{\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n gap: 0.5,\r\n }}\r\n >\r\n <Box\r\n sx={{\r\n width: 8,\r\n height: 8,\r\n borderRadius: \"50%\",\r\n bgcolor: leg.color,\r\n }}\r\n />\r\n <Typography\r\n sx={{\r\n fontSize: \"11px\",\r\n color: \"rgba(0,0,0,0.6)\",\r\n fontWeight: 500,\r\n marginTop: {xs: \"1px\", sm: 0}\r\n }}\r\n >\r\n {leg.label}\r\n </Typography>\r\n </Box>\r\n ))}\r\n </Box>\r\n )}\r\n </Box>\r\n\r\n {item.footer && (\r\n <Box\r\n sx={{\r\n display: \"flex\",\r\n justifyContent: \"space-between\",\r\n mt: 2,\r\n pt: 2,\r\n borderTop: \"1px solid #f0f0f0\",\r\n }}\r\n >\r\n <Typography\r\n variant=\"caption\"\r\n sx={{ color: \"#606062\", fontWeight: 600 }}\r\n >\r\n {item.footer.left}\r\n </Typography>\r\n <Typography\r\n variant=\"caption\"\r\n sx={{ color: \"#606062\", fontWeight: 600 }}\r\n >\r\n {item.footer.right}\r\n </Typography>\r\n </Box>\r\n )}\r\n </CardContent>\r\n </Card>\r\n </Grid>\r\n );\r\n};\r\n\r\nexport default RenderChartCard;\r\n"],"names":["RevenueChart","_ref","metric","data","series","categories","_ref$height","height","_ref$stacked","stacked","_ref$type","type","_ref$id","id","colors","_ref$showLegend","showLegend","theme","useTheme","isRadial","baseOptions","chart","toolbar","show","sparkline","enabled","animations","palette","primary","main","tooltip","y","formatter","value","toLowerCase","concat","toLocaleString","radialOptions","_objectSpread","labels","stroke","width","dataLabels","legend","position","horizontalAlign","plotOptions","pie","donut","size","total","label","w","sum","globals","seriesTotals","reduce","a","b","Math","round","linearOptions","curve","fill","opacity","gradient","undefined","shadeIntensity","opacityFrom","opacityTo","stops","xaxis","axisBorder","axisTicks","tickAmount","rotate","rotateAlways","hideOverlappingLabels","style","fontSize","val","yaxis","grid","borderColor","strokeDashArray","length","bar","borderRadius","columnWidth","chartOptions","chartSeries","_series$","processedData","Array","isArray","map","v","_typeof","name","_jsx","ReactApexChart","options","MetricSelector","onMetricChange","_ref$options","_ref$label","_React$useState","React","useState","_React$useState2","_slicedToArray","anchorEl","setAnchorEl","open","Boolean","handleClick","event","currentTarget","handleClose","_jsxs","Box","sx","display","gap","children","Button","onClick","variant","color","textTransform","fontWeight","px","bgcolor","Menu","onClose","MenuListProps","PaperProps","mt","boxShadow","minWidth","option","MenuItem","RenderChartCard","item","index","_ref$isPrimary","isPrimary","_ref$isPremium","isPremium","setMetric","_ref$md","md","_ref$numberOfDays","numberOfDays","_ref$sx","_ref$cardSx","cardSx","_ref$contentSx","contentSx","daysLabel","Grid","xs","paddingTop","Card","flexDirection","border","CardContent","p","exportMode","flexGrow","justifyContent","alignItems","mb","textAlign","Typography","subtitle","JSON","stringify","trend","py","letterSpacing","subValue","hideControls","sm","leg","_Fragment","showSelector","IconButton","MoreHorizIcon","minHeight","includes","flexWrap","marginTop","footer","pt","borderTop","left","right"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAA4I;AAAA,EAAA,IAAtIC,MAAM,GAAAD,IAAA,CAANC,MAAM;IAAEC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM;IAAEC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IAAAC,WAAA,GAAAL,IAAA,CAAEM,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAA,MAAA,GAAG,GAAG,GAAAA,WAAA;IAAAE,YAAA,GAAAP,IAAA,CAAEQ,OAAO;AAAPA,IAAAA,OAAO,GA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;;;;"}
|
|
1
|
+
{"version":3,"file":"RenderChartCard.cjs.js","sources":["../src/components/RevenueChart.jsx","../src/components/MetricSelector.jsx","../src/config/helper.js","../src/components/UI/RenderChartCard/index.jsx"],"sourcesContent":["import React from 'react';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport { useTheme } from '@mui/material/styles';\r\n\r\nconst RevenueChart = ({ metric, data, series, categories, height = 350, stacked = false, type = \"area\", id = \"revenue-chart\", colors, showLegend = true }) => {\r\n const theme = useTheme();\r\n\r\n const isRadial = type === 'donut' || type === 'pie';\r\n\r\n // Base options common to all charts\r\n const baseOptions = {\r\n chart: {\r\n id: id,\r\n type: type,\r\n toolbar: { show: false },\r\n sparkline: { enabled: false },\r\n animations: { enabled: false }\r\n },\r\n colors: colors || [theme.palette.primary.main, '#4B4BC2', '#7E7EE6', '#A3A3F0', '#C8C8FA'],\r\n tooltip: {\r\n theme: 'light',\r\n y: {\r\n formatter: (value) => (metric?.toLowerCase() === 'revenue') ? `$${(value || 0).toLocaleString()}` : (value || 0)\r\n }\r\n }\r\n };\r\n\r\n const radialOptions = {\r\n ...baseOptions,\r\n labels: categories || [],\r\n stroke: { width: 0 },\r\n dataLabels: { enabled: true },\r\n legend: {\r\n show: showLegend,\r\n position: 'bottom',\r\n horizontalAlign: 'center'\r\n },\r\n plotOptions: {\r\n pie: {\r\n donut: {\r\n size: '70%',\r\n labels: {\r\n show: true,\r\n total: {\r\n show: true,\r\n label: 'Total',\r\n formatter: function (w) {\r\n const sum = w.globals.seriesTotals.reduce((a, b) => a + b, 0);\r\n return metric === 'Revenue' ? `$${Math.round(sum).toLocaleString()}` : Math.round(sum).toLocaleString();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n const linearOptions = {\r\n ...baseOptions,\r\n chart: {\r\n ...baseOptions.chart,\r\n stacked: stacked\r\n },\r\n stroke: {\r\n curve: 'smooth',\r\n width: type === 'bar' ? 0 : 2\r\n },\r\n fill: {\r\n type: type === 'line' ? 'solid' : 'gradient',\r\n opacity: type === 'line' ? 0 : 1,\r\n gradient: type === 'line' ? undefined : {\r\n shadeIntensity: 1,\r\n opacityFrom: 0.8,\r\n opacityTo: 0.4,\r\n stops: [0, 100]\r\n }\r\n },\r\n xaxis: {\r\n type: 'category',\r\n categories: categories || [],\r\n axisBorder: { show: false },\r\n axisTicks: { show: false },\r\n tickAmount: 5,\r\n labels: {\r\n rotate: 0,\r\n rotateAlways: false,\r\n hideOverlappingLabels: true,\r\n style: { colors: '#A1A1A8', fontSize: '12px' },\r\n formatter: (val) => {\r\n return val;\r\n }\r\n }\r\n },\r\n yaxis: {\r\n show: true,\r\n labels: {\r\n style: { colors: '#A1A1A8', fontSize: '12px' },\r\n formatter: (value) => (metric?.toLowerCase() === 'revenue') ? `$${(value || 0).toLocaleString()}` : (value || 0)\r\n }\r\n },\r\n grid: {\r\n show: true,\r\n borderColor: '#f1f1f1',\r\n strokeDashArray: 4,\r\n position: 'back'\r\n },\r\n dataLabels: { enabled: false },\r\n legend: {\r\n show: showLegend && (stacked || (series && series.length > 1)),\r\n position: 'top',\r\n horizontalAlign: 'left'\r\n },\r\n plotOptions: {\r\n bar: {\r\n borderRadius: 4,\r\n columnWidth: '60%'\r\n }\r\n }\r\n };\r\n\r\n const chartOptions = isRadial ? radialOptions : linearOptions;\r\n\r\n // Ensure series is in the correct format for the chart type\r\n let chartSeries = [];\r\n if (isRadial) {\r\n // For donut/pie, series must be a simple array of numbers\r\n const processedData = Array.isArray(data) ? data.map(v => (typeof v === 'object' && v !== null) ? v.value : v) : [];\r\n chartSeries = processedData.length > 0 ? processedData : (series?.[0]?.data || []);\r\n } else {\r\n // For bar/line/area, series must be an array of objects [{ name: '', data: [] }]\r\n const processedData = Array.isArray(data) ? data.map(v => (typeof v === 'object' && v !== null) ? v.value : v) : [];\r\n chartSeries = Array.isArray(series) ? series : [\r\n {\r\n name: metric || \"Value\",\r\n data: processedData\r\n }\r\n ];\r\n }\r\n\r\n return (\r\n <ReactApexChart\r\n key={`${id}-${type}-${chartSeries.length}`}\r\n options={chartOptions}\r\n series={chartSeries}\r\n type={type}\r\n height={height}\r\n width=\"100%\"\r\n />\r\n );\r\n};\r\n\r\nexport default RevenueChart;\r\n","import React from 'react';\r\nimport { Button, Menu, MenuItem, Box } from '@mui/material';\r\nimport { MoreHoriz as MoreHorizIcon } from '@mui/icons-material';\r\n\r\nconst MetricSelector = ({ metric, onMetricChange, options = ['Revenue', 'Donations'], label = \"Metric\" }) => {\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n const open = Boolean(anchorEl);\r\n\r\n const handleClick = (event) => {\r\n setAnchorEl(event.currentTarget);\r\n };\r\n\r\n const handleClose = (value) => {\r\n if (typeof value === 'string') {\r\n onMetricChange(value);\r\n }\r\n setAnchorEl(null);\r\n };\r\n\r\n return (\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n <Button\r\n id=\"metric-button\"\r\n aria-controls={open ? 'metric-menu' : undefined}\r\n aria-haspopup=\"true\"\r\n aria-expanded={open ? 'true' : undefined}\r\n onClick={handleClick}\r\n variant=\"outlined\"\r\n sx={{ \r\n borderRadius: '8px', \r\n borderColor: '#E9E9EB', \r\n color: '#000', \r\n textTransform: 'none',\r\n fontWeight: 600,\r\n px: 2,\r\n height: '40px',\r\n '&:hover': {\r\n borderColor: 'primary.main',\r\n bgcolor: 'rgba(99, 99, 230, 0.04)'\r\n }\r\n }}\r\n >\r\n {label}: {metric}\r\n </Button>\r\n <Menu\r\n id=\"metric-menu\"\r\n anchorEl={anchorEl}\r\n open={open}\r\n onClose={() => handleClose()}\r\n MenuListProps={{\r\n 'aria-labelledby': 'metric-button',\r\n }}\r\n PaperProps={{\r\n sx: {\r\n borderRadius: '8px',\r\n mt: 1,\r\n boxShadow: '0 4px 12px rgba(0,0,0,0.1)',\r\n minWidth: '150px'\r\n }\r\n }}\r\n >\r\n {options.map((option) => (\r\n <MenuItem \r\n key={option} \r\n onClick={() => handleClose(option)} \r\n sx={{ fontWeight: metric === option ? 700 : 400 }}\r\n >\r\n {option}\r\n </MenuItem>\r\n ))}\r\n </Menu>\r\n </Box>\r\n );\r\n};\r\n\r\nexport default MetricSelector;\r\n","export const TREND_UP_COLOR = \"#22C55E\";\r\nexport const TREND_DOWN_COLOR = \"#EF4444\";\r\n\r\nexport function getTrendDirection(valueOrText) {\r\n const text = String(valueOrText ?? \"\").trim();\r\n if (text.includes(\"▼\")) return \"down\";\r\n if (text.includes(\"▲\")) return \"up\";\r\n\r\n const match = text.match(/-?\\d+(\\.\\d+)?/);\r\n if (!match) return \"neutral\";\r\n\r\n const n = Number(match[0]);\r\n if (n < 0) return \"down\";\r\n if (n > 0) return \"up\";\r\n return \"neutral\";\r\n}\r\n\r\nexport function getTrendColor(\r\n valueOrText,\r\n { up = TREND_UP_COLOR, down = TREND_DOWN_COLOR, neutral = up } = {}\r\n) {\r\n const direction = getTrendDirection(valueOrText);\r\n if (direction === \"down\") return down;\r\n if (direction === \"up\") return up;\r\n return neutral;\r\n}\r\n\r\nexport function getTrendArrow(valueOrText) {\r\n const direction = getTrendDirection(valueOrText);\r\n if (direction === \"down\") return \"▼\";\r\n if (direction === \"up\") return \"▲\";\r\n return \"\";\r\n}\r\n\r\nexport function formatNumber(num) {\r\n if (num >= 1_000_000_000) {\r\n return (num / 1_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"B\";\r\n }\r\n\r\n if (num >= 1_000_000) {\r\n return (num / 1_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"M\";\r\n }\r\n\r\n if (num >= 1_000) {\r\n return (num / 1_000).toFixed(1).replace(/\\.0$/, \"\") + \"K\";\r\n }\r\n\r\n return (num ?? 0).toString();\r\n}","import {\r\n Box,\r\n Card,\r\n CardContent,\r\n Grid,\r\n IconButton,\r\n Typography,\r\n} from \"@mui/material\";\r\nimport RevenueChart from \"../../RevenueChart\";\r\nimport { MoreHoriz as MoreHorizIcon } from \"@mui/icons-material\";\r\nimport MetricSelector from \"../../MetricSelector\";\r\nimport { getTrendArrow, getTrendColor } from \"../../../config/helper\";\r\n\r\nconst RenderChartCard = ({\r\n item,\r\n index,\r\n isPrimary = false,\r\n isPremium = false,\r\n metric,\r\n setMetric,\r\n md = 4,\r\n numberOfDays = 30,\r\n type = \"area\",\r\n sx = {},\r\n cardSx = {},\r\n contentSx = {},\r\n}) => {\r\n const daysLabel = `${numberOfDays} day${numberOfDays === 1 ? \"\" : \"s\"}`;\r\n const trendText = item.trend || \"18%\";\r\n const trendColor = getTrendColor(trendText, { up: \"#054835ff\", down: \"#EF4444\" });\r\n const trendArrow = getTrendArrow(trendText);\r\n const trendBadgeBg = trendColor === \"#EF4444\" ? \"#fee2e2\" : \"#8df3be9a\";\r\n\r\n return (\r\n <Grid\r\n item\r\n xs={12}\r\n md={md}\r\n key={item.label + index}\r\n sx={{ display: \"flex\", paddingTop: \"0px !important\", ...sx }}\r\n >\r\n <Card\r\n sx={{\r\n width: \"100%\",\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n boxShadow: \"0 4px 24px rgba(0,0,0,0.06)\",\r\n borderRadius: 4,\r\n border: \"1px solid #f0f0f0\",\r\n ...cardSx,\r\n }}\r\n >\r\n <CardContent\r\n sx={{\r\n p: item.exportMode ? 2 : 3,\r\n flexGrow: 1,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n ...contentSx,\r\n }}\r\n >\r\n <Box\r\n sx={{\r\n display: \"flex\",\r\n justifyContent: \"space-between\",\r\n alignItems: \"flex-start\",\r\n mb: item.exportMode ? 2 : isPremium ? 3 : 2,\r\n }}\r\n >\r\n {isPremium ? (\r\n <Box sx={{ textAlign: \"left\" }}>\r\n <Typography\r\n sx={{\r\n color: \"#000000\",\r\n fontWeight: 700,\r\n fontSize: \"18px\",\r\n mb: 0.2,\r\n }}\r\n >\r\n {item.label}\r\n </Typography>\r\n <Typography\r\n variant=\"caption\"\r\n sx={{\r\n color: \"rgba(0, 0, 0, 0.4)\",\r\n fontWeight: 400,\r\n display: \"block\",\r\n mb: 1.5,\r\n }}\r\n >\r\n {item.subtitle || `Last ${daysLabel} · daily aggregation`}\r\n </Typography>\r\n\r\n <Box sx={{ display: \"flex\", alignItems: \"center\", gap: 1.5 }}>\r\n {item.value && (\r\n <Typography\r\n sx={{ fontWeight: 700, color: \"#000000\", fontSize: \"28px\" }}\r\n >\r\n {typeof item.value === 'object' && item.value !== null\r\n ? (item.value.value !== undefined ? item.value.value : JSON.stringify(item.value))\r\n : item.value}\r\n </Typography>\r\n )}\r\n {(item.trend || \"18%\") && (\r\n <Box\r\n sx={{\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n gap: 0.5,\r\n bgcolor: trendBadgeBg,\r\n color: trendColor,\r\n px: 1,\r\n py: 0.5,\r\n borderRadius: \"100px\",\r\n fontSize: \"12px\",\r\n fontWeight: 600,\r\n }}\r\n >\r\n {trendArrow && <span>{trendArrow}</span>}\r\n {trendText === \"18%\" && !item.trend ? \"18% vs last month\" : trendText}\r\n </Box>\r\n )}\r\n </Box>\r\n </Box>\r\n ) : (\r\n <Box sx={{ textAlign: \"left\" }}>\r\n <Typography\r\n variant=\"subtitle2\"\r\n sx={{\r\n color: \"#000000\",\r\n fontWeight: 600,\r\n textTransform: \"uppercase\",\r\n letterSpacing: \"0.5px\",\r\n mb: 0.5,\r\n }}\r\n >\r\n {item.label}\r\n </Typography>\r\n {item.value && (\r\n <Typography\r\n variant=\"subtitle2\"\r\n sx={{ fontWeight: 600, color: \"#000000\", mb: 0.5 }}\r\n >\r\n {typeof item.value === 'object' && item.value !== null\r\n ? (item.value.value !== undefined ? item.value.value : JSON.stringify(item.value))\r\n : item.value}\r\n </Typography>\r\n )}\r\n {item.subValue && (\r\n <Typography\r\n variant=\"subtitle2\"\r\n sx={{ color: \"#000000\", fontWeight: 600 }}\r\n >\r\n {typeof item.subValue === 'object' && item.subValue !== null\r\n ? JSON.stringify(item.subValue)\r\n : item.subValue}\r\n </Typography>\r\n )}\r\n </Box>\r\n )}\r\n\r\n <Box sx={{ display: \"flex\", gap: 1, alignItems: \"center\" }}>\r\n {item.hideControls ? (\r\n item.series && (\r\n <Box\r\n sx={{\r\n display: item.exportMode ? \"flex\" : { xs: \"none\", sm: \"flex\" },\r\n gap: 2,\r\n alignItems: \"center\",\r\n }}\r\n >\r\n {[\r\n { label: \"Paid Ads\", color: \"#6366F1\" },\r\n { label: \"Organic\", color: \"#10B981\" },\r\n { label: \"Email\", color: \"#06B6D4\" },\r\n ].map((leg) => (\r\n <Box\r\n key={leg.label}\r\n sx={{ display: \"flex\", alignItems: \"center\", gap: 0.5 }}\r\n >\r\n <Box\r\n sx={{\r\n width: 8,\r\n height: 8,\r\n borderRadius: \"50%\",\r\n bgcolor: leg.color,\r\n }}\r\n />\r\n <Typography\r\n sx={{\r\n fontSize: \"12px\",\r\n color: \"rgba(0,0,0,0.6)\",\r\n fontWeight: 500,\r\n }}\r\n >\r\n {leg.label}\r\n </Typography>\r\n </Box>\r\n ))}\r\n </Box>\r\n )\r\n) : (\r\n <>\r\n {item.showSelector && (\r\n <MetricSelector\r\n metric={metric}\r\n onMetricChange={setMetric}\r\n options={[\"Revenue\", \"Donations\"]}\r\n />\r\n )}\r\n <IconButton\r\n sx={{\r\n border: \"1px solid #E9E9EB\",\r\n borderRadius: \"8px\",\r\n color: \"#000\",\r\n height: \"40px\",\r\n width: \"40px\",\r\n \"&:hover\": {\r\n borderColor: \"primary.main\",\r\n bgcolor: \"rgba(99, 99, 230, 0.04)\",\r\n },\r\n }}\r\n >\r\n <MoreHorizIcon sx={{ fontSize: \"1.2rem\" }} />\r\n </IconButton>\r\n </>\r\n )}\r\n </Box>\r\n </Box>\r\n\r\n <Box sx={{ flexGrow: 1, minHeight: isPrimary ? \"250px\" : \"200px\" }}>\r\n <RevenueChart\r\n id={`${item.label}-${index}`}\r\n metric={\r\n item.label.includes(\"Rate\") ||\r\n item.label.includes(\"Performance\") ||\r\n item.label.includes(\"source\") ||\r\n item.label === \"URL\"\r\n ? \"Percent\"\r\n : item.stacked\r\n ? item.label.includes(\"Traffic\")\r\n ? \"Visitors\"\r\n : \"Donors\"\r\n : metric\r\n }\r\n data={item.data}\r\n series={item.series}\r\n categories={item.categories}\r\n height={item.height || (isPrimary ? 250 : 200)}\r\n stacked={item.stacked}\r\n type={type || item.type || \"area\"}\r\n colors={item.colors}\r\n showLegend={!item.hideControls}\r\n />\r\n {item.hideControls && item.series && (\r\n <Box\r\n sx={{\r\n display: { xs: \"flex\", sm: \"none\" },\r\n justifyContent: \"center\",\r\n gap: 2,\r\n flexWrap: \"wrap\",\r\n mt: 1.5,\r\n }}\r\n >\r\n {[\r\n { label: \"Paid Ads\", color: \"#6366F1\" },\r\n { label: \"Organic\", color: \"#10B981\" },\r\n { label: \"Email\", color: \"#06B6D4\" },\r\n ].map((leg) => (\r\n <Box\r\n key={leg.label}\r\n sx={{\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n gap: 0.5,\r\n }}\r\n >\r\n <Box\r\n sx={{\r\n width: 8,\r\n height: 8,\r\n borderRadius: \"50%\",\r\n bgcolor: leg.color,\r\n }}\r\n />\r\n <Typography\r\n sx={{\r\n fontSize: \"11px\",\r\n color: \"rgba(0,0,0,0.6)\",\r\n fontWeight: 500,\r\n marginTop: {xs: \"1px\", sm: 0}\r\n }}\r\n >\r\n {leg.label}\r\n </Typography>\r\n </Box>\r\n ))}\r\n </Box>\r\n )}\r\n </Box>\r\n\r\n {item.footer && (\r\n <Box\r\n sx={{\r\n display: \"flex\",\r\n justifyContent: \"space-between\",\r\n mt: 2,\r\n pt: 2,\r\n borderTop: \"1px solid #f0f0f0\",\r\n }}\r\n >\r\n <Typography\r\n variant=\"caption\"\r\n sx={{ color: \"#606062\", fontWeight: 600 }}\r\n >\r\n {item.footer.left}\r\n </Typography>\r\n <Typography\r\n variant=\"caption\"\r\n sx={{ color: \"#606062\", fontWeight: 600 }}\r\n >\r\n {item.footer.right}\r\n </Typography>\r\n </Box>\r\n )}\r\n </CardContent>\r\n </Card>\r\n </Grid>\r\n );\r\n};\r\n\r\nexport default RenderChartCard;\r\n"],"names":["RevenueChart","_ref","metric","data","series","categories","_ref$height","height","_ref$stacked","stacked","_ref$type","type","_ref$id","id","colors","_ref$showLegend","showLegend","theme","useTheme","isRadial","baseOptions","chart","toolbar","show","sparkline","enabled","animations","palette","primary","main","tooltip","y","formatter","value","toLowerCase","concat","toLocaleString","radialOptions","_objectSpread","labels","stroke","width","dataLabels","legend","position","horizontalAlign","plotOptions","pie","donut","size","total","label","w","sum","globals","seriesTotals","reduce","a","b","Math","round","linearOptions","curve","fill","opacity","gradient","undefined","shadeIntensity","opacityFrom","opacityTo","stops","xaxis","axisBorder","axisTicks","tickAmount","rotate","rotateAlways","hideOverlappingLabels","style","fontSize","val","yaxis","grid","borderColor","strokeDashArray","length","bar","borderRadius","columnWidth","chartOptions","chartSeries","_series$","processedData","Array","isArray","map","v","_typeof","name","_jsx","ReactApexChart","options","MetricSelector","onMetricChange","_ref$options","_ref$label","_React$useState","React","useState","_React$useState2","_slicedToArray","anchorEl","setAnchorEl","open","Boolean","handleClick","event","currentTarget","handleClose","_jsxs","Box","sx","display","gap","children","Button","onClick","variant","color","textTransform","fontWeight","px","bgcolor","Menu","onClose","MenuListProps","PaperProps","mt","boxShadow","minWidth","option","MenuItem","TREND_UP_COLOR","TREND_DOWN_COLOR","getTrendDirection","valueOrText","text","String","trim","includes","match","n","Number","getTrendColor","arguments","_ref$up","up","_ref$down","down","_ref$neutral","neutral","direction","getTrendArrow","RenderChartCard","item","index","_ref$isPrimary","isPrimary","_ref$isPremium","isPremium","setMetric","_ref$md","md","_ref$numberOfDays","numberOfDays","_ref$sx","_ref$cardSx","cardSx","_ref$contentSx","contentSx","daysLabel","trendText","trend","trendColor","trendArrow","trendBadgeBg","Grid","xs","paddingTop","Card","flexDirection","border","CardContent","p","exportMode","flexGrow","justifyContent","alignItems","mb","textAlign","Typography","subtitle","JSON","stringify","py","letterSpacing","subValue","hideControls","sm","leg","_Fragment","showSelector","IconButton","More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,EAAE;aAAM;AAAAN,YAAAA,QAAA,EAEzCwC,IAAI,CAACqD,MAAM,CAACI;AAAK,WACR,CAAC;AAAA,SACV,CACN;OACU;KACT;AAAC,GAAA,EAhSFzD,IAAI,CAACjH,KAAK,GAAGkH,KAiSd,CAAC;AAEX;;;;"}
|
|
@@ -365,6 +365,39 @@ var MetricSelector = function MetricSelector(_ref) {
|
|
|
365
365
|
});
|
|
366
366
|
};
|
|
367
367
|
|
|
368
|
+
var TREND_UP_COLOR = "#22C55E";
|
|
369
|
+
var TREND_DOWN_COLOR = "#EF4444";
|
|
370
|
+
function getTrendDirection(valueOrText) {
|
|
371
|
+
var text = String(valueOrText !== null && valueOrText !== void 0 ? valueOrText : "").trim();
|
|
372
|
+
if (text.includes("▼")) return "down";
|
|
373
|
+
if (text.includes("▲")) return "up";
|
|
374
|
+
var match = text.match(/-?\d+(\.\d+)?/);
|
|
375
|
+
if (!match) return "neutral";
|
|
376
|
+
var n = Number(match[0]);
|
|
377
|
+
if (n < 0) return "down";
|
|
378
|
+
if (n > 0) return "up";
|
|
379
|
+
return "neutral";
|
|
380
|
+
}
|
|
381
|
+
function getTrendColor(valueOrText) {
|
|
382
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
383
|
+
_ref$up = _ref.up,
|
|
384
|
+
up = _ref$up === void 0 ? TREND_UP_COLOR : _ref$up,
|
|
385
|
+
_ref$down = _ref.down,
|
|
386
|
+
down = _ref$down === void 0 ? TREND_DOWN_COLOR : _ref$down,
|
|
387
|
+
_ref$neutral = _ref.neutral,
|
|
388
|
+
neutral = _ref$neutral === void 0 ? up : _ref$neutral;
|
|
389
|
+
var direction = getTrendDirection(valueOrText);
|
|
390
|
+
if (direction === "down") return down;
|
|
391
|
+
if (direction === "up") return up;
|
|
392
|
+
return neutral;
|
|
393
|
+
}
|
|
394
|
+
function getTrendArrow(valueOrText) {
|
|
395
|
+
var direction = getTrendDirection(valueOrText);
|
|
396
|
+
if (direction === "down") return "▼";
|
|
397
|
+
if (direction === "up") return "▲";
|
|
398
|
+
return "";
|
|
399
|
+
}
|
|
400
|
+
|
|
368
401
|
var RenderChartCard = function RenderChartCard(_ref) {
|
|
369
402
|
var item = _ref.item,
|
|
370
403
|
index = _ref.index,
|
|
@@ -387,6 +420,13 @@ var RenderChartCard = function RenderChartCard(_ref) {
|
|
|
387
420
|
_ref$contentSx = _ref.contentSx,
|
|
388
421
|
contentSx = _ref$contentSx === void 0 ? {} : _ref$contentSx;
|
|
389
422
|
var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
|
|
423
|
+
var trendText = item.trend || "18%";
|
|
424
|
+
var trendColor = getTrendColor(trendText, {
|
|
425
|
+
up: "#054835ff",
|
|
426
|
+
down: "#EF4444"
|
|
427
|
+
});
|
|
428
|
+
var trendArrow = getTrendArrow(trendText);
|
|
429
|
+
var trendBadgeBg = trendColor === "#EF4444" ? "#fee2e2" : "#8df3be9a";
|
|
390
430
|
return /*#__PURE__*/jsx(Grid, {
|
|
391
431
|
item: true,
|
|
392
432
|
xs: 12,
|
|
@@ -457,17 +497,17 @@ var RenderChartCard = function RenderChartCard(_ref) {
|
|
|
457
497
|
display: "flex",
|
|
458
498
|
alignItems: "center",
|
|
459
499
|
gap: 0.5,
|
|
460
|
-
bgcolor:
|
|
461
|
-
color:
|
|
500
|
+
bgcolor: trendBadgeBg,
|
|
501
|
+
color: trendColor,
|
|
462
502
|
px: 1,
|
|
463
503
|
py: 0.5,
|
|
464
504
|
borderRadius: "100px",
|
|
465
505
|
fontSize: "12px",
|
|
466
506
|
fontWeight: 600
|
|
467
507
|
},
|
|
468
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
469
|
-
children:
|
|
470
|
-
}), item.trend
|
|
508
|
+
children: [trendArrow && /*#__PURE__*/jsx("span", {
|
|
509
|
+
children: trendArrow
|
|
510
|
+
}), trendText === "18%" && !item.trend ? "18% vs last month" : trendText]
|
|
471
511
|
})]
|
|
472
512
|
})]
|
|
473
513
|
}) : /*#__PURE__*/jsxs(Box, {
|