@popmenu/dashboard 0.40.0 → 0.40.3
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/build/components/KpiMetric/KpiMetric.d.ts +0 -2
- package/build/index.es.js +24 -5
- package/build/index.es.js.map +1 -1
- package/build/index.js +24 -5
- package/build/index.js.map +1 -1
- package/package.json +3 -3
package/build/index.js
CHANGED
|
@@ -807,9 +807,11 @@ var MoreLink = function (props) {
|
|
|
807
807
|
var useTileStyles = core.makeStyles(function (theme) { return ({
|
|
808
808
|
root: {
|
|
809
809
|
borderRadius: theme.spacing(1),
|
|
810
|
+
width: '100%',
|
|
810
811
|
},
|
|
811
812
|
content: {
|
|
812
813
|
padding: theme.spacing(3),
|
|
814
|
+
height: '100%',
|
|
813
815
|
},
|
|
814
816
|
}); });
|
|
815
817
|
|
|
@@ -869,6 +871,24 @@ function SvgTrendDown(props) {
|
|
|
869
871
|
}
|
|
870
872
|
|
|
871
873
|
var useKpiMetricStyles = core.makeStyles(function (theme) { return ({
|
|
874
|
+
iconContainer: {
|
|
875
|
+
fontSize: theme.spacing(3),
|
|
876
|
+
display: 'flex',
|
|
877
|
+
backgroundColor: theme.palette.grey[100],
|
|
878
|
+
color: theme.palette.secondary.light,
|
|
879
|
+
borderRadius: '50%',
|
|
880
|
+
padding: theme.spacing(2),
|
|
881
|
+
marginBottom: theme.spacing(2),
|
|
882
|
+
},
|
|
883
|
+
root: {
|
|
884
|
+
display: 'flex',
|
|
885
|
+
flexDirection: 'column',
|
|
886
|
+
alignItems: 'center',
|
|
887
|
+
height: '100%',
|
|
888
|
+
justifyContent: 'space-between',
|
|
889
|
+
textAlign: 'center',
|
|
890
|
+
fontSize: '0.75rem',
|
|
891
|
+
},
|
|
872
892
|
trendIcon: {
|
|
873
893
|
'&&': {
|
|
874
894
|
paddingInlineEnd: theme.spacing(1),
|
|
@@ -878,22 +898,21 @@ var useKpiMetricStyles = core.makeStyles(function (theme) { return ({
|
|
|
878
898
|
|
|
879
899
|
var defaultProps = {
|
|
880
900
|
trendStatus: 'natural',
|
|
881
|
-
trendMessage: 'data unavailable',
|
|
882
901
|
};
|
|
883
902
|
var KpiMetric = function (props) {
|
|
884
903
|
var KpiIcon = props.Icon, metric = props.metric, value = props.value, trend = props.trend, trendMessage = props.trendMessage, trendStatus = props.trendStatus;
|
|
885
904
|
var classes = useKpiMetricStyles(props);
|
|
886
905
|
var trendColors = trendStatus === 'natural' ? ['success', 'warning'] : ['warning', 'success'];
|
|
887
906
|
var trendColorMap = { up: 0, down: 1, level: 1 };
|
|
888
|
-
return (React__default['default'].createElement(core.Box, {
|
|
889
|
-
KpiIcon && (React__default['default'].createElement(core.Box, {
|
|
907
|
+
return (React__default['default'].createElement(core.Box, { className: classes.root },
|
|
908
|
+
KpiIcon && (React__default['default'].createElement(core.Box, { className: classes.iconContainer },
|
|
890
909
|
React__default['default'].createElement(Icon, { icon: KpiIcon, size: "inherit" }))),
|
|
891
910
|
React__default['default'].createElement(Typography, { color: "secondary.light", variant: "body2" }, metric),
|
|
892
911
|
React__default['default'].createElement(Typography, { color: "secondary", variant: "h4" }, value ? value : '-'),
|
|
893
|
-
React__default['default'].createElement(Typography, { style: { fontSize: 'inherit' }, variant: "body2", color: trend ? trendColors[trendColorMap[trend]] : 'grey.500' },
|
|
912
|
+
trendMessage && (React__default['default'].createElement(Typography, { style: { fontSize: 'inherit' }, variant: "body2", color: trend ? trendColors[trendColorMap[trend]] : 'grey.500' },
|
|
894
913
|
trend === 'up' && React__default['default'].createElement(Icon, { className: classes.trendIcon, icon: SvgTrend, size: "inherit" }),
|
|
895
914
|
trend === 'down' && React__default['default'].createElement(Icon, { className: classes.trendIcon, icon: SvgTrendDown, size: "inherit" }),
|
|
896
|
-
trendMessage)));
|
|
915
|
+
trendMessage))));
|
|
897
916
|
};
|
|
898
917
|
KpiMetric.defaultProps = defaultProps;
|
|
899
918
|
|