contentoh-components-library 21.0.26 → 21.0.27

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 (51) hide show
  1. package/dist/components/atoms/Loading/Loading.stories.js +28 -0
  2. package/dist/components/atoms/Loading/index.js +27 -0
  3. package/dist/components/atoms/Loading/styles.js +18 -0
  4. package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +28 -0
  5. package/dist/components/molecules/EmailResetPasswordLogin/index.js +159 -0
  6. package/dist/components/molecules/EmailResetPasswordLogin/styles.js +20 -0
  7. package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +28 -0
  8. package/dist/components/molecules/RegistrationFirstStep/index.js +371 -0
  9. package/dist/components/molecules/RegistrationFirstStep/styles.js +20 -0
  10. package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +28 -0
  11. package/dist/components/molecules/RegistrationSecondStep/index.js +156 -0
  12. package/dist/components/molecules/RegistrationSecondStep/styles.js +20 -0
  13. package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +28 -0
  14. package/dist/components/molecules/RegistrationThirdStep/index.js +161 -0
  15. package/dist/components/molecules/RegistrationThirdStep/styles.js +20 -0
  16. package/dist/components/molecules/SignInLogin/index.js +213 -67
  17. package/dist/components/molecules/SignInLogin/styles.js +1 -1
  18. package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +28 -0
  19. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +104 -0
  20. package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +20 -0
  21. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +69 -0
  22. package/dist/components/organisms/ChangePassword/ChangePassword.stories.js +28 -0
  23. package/dist/components/organisms/ChangePassword/index.js +113 -0
  24. package/dist/components/organisms/ChangePassword/styles.js +18 -0
  25. package/dist/index.js +138 -47
  26. package/package.json +4 -2
  27. package/src/components/atoms/Loading/Loading.stories.js +10 -0
  28. package/src/components/atoms/Loading/index.js +13 -0
  29. package/src/components/atoms/Loading/styles.js +57 -0
  30. package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +11 -0
  31. package/src/components/molecules/EmailResetPasswordLogin/index.js +87 -0
  32. package/src/components/molecules/EmailResetPasswordLogin/styles.js +23 -0
  33. package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +11 -0
  34. package/src/components/molecules/RegistrationFirstStep/index.js +259 -0
  35. package/src/components/molecules/RegistrationFirstStep/styles.js +81 -0
  36. package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +11 -0
  37. package/src/components/molecules/RegistrationSecondStep/index.js +97 -0
  38. package/src/components/molecules/RegistrationSecondStep/styles.js +59 -0
  39. package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +11 -0
  40. package/src/components/molecules/RegistrationThirdStep/index.js +109 -0
  41. package/src/components/molecules/RegistrationThirdStep/styles.js +44 -0
  42. package/src/components/molecules/SignInLogin/index.js +177 -55
  43. package/src/components/molecules/SignInLogin/styles.js +1 -0
  44. package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +11 -0
  45. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +78 -0
  46. package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +49 -0
  47. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +56 -0
  48. package/src/components/organisms/ChangePassword/ChangePassword.stories.js +11 -0
  49. package/src/components/organisms/ChangePassword/index.js +63 -0
  50. package/src/components/organisms/ChangePassword/styles.js +16 -0
  51. package/src/index.js +7 -0
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.RegistrationThirdStep = void 0;
9
+
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
13
+
14
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
15
+
16
+ var _styles = require("./styles");
17
+
18
+ var _GradientPanel = require("../../atoms/GradientPanel");
19
+
20
+ var _react = require("react");
21
+
22
+ var _LogoImage = require("../../atoms/LogoImage");
23
+
24
+ var _ScreenHeader = require("../../atoms/ScreenHeader");
25
+
26
+ var _variables = require("../../../global-files/variables");
27
+
28
+ var _TagAndInput = require("../../molecules/TagAndInput");
29
+
30
+ var _GeneralButton = require("../../atoms/GeneralButton");
31
+
32
+ var _jsxRuntime = require("react/jsx-runtime");
33
+
34
+ var RegistrationThirdStep = function RegistrationThirdStep() {
35
+ var _useState = (0, _react.useState)(false),
36
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
37
+ emptyCommercialName = _useState2[0],
38
+ setEmptyCommercialName = _useState2[1];
39
+
40
+ var _useState3 = (0, _react.useState)(false),
41
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
42
+ emptyBussinesName = _useState4[0],
43
+ setEmptyBussinesName = _useState4[1];
44
+
45
+ var _useState5 = (0, _react.useState)(false),
46
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
47
+ emptyRFC = _useState6[0],
48
+ setEmptyRFC = _useState6[1];
49
+
50
+ var _useState7 = (0, _react.useState)(false),
51
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
52
+ emptyFiscalAddress = _useState8[0],
53
+ setEmptyFiscalAddress = _useState8[1];
54
+
55
+ var validate = /*#__PURE__*/function () {
56
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
57
+ var commercialName, bussinesName, RFC, FiscalAddress;
58
+ return _regenerator.default.wrap(function _callee$(_context) {
59
+ while (1) {
60
+ switch (_context.prev = _context.next) {
61
+ case 0:
62
+ e.preventDefault();
63
+ commercialName = document.querySelector("#commercialNameInput").value;
64
+ bussinesName = document.querySelector("#bussinesNameInput").value;
65
+ RFC = document.querySelector("#rfcInput").value;
66
+ FiscalAddress = document.querySelector("#fiscalAddressInput").value;
67
+ commercialName === "" ? setEmptyCommercialName(true) : setEmptyCommercialName(false);
68
+ bussinesName === "" ? setEmptyBussinesName(true) : setEmptyBussinesName(false);
69
+ RFC === "" ? setEmptyRFC(true) : setEmptyRFC(false);
70
+ FiscalAddress === "" ? setEmptyFiscalAddress(true) : setEmptyFiscalAddress(false);
71
+
72
+ case 9:
73
+ case "end":
74
+ return _context.stop();
75
+ }
76
+ }
77
+ }, _callee);
78
+ }));
79
+
80
+ return function validate(_x) {
81
+ return _ref.apply(this, arguments);
82
+ };
83
+ }();
84
+
85
+ var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
86
+ className: "credenciales",
87
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
88
+ fontFamily: _variables.FontFamily.AvenirNext,
89
+ color: _variables.GlobalColors.s5,
90
+ text: "Ingresa tus credenciales"
91
+ })
92
+ }, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
93
+ className: "user",
94
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
95
+ inputType: "text",
96
+ inputId: "commercialNameInput",
97
+ label: "Nombre comercial",
98
+ inputPlaceHolder: "Nombre comercial"
99
+ }), emptyCommercialName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
100
+ children: "Ingrese el nombre comercial de la empresa"
101
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
102
+ inputType: "text",
103
+ inputId: "bussinesNameInput",
104
+ label: "Razón social",
105
+ inputPlaceHolder: "Razón social"
106
+ }), emptyBussinesName && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
107
+ children: "Ingrese la raz\xF3n social de la empresa"
108
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
109
+ inputType: "text",
110
+ inputId: "rfcInput",
111
+ label: "RFC",
112
+ inputPlaceHolder: "RFC"
113
+ }), emptyRFC && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
114
+ children: "El RFC es requerido"
115
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
116
+ inputType: "text",
117
+ inputId: "fiscalAddressInput",
118
+ label: "Direccion fiscal",
119
+ inputPlaceHolder: "Dirección fiscal"
120
+ }), emptyFiscalAddress && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
121
+ children: "Ingrese la direccion fiscal de la empresa"
122
+ })]
123
+ }, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
124
+ className: "button-end",
125
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
126
+ buttonType: "general-default-button",
127
+ label: "Enviar",
128
+ onClick: function onClick(e) {
129
+ return validate(e);
130
+ }
131
+ })
132
+ }, "4"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
133
+ className: "progress-bar",
134
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
135
+ className: "progress-bar-step-check"
136
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
137
+ className: "progress-bar-registration"
138
+ })]
139
+ }, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
140
+ text: "Paso 3",
141
+ headerType: "date-header",
142
+ color: _variables.GlobalColors.s4
143
+ }, "6"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
144
+ className: "new-login",
145
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
146
+ className: "pre-registro",
147
+ children: ["\xBFYa tienes una cuenta?", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
148
+ children: " Inicia Sesi\xF3n"
149
+ })]
150
+ })
151
+ }, "7")];
152
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
153
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientPanel.GradientPanel, {
154
+ componentsArray: loginRight,
155
+ panelType: "home-login",
156
+ panelColor: _variables.GlobalColors.white
157
+ })
158
+ });
159
+ };
160
+
161
+ exports.RegistrationThirdStep = RegistrationThirdStep;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.Container = void 0;
9
+
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
11
+
12
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
+
14
+ var _variables = require("../../../global-files/variables");
15
+
16
+ var _templateObject;
17
+
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 50%;\n height: 100%;\n .user {\n .input-name-header {\n margin-top: 10px;\n }\n }\n .button-end {\n text-align: end;\n .general-default-button {\n width: 160px;\n }\n & + * {\n margin-top: 10px;\n }\n }\n .progress-bar {\n width: 100%;\n height: 8px;\n display: flex;\n justify-content: space-between;\n .progress-bar-step-check {\n width: 66.66%;\n background-color: ", ";\n }\n .progress-bar-registration {\n background-color: rgb(196, 196, 196);\n width: 33.33%;\n }\n }\n .date-header {\n margin-left: 66.66%;\n .new-login {\n & + * {\n margin-top: 20px;\n }\n }\n }\n"])), _variables.GlobalColors.exported);
19
+
20
+ exports.Container = Container;
@@ -29,9 +29,13 @@ var _variables = require("../../../global-files/variables");
29
29
 
30
30
  var _react = require("react");
31
31
 
32
+ var _Loading = require("../../atoms/Loading");
33
+
34
+ var _reactRouterDom = require("react-router-dom");
35
+
32
36
  var _jsxRuntime = require("react/jsx-runtime");
33
37
 
34
- var SignInLogin = function SignInLogin() {
38
+ var SignInLogin = function SignInLogin(props) {
35
39
  var _useState = (0, _react.useState)(false),
36
40
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
37
41
  emptyEmail = _useState2[0],
@@ -47,26 +51,136 @@ var SignInLogin = function SignInLogin() {
47
51
  emptyPassword = _useState6[0],
48
52
  setEmptyPassword = _useState6[1];
49
53
 
54
+ var _useState7 = (0, _react.useState)(true),
55
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
56
+ showErrors = _useState8[0],
57
+ setShowErrors = _useState8[1];
58
+
59
+ var _useState9 = (0, _react.useState)(""),
60
+ _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
61
+ signInError = _useState10[0],
62
+ setSignInError = _useState10[1];
63
+
64
+ var _useState11 = (0, _react.useState)(false),
65
+ _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
66
+ loading = _useState12[0],
67
+ setLoading = _useState12[1];
68
+
69
+ var _useState13 = (0, _react.useState)(false),
70
+ _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
71
+ upgradePlanRedirect = _useState14[0],
72
+ setUpgradePlanRedirect = _useState14[1];
73
+
50
74
  var validate = /*#__PURE__*/function () {
51
75
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
52
- var email, password;
76
+ var valid, email, password, session, userGroup, response, userGroupValue, user, company;
53
77
  return _regenerator.default.wrap(function _callee$(_context) {
54
78
  while (1) {
55
79
  switch (_context.prev = _context.next) {
56
80
  case 0:
81
+ setSignInError("");
82
+ setShowErrors(true);
57
83
  e.preventDefault();
84
+ valid = true;
58
85
  email = document.querySelector("#emailInput").value;
59
86
  password = document.querySelector("#passwordInput").value;
60
- email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
61
- password === "" ? setEmptyPassword(true) : setEmptyPassword(false);
62
87
  !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
63
88
 
64
- case 6:
89
+ if (email === "") {
90
+ valid = false;
91
+ setEmptyEmail(true);
92
+ } else {
93
+ setEmptyEmail(false);
94
+ }
95
+
96
+ if (password === "") {
97
+ valid = false;
98
+ setEmptyPassword(true);
99
+ } else {
100
+ setEmptyPassword(false);
101
+ }
102
+
103
+ if (!valid) {
104
+ _context.next = 33;
105
+ break;
106
+ }
107
+
108
+ _context.prev = 10;
109
+ setLoading(true);
110
+ _context.next = 14;
111
+ return Auth.signIn(email, password);
112
+
113
+ case 14:
114
+ session = _context.sent;
115
+
116
+ if (!(session.challengeName === "NEW_PASSWORD_REQUIRED")) {
117
+ _context.next = 20;
118
+ break;
119
+ }
120
+
121
+ props.setUser(session);
122
+ props.setPaso(8);
123
+ _context.next = 26;
124
+ break;
125
+
126
+ case 20:
127
+ userGroup = session.signInUserSession.accessToken.payload["cognito:groups"];
128
+ _context.next = 23;
129
+ return axios.get(process.env.REACT_APP_USER_ENDPOINT, {
130
+ headers: {
131
+ Authorization: session.signInUserSession.idToken.jwtToken
132
+ }
133
+ });
134
+
135
+ case 23:
136
+ response = _context.sent;
137
+ userGroupValue = typeof userGroup === "string" ? userGroup : userGroup[0];
138
+
139
+ if (userGroupValue === "usuario_contentoh") {
140
+ sessionStorage.setItem("auth", true);
141
+ sessionStorage.setItem("jwt", session.signInUserSession.idToken.jwtToken);
142
+ user = JSON.parse(response.data.body).data[0];
143
+ company = JSON.parse(response.data.body).data[1];
144
+ caches.keys().then(function (names) {
145
+ names.forEach(function (name) {
146
+ caches.delete(name);
147
+ });
148
+ });
149
+ user.src = "https://".concat(process.env.REACT_APP_IMAGES_PROFILE_BUCKET, ".s3.amazonaws.com/id-").concat(user.id_user, "/").concat(user.id_user, ".png?").concat(new Date().getTime());
150
+ sessionStorage.setItem("user", JSON.stringify(user));
151
+ sessionStorage.setItem("company", JSON.stringify(company));
152
+ setUpgradePlanRedirect(true);
153
+ } else {
154
+ setSignInError("NotAuthorizedException");
155
+ setLoading(false);
156
+ }
157
+
158
+ case 26:
159
+ _context.next = 33;
160
+ break;
161
+
162
+ case 28:
163
+ _context.prev = 28;
164
+ _context.t0 = _context["catch"](10);
165
+ console.log(_context.t0);
166
+ setLoading(false);
167
+
168
+ if (_context.t0.code === "NotAuthorizedException") {
169
+ setSignInError("NotAuthorizedException");
170
+ } else if (_context.t0.code === "UserNotConfirmedException") {
171
+ sessionStorage.setItem("email", JSON.stringify(document.querySelector("#usernameInput").value.trim()));
172
+ sessionStorage.setItem("email", JSON.stringify(email));
173
+ props.setPaso(5);
174
+ } else {
175
+ setSignInError("Error");
176
+ }
177
+
178
+ case 33:
65
179
  case "end":
66
180
  return _context.stop();
67
181
  }
68
182
  }
69
- }, _callee);
183
+ }, _callee, null, [[10, 28]]);
70
184
  }));
71
185
 
72
186
  return function validate(_x) {
@@ -74,68 +188,100 @@ var SignInLogin = function SignInLogin() {
74
188
  };
75
189
  }();
76
190
 
77
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
78
- className: "home-login",
79
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
80
- className: "main-container",
81
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.LogoImage, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
82
- className: "credenciales",
83
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.ScreenHeader, {
84
- fontFamily: _variables.FontFamily.AvenirNext,
85
- color: _variables.GlobalColors.s5,
86
- text: "Ingresa tus credenciales"
87
- })
88
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
89
- className: "user",
90
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
91
- inputType: "text",
92
- label: "Nombre de usuario",
93
- inputPlaceHolder: "username@contentoh.com",
94
- inputId: "emailInput"
95
- })
96
- }), emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
97
- children: "Ingrese su correo"
98
- }), invalidEmail && !emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
99
- children: "Ingrese un correo v\xE1lido"
100
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
101
- className: "password",
102
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
103
- inputType: "text",
104
- label: "Contraseña",
105
- inputPlaceHolder: "Escribe tu contraseña",
106
- inputId: "passwordInput"
107
- })
108
- }), emptyPassword && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
109
- children: "Ingrese su contrase\xF1a"
110
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
111
- className: "select",
112
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index4.CheckBox, {
113
- label: "Mantener sesión activada",
114
- id: "chk-default",
115
- className: "active-left"
116
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
117
- className: "active-right",
118
- children: "Olvide mi contrase\xF1a"
119
- })]
120
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
121
- className: "button-right",
122
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Button, {
123
- buttonType: "general-default-button",
124
- label: "Iniciar sesión",
125
- onClick: function onClick(e) {
126
- return validate(e);
127
- }
128
- })
129
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
130
- className: "new-login",
131
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
132
- className: "pre-registro",
133
- children: ["\xBFA\xFAn no tienes cuenta?", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
134
- children: " Reg\xEDstrate"
191
+ (0, _react.useEffect)(function () {
192
+ sessionStorage.getItem("resetPasswordProcess") && sessionStorage.removeItem("resetPasswordProcess");
193
+ }, []);
194
+ return loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
195
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
196
+ className: "home-login",
197
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
198
+ className: "main-container",
199
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.LogoImage, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
200
+ className: "credenciales",
201
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.ScreenHeader, {
202
+ fontFamily: _variables.FontFamily.AvenirNext,
203
+ color: _variables.GlobalColors.s5,
204
+ text: "Ingresa tus credenciales"
205
+ })
206
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
207
+ className: "user",
208
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
209
+ inputType: "text",
210
+ label: "Nombre de usuario",
211
+ inputPlaceHolder: "username@contentoh.com",
212
+ inputId: "emailInput"
213
+ })
214
+ }), showErrors && emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
215
+ children: "Ingrese su correo"
216
+ }), invalidEmail && !emptyEmail && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
217
+ children: "Ingrese un correo v\xE1lido"
218
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
219
+ className: "password",
220
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
221
+ inputType: "password",
222
+ label: "Contraseña",
223
+ inputPlaceHolder: "Escribe tu contraseña",
224
+ inputId: "passwordInput"
225
+ })
226
+ }), showErrors && emptyPassword && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
227
+ children: "Ingrese su contrase\xF1a"
228
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
229
+ className: "select",
230
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index4.CheckBox, {
231
+ label: "Mantener sesión activada",
232
+ id: "chk-default",
233
+ className: "active-left"
234
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
235
+ onClick: function onClick() {
236
+ return props.setPaso(10);
237
+ },
238
+ className: "active-right",
239
+ children: "Olvide mi contrase\xF1a"
135
240
  })]
136
- })
137
- })]
138
- })
241
+ }), showErrors && signInError === "NotAuthorizedException" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
242
+ children: "Correo o contrase\xF1a incorrectos"
243
+ }), showErrors && signInError === "Error" && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
244
+ children: "Ha habido un problema al iniciar sesi\xF3n"
245
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
246
+ className: "button-right",
247
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Button, {
248
+ buttonType: "general-default-button",
249
+ label: "Iniciar sesión",
250
+ onClick: function onClick(e) {
251
+ return validate(e);
252
+ }
253
+ })
254
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
255
+ className: "new-login",
256
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
257
+ className: "pre-registro",
258
+ onClick: function onClick() {
259
+ props.setPaso(1);
260
+ sessionStorage.setItem("nuevoRegistro", JSON.stringify({
261
+ name: "",
262
+ lastName: "",
263
+ email: "",
264
+ position: "",
265
+ country: "",
266
+ phone: "",
267
+ commercialName: "",
268
+ companyName: "",
269
+ rfc: "",
270
+ adress: ""
271
+ }));
272
+ sessionStorage.setItem("countryCode", JSON.stringify("+52"));
273
+ },
274
+ children: ["\xBFA\xFAn no tienes cuenta?", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
275
+ children: " Reg\xEDstrate"
276
+ })]
277
+ })
278
+ })]
279
+ })
280
+ }), upgradePlanRedirect && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.Redirect, {
281
+ to: {
282
+ pathname: "/dashboard"
283
+ }
284
+ })]
139
285
  });
140
286
  };
141
287
 
@@ -15,6 +15,6 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: \"white\";\n display: flex;\n height: 100%;\n justify-content: center;\n align-items: center;\n label {\n color: red;\n margin-top: 3px;\n margin-left: 15px;\n font-family: ", ";\n font-size: 11px;\n & + * {\n margin-top: 12px;\n }\n }\n\n &.home-login {\n .credenciales {\n & + * {\n margin-top: 30px;\n }\n }\n .user {\n & + * {\n margin-top: 20px;\n }\n }\n .password {\n & + * {\n margin-top: 20px;\n }\n }\n .select {\n display: flex;\n justify-content: space-between;\n .active-right {\n font-family: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n letter-spacing: -0.015em;\n color: ", ";\n cursor: pointer;\n }\n & + * {\n margin-top: 50px;\n }\n }\n .button-right {\n text-align: right;\n & + * {\n margin-top: 55px;\n }\n }\n .new-login {\n p {\n font-family: ", ";\n text-align: right;\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n color: ", ";\n span {\n color: ", ";\n }\n }\n }\n }\n .main-container {\n max-width: 80%;\n max-height: 80%;\n }\n"])), _variables.FontFamily.Raleway_700, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.GlobalColors.secondary_magenta);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: \"white\";\n display: flex;\n height: 100%;\n width: 50%;\n justify-content: center;\n align-items: center;\n label {\n color: red;\n margin-top: 3px;\n margin-left: 15px;\n font-family: ", ";\n font-size: 11px;\n & + * {\n margin-top: 12px;\n }\n }\n\n &.home-login {\n .credenciales {\n & + * {\n margin-top: 30px;\n }\n }\n .user {\n & + * {\n margin-top: 20px;\n }\n }\n .password {\n & + * {\n margin-top: 20px;\n }\n }\n .select {\n display: flex;\n justify-content: space-between;\n .active-right {\n font-family: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n letter-spacing: -0.015em;\n color: ", ";\n cursor: pointer;\n }\n & + * {\n margin-top: 50px;\n }\n }\n .button-right {\n text-align: right;\n & + * {\n margin-top: 55px;\n }\n }\n .new-login {\n p {\n font-family: ", ";\n text-align: right;\n font-weight: 500;\n font-size: 13px;\n line-height: 24px;\n color: ", ";\n span {\n color: ", ";\n }\n }\n }\n }\n .main-container {\n max-width: 80%;\n max-height: 80%;\n }\n"])), _variables.FontFamily.Raleway_700, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s5, _variables.GlobalColors.secondary_magenta);
19
19
 
20
20
  exports.Container = Container;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = exports.VerificationCodeResetPasswordLoginDefault = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
+
12
+ var _index = require("./index");
13
+
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+
16
+ var _default = {
17
+ title: "Components/molecules/VerificationCodeResetPasswordLogin",
18
+ component: _index.VerificationCodeResetPasswordLogin
19
+ };
20
+ exports.default = _default;
21
+
22
+ var Template = function Template(args) {
23
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.VerificationCodeResetPasswordLogin, (0, _objectSpread2.default)({}, args));
24
+ };
25
+
26
+ var VerificationCodeResetPasswordLoginDefault = Template.bind({});
27
+ exports.VerificationCodeResetPasswordLoginDefault = VerificationCodeResetPasswordLoginDefault;
28
+ VerificationCodeResetPasswordLoginDefault.args = {};
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.VerificationCodeResetPasswordLogin = void 0;
9
+
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
+
12
+ var _styles = require("./styles");
13
+
14
+ var _GradientPanel = require("../../atoms/GradientPanel");
15
+
16
+ var _react = require("react");
17
+
18
+ var _LogoImage = require("../../atoms/LogoImage");
19
+
20
+ var _ScreenHeader = require("../../atoms/ScreenHeader");
21
+
22
+ var _variables = require("../../../global-files/variables");
23
+
24
+ var _GeneralInput = require("../../atoms/GeneralInput");
25
+
26
+ var _GeneralButton = require("../../atoms/GeneralButton");
27
+
28
+ var _utils = require("./utils");
29
+
30
+ var _jsxRuntime = require("react/jsx-runtime");
31
+
32
+ var VerificationCodeResetPasswordLogin = function VerificationCodeResetPasswordLogin() {
33
+ var _useState = (0, _react.useState)(false),
34
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
35
+ emptyVerificationCode = _useState2[0],
36
+ setEmptyVerificationCode = _useState2[1];
37
+
38
+ var _useState3 = (0, _react.useState)(),
39
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
40
+ inputCodeVerificationAll = _useState4[0],
41
+ setInputCodeVerificationAll = _useState4[1];
42
+
43
+ var inputPositions = [1, 2, 3, 4, 5, 6];
44
+ (0, _react.useEffect)(function () {
45
+ setInputCodeVerificationAll(document.querySelectorAll("[id^='verificationCodeInput']"));
46
+ }, []);
47
+ var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
48
+ className: "credenciales",
49
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
50
+ fontFamily: _variables.FontFamily.AvenirNext,
51
+ color: _variables.GlobalColors.s5,
52
+ text: "Ingresa tus credenciales"
53
+ })
54
+ }, "2"), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
55
+ className: "user",
56
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
57
+ text: "Ingresa el código de verificación enviado a:",
58
+ headerType: "input-name-header"
59
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
60
+ className: "verification-code",
61
+ children: inputPositions.map(function (position) {
62
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralInput.GeneralInput, {
63
+ inputId: "verificationCodeInput".concat(position),
64
+ inputType: "text",
65
+ inputPlaceholder: "X",
66
+ validateInput: _utils.validateInput,
67
+ inputsArray: inputCodeVerificationAll,
68
+ position: position,
69
+ maxLength: "1"
70
+ });
71
+ })
72
+ }), emptyVerificationCode && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
73
+ children: "Ingrese su c\xF3digo de verificaci\xF3n"
74
+ })]
75
+ }, "3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
76
+ className: "resend-code",
77
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
78
+ children: "Reenviar c\xF3digo de verificaci\xF3n"
79
+ })
80
+ }, "4"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
81
+ className: "button-center",
82
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
83
+ buttonType: "general-default-button",
84
+ label: "Enviar",
85
+ onClick: function onClick(e) {
86
+ return (0, _utils.validate)(inputCodeVerificationAll, setEmptyVerificationCode);
87
+ }
88
+ })
89
+ }, "5"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
90
+ className: "reset-password",
91
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
92
+ children: "Regresar..."
93
+ })
94
+ }, "6")];
95
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
96
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientPanel.GradientPanel, {
97
+ componentsArray: loginRight,
98
+ panelType: "home-login",
99
+ panelColor: _variables.GlobalColors.white
100
+ })
101
+ });
102
+ };
103
+
104
+ exports.VerificationCodeResetPasswordLogin = VerificationCodeResetPasswordLogin;