@popmenu/dashboard 0.126.0 → 0.126.2

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.
Files changed (79) hide show
  1. package/build/{components → cjs/components}/ClickableTile/ClickableTile.d.ts +8 -8
  2. package/build/{components → cjs/components}/ClickableTile/ClickableTileProps.d.ts +8 -8
  3. package/build/{components → cjs/components}/ClickableTile/ClickableTileStyles.d.ts +1 -1
  4. package/build/{components → cjs/components}/DashboardContainer/DashboardContainer.d.ts +3 -3
  5. package/build/{components → cjs/components}/DashboardContainer/index.d.ts +1 -1
  6. package/build/{components → cjs/components}/KpiMetric/KpiMetric.d.ts +12 -12
  7. package/build/{components → cjs/components}/KpiMetric/KpiMetricProps.d.ts +15 -15
  8. package/build/{components → cjs/components}/KpiMetric/KpiMetricStyles.d.ts +2 -2
  9. package/build/{components → cjs/components}/KpiMetric/index.d.ts +2 -2
  10. package/build/{components → cjs/components}/KpiMetricTile/KpiMetricTile.d.ts +3 -3
  11. package/build/{components → cjs/components}/KpiMetricTile/KpiMetricTileProps.d.ts +6 -6
  12. package/build/{components → cjs/components}/KpiMetricTile/index.d.ts +2 -2
  13. package/build/{components → cjs/components}/Leaderboard/Leaderboard.d.ts +3 -3
  14. package/build/{components → cjs/components}/Leaderboard/LeaderboardProps.d.ts +56 -56
  15. package/build/{components → cjs/components}/Leaderboard/LeaderboardStyles.d.ts +5 -5
  16. package/build/{components → cjs/components}/Leaderboard/index.d.ts +2 -2
  17. package/build/{components → cjs/components}/LeaderboardTile/LeaderboardTile.d.ts +3 -3
  18. package/build/{components → cjs/components}/LeaderboardTile/LeaderboardTileProps.d.ts +5 -5
  19. package/build/{components → cjs/components}/LeaderboardTile/index.d.ts +2 -2
  20. package/build/{components → cjs/components}/Tile/Tile.d.ts +3 -3
  21. package/build/{components → cjs/components}/Tile/TileProps.d.ts +8 -8
  22. package/build/{components → cjs/components}/Tile/TileStyles.d.ts +1 -1
  23. package/build/{components → cjs/components}/Tile/index.d.ts +2 -2
  24. package/build/{components → cjs/components}/index.d.ts +5 -5
  25. package/build/{index.d.ts → cjs/index.d.ts} +1 -1
  26. package/build/cjs/index.js +224 -0
  27. package/build/cjs/index.js.map +1 -0
  28. package/build/esm/components/ClickableTile/ClickableTile.d.ts +8 -0
  29. package/build/esm/components/ClickableTile/ClickableTile.js +18 -0
  30. package/build/esm/components/ClickableTile/ClickableTile.js.map +1 -0
  31. package/build/esm/components/ClickableTile/ClickableTileProps.d.ts +8 -0
  32. package/build/esm/components/ClickableTile/ClickableTileStyles.d.ts +1 -0
  33. package/build/esm/components/ClickableTile/ClickableTileStyles.js +16 -0
  34. package/build/esm/components/ClickableTile/ClickableTileStyles.js.map +1 -0
  35. package/build/esm/components/DashboardContainer/DashboardContainer.d.ts +3 -0
  36. package/build/esm/components/DashboardContainer/index.d.ts +1 -0
  37. package/build/esm/components/KpiMetric/KpiMetric.d.ts +12 -0
  38. package/build/esm/components/KpiMetric/KpiMetric.js +28 -0
  39. package/build/esm/components/KpiMetric/KpiMetric.js.map +1 -0
  40. package/build/esm/components/KpiMetric/KpiMetricProps.d.ts +15 -0
  41. package/build/esm/components/KpiMetric/KpiMetricStyles.d.ts +2 -0
  42. package/build/esm/components/KpiMetric/KpiMetricStyles.js +30 -0
  43. package/build/esm/components/KpiMetric/KpiMetricStyles.js.map +1 -0
  44. package/build/esm/components/KpiMetric/index.d.ts +2 -0
  45. package/build/esm/components/KpiMetricTile/KpiMetricTile.d.ts +3 -0
  46. package/build/esm/components/KpiMetricTile/KpiMetricTile.js +15 -0
  47. package/build/esm/components/KpiMetricTile/KpiMetricTile.js.map +1 -0
  48. package/build/esm/components/KpiMetricTile/KpiMetricTileProps.d.ts +6 -0
  49. package/build/esm/components/KpiMetricTile/index.d.ts +2 -0
  50. package/build/esm/components/Leaderboard/Leaderboard.d.ts +3 -0
  51. package/build/esm/components/Leaderboard/Leaderboard.js +78 -0
  52. package/build/esm/components/Leaderboard/Leaderboard.js.map +1 -0
  53. package/build/esm/components/Leaderboard/LeaderboardProps.d.ts +56 -0
  54. package/build/esm/components/Leaderboard/LeaderboardStyles.d.ts +5 -0
  55. package/build/esm/components/Leaderboard/LeaderboardStyles.js +44 -0
  56. package/build/esm/components/Leaderboard/LeaderboardStyles.js.map +1 -0
  57. package/build/esm/components/Leaderboard/index.d.ts +2 -0
  58. package/build/esm/components/LeaderboardTile/LeaderboardTile.d.ts +3 -0
  59. package/build/esm/components/LeaderboardTile/LeaderboardTile.js +13 -0
  60. package/build/esm/components/LeaderboardTile/LeaderboardTile.js.map +1 -0
  61. package/build/esm/components/LeaderboardTile/LeaderboardTileProps.d.ts +5 -0
  62. package/build/esm/components/LeaderboardTile/index.d.ts +2 -0
  63. package/build/esm/components/Tile/Tile.d.ts +3 -0
  64. package/build/esm/components/Tile/Tile.js +14 -0
  65. package/build/esm/components/Tile/Tile.js.map +1 -0
  66. package/build/esm/components/Tile/TileProps.d.ts +8 -0
  67. package/build/esm/components/Tile/TileStyles.d.ts +1 -0
  68. package/build/esm/components/Tile/TileStyles.js +15 -0
  69. package/build/esm/components/Tile/TileStyles.js.map +1 -0
  70. package/build/esm/components/Tile/index.d.ts +2 -0
  71. package/build/esm/components/index.d.ts +5 -0
  72. package/build/esm/index.d.ts +1 -0
  73. package/build/esm/index.js +6 -0
  74. package/build/esm/index.js.map +1 -0
  75. package/package.json +8 -5
  76. package/build/index.es.js +0 -1138
  77. package/build/index.es.js.map +0 -1
  78. package/build/index.js +0 -1185
  79. package/build/index.js.map +0 -1
@@ -0,0 +1,18 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import { Card, CardActionArea, CardContent } from '@material-ui/core';
4
+ import { useClickableTileStyles } from './ClickableTileStyles.js';
5
+
6
+ var ClickableTile = function (props) {
7
+ var children = props.children, CardContentProps = props.CardContentProps, link = props.link, restProps = __rest(props, ["children", "CardContentProps", "link"]);
8
+ var classes = useClickableTileStyles(props);
9
+ return (React.createElement(Card, __assign({ classes: { root: classes.root } }, restProps),
10
+ React.createElement(CardActionArea, { component: link ? 'a' : 'div' },
11
+ React.createElement(CardContent, __assign({ classes: { root: classes.content } }, CardContentProps), children))));
12
+ };
13
+ ClickableTile.defaultProps = {
14
+ link: false,
15
+ };
16
+
17
+ export { ClickableTile };
18
+ //# sourceMappingURL=ClickableTile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClickableTile.js","sources":["../../../../src/components/ClickableTile/ClickableTile.tsx"],"sourcesContent":["import React from 'react'\nimport { Card, CardActionArea, CardContent } from '@material-ui/core'\nimport { ClickableTileProps } from './ClickableTileProps'\nimport { useClickableTileStyles } from './ClickableTileStyles'\n\nexport const ClickableTile = (props: ClickableTileProps) => {\n const { children, CardContentProps, link, ...restProps } = props\n const classes = useClickableTileStyles(props)\n\n return (\n <Card classes={{ root: classes.root }} {...restProps}>\n <CardActionArea component={link ? 'a' : 'div'}>\n <CardContent classes={{ root: classes.content }} {...CardContentProps}>\n {children}\n </CardContent>\n </CardActionArea>\n </Card>\n )\n}\n\nClickableTile.defaultProps = {\n link: false,\n}\n"],"names":[],"mappings":";;;;;AAKO,IAAM,aAAa,GAAG,UAAC,KAAyB,EAAA;IAC7C,IAAA,QAAQ,GAA2C,KAAK,CAAA,QAAhD,EAAE,gBAAgB,GAAyB,KAAK,CAA9B,gBAAA,EAAE,IAAI,GAAmB,KAAK,KAAxB,EAAK,SAAS,UAAK,KAAK,EAA1D,CAAkD,UAAA,EAAA,kBAAA,EAAA,MAAA,CAAA,CAAF;AACtD,IAAA,IAAM,OAAO,GAAG,sBAAsB,CAAC,KAAK,CAAC;AAE7C,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,QAAA,CAAA,EAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAM,SAAS,CAAA;AAClD,QAAA,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,KAAK,EAAA;AAC3C,YAAA,KAAA,CAAA,aAAA,CAAC,WAAW,EAAC,QAAA,CAAA,EAAA,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,EAAA,EAAM,gBAAgB,CAClE,EAAA,QAAQ,CACG,CACC,CACZ;AAEX;AAEA,aAAa,CAAC,YAAY,GAAG;AAC3B,IAAA,IAAI,EAAE,KAAK;CACZ;;;;"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { TileProps } from '../Tile';
3
+ export interface ClickableTileProps extends TileProps {
4
+ /** transforms the root DOM node an anchor element when true */
5
+ link: boolean;
6
+ /** callback invoked for a click event */
7
+ onClick: (event: React.MouseEvent<HTMLDivElement | HTMLAnchorElement>) => void;
8
+ }
@@ -0,0 +1 @@
1
+ export declare const useClickableTileStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"root" | "content">;
@@ -0,0 +1,16 @@
1
+ import { makeStyles } from '@material-ui/core';
2
+
3
+ var useClickableTileStyles = makeStyles(function (theme) { return ({
4
+ root: {
5
+ textDecoration: 'none',
6
+ borderRadius: theme.spacing(1),
7
+ width: '100%',
8
+ },
9
+ content: {
10
+ padding: theme.spacing(3),
11
+ height: '100%',
12
+ },
13
+ }); });
14
+
15
+ export { useClickableTileStyles };
16
+ //# sourceMappingURL=ClickableTileStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClickableTileStyles.js","sources":["../../../../src/components/ClickableTile/ClickableTileStyles.ts"],"sourcesContent":["import { makeStyles } from '@material-ui/core'\n\nexport const useClickableTileStyles = makeStyles((theme) => ({\n root: {\n textDecoration: 'none',\n borderRadius: theme.spacing(1),\n width: '100%',\n },\n content: {\n padding: theme.spacing(3),\n height: '100%',\n },\n}))\n"],"names":[],"mappings":";;AAEa,IAAA,sBAAsB,GAAG,UAAU,CAAC,UAAC,KAAK,EAAK,EAAA,QAAC;AAC3D,IAAA,IAAI,EAAE;AACJ,QAAA,cAAc,EAAE,MAAM;AACtB,QAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9B,QAAA,KAAK,EAAE,MAAM;AACd,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACzB,QAAA,MAAM,EAAE,MAAM;AACf,KAAA;CACF,EAAC,EAAA;;;;"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { BoxProps as DashboardContainerProps } from '@popmenu/common-ui';
3
+ export declare const DashboardContainer: (props: DashboardContainerProps) => JSX.Element;
@@ -0,0 +1 @@
1
+ export { DashboardContainer } from './DashboardContainer';
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { KpiMetricProps } from './KpiMetricProps';
3
+ declare const defaultProps: {
4
+ trendStatus: string;
5
+ };
6
+ export declare const KpiMetric: {
7
+ (props: KpiMetricProps & typeof defaultProps): JSX.Element;
8
+ defaultProps: {
9
+ trendStatus: string;
10
+ };
11
+ };
12
+ export {};
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { Box, Icon, Typography } from '@popmenu/common-ui';
3
+ import { Trend, TrendDown, GitCommit } from '@popmenu/web-icons';
4
+ import { useKpiMetricStyles } from './KpiMetricStyles.js';
5
+
6
+ var defaultProps = {
7
+ trendStatus: 'natural',
8
+ };
9
+ var KpiMetric = function (props) {
10
+ var KpiIcon = props.Icon, metric = props.metric, value = props.value, trend = props.trend, trendMessage = props.trendMessage, trendStatus = props.trendStatus;
11
+ var classes = useKpiMetricStyles(props);
12
+ var trendColors = trendStatus === 'natural' ? ['success', 'warning', 'grey.500'] : ['warning', 'success', 'grey.500'];
13
+ var trendColorMap = { up: 0, down: 1, level: 2 };
14
+ return (React.createElement(Box, { className: classes.root },
15
+ KpiIcon && (React.createElement(Box, { className: classes.iconContainer },
16
+ React.createElement(Icon, { icon: KpiIcon, size: "inherit" }))),
17
+ React.createElement(Typography, { color: "secondary.light", variant: "body2" }, metric),
18
+ React.createElement(Typography, { color: "secondary", variant: "h4" }, value ? value : '-'),
19
+ trendMessage && (React.createElement(Typography, { style: { fontSize: 'inherit' }, variant: "body2", color: trend ? trendColors[trendColorMap[trend]] : 'grey.500' },
20
+ trend === 'up' && React.createElement(Icon, { className: classes.trendIcon, icon: Trend, size: "inherit" }),
21
+ trend === 'down' && React.createElement(Icon, { className: classes.trendIcon, icon: TrendDown, size: "inherit" }),
22
+ trend === 'level' && React.createElement(Icon, { className: classes.trendIcon, icon: GitCommit, size: "inherit" }),
23
+ trendMessage))));
24
+ };
25
+ KpiMetric.defaultProps = defaultProps;
26
+
27
+ export { KpiMetric };
28
+ //# sourceMappingURL=KpiMetric.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KpiMetric.js","sources":["../../../../src/components/KpiMetric/KpiMetric.tsx"],"sourcesContent":["import React from 'react'\nimport { Box, Icon, ThemeColors, Typography } from '@popmenu/common-ui'\nimport { GitCommit, Trend, TrendDown } from '@popmenu/web-icons'\nimport { KpiMetricProps } from './KpiMetricProps'\nimport { useKpiMetricStyles } from './KpiMetricStyles'\n\nconst defaultProps = {\n trendStatus: 'natural',\n}\n\nexport const KpiMetric = (props: KpiMetricProps & typeof defaultProps) => {\n const { Icon: KpiIcon, metric, value, trend, trendMessage, trendStatus } = props\n const classes = useKpiMetricStyles(props)\n const trendColors: Array<ThemeColors> =\n trendStatus === 'natural' ? ['success', 'warning', 'grey.500'] : ['warning', 'success', 'grey.500']\n const trendColorMap = { up: 0, down: 1, level: 2 }\n return (\n <Box className={classes.root}>\n {KpiIcon && (\n <Box className={classes.iconContainer}>\n <Icon icon={KpiIcon} size=\"inherit\" />\n </Box>\n )}\n <Typography color=\"secondary.light\" variant=\"body2\">\n {metric}\n </Typography>\n <Typography color=\"secondary\" variant=\"h4\">\n {value ? value : '-'}\n </Typography>\n {trendMessage && (\n <Typography\n style={{ fontSize: 'inherit' }}\n variant=\"body2\"\n color={trend ? trendColors[trendColorMap[trend]] : 'grey.500'}\n >\n {trend === 'up' && <Icon className={classes.trendIcon} icon={Trend} size=\"inherit\" />}\n {trend === 'down' && <Icon className={classes.trendIcon} icon={TrendDown} size=\"inherit\" />}\n {trend === 'level' && <Icon className={classes.trendIcon} icon={GitCommit} size=\"inherit\" />}\n {trendMessage}\n </Typography>\n )}\n </Box>\n )\n}\n\nKpiMetric.defaultProps = defaultProps\n"],"names":[],"mappings":";;;;;AAMA,IAAM,YAAY,GAAG;AACnB,IAAA,WAAW,EAAE,SAAS;CACvB;AAEM,IAAM,SAAS,GAAG,UAAC,KAA2C,EAAA;AAC3D,IAAA,IAAM,OAAO,GAAsD,KAAK,CAAA,IAA3D,EAAE,MAAM,GAA8C,KAAK,CAAnD,MAAA,EAAE,KAAK,GAAuC,KAAK,CAAA,KAA5C,EAAE,KAAK,GAAgC,KAAK,CAArC,KAAA,EAAE,YAAY,GAAkB,KAAK,CAAA,YAAvB,EAAE,WAAW,GAAK,KAAK,YAAV;AACtE,IAAA,IAAM,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC;IACzC,IAAM,WAAW,GACf,WAAW,KAAK,SAAS,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC;AACrG,IAAA,IAAM,aAAa,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;IAClD,QACE,oBAAC,GAAG,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,IAAI,EAAA;QACzB,OAAO,KACN,KAAC,CAAA,aAAA,CAAA,GAAG,IAAC,SAAS,EAAE,OAAO,CAAC,aAAa,EAAA;YACnC,KAAC,CAAA,aAAA,CAAA,IAAI,EAAC,EAAA,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,SAAS,EAAG,CAAA,CAClC,CACP;QACD,KAAC,CAAA,aAAA,CAAA,UAAU,EAAC,EAAA,KAAK,EAAC,iBAAiB,EAAC,OAAO,EAAC,OAAO,EAChD,EAAA,MAAM,CACI;AACb,QAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAC,EAAA,KAAK,EAAC,WAAW,EAAC,OAAO,EAAC,IAAI,IACvC,KAAK,GAAG,KAAK,GAAG,GAAG,CACT;AACZ,QAAA,YAAY,KACX,KAAC,CAAA,aAAA,CAAA,UAAU,IACT,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,EAC9B,OAAO,EAAC,OAAO,EACf,KAAK,EAAE,KAAK,GAAG,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,EAAA;AAE5D,YAAA,KAAK,KAAK,IAAI,IAAI,oBAAC,IAAI,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,SAAS,EAAG,CAAA;AACpF,YAAA,KAAK,KAAK,MAAM,IAAI,oBAAC,IAAI,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAC,SAAS,EAAG,CAAA;AAC1F,YAAA,KAAK,KAAK,OAAO,IAAI,oBAAC,IAAI,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAC,SAAS,EAAG,CAAA;AAC3F,YAAA,YAAY,CACF,CACd,CACG;AAEV;AAEA,SAAS,CAAC,YAAY,GAAG,YAAY;;;;"}
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ export interface KpiMetricProps {
3
+ /** The icon from @popmenu/web-icons to be rendered */
4
+ Icon?: string | React.FC<React.SVGProps<SVGSVGElement>>;
5
+ /** A KPI metric name */
6
+ metric: string;
7
+ /** A KPI metric measurement */
8
+ value: string | undefined;
9
+ /** A KPI metric trend direction */
10
+ trend: 'up' | 'down' | 'level' | undefined;
11
+ /** A KPI metric trend description */
12
+ trendMessage: string | undefined;
13
+ /** Determines if the trend direction is diplayed as success or warning. When "natural", a trend of "up" is successful*/
14
+ trendStatus: 'natural' | 'inverted' | undefined;
15
+ }
@@ -0,0 +1,2 @@
1
+ import { KpiMetricProps } from './KpiMetricProps';
2
+ export declare const useKpiMetricStyles: (props: KpiMetricProps) => import("@material-ui/styles").ClassNameMap<string>;
@@ -0,0 +1,30 @@
1
+ import { makeStyles } from '@material-ui/core';
2
+
3
+ var useKpiMetricStyles = makeStyles(function (theme) { return ({
4
+ iconContainer: {
5
+ fontSize: theme.spacing(3),
6
+ display: 'flex',
7
+ backgroundColor: theme.palette.grey[100],
8
+ color: theme.palette.secondary.light,
9
+ borderRadius: '50%',
10
+ padding: theme.spacing(2),
11
+ marginBottom: theme.spacing(2),
12
+ },
13
+ root: {
14
+ display: 'flex',
15
+ flexDirection: 'column',
16
+ alignItems: 'center',
17
+ height: '100%',
18
+ justifyContent: 'space-between',
19
+ textAlign: 'center',
20
+ fontSize: '0.75rem',
21
+ },
22
+ trendIcon: {
23
+ '&&': {
24
+ paddingInlineEnd: theme.spacing(1),
25
+ },
26
+ },
27
+ }); });
28
+
29
+ export { useKpiMetricStyles };
30
+ //# sourceMappingURL=KpiMetricStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KpiMetricStyles.js","sources":["../../../../src/components/KpiMetric/KpiMetricStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { KpiMetricProps } from './KpiMetricProps'\n\nexport const useKpiMetricStyles = makeStyles<Theme, KpiMetricProps>((theme) => ({\n iconContainer: {\n fontSize: theme.spacing(3),\n display: 'flex',\n backgroundColor: theme.palette.grey[100],\n color: theme.palette.secondary.light,\n borderRadius: '50%',\n padding: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n root: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n height: '100%',\n justifyContent: 'space-between',\n textAlign: 'center',\n fontSize: '0.75rem',\n },\n trendIcon: {\n '&&': {\n paddingInlineEnd: theme.spacing(1),\n },\n },\n}))\n"],"names":[],"mappings":";;AAGa,IAAA,kBAAkB,GAAG,UAAU,CAAwB,UAAC,KAAK,EAAK,EAAA,QAAC;AAC9E,IAAA,aAAa,EAAE;AACb,QAAA,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC1B,QAAA,OAAO,EAAE,MAAM;QACf,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;AACxC,QAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK;AACpC,QAAA,YAAY,EAAE,KAAK;AACnB,QAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACzB,QAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/B,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,aAAa,EAAE,QAAQ;AACvB,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,MAAM,EAAE,MAAM;AACd,QAAA,cAAc,EAAE,eAAe;AAC/B,QAAA,SAAS,EAAE,QAAQ;AACnB,QAAA,QAAQ,EAAE,SAAS;AACpB,KAAA;AACD,IAAA,SAAS,EAAE;AACT,QAAA,IAAI,EAAE;AACJ,YAAA,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACnC,SAAA;AACF,KAAA;CACF,EAAC,EAAA;;;;"}
@@ -0,0 +1,2 @@
1
+ export { KpiMetric } from './KpiMetric';
2
+ export { KpiMetricProps } from './KpiMetricProps';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { KpiMetricTileProps } from './KpiMetricTileProps';
3
+ export declare const KpiMetricTile: (props: KpiMetricTileProps) => JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import { KpiMetric } from '../KpiMetric/KpiMetric.js';
4
+ import { ClickableTile } from '../ClickableTile/ClickableTile.js';
5
+ import { Tile } from '../Tile/Tile.js';
6
+
7
+ var KpiMetricTile = function (props) {
8
+ var TileProps = props.TileProps, restProps = __rest(props, ["TileProps"]);
9
+ var DynamicTile = typeof (TileProps === null || TileProps === void 0 ? void 0 : TileProps.onClick) === 'function' ? ClickableTile : Tile;
10
+ return (React.createElement(DynamicTile, __assign({}, TileProps),
11
+ React.createElement(KpiMetric, __assign({}, restProps))));
12
+ };
13
+
14
+ export { KpiMetricTile };
15
+ //# sourceMappingURL=KpiMetricTile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KpiMetricTile.js","sources":["../../../../src/components/KpiMetricTile/KpiMetricTile.tsx"],"sourcesContent":["import React from 'react'\nimport { KpiMetricTileProps } from './KpiMetricTileProps'\nimport { KpiMetric } from '../KpiMetric/KpiMetric'\nimport { ClickableTile } from '../ClickableTile/ClickableTile'\nimport { Tile } from '../Tile'\n\nexport const KpiMetricTile = (props: KpiMetricTileProps) => {\n const { TileProps, ...restProps } = props\n const DynamicTile = typeof TileProps?.onClick === 'function' ? ClickableTile : Tile\n\n return (\n <DynamicTile {...TileProps}>\n <KpiMetric {...restProps} />\n </DynamicTile>\n )\n}\n"],"names":[],"mappings":";;;;;;AAMO,IAAM,aAAa,GAAG,UAAC,KAAyB,EAAA;IAC7C,IAAA,SAAS,GAAmB,KAAK,CAAxB,SAAA,EAAK,SAAS,GAAA,MAAA,CAAK,KAAK,EAAnC,CAA2B,WAAA,CAAA,CAAF;IAC/B,IAAM,WAAW,GAAG,QAAO,SAAS,KAAT,IAAA,IAAA,SAAS,KAAT,MAAA,GAAA,MAAA,GAAA,SAAS,CAAE,OAAO,CAAA,KAAK,UAAU,GAAG,aAAa,GAAG,IAAI;AAEnF,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,WAAW,EAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAA;AACxB,QAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAK,QAAA,CAAA,EAAA,EAAA,SAAS,CAAI,CAAA,CAChB;AAElB;;;;"}
@@ -0,0 +1,6 @@
1
+ import { ClickableTileProps } from '../ClickableTile/ClickableTileProps';
2
+ import { KpiMetricProps } from '../KpiMetric/KpiMetricProps';
3
+ import { TileProps } from '../Tile';
4
+ export interface KpiMetricTileProps extends KpiMetricProps {
5
+ TileProps: TileProps | ClickableTileProps;
6
+ }
@@ -0,0 +1,2 @@
1
+ export { KpiMetricTile } from './KpiMetricTile';
2
+ export { KpiMetricTileProps } from './KpiMetricTileProps';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { LeaderboardProps } from './LeaderboardProps';
3
+ export declare const Leaderboard: (props: LeaderboardProps) => JSX.Element;
@@ -0,0 +1,78 @@
1
+ import { __assign } from 'tslib';
2
+ import React, { useState } from 'react';
3
+ import { Menu, MenuItem } from '@material-ui/core';
4
+ import { Box, Typography, List, Icon, ListItem, ListItemAvatar, Avatar, ListItemText } from '@popmenu/common-ui';
5
+ import { Link } from 'react-router-dom';
6
+ import { ChevronDown } from '@popmenu/web-icons';
7
+ import { useLeaderboardStyles, useLeaderboardFilterStyles, useLeaderboardListItemStyles, useMoreLinkStyles } from './LeaderboardStyles.js';
8
+
9
+ var Leaderboard = function (props) {
10
+ var data = props.data, EmptyState = props.EmptyState, filterProps = props.filterProps, title = props.title, moreLink = props.moreLink, subtitle = props.subtitle;
11
+ var classes = useLeaderboardStyles(props);
12
+ var isEmpty = data.length === 0;
13
+ var slicedData = data.slice(0, 5);
14
+ var isOverflow = data.length > 5;
15
+ var showMoreButton = !isEmpty && ((moreLink === null || moreLink === void 0 ? void 0 : moreLink.show) || isOverflow);
16
+ return (React.createElement(Box, { display: "flex", flexDirection: "column" },
17
+ React.createElement(Box, { alignItems: "left" },
18
+ React.createElement(Typography, { variant: "h5" }, title),
19
+ React.createElement(Typography, { className: classes.text }, subtitle),
20
+ filterProps && React.createElement(LeaderboardFilter, __assign({}, filterProps))),
21
+ !isEmpty ? (React.createElement(List, { classes: classes }, slicedData.map(function (itemProps, index) { return (React.createElement(LeaderboardListItem, __assign({ key: "tile-list-item-" + index }, itemProps))); }))) : (EmptyState),
22
+ moreLink && showMoreButton && React.createElement(MoreLink, { text: moreLink.text, to: moreLink.to })));
23
+ };
24
+ var LeaderboardListItem = function (props) {
25
+ var ItemIcon = props.Icon, image = props.image, to = props.to, subtitle = props.subtitle, title = props.title;
26
+ var classes = useLeaderboardListItemStyles(props);
27
+ var routeProps = { component: Link, to: to };
28
+ var showListItemAvatar = image || ItemIcon;
29
+ return (React.createElement(Box, __assign({}, (to && routeProps), { className: to && routeProps ? classes.link : '' }),
30
+ React.createElement(ListItem, null,
31
+ showListItemAvatar && (React.createElement(ListItemAvatar, null,
32
+ React.createElement(Avatar, __assign({ classes: { colorDefault: classes.fallbackIcon } }, image), ItemIcon && React.createElement(Icon, { icon: ItemIcon })))),
33
+ React.createElement(ListItemText, { classes: { secondary: classes.subtitle }, primary: title, primaryTypographyProps: {
34
+ noWrap: true,
35
+ }, secondary: subtitle }))));
36
+ };
37
+ var LeaderboardFilter = function (props) {
38
+ var onChange = props.onChange, options = props.options, text = props.text;
39
+ var classes = useLeaderboardFilterStyles(props);
40
+ var _a = useState(false), open = _a[0], setOpen = _a[1];
41
+ var _b = useState(null), menuAnchor = _b[0], setMenuAnchor = _b[1];
42
+ var _c = useState(null), selection = _c[0], setSelection = _c[1];
43
+ var handleOpen = function (event) {
44
+ setMenuAnchor(event.currentTarget);
45
+ setOpen(true);
46
+ };
47
+ var handleClose = function () {
48
+ setMenuAnchor(null);
49
+ setOpen(false);
50
+ };
51
+ var handleSelection = function (label, value) {
52
+ if (typeof onChange === 'function') {
53
+ onChange(value);
54
+ }
55
+ setSelection(label);
56
+ handleClose();
57
+ };
58
+ if (options.length < 1)
59
+ return null;
60
+ return (React.createElement(React.Fragment, null,
61
+ React.createElement(Box, { className: classes.filterWrapper, pt: 1, onClick: handleOpen },
62
+ React.createElement(Typography, { className: classes.text }, selection || text),
63
+ React.createElement(Icon, { icon: ChevronDown })),
64
+ React.createElement(Menu, { anchorEl: menuAnchor, onClose: handleClose, open: open }, options.map(function (_a) {
65
+ var label = _a.label, value = _a.value;
66
+ return (React.createElement(MenuItem, { key: value, onClick: function () { return handleSelection(label, value); } }, label));
67
+ }))));
68
+ };
69
+ var MoreLink = function (props) {
70
+ var text = props.text, to = props.to;
71
+ var classes = useMoreLinkStyles(props);
72
+ var routeProps = { component: Link, to: to };
73
+ return (React.createElement(Box, __assign({ display: "flex", justifyContent: "center" }, routeProps, { className: classes.link }),
74
+ React.createElement(Typography, { variant: "body2" }, text)));
75
+ };
76
+
77
+ export { Leaderboard };
78
+ //# sourceMappingURL=Leaderboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Leaderboard.js","sources":["../../../../src/components/Leaderboard/Leaderboard.tsx"],"sourcesContent":["import React, { useState } from 'react'\nimport { Menu, MenuItem } from '@material-ui/core'\nimport { Icon } from '@popmenu/common-ui'\nimport { Link as RouterLink } from 'react-router-dom'\nimport { Avatar, Box, List, ListItem, ListItemAvatar, ListItemText, Typography } from '@popmenu/common-ui'\nimport { ChevronDown } from '@popmenu/web-icons'\n\nimport { LeaderboardFilterProps, LeaderboardListItemProps, LeaderboardProps, MoreLinkProps } from './LeaderboardProps'\nimport {\n useLeaderboardStyles,\n useLeaderboardListItemStyles,\n useLeaderboardFilterStyles,\n useMoreLinkStyles,\n} from './LeaderboardStyles'\n\nexport const Leaderboard = (props: LeaderboardProps) => {\n const { data, EmptyState, filterProps, title, moreLink, subtitle } = props\n const classes = useLeaderboardStyles(props)\n const isEmpty = data.length === 0\n const slicedData = data.slice(0, 5)\n const isOverflow = data.length > 5\n const showMoreButton = !isEmpty && (moreLink?.show || isOverflow)\n\n return (\n <Box display=\"flex\" flexDirection=\"column\">\n <Box alignItems=\"left\">\n <Typography variant=\"h5\">{title}</Typography>\n <Typography className={classes.text}>{subtitle}</Typography>\n {filterProps && <LeaderboardFilter {...filterProps} />}\n </Box>\n {!isEmpty ? (\n <List classes={classes}>\n {slicedData.map((itemProps, index) => (\n <LeaderboardListItem key={`tile-list-item-${index}`} {...itemProps} />\n ))}\n </List>\n ) : (\n EmptyState\n )}\n {moreLink && showMoreButton && <MoreLink text={moreLink.text} to={moreLink.to} />}\n </Box>\n )\n}\n\nconst LeaderboardListItem = (props: LeaderboardListItemProps) => {\n const { Icon: ItemIcon, image, to, subtitle, title } = props\n const classes = useLeaderboardListItemStyles(props)\n const routeProps = { component: RouterLink, to }\n const showListItemAvatar = image || ItemIcon\n\n return (\n <Box {...(to && routeProps)} className={to && routeProps ? classes.link : ''}>\n <ListItem>\n {showListItemAvatar && (\n <ListItemAvatar>\n <Avatar classes={{ colorDefault: classes.fallbackIcon }} {...image}>\n {ItemIcon && <Icon icon={ItemIcon} />}\n </Avatar>\n </ListItemAvatar>\n )}\n <ListItemText\n classes={{ secondary: classes.subtitle }}\n primary={title}\n primaryTypographyProps={{\n noWrap: true,\n }}\n secondary={subtitle}\n />\n </ListItem>\n </Box>\n )\n}\n\nconst LeaderboardFilter = (props: LeaderboardFilterProps) => {\n const { onChange, options, text } = props\n const classes = useLeaderboardFilterStyles(props)\n const [open, setOpen] = useState(false)\n const [menuAnchor, setMenuAnchor] = useState<Element | null>(null)\n const [selection, setSelection] = useState<string | null>(null)\n\n const handleOpen = (event: React.SyntheticEvent) => {\n setMenuAnchor(event.currentTarget)\n setOpen(true)\n }\n\n const handleClose = () => {\n setMenuAnchor(null)\n setOpen(false)\n }\n\n const handleSelection = (label: string, value: string) => {\n if (typeof onChange === 'function') {\n onChange(value)\n }\n setSelection(label)\n handleClose()\n }\n\n if (options.length < 1) return null\n\n return (\n <>\n <Box className={classes.filterWrapper} pt={1} onClick={handleOpen}>\n <Typography className={classes.text}>{selection || text}</Typography>\n <Icon icon={ChevronDown} />\n </Box>\n <Menu anchorEl={menuAnchor} onClose={handleClose} open={open}>\n {options.map(({ label, value }) => (\n <MenuItem key={value} onClick={() => handleSelection(label, value)}>\n {label}\n </MenuItem>\n ))}\n </Menu>\n </>\n )\n}\n\nconst MoreLink = (props: MoreLinkProps) => {\n const { text, to } = props\n const classes = useMoreLinkStyles(props)\n const routeProps = { component: RouterLink, to }\n return (\n <Box display=\"flex\" justifyContent=\"center\" {...routeProps} className={classes.link}>\n <Typography variant=\"body2\">{text}</Typography>\n </Box>\n )\n}\n"],"names":["RouterLink"],"mappings":";;;;;;;;AAeO,IAAM,WAAW,GAAG,UAAC,KAAuB,EAAA;AACzC,IAAA,IAAA,IAAI,GAAyD,KAAK,CAAA,IAA9D,EAAE,UAAU,GAA6C,KAAK,CAAlD,UAAA,EAAE,WAAW,GAAgC,KAAK,CAAA,WAArC,EAAE,KAAK,GAAyB,KAAK,CAA9B,KAAA,EAAE,QAAQ,GAAe,KAAK,CAAA,QAApB,EAAE,QAAQ,GAAK,KAAK,SAAV;AAChE,IAAA,IAAM,OAAO,GAAG,oBAAoB,CAAC,KAAK,CAAC;AAC3C,IAAA,IAAM,OAAO,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC;IACjC,IAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AACnC,IAAA,IAAM,UAAU,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC;AAClC,IAAA,IAAM,cAAc,GAAG,CAAC,OAAO,KAAK,CAAA,QAAQ,KAAR,IAAA,IAAA,QAAQ,uBAAR,QAAQ,CAAE,IAAI,KAAI,UAAU,CAAC;IAEjE,QACE,KAAC,CAAA,aAAA,CAAA,GAAG,EAAC,EAAA,OAAO,EAAC,MAAM,EAAC,aAAa,EAAC,QAAQ,EAAA;AACxC,QAAA,KAAA,CAAA,aAAA,CAAC,GAAG,EAAA,EAAC,UAAU,EAAC,MAAM,EAAA;AACpB,YAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAC,EAAA,OAAO,EAAC,IAAI,EAAA,EAA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AAA,CAAA,KAAA;YAAO,QACjC,oBAAC,QAAQ,EAAA,EAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,YAAA,EAAM,OAAA,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,GAAA,EAAA,EAC/D,KAAK,CACG;AAHsB,SAIlC,CAAC,CACG,CACN;AAEP,CAAC;AAED,IAAM,QAAQ,GAAG,UAAC,KAAoB,EAAA;IAC5B,IAAA,IAAI,GAAS,KAAK,CAAA,IAAd,EAAE,EAAE,GAAK,KAAK,CAAA,EAAV;AAChB,IAAA,IAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC;IACxC,IAAM,UAAU,GAAG,EAAE,SAAS,EAAEA,IAAU,EAAE,EAAE,EAAA,EAAA,EAAE;AAChD,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,GAAG,aAAC,OAAO,EAAC,MAAM,EAAC,cAAc,EAAC,QAAQ,IAAK,UAAU,EAAA,EAAE,SAAS,EAAE,OAAO,CAAC,IAAI,EAAA,CAAA;QACjF,KAAC,CAAA,aAAA,CAAA,UAAU,EAAC,EAAA,OAAO,EAAC,OAAO,IAAE,IAAI,CAAc,CAC3C;AAEV,CAAC;;;;"}
@@ -0,0 +1,56 @@
1
+ /// <reference types="react" />
2
+ import { MenuProps } from '@material-ui/core';
3
+ export interface LeaderboardFilterOptionProps {
4
+ label: string;
5
+ value: string;
6
+ }
7
+ export interface LeaderboardFilterProps extends MenuProps {
8
+ onChange: (event: any) => void;
9
+ options: LeaderboardFilterOptionProps[];
10
+ text: string;
11
+ }
12
+ export interface LeaderboardListItemProps {
13
+ /** The icon to be displayed. Should be an icon component from popmenu/web-icons */
14
+ Icon?: string | React.FC<React.SVGProps<SVGSVGElement>>;
15
+ /** The image to be displayed. */
16
+ image?: {
17
+ /** alt attribute for the html img. */
18
+ alt: string;
19
+ /** src attribute for the html img. */
20
+ src: string;
21
+ };
22
+ /** Index used for styling */
23
+ index: number;
24
+ /** The subtitle to be displayed */
25
+ subtitle?: string;
26
+ /** The title to be displayed */
27
+ title: string;
28
+ /** Optional link to be attached to the list item */
29
+ to?: string;
30
+ }
31
+ export interface LeaderboardProps {
32
+ /** Data to be shown for each leaderboard list item */
33
+ data: LeaderboardListItemProps[];
34
+ /** Component to display when no data is present */
35
+ EmptyState: React.ReactNode;
36
+ /** Optional props for filter after the title/subtitle */
37
+ filterProps: LeaderboardFilterProps;
38
+ /** Optional link at bottom to redirect to another page. Intended as a link to more data within the leaderboard. */
39
+ moreLink?: {
40
+ /** Will display regardless of overflow */
41
+ show?: boolean;
42
+ /** Path to route to. */
43
+ to: string;
44
+ /** Text the link will have. */
45
+ text: string;
46
+ };
47
+ /** Subtitle to be displayed */
48
+ subtitle: string;
49
+ /** The title to be displayed */
50
+ title: string;
51
+ }
52
+ export interface MoreLinkProps {
53
+ show?: boolean;
54
+ text: string;
55
+ to: string;
56
+ }
@@ -0,0 +1,5 @@
1
+ import { LeaderboardProps, LeaderboardListItemProps, LeaderboardFilterProps, MoreLinkProps } from './LeaderboardProps';
2
+ export declare const useLeaderboardStyles: (props: LeaderboardProps) => import("@material-ui/styles").ClassNameMap<string>;
3
+ export declare const useLeaderboardListItemStyles: (props: LeaderboardListItemProps) => import("@material-ui/styles").ClassNameMap<string>;
4
+ export declare const useLeaderboardFilterStyles: (props: LeaderboardFilterProps) => import("@material-ui/styles").ClassNameMap<string>;
5
+ export declare const useMoreLinkStyles: (props: MoreLinkProps) => import("@material-ui/styles").ClassNameMap<string>;
@@ -0,0 +1,44 @@
1
+ import { makeStyles } from '@material-ui/core';
2
+
3
+ var useLeaderboardStyles = makeStyles(function (theme) { return ({
4
+ root: {
5
+ '& >:nth-child(even) > li': {
6
+ background: theme.palette.grey[100],
7
+ },
8
+ },
9
+ }); });
10
+ var useLeaderboardListItemStyles = makeStyles(function (theme) { return ({
11
+ fallbackIcon: {
12
+ background: 'white',
13
+ border: "1px solid " + theme.palette.grey[300],
14
+ color: theme.palette.grey[500],
15
+ },
16
+ link: {
17
+ color: theme.palette.info.main,
18
+ textDecoration: 'none',
19
+ },
20
+ subtitle: {
21
+ color: theme.palette.secondary.light,
22
+ },
23
+ }); });
24
+ var useLeaderboardFilterStyles = makeStyles(function (theme) { return ({
25
+ filterWrapper: {
26
+ alignItems: 'center',
27
+ cursor: 'pointer',
28
+ display: 'flex',
29
+ },
30
+ text: {
31
+ color: theme.palette.secondary.main,
32
+ fontSize: '.75rem',
33
+ paddingRight: theme.spacing(1),
34
+ },
35
+ }); });
36
+ var useMoreLinkStyles = makeStyles(function (theme) { return ({
37
+ link: {
38
+ color: theme.palette.info.main,
39
+ textDecoration: 'none',
40
+ },
41
+ }); });
42
+
43
+ export { useLeaderboardFilterStyles, useLeaderboardListItemStyles, useLeaderboardStyles, useMoreLinkStyles };
44
+ //# sourceMappingURL=LeaderboardStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeaderboardStyles.js","sources":["../../../../src/components/Leaderboard/LeaderboardStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { LeaderboardProps, LeaderboardListItemProps, LeaderboardFilterProps, MoreLinkProps } from './LeaderboardProps'\n\nexport const useLeaderboardStyles = makeStyles<Theme, LeaderboardProps>((theme) => ({\n root: {\n '& >:nth-child(even) > li': {\n background: theme.palette.grey[100],\n },\n },\n}))\n\nexport const useLeaderboardListItemStyles = makeStyles<Theme, LeaderboardListItemProps>((theme) => ({\n fallbackIcon: {\n background: 'white',\n border: `1px solid ${theme.palette.grey[300]}`,\n color: theme.palette.grey[500],\n },\n link: {\n color: theme.palette.info.main,\n textDecoration: 'none',\n },\n subtitle: {\n color: theme.palette.secondary.light,\n },\n}))\n\nexport const useLeaderboardFilterStyles = makeStyles<Theme, LeaderboardFilterProps>((theme) => ({\n filterWrapper: {\n alignItems: 'center',\n cursor: 'pointer',\n display: 'flex',\n },\n text: {\n color: theme.palette.secondary.main,\n fontSize: '.75rem',\n paddingRight: theme.spacing(1),\n },\n}))\n\nexport const use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AC,CAAC;AAC/B,KAAA;CACF,EAAC,EAAA;AAEW,IAAA,iBAAiB,GAAG,UAAU,CAAuB,UAAC,KAAK,EAAK,EAAA,QAAC;AAC5E,IAAA,IAAI,EAAE;AACJ,QAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;AAC9B,QAAA,cAAc,EAAE,MAAM;AACvB,KAAA;CACF,EAAC,EAAA;;;;"}
@@ -0,0 +1,2 @@
1
+ export { Leaderboard } from './Leaderboard';
2
+ export { LeaderboardProps } from './LeaderboardProps';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { LeaderboardTileProps } from './LeaderboardTileProps';
3
+ export declare const LeaderboardTile: (props: LeaderboardTileProps) => JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import { Tile } from '../Tile/Tile.js';
4
+ import { Leaderboard } from '../Leaderboard/Leaderboard.js';
5
+
6
+ var LeaderboardTile = function (props) {
7
+ var TileProps = props.TileProps, restProps = __rest(props, ["TileProps"]);
8
+ return (React.createElement(Tile, __assign({}, TileProps),
9
+ React.createElement(Leaderboard, __assign({}, restProps))));
10
+ };
11
+
12
+ export { LeaderboardTile };
13
+ //# sourceMappingURL=LeaderboardTile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeaderboardTile.js","sources":["../../../../src/components/LeaderboardTile/LeaderboardTile.tsx"],"sourcesContent":["import React from 'react'\nimport { LeaderboardTileProps } from './LeaderboardTileProps'\nimport { Tile } from '../Tile'\nimport { Leaderboard } from '../Leaderboard'\n\nexport const LeaderboardTile = (props: LeaderboardTileProps) => {\n const { TileProps, ...restProps } = props\n\n return (\n <Tile {...TileProps}>\n <Leaderboard {...restProps} />\n </Tile>\n )\n}\n"],"names":[],"mappings":";;;;;AAKO,IAAM,eAAe,GAAG,UAAC,KAA2B,EAAA;IACjD,IAAA,SAAS,GAAmB,KAAK,CAAxB,SAAA,EAAK,SAAS,GAAA,MAAA,CAAK,KAAK,EAAnC,CAA2B,WAAA,CAAA,CAAF;AAE/B,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAA;AACjB,QAAA,KAAA,CAAA,aAAA,CAAC,WAAW,EAAK,QAAA,CAAA,EAAA,EAAA,SAAS,CAAI,CAAA,CACzB;AAEX;;;;"}
@@ -0,0 +1,5 @@
1
+ import { TileProps } from '../Tile/TileProps';
2
+ import { LeaderboardProps } from '../Leaderboard/LeaderboardProps';
3
+ export interface LeaderboardTileProps extends LeaderboardProps {
4
+ TileProps: TileProps;
5
+ }
@@ -0,0 +1,2 @@
1
+ export { LeaderboardTile } from './LeaderboardTile';
2
+ export { LeaderboardTileProps } from './LeaderboardTileProps';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { TileProps } from './TileProps';
3
+ export declare const Tile: (props: TileProps) => JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import { Card, CardContent } from '@popmenu/common-ui';
4
+ import { useTileStyles } from './TileStyles.js';
5
+
6
+ var Tile = function (props) {
7
+ var children = props.children, CardContentProps = props.CardContentProps, restProps = __rest(props, ["children", "CardContentProps"]);
8
+ var classes = useTileStyles(props);
9
+ return (React.createElement(Card, __assign({ classes: { root: classes.root } }, restProps),
10
+ React.createElement(CardContent, __assign({ classes: { root: classes.content } }, CardContentProps), children)));
11
+ };
12
+
13
+ export { Tile };
14
+ //# sourceMappingURL=Tile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tile.js","sources":["../../../../src/components/Tile/Tile.tsx"],"sourcesContent":["import React from 'react'\nimport { Card } from '@popmenu/common-ui'\nimport { CardContent } from '@popmenu/common-ui'\nimport { TileProps } from './TileProps'\nimport { useTileStyles } from './TileStyles'\n\nexport const Tile = (props: TileProps) => {\n const { children, CardContentProps, ...restProps } = props\n const classes = useTileStyles(props)\n return (\n <Card classes={{ root: classes.root }} {...restProps}>\n <CardContent classes={{ root: classes.content }} {...CardContentProps}>\n {children}\n </CardContent>\n </Card>\n )\n}\n"],"names":[],"mappings":";;;;;AAMO,IAAM,IAAI,GAAG,UAAC,KAAgB,EAAA;AAC3B,IAAA,IAAA,QAAQ,GAAqC,KAAK,CAA1C,QAAA,EAAE,gBAAgB,GAAmB,KAAK,CAAxB,gBAAA,EAAK,SAAS,GAAK,MAAA,CAAA,KAAK,EAApD,CAAA,UAAA,EAAA,kBAAA,CAA4C,CAAF;AAChD,IAAA,IAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC;AACpC,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,QAAA,CAAA,EAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAM,SAAS,CAAA;AAClD,QAAA,KAAA,CAAA,aAAA,CAAC,WAAW,EAAC,QAAA,CAAA,EAAA,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAM,gBAAgB,CAAA,EAClE,QAAQ,CACG,CACT;AAEX;;;;"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { CardProps, CardContentProps } from '@popmenu/common-ui';
3
+ export interface TileProps extends CardProps {
4
+ /** Props applied to the built in CardContent component */
5
+ CardContentProps?: CardContentProps;
6
+ /** Content of the Tile */
7
+ children?: React.ReactNode;
8
+ }
@@ -0,0 +1 @@
1
+ export declare const useTileStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"root" | "content">;
@@ -0,0 +1,15 @@
1
+ import { makeStyles } from '@material-ui/core';
2
+
3
+ var useTileStyles = makeStyles(function (theme) { return ({
4
+ root: {
5
+ borderRadius: theme.spacing(1),
6
+ width: '100%',
7
+ },
8
+ content: {
9
+ padding: theme.spacing(3),
10
+ height: '100%',
11
+ },
12
+ }); });
13
+
14
+ export { useTileStyles };
15
+ //# sourceMappingURL=TileStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TileStyles.js","sources":["../../../../src/components/Tile/TileStyles.ts"],"sourcesContent":["import { makeStyles } from '@material-ui/core'\n\nexport const useTileStyles = makeStyles((theme) => ({\n root: {\n borderRadius: theme.spacing(1),\n width: '100%',\n },\n content: {\n padding: theme.spacing(3),\n height: '100%',\n },\n}))\n"],"names":[],"mappings":";;AAEa,IAAA,aAAa,GAAG,UAAU,CAAC,UAAC,KAAK,EAAK,EAAA,QAAC;AAClD,IAAA,IAAI,EAAE;AACJ,QAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9B,QAAA,KAAK,EAAE,MAAM;AACd,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACzB,QAAA,MAAM,EAAE,MAAM;AACf,KAAA;CACF,EAAC,EAAA;;;;"}
@@ -0,0 +1,2 @@
1
+ export { Tile } from './Tile';
2
+ export { TileProps } from './TileProps';
@@ -0,0 +1,5 @@
1
+ export { Leaderboard, LeaderboardProps } from './Leaderboard';
2
+ export { LeaderboardTile, LeaderboardTileProps } from './LeaderboardTile';
3
+ export { KpiMetric, KpiMetricProps } from './KpiMetric';
4
+ export { KpiMetricTile, KpiMetricTileProps } from './KpiMetricTile';
5
+ export { Tile, TileProps } from './Tile';
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,6 @@
1
+ export { Leaderboard } from './components/Leaderboard/Leaderboard.js';
2
+ export { LeaderboardTile } from './components/LeaderboardTile/LeaderboardTile.js';
3
+ export { KpiMetric } from './components/KpiMetric/KpiMetric.js';
4
+ export { KpiMetricTile } from './components/KpiMetricTile/KpiMetricTile.js';
5
+ export { Tile } from './components/Tile/Tile.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@popmenu/dashboard",
3
- "version": "0.126.0",
3
+ "version": "0.126.2",
4
4
  "license": "MIT",
5
5
  "author": "Popmenu Design System Team",
6
6
  "description": "React dashboard components for admin app.",
7
- "main": "./build/index.js",
8
- "module": "./build/index.es.js",
9
- "types": "./build/index.d.ts",
7
+ "main": "./build/cjs/index.js",
8
+ "module": "./build/esm/index.js",
9
+ "types": "./build/esm/index.d.ts",
10
+ "type": "module",
10
11
  "files": [
11
12
  "/build"
12
13
  ],
@@ -24,10 +25,12 @@
24
25
  "peerDependencies": {
25
26
  "@material-ui/core": "^4.12.2",
26
27
  "@material-ui/lab": "^4.0.0-alpha.60",
28
+ "@popmenu/common-ui": "^0.125.0",
29
+ "@popmenu/web-icons": "^0.125.0",
27
30
  "react": "17.x",
28
31
  "react-router-dom": "^5.2.0",
29
32
  "react-table": "^7.7.0"
30
33
  },
31
34
  "sideEffects": false,
32
- "gitHead": "41f682c20fba98382fb86cf2a3d1809d64fad750"
35
+ "gitHead": "1cfb282646479bcc4baa627d2b2dfdd20b75a63d"
33
36
  }