@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
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
import { KpiMetricProps } from './KpiMetricProps';
|
|
3
3
|
declare const defaultProps: {
|
|
4
4
|
trendStatus: string;
|
|
5
|
-
trendMessage: string;
|
|
6
5
|
};
|
|
7
6
|
export declare const KpiMetric: {
|
|
8
7
|
(props: KpiMetricProps & typeof defaultProps): JSX.Element;
|
|
9
8
|
defaultProps: {
|
|
10
9
|
trendStatus: string;
|
|
11
|
-
trendMessage: string;
|
|
12
10
|
};
|
|
13
11
|
};
|
|
14
12
|
export {};
|
package/build/index.es.js
CHANGED
|
@@ -762,9 +762,11 @@ var MoreLink = function (props) {
|
|
|
762
762
|
var useTileStyles = makeStyles(function (theme) { return ({
|
|
763
763
|
root: {
|
|
764
764
|
borderRadius: theme.spacing(1),
|
|
765
|
+
width: '100%',
|
|
765
766
|
},
|
|
766
767
|
content: {
|
|
767
768
|
padding: theme.spacing(3),
|
|
769
|
+
height: '100%',
|
|
768
770
|
},
|
|
769
771
|
}); });
|
|
770
772
|
|
|
@@ -824,6 +826,24 @@ function SvgTrendDown(props) {
|
|
|
824
826
|
}
|
|
825
827
|
|
|
826
828
|
var useKpiMetricStyles = makeStyles(function (theme) { return ({
|
|
829
|
+
iconContainer: {
|
|
830
|
+
fontSize: theme.spacing(3),
|
|
831
|
+
display: 'flex',
|
|
832
|
+
backgroundColor: theme.palette.grey[100],
|
|
833
|
+
color: theme.palette.secondary.light,
|
|
834
|
+
borderRadius: '50%',
|
|
835
|
+
padding: theme.spacing(2),
|
|
836
|
+
marginBottom: theme.spacing(2),
|
|
837
|
+
},
|
|
838
|
+
root: {
|
|
839
|
+
display: 'flex',
|
|
840
|
+
flexDirection: 'column',
|
|
841
|
+
alignItems: 'center',
|
|
842
|
+
height: '100%',
|
|
843
|
+
justifyContent: 'space-between',
|
|
844
|
+
textAlign: 'center',
|
|
845
|
+
fontSize: '0.75rem',
|
|
846
|
+
},
|
|
827
847
|
trendIcon: {
|
|
828
848
|
'&&': {
|
|
829
849
|
paddingInlineEnd: theme.spacing(1),
|
|
@@ -833,22 +853,21 @@ var useKpiMetricStyles = makeStyles(function (theme) { return ({
|
|
|
833
853
|
|
|
834
854
|
var defaultProps = {
|
|
835
855
|
trendStatus: 'natural',
|
|
836
|
-
trendMessage: 'data unavailable',
|
|
837
856
|
};
|
|
838
857
|
var KpiMetric = function (props) {
|
|
839
858
|
var KpiIcon = props.Icon, metric = props.metric, value = props.value, trend = props.trend, trendMessage = props.trendMessage, trendStatus = props.trendStatus;
|
|
840
859
|
var classes = useKpiMetricStyles(props);
|
|
841
860
|
var trendColors = trendStatus === 'natural' ? ['success', 'warning'] : ['warning', 'success'];
|
|
842
861
|
var trendColorMap = { up: 0, down: 1, level: 1 };
|
|
843
|
-
return (React__default.createElement(Box, {
|
|
844
|
-
KpiIcon && (React__default.createElement(Box, {
|
|
862
|
+
return (React__default.createElement(Box, { className: classes.root },
|
|
863
|
+
KpiIcon && (React__default.createElement(Box, { className: classes.iconContainer },
|
|
845
864
|
React__default.createElement(Icon, { icon: KpiIcon, size: "inherit" }))),
|
|
846
865
|
React__default.createElement(Typography, { color: "secondary.light", variant: "body2" }, metric),
|
|
847
866
|
React__default.createElement(Typography, { color: "secondary", variant: "h4" }, value ? value : '-'),
|
|
848
|
-
React__default.createElement(Typography, { style: { fontSize: 'inherit' }, variant: "body2", color: trend ? trendColors[trendColorMap[trend]] : 'grey.500' },
|
|
867
|
+
trendMessage && (React__default.createElement(Typography, { style: { fontSize: 'inherit' }, variant: "body2", color: trend ? trendColors[trendColorMap[trend]] : 'grey.500' },
|
|
849
868
|
trend === 'up' && React__default.createElement(Icon, { className: classes.trendIcon, icon: SvgTrend, size: "inherit" }),
|
|
850
869
|
trend === 'down' && React__default.createElement(Icon, { className: classes.trendIcon, icon: SvgTrendDown, size: "inherit" }),
|
|
851
|
-
trendMessage)));
|
|
870
|
+
trendMessage))));
|
|
852
871
|
};
|
|
853
872
|
KpiMetric.defaultProps = defaultProps;
|
|
854
873
|
|