impaktapps-design 0.2.53 → 0.2.56
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/README.md +46 -46
- package/dist/impaktapps-design.d.ts +1 -0
- package/dist/impaktapps-design.es.js +26894 -18828
- package/dist/impaktapps-design.umd.js +116 -0
- package/dist/src/component/BarGraph/BarGraph.d.ts +2 -0
- package/dist/src/component/BarGraph/DrawBarGraph.d.ts +2 -0
- package/dist/src/component/BarGraph/DrawHorizontalBarGraph.d.ts +4 -0
- package/dist/src/component/BarGraph/HorizontalBarGraph.d.ts +2 -0
- package/dist/src/component/BottomAxis.d.ts +3 -0
- package/dist/src/component/Card/Card.d.ts +3 -0
- package/dist/src/component/LeftAxis.d.ts +3 -0
- package/dist/src/component/Legend.d.ts +2 -0
- package/dist/src/component/LineGraph/DrawLineGraph.d.ts +2 -0
- package/dist/src/component/LineGraph/LineGraph.d.ts +2 -0
- package/dist/src/component/PieGraph/DrawPieGraph.d.ts +2 -0
- package/dist/src/component/PieGraph/PieGraph.d.ts +2 -0
- package/dist/src/component/ProgressBar/ProgressBar.d.ts +2 -0
- package/dist/src/component/SpeedoMeter/SpeedoMeter.d.ts +2 -0
- package/dist/src/component/Timer/Timer.d.ts +4 -0
- package/dist/src/component/ToolTip.d.ts +3 -0
- package/dist/src/interface/interface.d.ts +54 -0
- package/dist/src/lib/index.d.ts +8 -0
- package/dist/src/utils/finalDataProvider.d.ts +40 -0
- package/package.json +67 -64
- package/src/component/Card/Card.tsx +65 -0
- package/src/component/Timer/Timer.tsx +95 -0
- package/src/lib/index.ts +3 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface leftAxisProps {
|
|
2
|
+
value: any;
|
|
3
|
+
yScale: any;
|
|
4
|
+
parentWidth: number;
|
|
5
|
+
}
|
|
6
|
+
export interface bottomAxisProps {
|
|
7
|
+
left?: number;
|
|
8
|
+
data?: any[];
|
|
9
|
+
yMax: number;
|
|
10
|
+
value: any;
|
|
11
|
+
xScale: any;
|
|
12
|
+
parentWidth: number;
|
|
13
|
+
}
|
|
14
|
+
export interface tooltipProps {
|
|
15
|
+
style: any;
|
|
16
|
+
top: any;
|
|
17
|
+
left: any;
|
|
18
|
+
tooltipData: any;
|
|
19
|
+
}
|
|
20
|
+
export declare type BarGroupProps = {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
margin?: {
|
|
24
|
+
top: number;
|
|
25
|
+
right: number;
|
|
26
|
+
bottom: number;
|
|
27
|
+
left: number;
|
|
28
|
+
};
|
|
29
|
+
events?: boolean;
|
|
30
|
+
value: any;
|
|
31
|
+
};
|
|
32
|
+
export declare type CityName = "v1" | "v2" | "v3";
|
|
33
|
+
export declare type TooltipData = {
|
|
34
|
+
bar: any;
|
|
35
|
+
key: CityName;
|
|
36
|
+
index: number;
|
|
37
|
+
height: number;
|
|
38
|
+
width: number;
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
color: string;
|
|
42
|
+
};
|
|
43
|
+
export declare type BarStackHorizontalProps = {
|
|
44
|
+
width?: number;
|
|
45
|
+
height?: number;
|
|
46
|
+
margin: {
|
|
47
|
+
top: number;
|
|
48
|
+
right: number;
|
|
49
|
+
bottom: number;
|
|
50
|
+
left: number;
|
|
51
|
+
};
|
|
52
|
+
events?: boolean;
|
|
53
|
+
barValue: any;
|
|
54
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as BarGraph } from "../component/BarGraph/BarGraph";
|
|
2
|
+
export { default as PieGraph } from "../component/PieGraph/PieGraph";
|
|
3
|
+
export { default as LineGraph } from "../component/LineGraph/LineGraph";
|
|
4
|
+
export { default as HorizontalBarGraph } from "../component/BarGraph/HorizontalBarGraph";
|
|
5
|
+
export { default as ProgressBar } from "../component/ProgressBar/ProgressBar";
|
|
6
|
+
export { default as SpeedoMeter } from "../component/SpeedoMeter/SpeedoMeter";
|
|
7
|
+
export { default as Card } from "../component/Card/Card";
|
|
8
|
+
export { default as Timer } from "../component/Timer/Timer";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const finalDataProvider: (type: string, value: any, theme?: any) => {
|
|
2
|
+
main: any;
|
|
3
|
+
style: {
|
|
4
|
+
containerStyle: any;
|
|
5
|
+
headerStyle: any;
|
|
6
|
+
tooltipStyle: any;
|
|
7
|
+
labelStyle: any;
|
|
8
|
+
barStyle: any;
|
|
9
|
+
legendStyle?: undefined;
|
|
10
|
+
pieStyle?: undefined;
|
|
11
|
+
lineStyle?: undefined;
|
|
12
|
+
};
|
|
13
|
+
} | {
|
|
14
|
+
main: any;
|
|
15
|
+
style: {
|
|
16
|
+
containerStyle: any;
|
|
17
|
+
headerStyle: any;
|
|
18
|
+
tooltipStyle: any;
|
|
19
|
+
labelStyle: any;
|
|
20
|
+
legendStyle: {
|
|
21
|
+
legend: any;
|
|
22
|
+
legendTitle: any;
|
|
23
|
+
};
|
|
24
|
+
pieStyle: any;
|
|
25
|
+
barStyle?: undefined;
|
|
26
|
+
lineStyle?: undefined;
|
|
27
|
+
};
|
|
28
|
+
} | {
|
|
29
|
+
main: any;
|
|
30
|
+
style: {
|
|
31
|
+
containerStyle: any;
|
|
32
|
+
headerStyle: any;
|
|
33
|
+
labelStyle: any;
|
|
34
|
+
lineStyle: any;
|
|
35
|
+
tooltipStyle?: undefined;
|
|
36
|
+
barStyle?: undefined;
|
|
37
|
+
legendStyle?: undefined;
|
|
38
|
+
pieStyle?: undefined;
|
|
39
|
+
};
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -1,64 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "impaktapps-design",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"dependencies": {
|
|
5
|
-
"@babel/core": "^7.16.12",
|
|
6
|
-
"@
|
|
7
|
-
"@
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"react
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"react
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"@types/
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "impaktapps-design",
|
|
3
|
+
"version": "0.2.56",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@babel/core": "^7.16.12",
|
|
6
|
+
"@emotion/react": "^11.11.1",
|
|
7
|
+
"@emotion/styled": "^11.11.0",
|
|
8
|
+
"@mui/material": "^5.14.3",
|
|
9
|
+
"@visx/visx": "^3.1.2",
|
|
10
|
+
"@vitejs/plugin-react": "^1.1.4",
|
|
11
|
+
"babel-loader": "^8.2.3",
|
|
12
|
+
"latest-version": "^7.0.0",
|
|
13
|
+
"react": "^18.2.0",
|
|
14
|
+
"react-d3-speedometer": "^1.1.0",
|
|
15
|
+
"react-dom": "^18.2.0",
|
|
16
|
+
"react-scripts": "^2.1.3"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite",
|
|
20
|
+
"build": "tsc && vite build",
|
|
21
|
+
"preview": "vite preview"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://git.act21.io/lovely/incentivo/-/tree/Grapho_In_Development"
|
|
26
|
+
},
|
|
27
|
+
"eslintConfig": {
|
|
28
|
+
"extends": [
|
|
29
|
+
"react-app",
|
|
30
|
+
"react-app/jest"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"browserslist": {
|
|
37
|
+
"production": [
|
|
38
|
+
">0.2%",
|
|
39
|
+
"not dead",
|
|
40
|
+
"not op_mini all"
|
|
41
|
+
],
|
|
42
|
+
"development": [
|
|
43
|
+
"last 1 chrome version",
|
|
44
|
+
"last 1 firefox version",
|
|
45
|
+
"last 1 safari version"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"author": "Satendra Raghav",
|
|
50
|
+
"files": [
|
|
51
|
+
"dist",
|
|
52
|
+
"src"
|
|
53
|
+
],
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/jest": "^27.5.2",
|
|
56
|
+
"@types/node": "^17.0.12",
|
|
57
|
+
"@types/react": "^18.0.28",
|
|
58
|
+
"@types/react-dom": "^18.0.11",
|
|
59
|
+
"typescript": "^4.5.5",
|
|
60
|
+
"vite": "^2.7.13",
|
|
61
|
+
"vite-plugin-dts": "^0.9.9"
|
|
62
|
+
},
|
|
63
|
+
"main": "./dist/impaktapps-design.umd.js",
|
|
64
|
+
"module": "./dist/impaktapps-design.es.js",
|
|
65
|
+
"types": "./dist/impaktapps-design.d.ts",
|
|
66
|
+
"description": "This is Act21 product powered by ImpaktApps, this is mainly develop to provide different ready to use UI components."
|
|
67
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import Card from "@mui/material/Card";
|
|
3
|
+
import CardContent from "@mui/material/CardContent";
|
|
4
|
+
import CardMedia from "@mui/material/CardMedia";
|
|
5
|
+
import Typography from "@mui/material/Typography";
|
|
6
|
+
import {Box} from "@mui/material";
|
|
7
|
+
|
|
8
|
+
import { CardActionArea } from "@mui/material";
|
|
9
|
+
|
|
10
|
+
export default function ImpaktAppsCard({ value }) {
|
|
11
|
+
|
|
12
|
+
const { uischema } = value;
|
|
13
|
+
const uischemaData:any = uischema?.config?.main;
|
|
14
|
+
const uischemaStyle:any = uischema?.config?.style;
|
|
15
|
+
|
|
16
|
+
const rankStyle = {position: "absolute",top: "0px",right: "0px",color: "#0DF3C2",backgroundColor: "#333333",padding: "4px 8px",borderRadius: "3px 12px 4px 14px",fontWeight: "bold",...uischemaStyle?.rank};
|
|
17
|
+
const descriptionStyle = {paddingBottom : "10px",textAlign: 'center' ,maxHeight: 100,fontSize: "15px",fontWeight: "400",color: "gray",overflow: "auto",wordWrap: "break-word","&::-webkit-scrollbar": { display: "none" }, ...uischemaStyle?.description };
|
|
18
|
+
const nameStyle = {color: "#3747A6", backgroundColor: "#eae9e9",marginTop : "8px",padding: "0px 12px",textAlign: "center",borderRadius: "8px",fontWeight : "700", ...uischemaStyle?.name};
|
|
19
|
+
const cardStyle = { boxShadow: '0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)',minWidth:280,maxWidth: 280,minHeight : 290,maxHeight:290, position: "relative",borderRadius: "12px",...uischemaStyle?.card};
|
|
20
|
+
const containerStyle = {backgroundColor: "#ebebff",display: "flex",justifyContent: "center",alignItems : "center", gap: "10px",padding : "5px" }
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<Box sx={containerStyle}>
|
|
25
|
+
<Card
|
|
26
|
+
sx={cardStyle}
|
|
27
|
+
>
|
|
28
|
+
<CardActionArea>
|
|
29
|
+
<CardMedia
|
|
30
|
+
component="img"
|
|
31
|
+
height="140"
|
|
32
|
+
image="https://cdn.onlinewebfonts.com/svg/img_296570.png"
|
|
33
|
+
style={{ objectFit: "contain",paddingTop:"15px" }}
|
|
34
|
+
alt="green iguana"
|
|
35
|
+
/>
|
|
36
|
+
<CardContent>
|
|
37
|
+
<Typography
|
|
38
|
+
sx={rankStyle}
|
|
39
|
+
>
|
|
40
|
+
{"# " + uischemaData?.rank ||"#"}
|
|
41
|
+
</Typography>
|
|
42
|
+
<Typography
|
|
43
|
+
gutterBottom
|
|
44
|
+
variant="h6"
|
|
45
|
+
component="div"
|
|
46
|
+
sx={nameStyle}
|
|
47
|
+
>
|
|
48
|
+
{uischemaData?.name}
|
|
49
|
+
</Typography>
|
|
50
|
+
<Typography
|
|
51
|
+
|
|
52
|
+
variant="body2"
|
|
53
|
+
color="text.secondary"
|
|
54
|
+
sx={descriptionStyle}
|
|
55
|
+
>
|
|
56
|
+
{uischemaData?.description}
|
|
57
|
+
</Typography>
|
|
58
|
+
</CardContent>
|
|
59
|
+
|
|
60
|
+
</CardActionArea>
|
|
61
|
+
</Card>
|
|
62
|
+
</Box>
|
|
63
|
+
</>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import {Box} from "@mui/material"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const CustomTimer = ({ value }) => {
|
|
6
|
+
|
|
7
|
+
let {uischema , data } = value;
|
|
8
|
+
|
|
9
|
+
const uischemaStyle = uischema?.config?.style;
|
|
10
|
+
const [days, setDays] = useState(0);
|
|
11
|
+
const [min, setMin] = useState(0);
|
|
12
|
+
const [sec, setSec] = useState(0);
|
|
13
|
+
const [hour, setHours] = useState(0);
|
|
14
|
+
const [interval, setInter] = useState<any>();
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (
|
|
18
|
+
new Date(data.startDate).getTime() <
|
|
19
|
+
new Date().getTime() &&
|
|
20
|
+
new Date(data.startDate).getTime() <
|
|
21
|
+
new Date(data.endDate).getTime()
|
|
22
|
+
) {
|
|
23
|
+
let currentDate = new Date();
|
|
24
|
+
const Difference_In_Time = new Date(data.endDate).getTime() - currentDate.getTime();
|
|
25
|
+
const Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24);
|
|
26
|
+
setDays(Math.floor(Difference_In_Days));
|
|
27
|
+
setInter(
|
|
28
|
+
setInterval(() => {
|
|
29
|
+
const currdate = new Date();
|
|
30
|
+
setHours(currdate.getHours());
|
|
31
|
+
setMin(currdate.getMinutes());
|
|
32
|
+
setSec(currdate.getSeconds());
|
|
33
|
+
}, 1000)
|
|
34
|
+
);
|
|
35
|
+
return () => {
|
|
36
|
+
clearInterval(interval);
|
|
37
|
+
};
|
|
38
|
+
} else {
|
|
39
|
+
setDays(0);
|
|
40
|
+
setHours(0);
|
|
41
|
+
setMin(0);
|
|
42
|
+
setSec(0);
|
|
43
|
+
}
|
|
44
|
+
},[data]);
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
const containerStyle = {display: "flex",flexDirection: "column",backgroundColor: "rgb(15,15,15)",justifyContent: "center",alignItems: "center",height: "40vh",gap: "10px",...uischemaStyle?.container};
|
|
48
|
+
const boxStyle = {backgroundColor : "rgb(51,51,51)", width: "22%",minWidth:"40px",height:"100px", padding : "10px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",...uischemaStyle?.digitContainer};
|
|
49
|
+
const digitStyle = {color : "rgb(0,253,199)",fontSize : "19px",fontWeight:"700",padding:"6px",...uischemaStyle?.digit};
|
|
50
|
+
const digitLabelStyle = {color : "white",fontSize : "19px",fontWeight:"700",...uischemaStyle?.digitLabel};
|
|
51
|
+
const containerLabelColor = {color : "white", ...uischemaStyle.containerLabelColor};
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
<Box component="div" sx={containerStyle}
|
|
56
|
+
>
|
|
57
|
+
<Box component="h1" style={containerLabelColor}>
|
|
58
|
+
{ new Date().getTime() >= new Date(data?.startDate).getTime() && new Date().getTime() <= new Date(data.endDate).getTime() ? 'Contest ends in...' : (new Date().getTime() < new Date(data.startDate).getTime()) ? 'Program Not Started Yet' : 'Program Over' }
|
|
59
|
+
</Box>
|
|
60
|
+
<Box style={{display:"flex", gap: "15px",width:"80%",maxWidth:"650px",marginLeft:"auto",marginRight:"auto"}} >
|
|
61
|
+
<Box style={boxStyle}>
|
|
62
|
+
<Box style={digitStyle}>{days === 0 ? 0 : days < 10 ? 0 : Math.floor(days / 10)}{days === 0 ? 0 : days % 10}</Box>
|
|
63
|
+
<Box style={digitLabelStyle}>Days</Box>
|
|
64
|
+
</Box>
|
|
65
|
+
<Box style={boxStyle}>
|
|
66
|
+
<Box style={digitStyle}>{hour === 0
|
|
67
|
+
? 0
|
|
68
|
+
: 24 - hour < 10
|
|
69
|
+
? 0
|
|
70
|
+
: Math.floor((24 - hour) / 10)}{hour === 0 ? 0 : (24 - hour) % 10}</Box>
|
|
71
|
+
<Box style={digitLabelStyle}>Hours</Box>
|
|
72
|
+
</Box>
|
|
73
|
+
<Box style={boxStyle}>
|
|
74
|
+
<Box style={digitStyle}>{min === 0
|
|
75
|
+
? 0
|
|
76
|
+
: 60 - min < 10
|
|
77
|
+
? 0
|
|
78
|
+
: Math.floor((60 - min) / 10)}{min === 0 ? 0 : (60 - min) % 10}</Box>
|
|
79
|
+
<Box style={digitLabelStyle}>Mins</Box>
|
|
80
|
+
</Box>
|
|
81
|
+
<Box style={boxStyle}>
|
|
82
|
+
<Box style={digitStyle}>{sec === 0
|
|
83
|
+
? 0
|
|
84
|
+
: 60 - sec < 10
|
|
85
|
+
? 0
|
|
86
|
+
: Math.floor((60 - sec) / 10)}{sec === 0 ? 0 : (60 - sec) % 10}</Box>
|
|
87
|
+
<Box style={digitLabelStyle}>Secs</Box>
|
|
88
|
+
</Box>
|
|
89
|
+
</Box>
|
|
90
|
+
</Box>
|
|
91
|
+
</>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default CustomTimer;
|
package/src/lib/index.ts
CHANGED
|
@@ -3,4 +3,6 @@ export {default as PieGraph} from "../component/PieGraph/PieGraph"
|
|
|
3
3
|
export {default as LineGraph} from "../component/LineGraph/LineGraph"
|
|
4
4
|
export {default as HorizontalBarGraph} from "../component/BarGraph/HorizontalBarGraph"
|
|
5
5
|
export {default as ProgressBar} from "../component/ProgressBar/ProgressBar"
|
|
6
|
-
export {default as SpeedoMeter} from "../component/SpeedoMeter/SpeedoMeter"
|
|
6
|
+
export {default as SpeedoMeter} from "../component/SpeedoMeter/SpeedoMeter"
|
|
7
|
+
export {default as Card} from "../component/Card/Card";
|
|
8
|
+
export {default as Timer} from "../component/Timer/Timer";
|