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.
Files changed (130) hide show
  1. package/.env.development +4 -2
  2. package/.env.production +4 -2
  3. package/CHANGELOG.md +39 -0
  4. package/dist/assets/images/editField/showPassword.png +0 -0
  5. package/dist/assets/images/sliderToolTip/infoIcon.svg +4 -0
  6. package/dist/assets/images/sliderToolTip/slide1.svg +5 -0
  7. package/dist/assets/images/sliderToolTip/slide2.svg +9 -0
  8. package/dist/assets/images/sliderToolTip/slide3.svg +9 -0
  9. package/dist/assets/images/sliderToolTip/slide4.svg +9 -0
  10. package/dist/assets/images/sliderToolTip/slide5.svg +40 -0
  11. package/dist/assets/images/verticalSideMenuMainPage/closeMenu.svg +4 -0
  12. package/dist/assets/images/verticalSideMenuMainPage/iconFAQS.svg +12 -0
  13. package/dist/assets/images/verticalSideMenuMainPage/iconGroup.svg +3 -0
  14. package/dist/assets/images/verticalSideMenuMainPage/iconLogo.svg +12 -0
  15. package/dist/assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg +15 -0
  16. package/dist/assets/images/verticalSideMenuMainPage/iconProduct.svg +3 -0
  17. package/dist/assets/images/verticalSideMenuMainPage/iconSpeedometer.svg +12 -0
  18. package/dist/assets/images/verticalSideMenuMainPage/iconTask.svg +10 -0
  19. package/dist/assets/images/verticalSideMenuMainPage/openMenu.svg +4 -0
  20. package/dist/components/atoms/GeneralInput/index.js +2 -2
  21. package/dist/components/atoms/GradientPanel/styles.js +1 -1
  22. package/dist/components/atoms/Loading/Loading.stories.js +28 -0
  23. package/dist/components/atoms/Loading/index.js +1 -0
  24. package/dist/components/atoms/LogoImage/index.js +1 -0
  25. package/dist/components/atoms/SliderToolTip/SliderToolTip.stories.js +47 -0
  26. package/dist/components/atoms/SliderToolTip/index.js +200 -0
  27. package/dist/components/atoms/SliderToolTip/styles.js +24 -0
  28. package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +28 -0
  29. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +99 -0
  30. package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +24 -0
  31. package/dist/components/molecules/CarouselImagesLogin/index.js +40 -42
  32. package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +28 -0
  33. package/dist/components/molecules/EmailResetPasswordLogin/index.js +153 -0
  34. package/dist/components/molecules/EmailResetPasswordLogin/styles.js +20 -0
  35. package/dist/components/molecules/LoginPasswordStrength/index.js +9 -9
  36. package/dist/components/molecules/LoginPasswordStrength/styles.js +1 -1
  37. package/dist/components/molecules/LogoLoading/Loading.stories.js +28 -0
  38. package/dist/components/molecules/LogoLoading/index.js +22 -0
  39. package/dist/components/molecules/LogoLoading/styles.js +18 -0
  40. package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +28 -0
  41. package/dist/components/molecules/RegistrationFirstStep/index.js +308 -0
  42. package/dist/components/molecules/RegistrationFirstStep/styles.js +20 -0
  43. package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +28 -0
  44. package/dist/components/molecules/RegistrationSecondStep/index.js +173 -0
  45. package/dist/components/molecules/RegistrationSecondStep/styles.js +20 -0
  46. package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +28 -0
  47. package/dist/components/molecules/RegistrationThirdStep/index.js +155 -0
  48. package/dist/components/molecules/RegistrationThirdStep/styles.js +20 -0
  49. package/dist/components/molecules/SignInLogin/SignInLogin.stories.js +28 -0
  50. package/dist/components/molecules/SignInLogin/index.js +315 -0
  51. package/dist/components/molecules/SignInLogin/styles.js +20 -0
  52. package/dist/components/molecules/StatusAsignationInfo/index.js +3 -2
  53. package/dist/components/molecules/TagAndInput/index.js +4 -2
  54. package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +28 -0
  55. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +211 -0
  56. package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +20 -0
  57. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +69 -0
  58. package/dist/components/organisms/ChangePassword/ChangePassword.stories.js +28 -0
  59. package/dist/components/organisms/ChangePassword/index.js +124 -0
  60. package/dist/components/organisms/ChangePassword/styles.js +18 -0
  61. package/dist/components/organisms/FullTabsMenu/index.js +4 -2
  62. package/dist/components/organisms/InputGroup/index.js +1 -0
  63. package/dist/components/pages/ProviderProductEdition/index.js +1 -0
  64. package/dist/components/pages/RetailerProductEdition/index.js +1 -0
  65. package/dist/components/pages/VerificationCodeResetPassword/index.js +1 -1
  66. package/dist/index.js +290 -30
  67. package/package.json +12 -4
  68. package/src/assets/images/editField/showPassword.png +0 -0
  69. package/src/assets/images/sliderToolTip/infoIcon.svg +4 -0
  70. package/src/assets/images/sliderToolTip/slide1.svg +5 -0
  71. package/src/assets/images/sliderToolTip/slide2.svg +9 -0
  72. package/src/assets/images/sliderToolTip/slide3.svg +9 -0
  73. package/src/assets/images/sliderToolTip/slide4.svg +9 -0
  74. package/src/assets/images/sliderToolTip/slide5.svg +40 -0
  75. package/src/assets/images/verticalSideMenuMainPage/closeMenu.svg +4 -0
  76. package/src/assets/images/verticalSideMenuMainPage/iconFAQS.svg +12 -0
  77. package/src/assets/images/verticalSideMenuMainPage/iconGroup.svg +3 -0
  78. package/src/assets/images/verticalSideMenuMainPage/iconLogo.svg +12 -0
  79. package/src/assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg +15 -0
  80. package/src/assets/images/verticalSideMenuMainPage/iconProduct.svg +3 -0
  81. package/src/assets/images/verticalSideMenuMainPage/iconSpeedometer.svg +12 -0
  82. package/src/assets/images/verticalSideMenuMainPage/iconTask.svg +10 -0
  83. package/src/assets/images/verticalSideMenuMainPage/openMenu.svg +4 -0
  84. package/src/components/atoms/GeneralInput/index.js +1 -1
  85. package/src/components/atoms/GradientPanel/styles.js +1 -0
  86. package/src/components/atoms/Loading/Loading.stories.js +10 -0
  87. package/src/components/atoms/Loading/index.js +3 -2
  88. package/src/components/atoms/LogoImage/index.js +1 -1
  89. package/src/components/atoms/SliderToolTip/SliderToolTip.stories.js +23 -0
  90. package/src/components/atoms/SliderToolTip/index.js +182 -0
  91. package/src/components/atoms/SliderToolTip/styles.js +168 -0
  92. package/src/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +12 -0
  93. package/src/components/atoms/VerticalSideMenuMainPage/index.js +55 -0
  94. package/src/components/atoms/VerticalSideMenuMainPage/styles.js +45 -0
  95. package/src/components/molecules/CarouselImagesLogin/index.js +34 -37
  96. package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +11 -0
  97. package/src/components/molecules/EmailResetPasswordLogin/index.js +85 -0
  98. package/src/components/molecules/EmailResetPasswordLogin/styles.js +23 -0
  99. package/src/components/molecules/LoginPasswordStrength/index.js +11 -6
  100. package/src/components/molecules/LoginPasswordStrength/styles.js +5 -1
  101. package/src/components/molecules/LogoLoading/Loading.stories.js +10 -0
  102. package/src/components/molecules/LogoLoading/index.js +12 -0
  103. package/src/components/molecules/LogoLoading/styles.js +16 -0
  104. package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +11 -0
  105. package/src/components/molecules/RegistrationFirstStep/index.js +227 -0
  106. package/src/components/molecules/RegistrationFirstStep/styles.js +87 -0
  107. package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +11 -0
  108. package/src/components/molecules/RegistrationSecondStep/index.js +136 -0
  109. package/src/components/molecules/RegistrationSecondStep/styles.js +64 -0
  110. package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +11 -0
  111. package/src/components/molecules/RegistrationThirdStep/index.js +130 -0
  112. package/src/components/molecules/RegistrationThirdStep/styles.js +44 -0
  113. package/src/components/molecules/SignInLogin/SignInLogin.stories.js +11 -0
  114. package/src/components/molecules/SignInLogin/index.js +226 -0
  115. package/src/components/molecules/SignInLogin/styles.js +120 -0
  116. package/src/components/molecules/StatusAsignationInfo/index.js +2 -1
  117. package/src/components/molecules/TagAndInput/index.js +2 -0
  118. package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +11 -0
  119. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +171 -0
  120. package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +54 -0
  121. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +54 -0
  122. package/src/components/organisms/ChangePassword/ChangePassword.stories.js +11 -0
  123. package/src/components/organisms/ChangePassword/index.js +77 -0
  124. package/src/components/organisms/ChangePassword/styles.js +13 -0
  125. package/src/components/organisms/FullTabsMenu/index.js +2 -0
  126. package/src/components/organisms/InputGroup/index.js +1 -0
  127. package/src/components/pages/ProviderProductEdition/index.js +1 -0
  128. package/src/components/pages/RetailerProductEdition/index.js +1 -0
  129. package/src/components/pages/VerificationCodeResetPassword/index.js +1 -1
  130. package/src/index.js +21 -1
@@ -0,0 +1,227 @@
1
+ import { Container } from "./styles";
2
+ import { GradientPanel } from "../../atoms/GradientPanel";
3
+ import { useState, useEffect } 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
+ import { GeneralInput } from "../../atoms/GeneralInput";
10
+
11
+ export const RegistrationFirstStep = (props) => {
12
+ const [emptyName, setEmptyName] = useState(false);
13
+ const [emptyLastName, setEmptyLastName] = useState(false);
14
+ const [emptyEmail, setEmptyEmail] = useState(false);
15
+ const [emptyJob, setEmptyJob] = useState(false);
16
+ const [emptyPhone, setEmptyPhone] = useState(false);
17
+ const [emptyCountry, setEmptyCountry] = useState(false);
18
+ const [invalidEmail, setInvalidEmail] = useState(false);
19
+ const [phoneFormatError, setPhoneFormatError] = useState(false);
20
+ const [regError, setRegError] = useState(false);
21
+
22
+ useEffect(() => {
23
+ JSON.parse(sessionStorage.getItem("nuevoRegistro")).name === "" &&
24
+ sessionStorage.removeItem("registrationError");
25
+ sessionStorage.getItem("registrationError") && setRegError(true);
26
+ if (sessionStorage.getItem("registrationError")) {
27
+ setEmptyName(false);
28
+ setEmptyLastName(false);
29
+ setEmptyEmail(false);
30
+ setEmptyJob(false);
31
+ setEmptyCountry(false);
32
+ setEmptyPhone(false);
33
+ }
34
+ sessionStorage.getItem("resetPasswordProcess") &&
35
+ sessionStorage.getItem("resetPasswordProcess");
36
+ }, []);
37
+ const validate = (evt) => {
38
+ const name = document.querySelector("#nameInput").value;
39
+ const lastName = document.querySelector("#lastNameInput").value;
40
+ const email = document.querySelector("#emailInput").value;
41
+ const job = document.querySelector("#jobInput").value;
42
+ const phone = document.querySelector("#phoneInput").value;
43
+ const country = document.querySelector("#countrySelect").value;
44
+ const countryCode = document.querySelector("#countryCodeSelect").value;
45
+ let valid = true;
46
+ evt.preventDefault();
47
+ name === "" ? setEmptyName(true) : setEmptyName(false);
48
+ lastName === "" ? setEmptyLastName(true) : setEmptyLastName(false);
49
+ email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
50
+ job === "" ? setEmptyJob(true) : setEmptyJob(false);
51
+ phone === "" ? setEmptyPhone(true) : setEmptyPhone(false);
52
+ !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
53
+ email
54
+ )
55
+ ? setInvalidEmail(true)
56
+ : setInvalidEmail(false);
57
+ let invalidPhone = true;
58
+ country === "value" ? setEmptyCountry(true) : setEmptyCountry(false);
59
+ Array.from(phone).forEach((digit, i) => {
60
+ phone.charCodeAt(i) < 48
61
+ ? setPhoneFormatError(true)
62
+ : (invalidPhone = false);
63
+ phone.charCodeAt(i) > 57
64
+ ? setPhoneFormatError(true)
65
+ : (invalidPhone = false);
66
+ });
67
+ if (
68
+ name === "" ||
69
+ lastName === "" ||
70
+ email === "" ||
71
+ job === "" ||
72
+ phone === "" ||
73
+ country === "value" ||
74
+ !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
75
+ email
76
+ ) ||
77
+ invalidPhone
78
+ ) {
79
+ valid = false;
80
+ } else valid = true;
81
+ let nuevoUsuario = JSON.parse(sessionStorage.getItem("nuevoRegistro"));
82
+ if (valid) {
83
+ sessionStorage.setItem("countryCode", JSON.stringify(countryCode));
84
+ nuevoUsuario.name = name;
85
+ nuevoUsuario.lastName = lastName;
86
+ nuevoUsuario.email = email;
87
+ nuevoUsuario.position = job;
88
+ nuevoUsuario.phone = `${JSON.parse(
89
+ sessionStorage.getItem("countryCode")
90
+ )}${phone}`;
91
+ nuevoUsuario.country = country;
92
+ sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoUsuario));
93
+ !regError && valid && props.setPaso((paso) => props.paso + 1);
94
+ regError && valid && props.setPaso(4);
95
+ }
96
+ };
97
+
98
+ const loginRight = [
99
+ <LogoImage key="1" />,
100
+ <div className="credenciales" key={"2"}>
101
+ <ScreenHeader
102
+ fontFamily={FontFamily.AvenirNext}
103
+ color={GlobalColors.s5}
104
+ text={"Ingresa tus credenciales"}
105
+ />
106
+ </div>,
107
+ <div className="user" key="3">
108
+ <div className="name-registration-user">
109
+ <TagAndInput
110
+ inputType={"text"}
111
+ inputId={"nameInput"}
112
+ label={"Nombre"}
113
+ inputPlaceHolder={"Nombre"}
114
+ required={"required"}
115
+ />
116
+ <TagAndInput
117
+ inputType={"text"}
118
+ inputId={"lastNameInput"}
119
+ label={"Apellido"}
120
+ inputPlaceHolder={"Apellido"}
121
+ required={"required"}
122
+ />
123
+ </div>
124
+ {emptyName && <label>Ingrese su nombre</label>}
125
+ {emptyLastName && (
126
+ <label className="lastname">Ingrese sus apellidos</label>
127
+ )}
128
+ <TagAndInput
129
+ inputType={"text"}
130
+ inputId={"emailInput"}
131
+ label={"Correo electrónico"}
132
+ inputPlaceHolder={"username@contentoh.com"}
133
+ required={"required"}
134
+ />
135
+ {regError &&
136
+ JSON.parse(sessionStorage.getItem("registrationError")) ===
137
+ "emailExists" && (
138
+ <label>Ya existe una cuenta asociada a este correo</label>
139
+ )}
140
+ {emptyEmail && <label>Ingrese su email</label>}
141
+ {invalidEmail && !emptyEmail && <label>Ingrese un correo válido</label>}
142
+ <TagAndInput
143
+ inputType={"text"}
144
+ inputId={"jobInput"}
145
+ label={"Puesto laboral"}
146
+ inputPlaceHolder={"Puesto dentro de la empresa"}
147
+ required={"required"}
148
+ />
149
+ {emptyJob && <label>Ingrese su puesto</label>}
150
+ <ScreenHeader text={"Teléfono"} headerType={"input-name-header"} />
151
+ <div className="phone-registration-user">
152
+ <select name="select" className="phone-options" id="countryCodeSelect">
153
+ <option>+52</option>
154
+ <option>+54</option>
155
+ <option>+57</option>
156
+ <option>+506</option>
157
+ <option>+593</option>
158
+ <option>+503</option>
159
+ <option>+504</option>
160
+ <option>+507</option>
161
+ <option>+51</option>
162
+ </select>
163
+ <GeneralInput
164
+ inputId={"phoneInput"}
165
+ inputType={"text"}
166
+ inputPlaceholder={"Teléfono"}
167
+ required={"required"}
168
+ />
169
+ </div>
170
+ {regError &&
171
+ JSON.parse(sessionStorage.getItem("registrationError")) ===
172
+ "phoneFormatError" && <label>Introduzca un número válido</label>}
173
+ {emptyPhone && <label>Ingrese su número de teléfono</label>}
174
+ {phoneFormatError && (
175
+ <label>Introduzca un número valido ( Solo numeros )</label>
176
+ )}
177
+ <ScreenHeader text={"País"} headerType={"input-name-header"} />
178
+ <select name="select" className="country-options" id="countrySelect">
179
+ <option value="value" selected>
180
+ Selecciona tu país
181
+ </option>
182
+ <option value="Argentina">Argentina</option>
183
+ <option value="Colombia">Colombia</option>
184
+ <option value="Ecuador">Ecuador</option>
185
+ <option value="El Salvador">El Salvador</option>
186
+ <option value="Honduras">Honduras</option>
187
+ <option value="México">México</option>
188
+ <option value="Panamá">Panamá</option>
189
+ <option value="Perú">Perú</option>
190
+ </select>
191
+ {emptyCountry && <label>Seleccione su país</label>}
192
+ </div>,
193
+ <div className="button-end" key="4">
194
+ <Button
195
+ buttonType={"general-default-button"}
196
+ label={"Enviar"}
197
+ onClick={(e) => {
198
+ validate(e);
199
+ }}
200
+ />
201
+ </div>,
202
+ <div className="progress-bar" key="5">
203
+ <div className="progress-bar-first-step"></div>
204
+ <div className="progress-bar-registration"></div>
205
+ </div>,
206
+ <ScreenHeader
207
+ text={"Paso 1"}
208
+ headerType={"date-header"}
209
+ color={GlobalColors.s4}
210
+ key="6"
211
+ />,
212
+ <div className="new-login" key="7">
213
+ <p className="pre-registro" onClick={() => props.setPaso(7)}>
214
+ ¿Ya tienes una cuenta?<span> Inicia Sesión</span>
215
+ </p>
216
+ </div>,
217
+ ];
218
+ return (
219
+ <Container>
220
+ <GradientPanel
221
+ componentsArray={loginRight}
222
+ panelType={"home-login"}
223
+ panelColor={GlobalColors.white}
224
+ />
225
+ </Container>
226
+ );
227
+ };
@@ -0,0 +1,87 @@
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
+ .user {
9
+ .name-registration-user {
10
+ display: flex;
11
+ justify-content: space-between;
12
+ input {
13
+ width: 160px;
14
+ }
15
+ }
16
+ .lastname {
17
+ margin-left: 69%;
18
+ }
19
+ .input-name-header {
20
+ margin-bottom: 4px;
21
+ margin-top: 12px;
22
+ }
23
+ .phone-registration-user {
24
+ display: flex;
25
+ justify-content: space-between;
26
+ .phone-options {
27
+ width: 80px;
28
+ }
29
+ input {
30
+ width: 100%;
31
+ }
32
+ & + * {
33
+ margin-top: 10px;
34
+ }
35
+ }
36
+ .country-options,
37
+ .phone-options {
38
+ width: 100%;
39
+ border: 1px solid ${GlobalColors.s2};
40
+ font-family: ${FontFamily.AvenirNext};
41
+ color: ${GlobalColors.s4};
42
+ font-weight: normal;
43
+ font-size: 12px;
44
+ line-height: 15px;
45
+ padding: 10px;
46
+ outline: none;
47
+ border-radius: 2px;
48
+ resize: none;
49
+ &:focus {
50
+ border: 1px solid ${GlobalColors.magenta_s2};
51
+ }
52
+ }
53
+ }
54
+ .button-end {
55
+ text-align: end;
56
+ .general-default-button {
57
+ width: 160px;
58
+ }
59
+ & + * {
60
+ margin-top: 10px;
61
+ }
62
+ }
63
+ .progress-bar {
64
+ width: 100%;
65
+ height: 8px;
66
+ display: flex;
67
+ justify-content: space-between;
68
+ .progress-bar-first-step {
69
+ width: 33.33%;
70
+ background-color: rgb(196, 196, 196);
71
+ }
72
+ .progress-bar-registration {
73
+ background-color: rgb(226, 226, 226);
74
+ width: 66.66%;
75
+ }
76
+ }
77
+ .date-header {
78
+ .new-login {
79
+ & + * {
80
+ margin-top: 20px;
81
+ }
82
+ }
83
+ }
84
+ .pre-registro {
85
+ cursor: pointer;
86
+ }
87
+ `;
@@ -0,0 +1,11 @@
1
+ import { RegistrationSecondStep } from "./index";
2
+
3
+ export default {
4
+ title: "Components/molecules/RegistrationSecondStep",
5
+ component: RegistrationSecondStep,
6
+ };
7
+ const Template = (args) => <RegistrationSecondStep {...args} />;
8
+
9
+ export const RegistrationSecondStepDefault = Template.bind({});
10
+
11
+ RegistrationSecondStepDefault.args = {};
@@ -0,0 +1,136 @@
1
+ import { Container } from "./styles";
2
+ import { GradientPanel } from "../../atoms/GradientPanel";
3
+ import { useState } from "react";
4
+ import { ScreenHeader } from "../../atoms/ScreenHeader";
5
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
6
+ import { Button } from "../../atoms/GeneralButton";
7
+ import { LoginPasswordStrength } from "../../molecules/LoginPasswordStrength";
8
+ import { LogoImage } from "../../atoms/LogoImage";
9
+
10
+ export const RegistrationSecondStep = (props) => {
11
+ const [privacyCheck, setPrivacyCheck] = useState(false);
12
+ const [termsCheck, setTermsCheck] = useState(false);
13
+ const [emptyPassword, setEmptyPassword] = useState(false);
14
+ const [emptyConfirmPassword, setEmptyConfirmPassword] = useState(false);
15
+ const [matchPasswords, setMatchPasswords] = useState(true);
16
+ let nuevoUsuario = JSON.parse(sessionStorage.getItem("nuevoRegistro"));
17
+
18
+ const validateForm = (evt, valid) => {
19
+ evt.preventDefault();
20
+ const password = document.querySelector("#newPasswordInput").value;
21
+ !termsCheck && (valid = false);
22
+ !privacyCheck && (valid = false);
23
+ if (valid) {
24
+ console.log(valid)
25
+ nuevoUsuario.password = password;
26
+ sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoUsuario));
27
+ valid && props.setPaso(3);
28
+ }
29
+ };
30
+ const validate = (e) => {
31
+ e.preventDefault();
32
+ let valid = true;
33
+ const password = document.querySelector("#newPasswordInput").value;
34
+ password.length < 8 ? setEmptyPassword(true) : setEmptyPassword(false);
35
+ const confirmPassword = document.querySelector(
36
+ "#confirmPasswordInput"
37
+ ).value;
38
+ confirmPassword === ""
39
+ ? setEmptyConfirmPassword(true)
40
+ : setEmptyConfirmPassword(false);
41
+ password === confirmPassword
42
+ ? setMatchPasswords(true)
43
+ : setMatchPasswords(false);
44
+ if (
45
+ password.length < 8 ||
46
+ confirmPassword === "" ||
47
+ password !== confirmPassword
48
+ ) {
49
+ valid = false;
50
+ }
51
+ return valid;
52
+ };
53
+ const loginRight = [
54
+ <LogoImage key="1" />,
55
+ <div className="credenciales" key={"2"}>
56
+ <ScreenHeader
57
+ fontFamily={FontFamily.AvenirNext}
58
+ color={GlobalColors.s5}
59
+ text={"Ingresa tus credenciales"}
60
+ />
61
+ </div>,
62
+ <LoginPasswordStrength
63
+ key={"3"}
64
+ emptyPassword={emptyPassword}
65
+ emptyConfirmPassword={emptyConfirmPassword}
66
+ matchPasswords={matchPasswords}
67
+ textTittle={"Ingresa tus credenciales"}
68
+ required={"required"}
69
+ />,
70
+ <label className="label-terms" key={"4"}>
71
+ Términos y condiciones
72
+ </label>,
73
+ <div className="checkbox-terms" key={"5"}>
74
+ <input type="checkbox" onClick={(e) => setTermsCheck(e.target.checked)} />
75
+ <ScreenHeader
76
+ text={
77
+ "Conoce nuestros termnios y condiciones de cada uno de nuestros servicios. Si tienes algunda duda o comentario escríbenos."
78
+ }
79
+ headerType={"date-header"}
80
+ />
81
+ </div>,
82
+ <label className="label-terms" key={"6"}>
83
+ Aviso de privacidad
84
+ </label>,
85
+ <div className="checkbox-terms" key={"7"}>
86
+ <input
87
+ type="checkbox"
88
+ onClick={(e) => setPrivacyCheck(e.target.checked)}
89
+ />
90
+ <ScreenHeader
91
+ text={"Todos los datos estan protegidos."}
92
+ headerType={"date-header"}
93
+ />
94
+ </div>,
95
+ <div className="button-end" key="8">
96
+ {(!termsCheck || !privacyCheck) && (
97
+ <label className="terms">
98
+ *Aceptar los términos y condiciones y el aviso de privacidad
99
+ </label>
100
+ )}
101
+ <Button
102
+ buttonType={"general-default-button"}
103
+ label={"Enviar"}
104
+ onClick={(e) => {
105
+ let flag = validate(e);
106
+ validateForm(e, flag);
107
+ }}
108
+ />
109
+ </div>,
110
+ <div className="progress-bar" key={"9"}>
111
+ <div className="progress-bar-first-step-check"></div>
112
+ <div className="progress-bar-second-step"></div>
113
+ <div className="progress-bar-registration"></div>
114
+ </div>,
115
+ <ScreenHeader
116
+ text={"Paso 2"}
117
+ headerType={"date-header"}
118
+ color={GlobalColors.s4}
119
+ key={"10"}
120
+ />,
121
+ <div className="new-login" key="11">
122
+ <p className="pre-registro">
123
+ ¿Aún no tienes cuenta?<span> Regístrate</span>
124
+ </p>
125
+ </div>,
126
+ ];
127
+ return (
128
+ <Container>
129
+ <GradientPanel
130
+ panelColor={GlobalColors.white}
131
+ componentsArray={loginRight}
132
+ panelType={"home-login"}
133
+ ></GradientPanel>
134
+ </Container>
135
+ );
136
+ };
@@ -0,0 +1,64 @@
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-end {
9
+ display: flex;
10
+ flex-direction: column;
11
+ align-items: flex-end;
12
+ .general-default-button {
13
+ width: 160px;
14
+ }
15
+ .terms{
16
+ margin-bottom: 5px;
17
+ }
18
+ & + * {
19
+ margin-top: 10px;
20
+ }
21
+ }
22
+ .progress-bar {
23
+ width: 100%;
24
+ height: 8px;
25
+ display: flex;
26
+ justify-content: space-between;
27
+ .progress-bar-first-step-check {
28
+ width: 33.33%;
29
+ background-color: ${GlobalColors.exported};
30
+ }
31
+ .progress-bar-second-step {
32
+ width: 33.33%;
33
+ background-color: rgb(196, 196, 196);
34
+ }
35
+ .progress-bar-registration {
36
+ background-color: rgb(226, 226, 226);
37
+ width: 33.33%;
38
+ }
39
+ }
40
+ .date-header {
41
+ margin-left: 33.33%;
42
+ }
43
+ .checkbox-terms {
44
+ display: flex;
45
+ margin-bottom: 5px;
46
+ input {
47
+ cursor: pointer;
48
+ & + * {
49
+ margin-left: 15px;
50
+ }
51
+ }
52
+ }
53
+ .label-terms {
54
+ color: rgb(129, 115, 147);
55
+ font-size: 13px;
56
+ line-height: 24px;
57
+ font-weight: 700;
58
+ cursor: pointer;
59
+ margin-left: 25px;
60
+ & + * {
61
+ margin-top: 5px;
62
+ }
63
+ }
64
+ `;
@@ -0,0 +1,11 @@
1
+ import { RegistrationThirdStep } from "./index";
2
+
3
+ export default {
4
+ title: "Components/molecules/RegistrationThirdStep",
5
+ component: RegistrationThirdStep,
6
+ };
7
+ const Template = (args) => <RegistrationThirdStep {...args} />;
8
+
9
+ export const RegistrationThirdStepDefault = Template.bind({});
10
+
11
+ RegistrationThirdStepDefault.args = {};
@@ -0,0 +1,130 @@
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 RegistrationThirdStep = (props) => {
11
+ const [emptyCommercialName, setEmptyCommercialName] = useState(false);
12
+ const [emptyBussinesName, setEmptyBussinesName] = useState(false);
13
+ const [emptyRFC, setEmptyRFC] = useState(false);
14
+ const [emptyFiscalAddress, setEmptyFiscalAddress] = useState(false);
15
+
16
+ let nuevoRegistro = JSON.parse(sessionStorage.getItem("nuevoRegistro"));
17
+
18
+ const validate = (e) => {
19
+ e.preventDefault();
20
+ let valid = true;
21
+ const commercialName = document.querySelector("#commercialNameInput").value;
22
+ const bussinesName = document.querySelector("#bussinesNameInput").value;
23
+ const RFC = document.querySelector("#rfcInput").value;
24
+ const FiscalAddress = document.querySelector("#fiscalAddressInput").value;
25
+ commercialName === ""
26
+ ? setEmptyCommercialName(true)
27
+ : setEmptyCommercialName(false);
28
+ bussinesName === ""
29
+ ? setEmptyBussinesName(true)
30
+ : setEmptyBussinesName(false);
31
+ RFC === "" ? setEmptyRFC(true) : setEmptyRFC(false);
32
+ FiscalAddress === ""
33
+ ? setEmptyFiscalAddress(true)
34
+ : setEmptyFiscalAddress(false);
35
+ if (
36
+ commercialName === "" ||
37
+ bussinesName === "" ||
38
+ RFC === "" ||
39
+ FiscalAddress === ""
40
+ ) {
41
+ valid = false;
42
+ }
43
+ if (valid) {
44
+ nuevoRegistro.commercialName = commercialName;
45
+ nuevoRegistro.companyName = bussinesName;
46
+ nuevoRegistro.rfc = RFC;
47
+ nuevoRegistro.adress = FiscalAddress;
48
+ sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoRegistro));
49
+ props.setPaso(props.paso + 1);
50
+ }
51
+ };
52
+
53
+ const loginRight = [
54
+ <LogoImage key="1" />,
55
+ <div className="credenciales" key={"2"}>
56
+ <ScreenHeader
57
+ fontFamily={FontFamily.AvenirNext}
58
+ color={GlobalColors.s5}
59
+ text={"Ingresa tus credenciales"}
60
+ />
61
+ </div>,
62
+ <div className="user" key="3">
63
+ <TagAndInput
64
+ inputType={"text"}
65
+ inputId={"commercialNameInput"}
66
+ label={"Nombre comercial"}
67
+ inputPlaceHolder={"Nombre comercial"}
68
+ />
69
+ {emptyCommercialName && (
70
+ <label>Ingrese el nombre comercial de la empresa</label>
71
+ )}
72
+ <TagAndInput
73
+ inputType={"text"}
74
+ inputId={"bussinesNameInput"}
75
+ label={"Razón social"}
76
+ inputPlaceHolder={"Razón social"}
77
+ />
78
+ {emptyBussinesName && (
79
+ <label>Ingrese la razón social de la empresa</label>
80
+ )}
81
+ <TagAndInput
82
+ inputType={"text"}
83
+ inputId={"rfcInput"}
84
+ label={"RFC"}
85
+ inputPlaceHolder={"RFC"}
86
+ />
87
+ {emptyRFC && <label>El RFC es requerido</label>}
88
+ <TagAndInput
89
+ inputType={"text"}
90
+ inputId={"fiscalAddressInput"}
91
+ label={"Direccion fiscal"}
92
+ inputPlaceHolder={"Dirección fiscal"}
93
+ />
94
+ {emptyFiscalAddress && (
95
+ <label>Ingrese la direccion fiscal de la empresa</label>
96
+ )}
97
+ </div>,
98
+ <div className="button-end" key="4">
99
+ <Button
100
+ buttonType={"general-default-button"}
101
+ label={"Enviar"}
102
+ onClick={(e) => validate(e)}
103
+ />
104
+ </div>,
105
+ <div className="progress-bar" key="5">
106
+ <div className="progress-bar-step-check"></div>
107
+ <div className="progress-bar-registration"></div>
108
+ </div>,
109
+ <ScreenHeader
110
+ text={"Paso 3"}
111
+ headerType={"date-header"}
112
+ color={GlobalColors.s4}
113
+ key="6"
114
+ />,
115
+ <div className="new-login" key="7">
116
+ <p className="pre-registro">
117
+ ¿Ya tienes una cuenta?<span> Inicia Sesión</span>
118
+ </p>
119
+ </div>,
120
+ ];
121
+ return (
122
+ <Container>
123
+ <GradientPanel
124
+ componentsArray={loginRight}
125
+ panelType={"home-login"}
126
+ panelColor={GlobalColors.white}
127
+ />
128
+ </Container>
129
+ );
130
+ };