contentoh-components-library 21.0.28 → 21.0.31

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 (213) hide show
  1. package/.env.development +18 -3
  2. package/.env.production +16 -1
  3. package/CHANGELOG.md +31 -33
  4. package/dist/assets/images/generalButton/downloadIcon.svg +3 -0
  5. package/dist/assets/images/modalsSVGs/attributesSent.svg +208 -0
  6. package/dist/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  7. package/dist/assets/images/modalsSVGs/providerSent.svg +445 -0
  8. package/dist/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  9. package/dist/components/atoms/AsignationOption/index.js +9 -5
  10. package/dist/components/atoms/AsignationOption/styles.js +1 -1
  11. package/dist/components/{molecules/SignInLogin/SignInLogin.stories.js → atoms/CharCounter/CharCounter.stories.js} +10 -7
  12. package/dist/components/atoms/CharCounter/index.js +22 -0
  13. package/dist/components/{molecules/ApproveRejetPanel → atoms/CharCounter}/styles.js +3 -1
  14. package/dist/components/atoms/CheckBox/index.js +4 -2
  15. package/dist/components/atoms/Commentary/Commentary.stories.js +1 -0
  16. package/dist/components/atoms/Commentary/index.js +23 -0
  17. package/dist/components/atoms/{VerticalSideMenuMainPage → Commentary}/styles.js +6 -1
  18. package/dist/components/atoms/GeneralButton/index.js +5 -0
  19. package/dist/components/atoms/GeneralButton/styles.js +4 -2
  20. package/dist/components/atoms/GeneralInput/index.js +73 -24
  21. package/dist/components/atoms/GeneralInput/styles.js +7 -1
  22. package/dist/components/atoms/GenericModal/index.js +4 -2
  23. package/dist/components/atoms/GenericModal/styles.js +1 -1
  24. package/dist/components/atoms/Input/index.js +26 -0
  25. package/dist/components/atoms/Input/style.js +26 -0
  26. package/dist/components/{organisms/ChangePassword/ChangePassword.stories.js → atoms/InputFormatter/Wysiwyg.stories.js} +9 -7
  27. package/dist/components/atoms/InputFormatter/index.js +185 -0
  28. package/dist/components/atoms/InputFormatter/styles.js +33 -0
  29. package/dist/components/atoms/LabelToInput/index.js +53 -0
  30. package/dist/components/atoms/LabelToInput/style.js +22 -0
  31. package/dist/components/atoms/Loading/index.js +1 -2
  32. package/dist/components/atoms/Loading/styles.js +8 -4
  33. package/dist/components/atoms/Percent/Percent.stories.js +39 -0
  34. package/dist/components/atoms/Percent/index.js +39 -0
  35. package/dist/components/atoms/Percent/styles.js +20 -0
  36. package/dist/components/atoms/PriorityFlag/index.js +1 -1
  37. package/dist/components/atoms/ProductImage/styles.js +1 -1
  38. package/dist/components/atoms/ProgressBar/index.js +2 -2
  39. package/dist/components/atoms/ProgressBar/styles.js +3 -5
  40. package/dist/components/atoms/ScreenHeader/index.js +1 -1
  41. package/dist/components/atoms/ScreenHeader/styles.js +1 -1
  42. package/dist/components/atoms/Select/index.js +39 -0
  43. package/dist/components/atoms/Select/style.js +32 -0
  44. package/dist/components/atoms/StatusTag/index.js +37 -2
  45. package/dist/components/atoms/StatusTag/styles.js +1 -1
  46. package/dist/components/atoms/ValidationPanel/index.js +4 -3
  47. package/dist/components/molecules/AvatarAndValidation/index.js +17 -7
  48. package/dist/components/molecules/AvatarAndValidation/styles.js +1 -1
  49. package/dist/components/molecules/CarouselImagesLogin/index.js +42 -40
  50. package/dist/components/molecules/FeaturesBar/index.js +1 -1
  51. package/dist/components/molecules/GalleryElement/index.js +80 -21
  52. package/dist/components/molecules/GalleryElement/styles.js +1 -1
  53. package/dist/components/molecules/GalleryHeader/index.js +28 -6
  54. package/dist/components/molecules/GalleryHeader/styles.js +1 -1
  55. package/dist/components/molecules/ImageSelector/index.js +2 -4
  56. package/dist/components/molecules/ProductNameHeader/index.js +1 -2
  57. package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +48 -0
  58. package/dist/components/molecules/RetailerSelector/index.js +74 -0
  59. package/dist/components/{atoms/MenuCommercialRetailers → molecules/RetailerSelector}/styles.js +1 -1
  60. package/dist/components/molecules/StatusAsignationInfo/index.js +46 -25
  61. package/dist/components/molecules/StatusAsignationInfo/styles.js +1 -1
  62. package/dist/components/molecules/TableHeader/index.js +12 -5
  63. package/dist/components/molecules/TableHeader/styles.js +1 -1
  64. package/dist/components/molecules/TagAndInput/index.js +26 -2
  65. package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +31 -0
  66. package/dist/components/molecules/TextAndGradient/index.js +36 -0
  67. package/dist/components/molecules/TextAndGradient/styles.js +18 -0
  68. package/dist/components/organisms/FullProductNameHeader/index.js +32 -8
  69. package/dist/components/organisms/FullTabsMenu/index.js +18 -5
  70. package/dist/components/organisms/ImageDataTable/index.js +90 -14
  71. package/dist/components/organisms/InputGroup/index.js +34 -13
  72. package/dist/components/organisms/InputGroup/styles.js +1 -1
  73. package/dist/components/organisms/ProductImageModal/index.js +15 -11
  74. package/dist/components/organisms/ProductImageModal/styles.js +1 -1
  75. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +109 -347
  76. package/dist/components/pages/RetailerProductEdition/index.js +1589 -59
  77. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  78. package/dist/global-files/data.js +212 -53
  79. package/dist/global-files/global-styles.css +1 -0
  80. package/dist/global-files/variables.js +1 -0
  81. package/dist/index.js +30 -238
  82. package/package.json +12 -10
  83. package/src/assets/images/generalButton/downloadIcon.svg +3 -0
  84. package/src/assets/images/modalsSVGs/attributesSent.svg +208 -0
  85. package/src/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  86. package/src/assets/images/modalsSVGs/providerSent.svg +445 -0
  87. package/src/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  88. package/src/components/atoms/AsignationOption/index.js +7 -5
  89. package/src/components/atoms/AsignationOption/styles.js +9 -1
  90. package/src/components/atoms/CharCounter/CharCounter.stories.js +11 -0
  91. package/src/components/atoms/CharCounter/index.js +13 -0
  92. package/src/components/atoms/CharCounter/styles.js +10 -0
  93. package/src/components/atoms/CheckBox/index.js +8 -2
  94. package/src/components/atoms/Commentary/Commentary.stories.js +0 -0
  95. package/src/components/atoms/Commentary/index.js +9 -0
  96. package/src/components/atoms/Commentary/styles.js +16 -0
  97. package/src/components/atoms/GeneralButton/index.js +9 -2
  98. package/src/components/atoms/GeneralButton/styles.js +23 -0
  99. package/src/components/atoms/GeneralInput/index.js +71 -21
  100. package/src/components/atoms/GeneralInput/styles.js +11 -1
  101. package/src/components/atoms/GenericModal/index.js +2 -2
  102. package/src/components/atoms/GenericModal/styles.js +10 -2
  103. package/src/components/atoms/Input/index.js +15 -0
  104. package/src/components/atoms/Input/style.js +31 -0
  105. package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +12 -0
  106. package/src/components/atoms/InputFormatter/index.js +141 -0
  107. package/src/components/atoms/InputFormatter/styles.js +40 -0
  108. package/src/components/atoms/LabelToInput/index.js +26 -0
  109. package/src/components/atoms/LabelToInput/style.js +41 -0
  110. package/src/components/atoms/Loading/index.js +4 -5
  111. package/src/components/atoms/Loading/styles.js +43 -43
  112. package/src/components/atoms/PriorityFlag/index.js +1 -1
  113. package/src/components/atoms/ProductImage/styles.js +1 -1
  114. package/src/components/atoms/ProgressBar/index.js +2 -2
  115. package/src/components/atoms/ProgressBar/styles.js +54 -3
  116. package/src/components/atoms/ScreenHeader/index.js +7 -3
  117. package/src/components/atoms/ScreenHeader/styles.js +9 -2
  118. package/src/components/atoms/Select/index.js +35 -0
  119. package/src/components/atoms/Select/style.js +76 -0
  120. package/src/components/atoms/StatusTag/index.js +30 -2
  121. package/src/components/atoms/StatusTag/styles.js +15 -3
  122. package/src/components/atoms/ValidationPanel/index.js +3 -3
  123. package/src/components/molecules/AvatarAndValidation/index.js +24 -6
  124. package/src/components/molecules/AvatarAndValidation/styles.js +1 -1
  125. package/src/components/molecules/CarouselImagesLogin/index.js +37 -34
  126. package/src/components/molecules/FeaturesBar/index.js +10 -7
  127. package/src/components/molecules/GalleryElement/index.js +75 -36
  128. package/src/components/molecules/GalleryElement/styles.js +38 -11
  129. package/src/components/molecules/GalleryHeader/index.js +14 -8
  130. package/src/components/molecules/GalleryHeader/styles.js +16 -0
  131. package/src/components/molecules/ImageSelector/index.js +2 -3
  132. package/src/components/molecules/ProductNameHeader/index.js +1 -2
  133. package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +35 -0
  134. package/src/components/molecules/RetailerSelector/index.js +63 -0
  135. package/src/components/molecules/RetailerSelector/styles.js +18 -0
  136. package/src/components/molecules/StatusAsignationInfo/index.js +62 -38
  137. package/src/components/molecules/StatusAsignationInfo/styles.js +12 -2
  138. package/src/components/molecules/TableHeader/index.js +16 -3
  139. package/src/components/molecules/TableHeader/styles.js +5 -0
  140. package/src/components/molecules/TagAndInput/index.js +24 -0
  141. package/src/components/organisms/FullProductNameHeader/index.js +28 -7
  142. package/src/components/organisms/FullTabsMenu/index.js +15 -3
  143. package/src/components/organisms/ImageDataTable/index.js +89 -11
  144. package/src/components/organisms/InputGroup/index.js +46 -11
  145. package/src/components/organisms/InputGroup/styles.js +3 -0
  146. package/src/components/organisms/ProductImageModal/index.js +20 -12
  147. package/src/components/organisms/ProductImageModal/styles.js +3 -0
  148. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +117 -343
  149. package/src/components/pages/RetailerProductEdition/index.js +1225 -46
  150. package/src/components/pages/RetailerProductEdition/styles.js +67 -4
  151. package/src/global-files/data.js +156 -57
  152. package/src/global-files/global-styles.css +1 -0
  153. package/src/global-files/variables.js +1 -0
  154. package/src/index.js +1 -17
  155. package/dist/assets/images/carouselImagesLogin/login2.svg +0 -117
  156. package/dist/assets/images/carouselImagesLogin/login3.svg +0 -147
  157. package/dist/assets/images/carouselImagesLogin/loginImage.svg +0 -301
  158. package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +0 -36
  159. package/dist/components/atoms/ListCommercialRetailers/index.js +0 -64
  160. package/dist/components/atoms/ListCommercialRetailers/styles.js +0 -20
  161. package/dist/components/atoms/Loading/Loading.stories.js +0 -28
  162. package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +0 -37
  163. package/dist/components/atoms/MenuCommercialRetailers/index.js +0 -25
  164. package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +0 -28
  165. package/dist/components/atoms/MenuProductImage/index.js +0 -88
  166. package/dist/components/atoms/MenuProductImage/styles.js +0 -20
  167. package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +0 -22
  168. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +0 -49
  169. package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +0 -25
  170. package/dist/components/molecules/ApproveRejetPanel/index.js +0 -49
  171. package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +0 -28
  172. package/dist/components/molecules/EmailResetPasswordLogin/index.js +0 -159
  173. package/dist/components/molecules/EmailResetPasswordLogin/styles.js +0 -20
  174. package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +0 -28
  175. package/dist/components/molecules/RegistrationFirstStep/index.js +0 -371
  176. package/dist/components/molecules/RegistrationFirstStep/styles.js +0 -20
  177. package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +0 -28
  178. package/dist/components/molecules/RegistrationSecondStep/index.js +0 -156
  179. package/dist/components/molecules/RegistrationSecondStep/styles.js +0 -20
  180. package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +0 -28
  181. package/dist/components/molecules/RegistrationThirdStep/index.js +0 -161
  182. package/dist/components/molecules/RegistrationThirdStep/styles.js +0 -20
  183. package/dist/components/molecules/SignInLogin/index.js +0 -292
  184. package/dist/components/molecules/SignInLogin/styles.js +0 -20
  185. package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +0 -28
  186. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +0 -104
  187. package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +0 -20
  188. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +0 -69
  189. package/dist/components/organisms/ChangePassword/index.js +0 -113
  190. package/dist/components/organisms/ChangePassword/styles.js +0 -18
  191. package/src/components/atoms/Loading/Loading.stories.js +0 -10
  192. package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +0 -11
  193. package/src/components/molecules/EmailResetPasswordLogin/index.js +0 -87
  194. package/src/components/molecules/EmailResetPasswordLogin/styles.js +0 -23
  195. package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +0 -11
  196. package/src/components/molecules/RegistrationFirstStep/index.js +0 -259
  197. package/src/components/molecules/RegistrationFirstStep/styles.js +0 -81
  198. package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +0 -11
  199. package/src/components/molecules/RegistrationSecondStep/index.js +0 -97
  200. package/src/components/molecules/RegistrationSecondStep/styles.js +0 -59
  201. package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +0 -11
  202. package/src/components/molecules/RegistrationThirdStep/index.js +0 -109
  203. package/src/components/molecules/RegistrationThirdStep/styles.js +0 -44
  204. package/src/components/molecules/SignInLogin/SignInLogin.stories.js +0 -11
  205. package/src/components/molecules/SignInLogin/index.js +0 -205
  206. package/src/components/molecules/SignInLogin/styles.js +0 -78
  207. package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +0 -11
  208. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +0 -78
  209. package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +0 -49
  210. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +0 -56
  211. package/src/components/organisms/ChangePassword/ChangePassword.stories.js +0 -11
  212. package/src/components/organisms/ChangePassword/index.js +0 -63
  213. package/src/components/organisms/ChangePassword/styles.js +0 -16
@@ -1,11 +0,0 @@
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 = {};
@@ -1,97 +0,0 @@
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 = () => {
11
- const [emptyPassword, setEmptyPassword] = useState(false);
12
- const [emptyConfirmPassword, setEmptyConfirmPassword] = useState(false);
13
- const [matchPasswords, setMatchPasswords] = useState(true);
14
- const validate = async (e) => {
15
- e.preventDefault();
16
- const password = document.querySelector("#newPasswordInput").value;
17
- password.length < 8 ? setEmptyPassword(true) : setEmptyPassword(false);
18
- const confirmPassword = document.querySelector(
19
- "#confirmPasswordInput"
20
- ).value;
21
- confirmPassword === ""
22
- ? setEmptyConfirmPassword(true)
23
- : setEmptyConfirmPassword(false);
24
- if (password === confirmPassword) {
25
- setMatchPasswords(true);
26
- } else {
27
- setMatchPasswords(false);
28
- }
29
- };
30
- const loginRight = [
31
- <LogoImage key="1" />,
32
- <div className="credenciales" key={"2"}>
33
- <ScreenHeader
34
- fontFamily={FontFamily.AvenirNext}
35
- color={GlobalColors.s5}
36
- text={"Ingresa tus credenciales"}
37
- />
38
- </div>,
39
- <LoginPasswordStrength
40
- key={"3"}
41
- emptyPassword={emptyPassword}
42
- emptyConfirmPassword={emptyConfirmPassword}
43
- matchPasswords={matchPasswords}
44
- textTittle={"Ingresa tus credenciales"}
45
- />,
46
- <label className="label-terms" key={"4"}>Términos y condiciones</label>,
47
- <div className="checkbox-terms" key={"5"}>
48
- <input type="checkbox" />
49
- <ScreenHeader
50
- text={
51
- "Conoce nuestros termnios y condiciones de cada uno de nuestros servicios. Si tienes algunda duda o comentario escríbenos."
52
- }
53
- headerType={"date-header"}
54
- />
55
- </div>,
56
- <label className="label-terms" key={"6"}>Aviso de privacidad</label>,
57
- <div className="checkbox-terms" key={"7"}>
58
- <input type="checkbox" />
59
- <ScreenHeader
60
- text={"Todos los datos estan protegidos."}
61
- headerType={"date-header"}
62
- />
63
- </div>,
64
- <div className="button-end" key="8">
65
- <Button
66
- buttonType={"general-default-button"}
67
- label={"Enviar"}
68
- onClick={(e) => validate(e)}
69
- />
70
- </div>,
71
- <div className="progress-bar" key={"9"}>
72
- <div className="progress-bar-first-step-check"></div>
73
- <div className="progress-bar-second-step"></div>
74
- <div className="progress-bar-registration"></div>
75
- </div>,
76
- <ScreenHeader
77
- text={"Paso 2"}
78
- headerType={"date-header"}
79
- color={GlobalColors.s4}
80
- key={"10"}
81
- />,
82
- <div className="new-login" key="11">
83
- <p className="pre-registro">
84
- ¿Aún no tienes cuenta?<span> Regístrate</span>
85
- </p>
86
- </div>,
87
- ];
88
- return (
89
- <Container>
90
- <GradientPanel
91
- panelColor={GlobalColors.white}
92
- componentsArray={loginRight}
93
- panelType={"home-login"}
94
- ></GradientPanel>
95
- </Container>
96
- );
97
- };
@@ -1,59 +0,0 @@
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
- text-align: end;
10
- .general-default-button {
11
- width: 160px;
12
- }
13
- & + * {
14
- margin-top: 10px;
15
- }
16
- }
17
- .progress-bar {
18
- width: 100%;
19
- height: 8px;
20
- display: flex;
21
- justify-content: space-between;
22
- .progress-bar-first-step-check {
23
- width: 33.33%;
24
- background-color: ${GlobalColors.exported};
25
- }
26
- .progress-bar-second-step {
27
- width: 33.33%;
28
- background-color: rgb(196, 196, 196);
29
- }
30
- .progress-bar-registration {
31
- background-color: rgb(226, 226, 226);
32
- width: 33.33%;
33
- }
34
- }
35
- .date-header {
36
- margin-left: 33.33%;
37
- }
38
- .checkbox-terms {
39
- display: flex;
40
- margin-bottom: 5px;
41
- input {
42
- cursor: pointer;
43
- & + * {
44
- margin-left: 15px;
45
- }
46
- }
47
- }
48
- .label-terms {
49
- color: rgb(129, 115, 147);
50
- font-size: 13px;
51
- line-height: 24px;
52
- font-weight: 700;
53
- cursor: pointer;
54
- margin-left: 25px;
55
- & + * {
56
- margin-top: 5px;
57
- }
58
- }
59
- `;
@@ -1,11 +0,0 @@
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 = {};
@@ -1,109 +0,0 @@
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 = () => {
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
- const validate = async (e) => {
16
- e.preventDefault();
17
- const commercialName = document.querySelector("#commercialNameInput").value;
18
- const bussinesName = document.querySelector("#bussinesNameInput").value;
19
- const RFC = document.querySelector("#rfcInput").value;
20
- const FiscalAddress = document.querySelector("#fiscalAddressInput").value;
21
- commercialName === ""
22
- ? setEmptyCommercialName(true)
23
- : setEmptyCommercialName(false);
24
- bussinesName === ""
25
- ? setEmptyBussinesName(true)
26
- : setEmptyBussinesName(false);
27
- RFC === "" ? setEmptyRFC(true) : setEmptyRFC(false);
28
- FiscalAddress === ""
29
- ? setEmptyFiscalAddress(true)
30
- : setEmptyFiscalAddress(false);
31
- };
32
- const loginRight = [
33
- <LogoImage key="1" />,
34
- <div className="credenciales" key={"2"}>
35
- <ScreenHeader
36
- fontFamily={FontFamily.AvenirNext}
37
- color={GlobalColors.s5}
38
- text={"Ingresa tus credenciales"}
39
- />
40
- </div>,
41
- <div className="user" key="3">
42
- <TagAndInput
43
- inputType={"text"}
44
- inputId={"commercialNameInput"}
45
- label={"Nombre comercial"}
46
- inputPlaceHolder={"Nombre comercial"}
47
- />
48
- {emptyCommercialName && (
49
- <label>Ingrese el nombre comercial de la empresa</label>
50
- )}
51
- <TagAndInput
52
- inputType={"text"}
53
- inputId={"bussinesNameInput"}
54
- label={"Razón social"}
55
- inputPlaceHolder={"Razón social"}
56
- />
57
- {emptyBussinesName && (
58
- <label>Ingrese la razón social de la empresa</label>
59
- )}
60
- <TagAndInput
61
- inputType={"text"}
62
- inputId={"rfcInput"}
63
- label={"RFC"}
64
- inputPlaceHolder={"RFC"}
65
- />
66
- {emptyRFC && <label>El RFC es requerido</label>}
67
- <TagAndInput
68
- inputType={"text"}
69
- inputId={"fiscalAddressInput"}
70
- label={"Direccion fiscal"}
71
- inputPlaceHolder={"Dirección fiscal"}
72
- />
73
- {emptyFiscalAddress && (
74
- <label>Ingrese la direccion fiscal de la empresa</label>
75
- )}
76
- </div>,
77
- <div className="button-end" key="4">
78
- <Button
79
- buttonType={"general-default-button"}
80
- label={"Enviar"}
81
- onClick={(e) => validate(e)}
82
- />
83
- </div>,
84
- <div className="progress-bar" key="5">
85
- <div className="progress-bar-step-check"></div>
86
- <div className="progress-bar-registration"></div>
87
- </div>,
88
- <ScreenHeader
89
- text={"Paso 3"}
90
- headerType={"date-header"}
91
- color={GlobalColors.s4}
92
- key="6"
93
- />,
94
- <div className="new-login" key="7">
95
- <p className="pre-registro">
96
- ¿Ya tienes una cuenta?<span> Inicia Sesión</span>
97
- </p>
98
- </div>,
99
- ];
100
- return (
101
- <Container>
102
- <GradientPanel
103
- componentsArray={loginRight}
104
- panelType={"home-login"}
105
- panelColor={GlobalColors.white}
106
- />
107
- </Container>
108
- );
109
- };
@@ -1,44 +0,0 @@
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: 100%;
8
- .user {
9
- .input-name-header {
10
- margin-top: 10px;
11
- }
12
- }
13
- .button-end {
14
- text-align: end;
15
- .general-default-button {
16
- width: 160px;
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-step-check {
28
- width: 66.66%;
29
- background-color: ${GlobalColors.exported};
30
- }
31
- .progress-bar-registration {
32
- background-color: rgb(196, 196, 196);
33
- width: 33.33%;
34
- }
35
- }
36
- .date-header {
37
- margin-left: 66.66%;
38
- .new-login {
39
- & + * {
40
- margin-top: 20px;
41
- }
42
- }
43
- }
44
- `;
@@ -1,11 +0,0 @@
1
- import { SignInLogin } from "./index";
2
-
3
- export default {
4
- title: "Components/molecules/SignInLogin",
5
- component: SignInLogin,
6
- };
7
-
8
- const Template = (args) => <SignInLogin {...args} />;
9
-
10
- export const SignInLoginDefault = Template.bind({});
11
- SignInLoginDefault.args = {};
@@ -1,205 +0,0 @@
1
- import { Container } from "./styles";
2
- import { LogoImage } from "../../atoms/LogoImage/index";
3
- import { ScreenHeader } from "../../atoms/ScreenHeader/index";
4
- import { Button } from "../../atoms/GeneralButton/index";
5
- import { CheckBox } from "../../atoms/CheckBox/index";
6
- import { TagAndInput } from "../TagAndInput";
7
- import { FontFamily, GlobalColors } from "../../../global-files/variables";
8
- import { useState, useEffect } from "react";
9
- import { Loading } from "../../atoms/Loading";
10
- import { Redirect } from "react-router-dom";
11
- import { Auth } from "aws-amplify";
12
- import axios from "axios";
13
-
14
- export const SignInLogin = (props) => {
15
- const [emptyEmail, setEmptyEmail] = useState(false);
16
- const [invalidEmail, setInvalidEmail] = useState(false);
17
- const [emptyPassword, setEmptyPassword] = useState(false);
18
- const [showErrors, setShowErrors] = useState(true);
19
- const [signInError, setSignInError] = useState("");
20
- const [loading, setLoading] = useState(false);
21
- const [upgradePlanRedirect, setUpgradePlanRedirect] = useState(false);
22
- const validate = async (e) => {
23
- setSignInError("");
24
- setShowErrors(true);
25
- e.preventDefault();
26
- let valid = true;
27
- const email = document.querySelector("#emailInput").value;
28
- const password = document.querySelector("#passwordInput").value;
29
- !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
30
- email
31
- )
32
- ? setInvalidEmail(true)
33
- : setInvalidEmail(false);
34
- if (email === "") {
35
- valid = false;
36
- setEmptyEmail(true);
37
- } else {
38
- setEmptyEmail(false);
39
- }
40
- if (password === "") {
41
- valid = false;
42
- setEmptyPassword(true);
43
- } else {
44
- setEmptyPassword(false);
45
- }
46
- if (valid) {
47
- try {
48
- setLoading(true);
49
- const session = await Auth.signIn(email, password);
50
- if (session.challengeName === "NEW_PASSWORD_REQUIRED") {
51
- props.setUser(session);
52
- props.setPaso(8);
53
- } else {
54
- const userGroup =
55
- session.signInUserSession.accessToken.payload["cognito:groups"];
56
- const response = await axios.get(
57
- process.env.REACT_APP_USER_ENDPOINT,
58
- {
59
- headers: {
60
- Authorization: session.signInUserSession.idToken.jwtToken,
61
- },
62
- }
63
- );
64
- const userGroupValue =
65
- typeof userGroup === "string" ? userGroup : userGroup[0];
66
- if (userGroupValue === "usuario_contentoh") {
67
- sessionStorage.setItem("auth", true);
68
- sessionStorage.setItem(
69
- "jwt",
70
- session.signInUserSession.idToken.jwtToken
71
- );
72
- const user = JSON.parse(response.data.body).data[0];
73
- const company = JSON.parse(response.data.body).data[1];
74
- caches.keys().then((names) => {
75
- names.forEach((name) => {
76
- caches.delete(name);
77
- });
78
- });
79
- user.src = `https://${
80
- process.env.REACT_APP_IMAGES_PROFILE_BUCKET
81
- }.s3.amazonaws.com/id-${user.id_user}/${
82
- user.id_user
83
- }.png?${new Date().getTime()}`;
84
- sessionStorage.setItem("user", JSON.stringify(user));
85
- sessionStorage.setItem("company", JSON.stringify(company));
86
- setUpgradePlanRedirect(true);
87
- } else {
88
- setSignInError("NotAuthorizedException");
89
- setLoading(false);
90
- }
91
- }
92
- } catch (error) {
93
- console.log(error);
94
- setLoading(false);
95
- if (error.code === "NotAuthorizedException") {
96
- setSignInError("NotAuthorizedException");
97
- } else if (error.code === "UserNotConfirmedException") {
98
- sessionStorage.setItem(
99
- "email",
100
- JSON.stringify(
101
- document.querySelector("#usernameInput").value.trim()
102
- )
103
- );
104
- sessionStorage.setItem("email", JSON.stringify(email));
105
- props.setPaso(5);
106
- } else {
107
- setSignInError("Error");
108
- }
109
- }
110
- }
111
- };
112
- useEffect(() => {
113
- sessionStorage.getItem("resetPasswordProcess") &&
114
- sessionStorage.removeItem("resetPasswordProcess");
115
- }, []);
116
- return loading ? (
117
- <Loading />
118
- ) : (
119
- <>
120
- <Container className={"home-login"}>
121
- <div className="main-container">
122
- <LogoImage />
123
- <div className="credenciales">
124
- <ScreenHeader
125
- fontFamily={FontFamily.AvenirNext}
126
- color={GlobalColors.s5}
127
- text={"Ingresa tus credenciales"}
128
- />
129
- </div>
130
- <div className="user">
131
- <TagAndInput
132
- inputType={"text"}
133
- label={"Nombre de usuario"}
134
- inputPlaceHolder={"username@contentoh.com"}
135
- inputId={"emailInput"}
136
- />
137
- </div>
138
- {showErrors && emptyEmail && <label>Ingrese su correo</label>}
139
- {invalidEmail && !emptyEmail && (
140
- <label>Ingrese un correo válido</label>
141
- )}
142
- <div className="password">
143
- <TagAndInput
144
- inputType={"password"}
145
- label={"Contraseña"}
146
- inputPlaceHolder={"Escribe tu contraseña"}
147
- inputId={"passwordInput"}
148
- />
149
- </div>
150
- {showErrors && emptyPassword && <label>Ingrese su contraseña</label>}
151
- <div className="select">
152
- <CheckBox
153
- label={"Mantener sesión activada"}
154
- id={"chk-default"}
155
- className="active-left"
156
- />
157
- <p onClick={() => props.setPaso(10)} className="active-right">
158
- Olvide mi contraseña
159
- </p>
160
- </div>
161
- {showErrors && signInError === "NotAuthorizedException" && (
162
- <label>Correo o contraseña incorrectos</label>
163
- )}
164
- {showErrors && signInError === "Error" && (
165
- <label>Ha habido un problema al iniciar sesión</label>
166
- )}
167
- <div className="button-right">
168
- <Button
169
- buttonType={"general-default-button"}
170
- label={"Iniciar sesión"}
171
- onClick={(e) => validate(e)}
172
- />
173
- </div>
174
- <div className="new-login">
175
- <p
176
- className="pre-registro"
177
- onClick={() => {
178
- props.setPaso(1);
179
- sessionStorage.setItem(
180
- "nuevoRegistro",
181
- JSON.stringify({
182
- name: "",
183
- lastName: "",
184
- email: "",
185
- position: "",
186
- country: "",
187
- phone: "",
188
- commercialName: "",
189
- companyName: "",
190
- rfc: "",
191
- adress: "",
192
- })
193
- );
194
- sessionStorage.setItem("countryCode", JSON.stringify("+52"));
195
- }}
196
- >
197
- ¿Aún no tienes cuenta?<span> Regístrate</span>
198
- </p>
199
- </div>
200
- </div>
201
- </Container>
202
- {upgradePlanRedirect && <Redirect to={{ pathname: "/dashboard" }} />}
203
- </>
204
- );
205
- };
@@ -1,78 +0,0 @@
1
- import styled from "styled-components";
2
- import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
-
4
- export const Container = styled.div`
5
- background: "white";
6
- display: flex;
7
- height: 100%;
8
- width: 50%;
9
- justify-content: center;
10
- align-items: center;
11
- label {
12
- color: red;
13
- margin-top: 3px;
14
- margin-left: 15px;
15
- font-family: ${FontFamily.Raleway_700};
16
- font-size: 11px;
17
- & + * {
18
- margin-top: 12px;
19
- }
20
- }
21
-
22
- &.home-login {
23
- .credenciales {
24
- & + * {
25
- margin-top: 30px;
26
- }
27
- }
28
- .user {
29
- & + * {
30
- margin-top: 20px;
31
- }
32
- }
33
- .password {
34
- & + * {
35
- margin-top: 20px;
36
- }
37
- }
38
- .select {
39
- display: flex;
40
- justify-content: space-between;
41
- .active-right {
42
- font-family: ${FontFamily.AvenirNext};
43
- font-weight: 500;
44
- font-size: 13px;
45
- line-height: 24px;
46
- letter-spacing: -0.015em;
47
- color: ${GlobalColors.s5};
48
- cursor: pointer;
49
- }
50
- & + * {
51
- margin-top: 50px;
52
- }
53
- }
54
- .button-right {
55
- text-align: right;
56
- & + * {
57
- margin-top: 55px;
58
- }
59
- }
60
- .new-login {
61
- p {
62
- font-family: ${FontFamily.AvenirNext};
63
- text-align: right;
64
- font-weight: 500;
65
- font-size: 13px;
66
- line-height: 24px;
67
- color: ${GlobalColors.s5};
68
- span {
69
- color: ${GlobalColors.secondary_magenta};
70
- }
71
- }
72
- }
73
- }
74
- .main-container {
75
- max-width: 80%;
76
- max-height: 80%;
77
- }
78
- `;
@@ -1,11 +0,0 @@
1
- import { VerificationCodeResetPasswordLogin } from "./index";
2
-
3
- export default {
4
- title: "Components/molecules/VerificationCodeResetPasswordLogin",
5
- component: VerificationCodeResetPasswordLogin,
6
- };
7
- const Template = (args) => <VerificationCodeResetPasswordLogin {...args} />;
8
-
9
- export const VerificationCodeResetPasswordLoginDefault = Template.bind({});
10
-
11
- VerificationCodeResetPasswordLoginDefault.args = {};