l-min-components 0.2.0
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/package.json +38 -0
- package/src/assets/Icon.svg +3 -0
- package/src/assets/friendrequest.png +0 -0
- package/src/assets/images/User-avatar.svg.png +0 -0
- package/src/assets/images/Vector19.png +0 -0
- package/src/assets/images/android.png +0 -0
- package/src/assets/images/avatar.png +0 -0
- package/src/assets/images/banner.png +0 -0
- package/src/assets/images/dashboardImage.png +0 -0
- package/src/assets/images/figma.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/logo.png +0 -0
- package/src/assets/images/onboarding.png +0 -0
- package/src/assets/images/sign_up.png +0 -0
- package/src/assets/react.svg +1 -0
- package/src/assets/svg/Frame 4534413.svg +7 -0
- package/src/assets/svg/Property 44.svg +5 -0
- package/src/assets/svg/Property 55.svg +10 -0
- package/src/assets/svg/add.jsx +14 -0
- package/src/assets/svg/arrow-down.jsx +14 -0
- package/src/assets/svg/arrow-right.svg +4 -0
- package/src/assets/svg/book.jsx +34 -0
- package/src/assets/svg/calendar.jsx +64 -0
- package/src/assets/svg/close.jsx +15 -0
- package/src/assets/svg/coolicon.svg +3 -0
- package/src/assets/svg/download.jsx +32 -0
- package/src/assets/svg/eos-icons_machine-learning-outlined.svg +6 -0
- package/src/assets/svg/learning.jsx +21 -0
- package/src/assets/svg/logout.svg +5 -0
- package/src/assets/svg/material-symbols_spatial-audio-outline-rounded.svg +3 -0
- package/src/assets/svg/message.jsx +39 -0
- package/src/assets/svg/notification.jsx +32 -0
- package/src/assets/svg/people.jsx +17 -0
- package/src/assets/svg/search.jsx +24 -0
- package/src/assets/svg/setting.jsx +14 -0
- package/src/components/ApiProgress/ApiConsumption/assets/Vector.jsx +8 -0
- package/src/components/ApiProgress/ApiConsumption/index.jsx +60 -0
- package/src/components/ApiProgress/ApiConsumption/styles/index.jsx +61 -0
- package/src/components/ApiProgress/ApiProgressBar/index.jsx +99 -0
- package/src/components/ApiProgress/ApiProgressBar/styles/index.jsx +122 -0
- package/src/components/ApiProgress/toggle/index.jsx +34 -0
- package/src/components/ApiProgress/toggle/styles/index.jsx +72 -0
- package/src/components/AppMainLayout/index.jsx +50 -0
- package/src/components/AppMainLayout/index.styled.js +37 -0
- package/src/components/Arrow.jsx +24 -0
- package/src/components/apiBar/bar.jsx +46 -0
- package/src/components/apiBar/index.jsx +55 -0
- package/src/components/authentication/assets/images/sign_up.png +0 -0
- package/src/components/authentication/index.styled.js +32 -0
- package/src/components/authentication/mainLayout.jsx +14 -0
- package/src/components/banner/assets/Vector19.png +0 -0
- package/src/components/banner/assets/banner.png +0 -0
- package/src/components/banner/index.jsx +41 -0
- package/src/components/banner/styles/index.jsx +81 -0
- package/src/components/bar/styles.css +19 -0
- package/src/components/button/index.jsx +329 -0
- package/src/components/button/socialBtn.jsx +38 -0
- package/src/components/calender/input.jsx +202 -0
- package/src/components/calender/styles/input.jsx +127 -0
- package/src/components/checkBoxes/checkbox/doc.md +36 -0
- package/src/components/checkBoxes/checkbox/index.jsx +53 -0
- package/src/components/checkBoxes/checkbox/styles/index.jsx +64 -0
- package/src/components/checkBoxes/checkboxGroup/doc.md +55 -0
- package/src/components/checkBoxes/checkboxGroup/index.jsx +47 -0
- package/src/components/checkBoxes/checkboxGroup/styles/index.jsx +7 -0
- package/src/components/course/courseList/index.jsx +32 -0
- package/src/components/course/courseList/styles/index.jsx +10 -0
- package/src/components/course/coursecard/index.jsx +56 -0
- package/src/components/course/coursecard/styles/index.jsx +70 -0
- package/src/components/developerAPIdocs/assets/icons.jsx +46 -0
- package/src/components/developerAPIdocs/assets/learngual_developer_api_doc.png +0 -0
- package/src/components/developerAPIdocs/index.jsx +154 -0
- package/src/components/developerAPIdocs/index.styled.js +137 -0
- package/src/components/dropdown component/index.jsx +139 -0
- package/src/components/dropdown component/styles.js +82 -0
- package/src/components/friendRequest/friendRequestCard/doc.md +49 -0
- package/src/components/friendRequest/friendRequestCard/index.jsx +82 -0
- package/src/components/friendRequest/friendRequestCard/styles/index.jsx +109 -0
- package/src/components/friendRequest/friendRequestList/doc.md +61 -0
- package/src/components/friendRequest/friendRequestList/index.jsx +58 -0
- package/src/components/friendRequest/friendRequestList/styles/index.jsx +34 -0
- package/src/components/graph/graphData.jsx +119 -0
- package/src/components/graph/index.jsx +111 -0
- package/src/components/graph/index.styled.js +261 -0
- package/src/components/header/account-dropdown.jsx +86 -0
- package/src/components/header/assets/images/User-avatar.svg.png +0 -0
- package/src/components/header/assets/images/android.png +0 -0
- package/src/components/header/assets/images/avatar.png +0 -0
- package/src/components/header/assets/images/figma.png +0 -0
- package/src/components/header/assets/images/linkedin.png +0 -0
- package/src/components/header/assets/images/logo.png +0 -0
- package/src/components/header/assets/images/sign_up.png +0 -0
- package/src/components/header/assets/svg/add.jsx +14 -0
- package/src/components/header/assets/svg/arrow-down.jsx +14 -0
- package/src/components/header/assets/svg/book.jsx +34 -0
- package/src/components/header/assets/svg/close.jsx +15 -0
- package/src/components/header/assets/svg/coolicon.svg +3 -0
- package/src/components/header/assets/svg/message.jsx +39 -0
- package/src/components/header/assets/svg/notification.jsx +32 -0
- package/src/components/header/assets/svg/people.jsx +17 -0
- package/src/components/header/assets/svg/search.jsx +24 -0
- package/src/components/header/assets/svg/setting.jsx +14 -0
- package/src/components/header/index.jsx +134 -0
- package/src/components/header/index.styled.js +486 -0
- package/src/components/header/login-header.jsx +71 -0
- package/src/components/input/index.jsx +68 -0
- package/src/components/input/index.styled.js +45 -0
- package/src/components/loader/index.jsx +70 -0
- package/src/components/notificationProgressBar/index.jsx +187 -0
- package/src/components/notificationProgressBar/styles/index.jsx +122 -0
- package/src/components/notificationThreshold/index.jsx +111 -0
- package/src/components/notificationThreshold/index.styled.js +129 -0
- package/src/components/notificationThreshold/slider.jsx +46 -0
- package/src/components/progressBar/index.jsx +32 -0
- package/src/components/progressBar/styles/index.jsx +44 -0
- package/src/components/radio/doc.md +41 -0
- package/src/components/radio/index.jsx +70 -0
- package/src/components/radio/styles/index.jsx +56 -0
- package/src/components/searchBar/doc.md +68 -0
- package/src/components/searchBar/index.jsx +108 -0
- package/src/components/searchBar/styles/index.jsx +89 -0
- package/src/components/select/doc.md +0 -0
- package/src/components/select/index.jsx +122 -0
- package/src/components/select/styles/index.jsx +98 -0
- package/src/components/sideBar/sideMenu/index.jsx +95 -0
- package/src/components/sideBar/sideMenu/styles/index.jsx +135 -0
- package/src/components/sideBar/userCard/index.jsx +32 -0
- package/src/components/sideBar/userCard/styles/index.jsx +37 -0
- package/src/components/sideNav/index.jsx +28 -0
- package/src/components/sideNav/styles/index.jsx +159 -0
- package/src/components/subscriptionPreview/index.jsx +55 -0
- package/src/components/subscriptionPreview/style/style.js +85 -0
- package/src/components/successCard/assets/PartyingFace.png +0 -0
- package/src/components/successCard/index.jsx +29 -0
- package/src/components/successCard/index.styled.js +33 -0
- package/src/components/toggle button/index.jsx +43 -0
- package/src/components/toggle button/styles.js +26 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
import { Input, Label, ErrorMsg } from "./index.styled";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @param {{
|
|
6
|
+
* type: string,
|
|
7
|
+
* disabled: boolean,
|
|
8
|
+
* onClick: function,
|
|
9
|
+
* style: CSSProperties,
|
|
10
|
+
* required: boolean,
|
|
11
|
+
* value: string | number,
|
|
12
|
+
* onChange: function,
|
|
13
|
+
* }} props - properties of Input Component
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const InputComponent = (props) => {
|
|
18
|
+
const [value, setValue] = useState("");
|
|
19
|
+
const [formErrors, setFormErrors] = useState(false);
|
|
20
|
+
|
|
21
|
+
const validate = (e) => {
|
|
22
|
+
if (!e.target.value) {
|
|
23
|
+
setFormErrors(true);
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
setFormErrors(false);
|
|
26
|
+
}, 2000);
|
|
27
|
+
} else {
|
|
28
|
+
console.log("false");
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//validation
|
|
33
|
+
const handleValidation = () => {
|
|
34
|
+
// setFormErrors(validate(formData));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div style={props.style}>
|
|
39
|
+
<Label htmlFor={props.in} style={props.customLabelStyle}>
|
|
40
|
+
{props.label}
|
|
41
|
+
</Label>
|
|
42
|
+
<Input
|
|
43
|
+
type={props.inputType}
|
|
44
|
+
name={props.inputName}
|
|
45
|
+
value={props.value}
|
|
46
|
+
id={props.inputId}
|
|
47
|
+
placeholder={props.placeholder}
|
|
48
|
+
style={props.customInputStyle}
|
|
49
|
+
disabled={props.disabled}
|
|
50
|
+
hasError={props.hasError}
|
|
51
|
+
onBlur={validate}
|
|
52
|
+
required={props.required}
|
|
53
|
+
onChange={props.onChange}
|
|
54
|
+
ariaDescribedby={props.ariaDescribedby}
|
|
55
|
+
min={props.min}
|
|
56
|
+
max={props.max}
|
|
57
|
+
pattern={props.pattern}
|
|
58
|
+
/>
|
|
59
|
+
{props.hasError && (
|
|
60
|
+
<ErrorMsg role="alert" id={props.errorMsgId}>
|
|
61
|
+
{props.errorMsg}
|
|
62
|
+
</ErrorMsg>
|
|
63
|
+
)}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default InputComponent;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
/* styles for input component */
|
|
4
|
+
export const Input = styled.input`
|
|
5
|
+
background-color: transparent;
|
|
6
|
+
padding: 10px 14px;
|
|
7
|
+
font-size: 16px;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
border-radius: 10px;
|
|
10
|
+
border: 1px solid ${(props) => (props.hasError ? "#F95454" : "#adb2b2")};
|
|
11
|
+
color: #adb3b3;
|
|
12
|
+
transition: 0.5s;
|
|
13
|
+
outline: none;
|
|
14
|
+
width: 100%;
|
|
15
|
+
|
|
16
|
+
&:disabled {
|
|
17
|
+
background-color: #c6cccc;
|
|
18
|
+
cursor: not-allowed;
|
|
19
|
+
}
|
|
20
|
+
&:focus {
|
|
21
|
+
border: 1px solid #00c2c2;
|
|
22
|
+
}
|
|
23
|
+
&:active {
|
|
24
|
+
border: 1px solid #00c2c2;
|
|
25
|
+
}
|
|
26
|
+
&::placeholder {
|
|
27
|
+
color: #adb2b2;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
export const Label = styled.label`
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
color: #313333;
|
|
35
|
+
display: block;
|
|
36
|
+
margin-bottom: 12px;
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
export const ErrorMsg = styled.small`
|
|
40
|
+
font-size: 12px;
|
|
41
|
+
font-weight: 400;
|
|
42
|
+
color: #f95454;
|
|
43
|
+
display: block;
|
|
44
|
+
margin-top: 12px;
|
|
45
|
+
`;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {{zoom: number, color: string}} param0
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
const Loader = ({ zoom, color }) => {
|
|
9
|
+
return (
|
|
10
|
+
<Wrap zoom={zoom}>
|
|
11
|
+
<Container zoom={zoom} color={color}>
|
|
12
|
+
<div></div>
|
|
13
|
+
<div></div>
|
|
14
|
+
<div></div>
|
|
15
|
+
</Container>
|
|
16
|
+
</Wrap>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const Wrap = styled.div`
|
|
21
|
+
width: ${({ zoom }) => (zoom ? (zoom * 100 * 80) / 100 : 80)}px;
|
|
22
|
+
height: ${({ zoom }) => (zoom ? (zoom * 100 * 80) / 100 : 80)}px;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: "center";
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const Container = styled.div`
|
|
29
|
+
display: inline-block;
|
|
30
|
+
position: relative;
|
|
31
|
+
width: fit-content;
|
|
32
|
+
height: fit-content;
|
|
33
|
+
width: 80px;
|
|
34
|
+
height: 80px;
|
|
35
|
+
transform: scale(${({ zoom }) => zoom ?? 1});
|
|
36
|
+
& > div {
|
|
37
|
+
position: absolute;
|
|
38
|
+
/* display: flex; */
|
|
39
|
+
gap: 2px;
|
|
40
|
+
left: 8px;
|
|
41
|
+
width: 16px;
|
|
42
|
+
background: ${({ color }) => color ?? "#fff"};
|
|
43
|
+
animation: lds-facebook 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;
|
|
44
|
+
}
|
|
45
|
+
& > div:nth-child(1) {
|
|
46
|
+
left: 8px;
|
|
47
|
+
animation-delay: -0.24s;
|
|
48
|
+
}
|
|
49
|
+
& > div:nth-child(2) {
|
|
50
|
+
left: 32px;
|
|
51
|
+
animation-delay: -0.12s;
|
|
52
|
+
}
|
|
53
|
+
& > div:nth-child(3) {
|
|
54
|
+
left: 56px;
|
|
55
|
+
animation-delay: 0;
|
|
56
|
+
}
|
|
57
|
+
@keyframes lds-facebook {
|
|
58
|
+
0% {
|
|
59
|
+
top: 8px;
|
|
60
|
+
height: 64px;
|
|
61
|
+
}
|
|
62
|
+
50%,
|
|
63
|
+
100% {
|
|
64
|
+
top: 24px;
|
|
65
|
+
height: 32px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
|
|
70
|
+
export default Loader;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
|
|
4
|
+
const RangeMeterWrapper = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
border-radius: 22px;
|
|
10
|
+
height: 12px;
|
|
11
|
+
position: relative;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
const ThresholdsWrapper = styled.div`
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 12px;
|
|
19
|
+
border-radius: 22px;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
position: absolute;
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
const Threshold = styled.div`
|
|
25
|
+
width: ${(props) => props.width}%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
border-radius: 22px;
|
|
28
|
+
background-color: ${(props) => props.color};
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
const RangeTrack = styled.input.attrs((props) => ({
|
|
32
|
+
type: "range",
|
|
33
|
+
min: props.min,
|
|
34
|
+
max: props.max,
|
|
35
|
+
value: props.value,
|
|
36
|
+
}))`
|
|
37
|
+
-webkit-appearance: none;
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 100%;
|
|
40
|
+
background-color: transparent;
|
|
41
|
+
border-radius: 5px;
|
|
42
|
+
outline: none;
|
|
43
|
+
margin: 10px 0;
|
|
44
|
+
position: relative;
|
|
45
|
+
|
|
46
|
+
&::-webkit-slider-thumb {
|
|
47
|
+
-webkit-appearance: none;
|
|
48
|
+
appearance: none;
|
|
49
|
+
width: 20px;
|
|
50
|
+
height: 20px;
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
background-color: #ffffff;
|
|
53
|
+
border: 2px solid ${(props) => props.thresholdColor};
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
position: relative;
|
|
56
|
+
z-index: 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&::-moz-range-thumb {
|
|
60
|
+
width: 20px;
|
|
61
|
+
height: 20px;
|
|
62
|
+
border-radius: 50%;
|
|
63
|
+
background-color: #ffffff;
|
|
64
|
+
border: 2px solid ${(props) => props.thresholdColor};
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
position: relative;
|
|
67
|
+
z-index: 1;
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
const ThumbTooltip = styled.div`
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: -35px;
|
|
74
|
+
left: ${(props) => props.value}%;
|
|
75
|
+
transform: translateX(-50%);
|
|
76
|
+
background-color: #ffffff;
|
|
77
|
+
color: #000000;
|
|
78
|
+
font-size: 14px;
|
|
79
|
+
padding: 3px 5px;
|
|
80
|
+
/* padding: 5px; */
|
|
81
|
+
border-radius: px;
|
|
82
|
+
display: block;
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
const RangeMeter = ({ min, max, thresholds, value, onChange }) => {
|
|
86
|
+
const trackRef = React.useRef(null);
|
|
87
|
+
const thumbRef = React.useRef(null);
|
|
88
|
+
const tooltipRef = React.useRef(null);
|
|
89
|
+
|
|
90
|
+
const [thumbPosition, setThumbPosition] = React.useState({ x: 0, y: 0 });
|
|
91
|
+
const [tooltipVisible, setTooltipVisible] = React.useState(false);
|
|
92
|
+
|
|
93
|
+
const handleThumbMouseMove = (event) => {
|
|
94
|
+
const trackRect = trackRef.current.getBoundingClientRect();
|
|
95
|
+
const thumbRect = thumbRef.current.getBoundingClientRect();
|
|
96
|
+
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
97
|
+
|
|
98
|
+
const thumbPosition = {
|
|
99
|
+
x: event.clientX - trackRect.left - thumbRect.width / 2,
|
|
100
|
+
y: -tooltipRect.height - thumbRect.height,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
setThumbPosition(thumbPosition);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const handleThumbMouseEnter = () => {
|
|
107
|
+
setTooltipVisible(true);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const handleThumbMouseLeave = () => {
|
|
111
|
+
setTooltipVisible(false);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const handleTrackChange = (event) => {
|
|
115
|
+
const value = parseInt(event.target.value);
|
|
116
|
+
const threshold = thresholds.find((threshold) => value < threshold.value);
|
|
117
|
+
const thresholdColor = threshold
|
|
118
|
+
? threshold.color
|
|
119
|
+
: thresholds[thresholds.length - 1].color;
|
|
120
|
+
|
|
121
|
+
onChange(value, thresholdColor);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
React.useEffect(() => {
|
|
125
|
+
const thumb = thumbRef.current;
|
|
126
|
+
|
|
127
|
+
if (thumb) {
|
|
128
|
+
thumb.addEventListener("mousemove", handleThumbMouseMove);
|
|
129
|
+
thumb.addEventListener("mouseenter", handleThumbMouseEnter);
|
|
130
|
+
thumb.addEventListener("mouseleave", handleThumbMouseLeave);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return () => {
|
|
134
|
+
if (thumb) {
|
|
135
|
+
thumb.removeEventListener("mousemove", handleThumbMouseMove);
|
|
136
|
+
thumb.removeEventListener("mouseenter", handleThumbMouseEnter);
|
|
137
|
+
thumb.removeEventListener("mouseleave", handleThumbMouseLeave);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}, [thumbRef]);
|
|
141
|
+
const thresholdWidths = thresholds.map((threshold, index) => {
|
|
142
|
+
const start = index === 0 ? min : thresholds[index - 1].value;
|
|
143
|
+
const end = threshold.value ;
|
|
144
|
+
const percentage = ((end - start) / (max - min)) * 100;
|
|
145
|
+
return percentage;
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const thresholdColors = thresholds.map((threshold) => threshold.color);
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<RangeMeterWrapper>
|
|
152
|
+
<ThresholdsWrapper>
|
|
153
|
+
{thresholds.map((threshold, index) => (
|
|
154
|
+
<Threshold
|
|
155
|
+
key={index}
|
|
156
|
+
color={threshold.color}
|
|
157
|
+
width={thresholdWidths[index]}
|
|
158
|
+
/>
|
|
159
|
+
))}
|
|
160
|
+
</ThresholdsWrapper>
|
|
161
|
+
<RangeTrack
|
|
162
|
+
ref={trackRef}
|
|
163
|
+
min={min}
|
|
164
|
+
max={max}
|
|
165
|
+
value={value}
|
|
166
|
+
thresholdColor={thresholdColors.find(
|
|
167
|
+
(color, index) =>
|
|
168
|
+
value >= (index > 0 ? thresholds[index - 1].value : min) &&
|
|
169
|
+
value < thresholds[index].value
|
|
170
|
+
)}
|
|
171
|
+
onChange={handleTrackChange}
|
|
172
|
+
onMouseEnter={handleThumbMouseEnter}
|
|
173
|
+
onMouseLeave={handleThumbMouseLeave}
|
|
174
|
+
/>
|
|
175
|
+
<ThumbTooltip
|
|
176
|
+
ref={tooltipRef}
|
|
177
|
+
value={value}
|
|
178
|
+
thumbPosition={thumbPosition}
|
|
179
|
+
visible={tooltipVisible}
|
|
180
|
+
>
|
|
181
|
+
{value}
|
|
182
|
+
</ThumbTooltip>
|
|
183
|
+
</RangeMeterWrapper>
|
|
184
|
+
);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export default RangeMeter;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const sizes = {
|
|
4
|
+
xs: {
|
|
5
|
+
height: "8px",
|
|
6
|
+
borderRadius: "4px",
|
|
7
|
+
},
|
|
8
|
+
sm: {
|
|
9
|
+
height: "12px",
|
|
10
|
+
borderRadius: "6px",
|
|
11
|
+
},
|
|
12
|
+
md: {
|
|
13
|
+
height: "16px",
|
|
14
|
+
borderRadius: "8px",
|
|
15
|
+
},
|
|
16
|
+
lg: {
|
|
17
|
+
height: "24px",
|
|
18
|
+
borderRadius: "12px",
|
|
19
|
+
},
|
|
20
|
+
xl: {
|
|
21
|
+
height: "32px",
|
|
22
|
+
borderRadius: "16px",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Container = styled.div`
|
|
27
|
+
width: 100%;
|
|
28
|
+
padding: 50px;
|
|
29
|
+
border-radius: 10px;
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
align-items: center;
|
|
33
|
+
|
|
34
|
+
background-color: ${(props) =>
|
|
35
|
+
props.disabled ? "transparent" : "rgba(2, 215, 190, 0.091)"};
|
|
36
|
+
border: 1px solid
|
|
37
|
+
${(props) => (props.disabled ? "#fff" : "rgba(2, 215, 190, 0.091)")};
|
|
38
|
+
position: relative;
|
|
39
|
+
|
|
40
|
+
.switch {
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 10px;
|
|
43
|
+
left: 10px;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
export const ProgressBarContainer = styled.div`
|
|
47
|
+
position: relative;
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: ${(props) => sizes[props.size].height};
|
|
50
|
+
border-radius: ${(props) => sizes[props.size].borderRadius};
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
export const ProgressBarTotal = styled.div`
|
|
54
|
+
position: absolute;
|
|
55
|
+
height: 100%;
|
|
56
|
+
border-radius: 10px;
|
|
57
|
+
background-color: ${(props) => (props.disabled ? "rgba(255, 255, 255, 0.069)" : props.color)};
|
|
58
|
+
left: ${(props) => props.left}%;
|
|
59
|
+
width: ${(props) => props.width}%;
|
|
60
|
+
z-index: 1;
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
export const ProgressBarUsed = styled(ProgressBarTotal)`
|
|
64
|
+
background-color: ${(props) => (props.disabled ? "#ffffff" : props.color)};
|
|
65
|
+
z-index: 2;
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
export const ProgressBarAvailable = styled(ProgressBarTotal)`
|
|
69
|
+
background-color: ${(props) =>
|
|
70
|
+
props.disabled ? "rgba(255, 255, 255, 0.069)" : props.color};
|
|
71
|
+
left: ${(props) => props.left}%;
|
|
72
|
+
width: ${(props) => props.width}%;
|
|
73
|
+
z-index: 1;
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
export const ProgressHandle = styled.div`
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 50%;
|
|
79
|
+
left: ${(props) => props.left - "0.5"}%;
|
|
80
|
+
${(props) =>
|
|
81
|
+
props.disabled
|
|
82
|
+
? ``
|
|
83
|
+
: `
|
|
84
|
+
width: 20px;
|
|
85
|
+
height: 20px;
|
|
86
|
+
border-radius: 50%;
|
|
87
|
+
background-color: white;
|
|
88
|
+
border: 2px solid rgba(0, 194, 194, 1);
|
|
89
|
+
`}
|
|
90
|
+
|
|
91
|
+
transform: translate(-50%, -50%);
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
display: flex;
|
|
94
|
+
/* visibility: ${(props) => (props.disabled ? "hidden" : "visible")}; */
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
z-index: 3;
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
export const HandleValue = styled.div`
|
|
102
|
+
position: absolute;
|
|
103
|
+
bottom: -30px;
|
|
104
|
+
font-size: 12px;
|
|
105
|
+
color: ${(props) => (props.disabled ? "#ffffff" : props.color)};
|
|
106
|
+
`;
|
|
107
|
+
|
|
108
|
+
export const MinValue = styled.span`
|
|
109
|
+
position: absolute;
|
|
110
|
+
left: 0;
|
|
111
|
+
bottom: -20px;
|
|
112
|
+
font-size: 12px;
|
|
113
|
+
color: ${(props) => (props.disabled ? "#ffffff" : props.color)};
|
|
114
|
+
`;
|
|
115
|
+
|
|
116
|
+
export const MaxValue = styled.span`
|
|
117
|
+
position: absolute;
|
|
118
|
+
right: 0;
|
|
119
|
+
bottom: -20px;
|
|
120
|
+
font-size: 12px;
|
|
121
|
+
color: ${(props) => (props.disabled ? "#ffffff" : props.color)};
|
|
122
|
+
`;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
CardContainer,
|
|
4
|
+
CardBody,
|
|
5
|
+
CardHeader,
|
|
6
|
+
ModalCardContainer,
|
|
7
|
+
CloseModalButton,
|
|
8
|
+
} from "./index.styled";
|
|
9
|
+
import InputComponent from "../input";
|
|
10
|
+
import ButtonComponent from "../button";
|
|
11
|
+
import { IoMdClose } from "react-icons/all";
|
|
12
|
+
import Modal from "react-modal";
|
|
13
|
+
import SliderWithTooltip from "./slider";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param {{
|
|
17
|
+
* onClick: function,
|
|
18
|
+
* style: CSSProperties,
|
|
19
|
+
* }} props - properties of Component
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
const NotificationThresholdComponent = (props) => {
|
|
23
|
+
|
|
24
|
+
const [value, setValue] = useState(1);
|
|
25
|
+
console.log(value);
|
|
26
|
+
|
|
27
|
+
const modalCustomStyles = {
|
|
28
|
+
overlay: {
|
|
29
|
+
position: "fixed",
|
|
30
|
+
top: 0,
|
|
31
|
+
left: 0,
|
|
32
|
+
right: 0,
|
|
33
|
+
bottom: 0,
|
|
34
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
35
|
+
zIndex: 9999999999,
|
|
36
|
+
transition: "opacity 2000ms ease-in-out",
|
|
37
|
+
},
|
|
38
|
+
content: {
|
|
39
|
+
position: "absolute",
|
|
40
|
+
overflow: "auto",
|
|
41
|
+
WebkitOverflowScrolling: "touch",
|
|
42
|
+
outline: "none",
|
|
43
|
+
top: "50%",
|
|
44
|
+
left: "50%",
|
|
45
|
+
right: "auto",
|
|
46
|
+
bottom: "auto",
|
|
47
|
+
marginRight: "-50%",
|
|
48
|
+
transform: "translate(-50%, -50%)",
|
|
49
|
+
borderRadius: "30px",
|
|
50
|
+
border: "none",
|
|
51
|
+
zIndex: 333333333,
|
|
52
|
+
background: "transparent",
|
|
53
|
+
width: "755px",
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Modal
|
|
59
|
+
isOpen={props.isOpen}
|
|
60
|
+
onRequestClose={props.onRequestClose}
|
|
61
|
+
style={modalCustomStyles}
|
|
62
|
+
closeTimeoutMS={2000}
|
|
63
|
+
>
|
|
64
|
+
<ModalCardContainer>
|
|
65
|
+
<CloseModalButton onClick={props.onRequestClose}>
|
|
66
|
+
<IoMdClose />
|
|
67
|
+
</CloseModalButton>
|
|
68
|
+
|
|
69
|
+
<CardContainer style={props.style}>
|
|
70
|
+
<CardHeader>
|
|
71
|
+
<h1> Set Treshold Notification </h1>
|
|
72
|
+
<h6>
|
|
73
|
+
Adjust the slider to set a treshold for your notification and
|
|
74
|
+
input a notification name
|
|
75
|
+
</h6>
|
|
76
|
+
</CardHeader>
|
|
77
|
+
|
|
78
|
+
<CardBody>
|
|
79
|
+
<form action="">
|
|
80
|
+
<SliderWithTooltip value={value} setValue={setValue} />
|
|
81
|
+
<div className="form__contents">
|
|
82
|
+
<div className="input__contents">
|
|
83
|
+
<InputComponent
|
|
84
|
+
inputType="text"
|
|
85
|
+
label="Notification Name"
|
|
86
|
+
inputName="notification_name"
|
|
87
|
+
value={""}
|
|
88
|
+
placeholder="Enter the name for this notification"
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
<ButtonComponent
|
|
92
|
+
type="secondary"
|
|
93
|
+
text={"Save"}
|
|
94
|
+
styles={{ marginTop: 31 }}
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
<div className="notification__wrapper"></div>
|
|
98
|
+
<div className="btn__footer">
|
|
99
|
+
<ButtonComponent type="secondary" text={"Cancel"} />
|
|
100
|
+
|
|
101
|
+
<ButtonComponent text={"Done"} />
|
|
102
|
+
</div>
|
|
103
|
+
</form>
|
|
104
|
+
</CardBody>
|
|
105
|
+
</CardContainer>
|
|
106
|
+
</ModalCardContainer>
|
|
107
|
+
</Modal>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export default NotificationThresholdComponent;
|