contentoh-components-library 21.0.74 → 21.0.78
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/.env.development +4 -2
- package/.env.production +4 -2
- package/CHANGELOG.md +39 -0
- package/dist/assets/images/editField/showPassword.png +0 -0
- package/dist/assets/images/sliderToolTip/infoIcon.svg +4 -0
- package/dist/assets/images/sliderToolTip/slide1.svg +5 -0
- package/dist/assets/images/sliderToolTip/slide2.svg +9 -0
- package/dist/assets/images/sliderToolTip/slide3.svg +9 -0
- package/dist/assets/images/sliderToolTip/slide4.svg +9 -0
- package/dist/assets/images/sliderToolTip/slide5.svg +40 -0
- package/dist/assets/images/verticalSideMenuMainPage/closeMenu.svg +4 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconFAQS.svg +12 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconGroup.svg +3 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconLogo.svg +12 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg +15 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconProduct.svg +3 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconSpeedometer.svg +12 -0
- package/dist/assets/images/verticalSideMenuMainPage/iconTask.svg +10 -0
- package/dist/assets/images/verticalSideMenuMainPage/openMenu.svg +4 -0
- package/dist/components/atoms/GeneralInput/index.js +2 -2
- package/dist/components/atoms/GradientPanel/styles.js +1 -1
- package/dist/components/atoms/Loading/Loading.stories.js +28 -0
- package/dist/components/atoms/Loading/index.js +1 -0
- package/dist/components/atoms/LogoImage/index.js +1 -0
- package/dist/components/atoms/SliderToolTip/SliderToolTip.stories.js +47 -0
- package/dist/components/atoms/SliderToolTip/index.js +200 -0
- package/dist/components/atoms/SliderToolTip/styles.js +24 -0
- package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +28 -0
- package/dist/components/atoms/VerticalSideMenuMainPage/index.js +99 -0
- package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +24 -0
- package/dist/components/molecules/CarouselImagesLogin/index.js +40 -42
- package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +28 -0
- package/dist/components/molecules/EmailResetPasswordLogin/index.js +153 -0
- package/dist/components/molecules/EmailResetPasswordLogin/styles.js +20 -0
- package/dist/components/molecules/LoginPasswordStrength/index.js +9 -9
- package/dist/components/molecules/LoginPasswordStrength/styles.js +1 -1
- package/dist/components/molecules/LogoLoading/Loading.stories.js +28 -0
- package/dist/components/molecules/LogoLoading/index.js +22 -0
- package/dist/components/molecules/LogoLoading/styles.js +18 -0
- package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +28 -0
- package/dist/components/molecules/RegistrationFirstStep/index.js +308 -0
- package/dist/components/molecules/RegistrationFirstStep/styles.js +20 -0
- package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +28 -0
- package/dist/components/molecules/RegistrationSecondStep/index.js +173 -0
- package/dist/components/molecules/RegistrationSecondStep/styles.js +20 -0
- package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +28 -0
- package/dist/components/molecules/RegistrationThirdStep/index.js +155 -0
- package/dist/components/molecules/RegistrationThirdStep/styles.js +20 -0
- package/dist/components/molecules/SignInLogin/SignInLogin.stories.js +28 -0
- package/dist/components/molecules/SignInLogin/index.js +315 -0
- package/dist/components/molecules/SignInLogin/styles.js +20 -0
- package/dist/components/molecules/StatusAsignationInfo/index.js +3 -2
- package/dist/components/molecules/TagAndInput/index.js +4 -2
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +28 -0
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +211 -0
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +20 -0
- package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +69 -0
- package/dist/components/organisms/ChangePassword/ChangePassword.stories.js +28 -0
- package/dist/components/organisms/ChangePassword/index.js +124 -0
- package/dist/components/organisms/ChangePassword/styles.js +18 -0
- package/dist/components/organisms/FullTabsMenu/index.js +4 -2
- package/dist/components/organisms/InputGroup/index.js +1 -0
- package/dist/components/pages/ProviderProductEdition/index.js +1 -0
- package/dist/components/pages/RetailerProductEdition/index.js +1 -0
- package/dist/components/pages/VerificationCodeResetPassword/index.js +1 -1
- package/dist/index.js +290 -30
- package/package.json +12 -4
- package/src/assets/images/editField/showPassword.png +0 -0
- package/src/assets/images/sliderToolTip/infoIcon.svg +4 -0
- package/src/assets/images/sliderToolTip/slide1.svg +5 -0
- package/src/assets/images/sliderToolTip/slide2.svg +9 -0
- package/src/assets/images/sliderToolTip/slide3.svg +9 -0
- package/src/assets/images/sliderToolTip/slide4.svg +9 -0
- package/src/assets/images/sliderToolTip/slide5.svg +40 -0
- package/src/assets/images/verticalSideMenuMainPage/closeMenu.svg +4 -0
- package/src/assets/images/verticalSideMenuMainPage/iconFAQS.svg +12 -0
- package/src/assets/images/verticalSideMenuMainPage/iconGroup.svg +3 -0
- package/src/assets/images/verticalSideMenuMainPage/iconLogo.svg +12 -0
- package/src/assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg +15 -0
- package/src/assets/images/verticalSideMenuMainPage/iconProduct.svg +3 -0
- package/src/assets/images/verticalSideMenuMainPage/iconSpeedometer.svg +12 -0
- package/src/assets/images/verticalSideMenuMainPage/iconTask.svg +10 -0
- package/src/assets/images/verticalSideMenuMainPage/openMenu.svg +4 -0
- package/src/components/atoms/GeneralInput/index.js +1 -1
- package/src/components/atoms/GradientPanel/styles.js +1 -0
- package/src/components/atoms/Loading/Loading.stories.js +10 -0
- package/src/components/atoms/Loading/index.js +3 -2
- package/src/components/atoms/LogoImage/index.js +1 -1
- package/src/components/atoms/SliderToolTip/SliderToolTip.stories.js +23 -0
- package/src/components/atoms/SliderToolTip/index.js +182 -0
- package/src/components/atoms/SliderToolTip/styles.js +168 -0
- package/src/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +12 -0
- package/src/components/atoms/VerticalSideMenuMainPage/index.js +55 -0
- package/src/components/atoms/VerticalSideMenuMainPage/styles.js +45 -0
- package/src/components/molecules/CarouselImagesLogin/index.js +34 -37
- package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +11 -0
- package/src/components/molecules/EmailResetPasswordLogin/index.js +85 -0
- package/src/components/molecules/EmailResetPasswordLogin/styles.js +23 -0
- package/src/components/molecules/LoginPasswordStrength/index.js +11 -6
- package/src/components/molecules/LoginPasswordStrength/styles.js +5 -1
- package/src/components/molecules/LogoLoading/Loading.stories.js +10 -0
- package/src/components/molecules/LogoLoading/index.js +12 -0
- package/src/components/molecules/LogoLoading/styles.js +16 -0
- package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +11 -0
- package/src/components/molecules/RegistrationFirstStep/index.js +227 -0
- package/src/components/molecules/RegistrationFirstStep/styles.js +87 -0
- package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +11 -0
- package/src/components/molecules/RegistrationSecondStep/index.js +136 -0
- package/src/components/molecules/RegistrationSecondStep/styles.js +64 -0
- package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +11 -0
- package/src/components/molecules/RegistrationThirdStep/index.js +130 -0
- package/src/components/molecules/RegistrationThirdStep/styles.js +44 -0
- package/src/components/molecules/SignInLogin/SignInLogin.stories.js +11 -0
- package/src/components/molecules/SignInLogin/index.js +226 -0
- package/src/components/molecules/SignInLogin/styles.js +120 -0
- package/src/components/molecules/StatusAsignationInfo/index.js +2 -1
- package/src/components/molecules/TagAndInput/index.js +2 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +11 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +171 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +54 -0
- package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +54 -0
- package/src/components/organisms/ChangePassword/ChangePassword.stories.js +11 -0
- package/src/components/organisms/ChangePassword/index.js +77 -0
- package/src/components/organisms/ChangePassword/styles.js +13 -0
- package/src/components/organisms/FullTabsMenu/index.js +2 -0
- package/src/components/organisms/InputGroup/index.js +1 -0
- package/src/components/pages/ProviderProductEdition/index.js +1 -0
- package/src/components/pages/RetailerProductEdition/index.js +1 -0
- package/src/components/pages/VerificationCodeResetPassword/index.js +1 -1
- package/src/index.js +21 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import iconLogoContentoh from "../../../assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg";
|
|
3
|
+
import iconProduct from "../../../assets/images/verticalSideMenuMainPage/iconProduct.svg";
|
|
4
|
+
import iconGroup from "../../../assets/images/verticalSideMenuMainPage/iconGroup.svg";
|
|
5
|
+
import iconLogo from "../../../assets/images/verticalSideMenuMainPage/iconLogo.svg";
|
|
6
|
+
import iconSpeedometer from "../../../assets/images/verticalSideMenuMainPage/iconSpeedometer.svg";
|
|
7
|
+
import iconTask from "../../../assets/images/verticalSideMenuMainPage/iconTask.svg";
|
|
8
|
+
import openMenu from "../../../assets/images/verticalSideMenuMainPage/openMenu.svg";
|
|
9
|
+
import React, { useState, useEffect, useCallback } from "react";
|
|
10
|
+
|
|
11
|
+
export const VerticalSideMenuMainPage = () => {
|
|
12
|
+
const [trueBar, setTrueBar] = useState(false);
|
|
13
|
+
const active = () => {
|
|
14
|
+
console.log(window.location.href);
|
|
15
|
+
//document.getElementById("slidea1").style.border= "1px solid rgb(227, 58, 169)";
|
|
16
|
+
};
|
|
17
|
+
return (
|
|
18
|
+
<Container bar={trueBar}>
|
|
19
|
+
<div className="navbar-top">
|
|
20
|
+
<img
|
|
21
|
+
src={trueBar ? iconLogoContentoh : iconLogo}
|
|
22
|
+
alt="Logo"
|
|
23
|
+
className="logo"
|
|
24
|
+
></img>
|
|
25
|
+
<div className="option">
|
|
26
|
+
<div>
|
|
27
|
+
<img src={iconSpeedometer} alt="Speed Meter" width={"25px"}></img>
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
<img src={iconProduct} alt="Focus Product" width={"25px"}></img>
|
|
31
|
+
</div>
|
|
32
|
+
<div>
|
|
33
|
+
<img src={iconGroup} alt="Group" width={"25px"}></img>
|
|
34
|
+
</div>
|
|
35
|
+
<div>
|
|
36
|
+
<img src={iconLogo} alt="Logo" width={"25px"}></img>
|
|
37
|
+
</div>
|
|
38
|
+
<div>
|
|
39
|
+
<img src={iconTask} alt="Task" width={"25px"}></img>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div>
|
|
44
|
+
<img
|
|
45
|
+
src={openMenu}
|
|
46
|
+
alt="Open Menu"
|
|
47
|
+
onClick={() => {
|
|
48
|
+
setTrueBar(true);
|
|
49
|
+
active();
|
|
50
|
+
}}
|
|
51
|
+
></img>
|
|
52
|
+
</div>
|
|
53
|
+
</Container>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div`
|
|
4
|
+
height: 100%;
|
|
5
|
+
width: ${({ bar }) => (bar ? 200 : 58)}px;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
padding: 23px 10px 70px 10px;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
overflow: auto;
|
|
11
|
+
border-radius: ${({ bar }) => (bar ? 20 : 50)}px;
|
|
12
|
+
background: linear-gradient(180deg, #e33aa9 0%, #3b1366 100%);
|
|
13
|
+
scrollbar-width: none;
|
|
14
|
+
display: flex;
|
|
15
|
+
text-align: center;
|
|
16
|
+
img {
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
width:"25px" !important;
|
|
19
|
+
}
|
|
20
|
+
.navbar-top {
|
|
21
|
+
& + * {
|
|
22
|
+
margin-top: 15px;
|
|
23
|
+
}
|
|
24
|
+
.option {
|
|
25
|
+
div {
|
|
26
|
+
height: 38px;
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
border-radius: 100%;
|
|
30
|
+
& + * {
|
|
31
|
+
margin-top: 12px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
div:hover {
|
|
35
|
+
background: #e33aa9;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
.logo {
|
|
39
|
+
cursor: default;
|
|
40
|
+
& + * {
|
|
41
|
+
margin-top: 225%;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
@@ -9,46 +9,43 @@ export const CarouselImagesLogin = ({
|
|
|
9
9
|
panelColor,
|
|
10
10
|
}) => {
|
|
11
11
|
const carouselStart = () => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
const images = panelImg;
|
|
13
|
+
let i = 1;
|
|
14
|
+
const img1 = document.querySelector("#img1");
|
|
15
|
+
const img2 = document.querySelector("#img2");
|
|
16
|
+
const divIndicadores = document.querySelector("#indicadores");
|
|
17
|
+
for (let index = 0; index < images.length; index++) {
|
|
18
|
+
const div = document.createElement("div");
|
|
19
|
+
div.classList.add("circles");
|
|
20
|
+
div.id = index;
|
|
21
|
+
divIndicadores.appendChild(div);
|
|
22
|
+
}
|
|
23
|
+
img1.src = images[0];
|
|
24
|
+
const circulos = document.querySelectorAll(".circles");
|
|
25
|
+
circulos[0].classList.add("resaltado");
|
|
26
|
+
const slideshow = () => {
|
|
27
|
+
img2.src = images[i];
|
|
28
|
+
const circulo_actual = Array.from(circulos).find((el) => el.id == i);
|
|
29
|
+
Array.from(circulos).forEach((cir) => cir.classList.remove("resaltado"));
|
|
30
|
+
circulo_actual.classList.add("resaltado");
|
|
31
|
+
img1.classList.add("right");
|
|
32
|
+
img2.classList.add("active");
|
|
33
|
+
i++;
|
|
34
|
+
if (i == images.length) {
|
|
35
|
+
i = 0;
|
|
23
36
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
cir.classList.remove("resaltado")
|
|
32
|
-
);
|
|
33
|
-
circulo_actual.classList.add("resaltado");
|
|
34
|
-
img1.classList.add("right");
|
|
35
|
-
img2.classList.add("active");
|
|
36
|
-
i++;
|
|
37
|
-
if (i == images.length) {
|
|
38
|
-
i = 0;
|
|
39
|
-
}
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
img1.src = img2.src;
|
|
42
|
-
img2.classList.remove("active");
|
|
43
|
-
img1.classList.remove("right");
|
|
44
|
-
}, 1000);
|
|
45
|
-
};
|
|
46
|
-
setInterval(slideshow, 4000);
|
|
47
|
-
});
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
img1.src = img2.src;
|
|
39
|
+
img2.classList.remove("active");
|
|
40
|
+
img1.classList.remove("right");
|
|
41
|
+
}, 1000);
|
|
42
|
+
};
|
|
43
|
+
setInterval(slideshow, 4000);
|
|
48
44
|
};
|
|
49
|
-
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
50
47
|
carouselStart();
|
|
51
|
-
},[])
|
|
48
|
+
}, []);
|
|
52
49
|
|
|
53
50
|
return (
|
|
54
51
|
<Container panelColor={panelColor}>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EmailResetPasswordLogin } from "./index";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/molecules/EmailResetPasswordLogin",
|
|
5
|
+
component: EmailResetPasswordLogin,
|
|
6
|
+
};
|
|
7
|
+
const Template = (args) => <EmailResetPasswordLogin {...args} />;
|
|
8
|
+
|
|
9
|
+
export const EmailResetPasswordLoginDefault = Template.bind({});
|
|
10
|
+
|
|
11
|
+
EmailResetPasswordLoginDefault.args = {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import { GradientPanel } from "../../atoms/GradientPanel";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { LogoImage } from "../../atoms/LogoImage";
|
|
5
|
+
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
6
|
+
import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
7
|
+
import { TagAndInput } from "../../molecules/TagAndInput";
|
|
8
|
+
import { Button } from "../../atoms/GeneralButton";
|
|
9
|
+
|
|
10
|
+
export const EmailResetPasswordLogin = (props) => {
|
|
11
|
+
const [emptyEmail, setEmptyEmail] = useState(false);
|
|
12
|
+
const [invalidEmail, setInvalidEmail] = useState(false);
|
|
13
|
+
const [showErrors, setShowErrors] = useState(false);
|
|
14
|
+
const [awsError, setAwsError] = useState("");
|
|
15
|
+
|
|
16
|
+
const validate = async (e) => {
|
|
17
|
+
let valid = true;
|
|
18
|
+
setShowErrors(true);
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
const email = document.querySelector("#emailInput").value.trim();
|
|
21
|
+
email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
|
|
22
|
+
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
|
|
23
|
+
email
|
|
24
|
+
)
|
|
25
|
+
? setInvalidEmail(true)
|
|
26
|
+
: setInvalidEmail(false);
|
|
27
|
+
emptyEmail && (valid = false);
|
|
28
|
+
invalidEmail && (valid = false);
|
|
29
|
+
if (valid) {
|
|
30
|
+
try {
|
|
31
|
+
await props.Auth.forgotPassword(email);
|
|
32
|
+
sessionStorage.setItem("email", JSON.stringify(email));
|
|
33
|
+
sessionStorage.setItem("resetPasswordProcess", JSON.stringify("true"));
|
|
34
|
+
props.setPaso(5);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
setAwsError(err.code);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const loginRight = [
|
|
42
|
+
<LogoImage key="1" />,
|
|
43
|
+
<div className="credenciales" key={"2"}>
|
|
44
|
+
<ScreenHeader
|
|
45
|
+
fontFamily={FontFamily.AvenirNext}
|
|
46
|
+
color={GlobalColors.s5}
|
|
47
|
+
text={"Ingresa tus credenciales"}
|
|
48
|
+
/>
|
|
49
|
+
</div>,
|
|
50
|
+
<div className="user" key="3">
|
|
51
|
+
<TagAndInput
|
|
52
|
+
inputType={"text"}
|
|
53
|
+
inputId={"emailInput"}
|
|
54
|
+
label={"Nombre de usuario"}
|
|
55
|
+
inputPlaceHolder={"username@contentoh.com"}
|
|
56
|
+
/>
|
|
57
|
+
{showErrors && emptyEmail && <label>Ingrese su correo</label>}
|
|
58
|
+
{showErrors && invalidEmail && !emptyEmail && (
|
|
59
|
+
<label>Ingrese un correo valido</label>
|
|
60
|
+
)}
|
|
61
|
+
{showErrors && awsError === "LimitExceededException" && (
|
|
62
|
+
<label>Has cambiado la contraseña recientemente, intenta despues</label>
|
|
63
|
+
)}
|
|
64
|
+
</div>,
|
|
65
|
+
<div className="button-center" key="4">
|
|
66
|
+
<Button
|
|
67
|
+
buttonType={"general-default-button"}
|
|
68
|
+
label={"Enviar"}
|
|
69
|
+
onClick={(e) => validate(e)}
|
|
70
|
+
/>
|
|
71
|
+
</div>,
|
|
72
|
+
<div className="back-login" key="5">
|
|
73
|
+
<p onClick={() => props.setPaso(7)}>Regresar...</p>
|
|
74
|
+
</div>,
|
|
75
|
+
];
|
|
76
|
+
return (
|
|
77
|
+
<Container>
|
|
78
|
+
<GradientPanel
|
|
79
|
+
componentsArray={loginRight}
|
|
80
|
+
panelType={"home-login"}
|
|
81
|
+
panelColor={GlobalColors.white}
|
|
82
|
+
/>
|
|
83
|
+
</Container>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
width: 50%;
|
|
7
|
+
height: 100vh;
|
|
8
|
+
.button-center {
|
|
9
|
+
text-align: center;
|
|
10
|
+
.general-default-button {
|
|
11
|
+
width: 160px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
.back-login {
|
|
15
|
+
text-align: center;
|
|
16
|
+
margin: 15px !important;
|
|
17
|
+
color: ${GlobalColors.secondary_magenta};
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
font-weight: bold;
|
|
20
|
+
font-family: ${FontFamily.Raleway};
|
|
21
|
+
font-size: 13px;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { Container, ItemPasswordStrength, Password } from "./styles";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { TagAndInput } from "../TagAndInput";
|
|
4
|
+
|
|
4
5
|
export const LoginPasswordStrength = ({
|
|
5
6
|
emptyPassword,
|
|
6
7
|
emptyConfirmPassword,
|
|
7
8
|
matchPasswords,
|
|
9
|
+
required,
|
|
8
10
|
}) => {
|
|
9
11
|
const [passwordStrength, setPasswordStrength] = useState(0);
|
|
10
12
|
let upperCaseLetters = /[A-Z]/g;
|
|
11
13
|
let numbers = /[0-9]/g;
|
|
12
14
|
let specialChar = /[‘!’,‘@’,‘#’,‘$’,‘%’,‘^’,‘&’,‘*’]/g;
|
|
15
|
+
|
|
13
16
|
useEffect(() => {
|
|
14
17
|
const inputValue = document.getElementById("newPasswordInput");
|
|
15
18
|
inputValue.addEventListener(
|
|
@@ -20,6 +23,7 @@ export const LoginPasswordStrength = ({
|
|
|
20
23
|
false
|
|
21
24
|
);
|
|
22
25
|
}, []);
|
|
26
|
+
|
|
23
27
|
const updateInfo = (e, newValue) => {
|
|
24
28
|
switch (e.target.id) {
|
|
25
29
|
case "newPasswordInput":
|
|
@@ -35,25 +39,25 @@ export const LoginPasswordStrength = ({
|
|
|
35
39
|
newValue.match(specialChar) &&
|
|
36
40
|
setPasswordStrength((passwordStrength) => passwordStrength + 1);
|
|
37
41
|
break;
|
|
38
|
-
case "confirmPasswordInput":
|
|
39
|
-
break;
|
|
40
42
|
default:
|
|
41
43
|
return;
|
|
42
44
|
}
|
|
43
45
|
};
|
|
46
|
+
|
|
44
47
|
return (
|
|
45
48
|
<Container>
|
|
46
|
-
<div className="user"
|
|
49
|
+
<div className="user">
|
|
47
50
|
<TagAndInput
|
|
48
51
|
inputType={"password"}
|
|
49
52
|
inputId={"newPasswordInput"}
|
|
50
53
|
label={"Ingrese su nueva contraseña"}
|
|
54
|
+
isRequired={required}
|
|
51
55
|
/>
|
|
52
56
|
{emptyPassword && (
|
|
53
57
|
<label>La contraseña debe ser minimo de 8 caracteres</label>
|
|
54
58
|
)}
|
|
55
59
|
</div>
|
|
56
|
-
<div className="divPasswordStrength"
|
|
60
|
+
<div className="divPasswordStrength">
|
|
57
61
|
<ItemPasswordStrength paso={1}>
|
|
58
62
|
<Password level={1} passwordStrength={passwordStrength} />
|
|
59
63
|
{passwordStrength === 1 && <p>Baja</p>}
|
|
@@ -71,11 +75,12 @@ export const LoginPasswordStrength = ({
|
|
|
71
75
|
{passwordStrength === 4 && <p>Fuerte</p>}
|
|
72
76
|
</ItemPasswordStrength>
|
|
73
77
|
</div>
|
|
74
|
-
<div className="user"
|
|
78
|
+
<div className="user">
|
|
75
79
|
<TagAndInput
|
|
76
80
|
inputType={"password"}
|
|
77
81
|
inputId={"confirmPasswordInput"}
|
|
78
82
|
label={"Confirme la nueva contraseña"}
|
|
83
|
+
isRequired={required}
|
|
79
84
|
/>
|
|
80
85
|
{emptyConfirmPassword && !emptyPassword && (
|
|
81
86
|
<label>Confirme la contraseña</label>
|
|
@@ -86,4 +91,4 @@ export const LoginPasswordStrength = ({
|
|
|
86
91
|
</div>
|
|
87
92
|
</Container>
|
|
88
93
|
);
|
|
89
|
-
};
|
|
94
|
+
};
|
|
@@ -3,6 +3,7 @@ import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
|
3
3
|
|
|
4
4
|
export const Container = styled.div`
|
|
5
5
|
width: 100%;
|
|
6
|
+
margin-bottom: 15px;
|
|
6
7
|
.divPasswordStrength {
|
|
7
8
|
width: 100%;
|
|
8
9
|
display: flex;
|
|
@@ -20,6 +21,9 @@ export const Container = styled.div`
|
|
|
20
21
|
font-family: ${FontFamily.Raleway_700};
|
|
21
22
|
font-size: 11px;
|
|
22
23
|
}
|
|
24
|
+
& + * {
|
|
25
|
+
margin-top: 20px;
|
|
26
|
+
}
|
|
23
27
|
`;
|
|
24
28
|
|
|
25
29
|
export const Password = styled.div`
|
|
@@ -84,4 +88,4 @@ export const ItemPasswordStrength = styled.div`
|
|
|
84
88
|
}
|
|
85
89
|
}};
|
|
86
90
|
}
|
|
87
|
-
`;
|
|
91
|
+
`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LogoLoading } from "./index";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/molecules/LogoLoading",
|
|
5
|
+
component: LogoLoading,
|
|
6
|
+
};
|
|
7
|
+
const Template = (args) => <LogoLoading {...args} />;
|
|
8
|
+
export const LogoLoadingDefault = Template.bind({});
|
|
9
|
+
|
|
10
|
+
LogoLoadingDefault.args = {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import { Loading } from "../../atoms/Loading";
|
|
3
|
+
import { LogoImage } from "../../atoms/LogoImage";
|
|
4
|
+
|
|
5
|
+
export const LogoLoading = () => {
|
|
6
|
+
return (
|
|
7
|
+
<Container>
|
|
8
|
+
<LogoImage/>
|
|
9
|
+
<Loading/>
|
|
10
|
+
</Container>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RegistrationFirstStep } from "./index";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/molecules/RegistrationFirstStep",
|
|
5
|
+
component: RegistrationFirstStep,
|
|
6
|
+
};
|
|
7
|
+
const Template = (args) => <RegistrationFirstStep {...args} />;
|
|
8
|
+
|
|
9
|
+
export const RegistrationFirstStepDefault = Template.bind({});
|
|
10
|
+
|
|
11
|
+
RegistrationFirstStepDefault.args = {};
|