@stokr/components-library 3.0.77 → 3.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Input/InputPassword.js +3 -5
- package/dist/components/Input/OtpInput.js +1 -3
- package/dist/components/MenuNav/MenuNav.styles.js +1 -2
- package/dist/components/Modal/Modal.styles.js +2 -3
- package/dist/components/Newsletter/Newsletter.js +1 -3
- package/dist/components/NotificationCounter/NotificationCounter.styles.js +1 -2
- package/dist/components/SmartLink/SmartLink.js +0 -2
- package/dist/components/StepController/StepController.js +3 -5
- package/dist/components/StepController/StepController.styles.js +102 -1
- package/dist/components/StepController/StepControllerProgress.js +1 -1
- package/dist/components/Switch/Switch.js +1 -3
- package/dist/components/ToDoList/ToDoListTask.js +15 -3
- package/dist/components/taxId/register-taxid.js +7 -5
- package/dist/index.js +67 -141
- package/dist/runtime-config.js +4 -70
- package/dist/styles/global.js +1 -2
- package/dist/utils/check-todo-status.js +1 -2
- package/package.json +8 -14
- package/dist/api/authenticationApi.js +0 -13
- package/dist/auth/index.js +0 -34
- package/dist/components/2FA/Connect2FA.js +0 -58
- package/dist/components/2FA/EnterCode.js +0 -74
- package/dist/components/2FA/InstallAuthApp.js +0 -68
- package/dist/components/2FA/ResetCode.js +0 -34
- package/dist/components/2FA/Sucess2FA.js +0 -63
- package/dist/components/2FA/disable-2fa-flow.js +0 -104
- package/dist/components/2FA/enable-2fa-flow.js +0 -167
- package/dist/components/2FA/login-with-otp-flow.js +0 -262
- package/dist/components/2FA/main-flow.js +0 -273
- package/dist/components/Footer/Footer.js +0 -69
- package/dist/components/Footer/Footer.styles.js +0 -277
- package/dist/components/Footer/FooterLayout.js +0 -150
- package/dist/components/Footer/FooterMenu.js +0 -107
- package/dist/components/Footer/FooterMenu.styles.js +0 -334
- package/dist/components/ForgotPasswordModal/ForgotPasswordModal.js +0 -121
- package/dist/components/Header/Header.js +0 -441
- package/dist/components/Header/Header.styles.js +0 -568
- package/dist/components/Layout/Layout.js +0 -76
- package/dist/components/LoginModal/LoginModal.js +0 -165
- package/dist/components/MainMenu/DynamicMainMenu.js +0 -38
- package/dist/components/MainMenu/MainMenu.js +0 -220
- package/dist/components/MainMenu/MainMenu.styles.js +0 -362
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +0 -273
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.js +0 -74
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.styles.js +0 -20
- package/dist/components/RegisterModal/RegisterModal.js +0 -278
- package/dist/components/ResetConfirmModal/ResetConfirmModal.js +0 -40
- package/dist/components/ResetConfirmModal/ResetConfirmModal.styles.js +0 -41
- package/dist/components/ResetPasswordModal/ResetPasswordModal.js +0 -145
- package/dist/components/StepsProgress/StepIndicator.js +0 -40
- package/dist/components/StepsProgress/StepIndicator.styles.js +0 -69
- package/dist/components/StepsProgress/StepsProgress.js +0 -67
- package/dist/components/StepsProgress/StepsProgress.styles.js +0 -105
- package/dist/components/TermsModal/TermsModal.js +0 -145
- package/dist/components/TermsModal/_styles.js +0 -313
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +0 -122
- package/dist/components/headerHo/HeaderHo.js +0 -707
- package/dist/config.js +0 -33
- package/dist/context/Auth.js +0 -423
- package/dist/context/AuthContext.js +0 -1016
- package/dist/firebase-config.js +0 -56
- package/dist/hooks/useNewVentureForm.js +0 -235
- package/dist/static/images/background3.png.js +0 -4
- package/dist/static/images/google_auth.png.js +0 -4
- package/dist/static/images/iso27001-black.svg.js +0 -4
- package/dist/static/images/mangopay.svg.js +0 -4
- package/dist/static/images/social/Facebook_Logo.png.js +0 -4
- package/dist/static/images/social/LI-In-Bug.png.js +0 -4
- package/dist/static/images/social/Telegram-Logo.png.js +0 -4
- package/dist/static/images/social/X-logo-black.png.js +0 -4
- package/dist/static/images/social/youtube_social_circle_red.png.js +0 -4
- package/dist/utils/show-account-locked-modal.js +0 -23
- package/dist/utils/user-identity.js +0 -10
- package/dist/utils/withRouter.js +0 -26
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { Text } from "../Text/Text.styles.js";
|
|
3
|
-
import { colors } from "../../styles/colors.js";
|
|
4
|
-
const ContainerWithLine = styled(Text)`
|
|
5
|
-
position: relative;
|
|
6
|
-
padding-left: 48px;
|
|
7
|
-
|
|
8
|
-
&::before {
|
|
9
|
-
content: '';
|
|
10
|
-
width: 6px;
|
|
11
|
-
height: 72px;
|
|
12
|
-
background: ${colors.blue};
|
|
13
|
-
position: absolute;
|
|
14
|
-
left: 0;
|
|
15
|
-
top: 6px;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
export {
|
|
19
|
-
ContainerWithLine
|
|
20
|
-
};
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React__default, { useState, useEffect } from "react";
|
|
3
|
-
import { useLocation } from "react-router-dom";
|
|
4
|
-
import parse from "html-react-parser";
|
|
5
|
-
import { styled } from "styled-components";
|
|
6
|
-
import { Formik } from "formik";
|
|
7
|
-
import * as Yup from "yup";
|
|
8
|
-
import { Modal } from "../Modal/Modal.js";
|
|
9
|
-
import stdin_default$1 from "../Form/Form.js";
|
|
10
|
-
import { Text } from "../Text/Text.styles.js";
|
|
11
|
-
import { Input } from "../Input/Input.js";
|
|
12
|
-
import stdin_default$2 from "../Input/InputPassword.js";
|
|
13
|
-
import stdin_default$3 from "../Checkbox/Checkbox.js";
|
|
14
|
-
import stdin_default$4 from "../Button/Button.styles.js";
|
|
15
|
-
import { Row, Column } from "../Grid/Grid.styles.js";
|
|
16
|
-
import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
|
|
17
|
-
import fetchDataPublic from "../../api/fetchDataPublic.js";
|
|
18
|
-
import { emailRegex } from "../../constants/globalVariables.js";
|
|
19
|
-
import { isPasswordValid, PASSWORD_REQUIREMENTS_MESSAGE } from "../../utils/password-validation.js";
|
|
20
|
-
import { ModalInner, ModalLinkWrap, ModalLink } from "../Modal/Modal.styles.js";
|
|
21
|
-
import { FormField, FormError } from "../Form/Form.styles.js";
|
|
22
|
-
const TermsStyled = styled.span`
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
font-size: 12px;
|
|
25
|
-
/* margin-left: 4px; */
|
|
26
|
-
text-decoration: underline;
|
|
27
|
-
|
|
28
|
-
&:hover {
|
|
29
|
-
opacity: 0.7;
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
const RegisterModal = (props) => {
|
|
33
|
-
const [email, setemail] = useState(null);
|
|
34
|
-
const location = useLocation();
|
|
35
|
-
const [popupErrorWithValue, setpopupErrorWithValue] = useState({});
|
|
36
|
-
const [privacyTermsCheckbox, setprivacyTermsCheckbox] = useState({
|
|
37
|
-
agreementText: "By creating this account, I agree with STOKR's Privacy Terms.",
|
|
38
|
-
label: "privacyTerms",
|
|
39
|
-
text: "",
|
|
40
|
-
title: "privacy"
|
|
41
|
-
});
|
|
42
|
-
const [newsletterCheckbox, setNewsletterCheckbox] = useState({
|
|
43
|
-
agreementText: "I would like to receive updates and news from STOKR.",
|
|
44
|
-
label: "newsletter",
|
|
45
|
-
text: "",
|
|
46
|
-
title: "newsletter"
|
|
47
|
-
});
|
|
48
|
-
const fetchCheckbox = async () => {
|
|
49
|
-
try {
|
|
50
|
-
const response = await fetchDataPublic("compliance/get-checkboxes", {
|
|
51
|
-
labels: ["privacyTerms", "newsletter"]
|
|
52
|
-
});
|
|
53
|
-
if (response?.privacyTerms) {
|
|
54
|
-
setprivacyTermsCheckbox(response.privacyTerms);
|
|
55
|
-
}
|
|
56
|
-
if (response?.newsletter) {
|
|
57
|
-
setNewsletterCheckbox(response.newsletter);
|
|
58
|
-
}
|
|
59
|
-
} catch (error) {
|
|
60
|
-
console.log("🚀 ~ file: RegisterModal.js:75 ~ error:", error);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
React__default.useEffect(() => {
|
|
64
|
-
const { search } = location;
|
|
65
|
-
const query = new URLSearchParams(search);
|
|
66
|
-
let _email = query.get("email");
|
|
67
|
-
if (_email) {
|
|
68
|
-
setemail(_email);
|
|
69
|
-
}
|
|
70
|
-
fetchCheckbox();
|
|
71
|
-
}, []);
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
const { popupError: popupError2 } = props;
|
|
74
|
-
if (popupError2.popup === "register") {
|
|
75
|
-
setpopupErrorWithValue({
|
|
76
|
-
...popupError2
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}, [props.popupError]);
|
|
80
|
-
const validationSchema = Yup.object().shape({
|
|
81
|
-
email: Yup.string().matches(emailRegex, "Oops, that's not a valid address").required("Oops, this can‘t be blank"),
|
|
82
|
-
password: Yup.string().test("password-full", function(val) {
|
|
83
|
-
if (!val) return this.createError({ message: "Oops, this can’t be blank" });
|
|
84
|
-
if (!isPasswordValid(val)) return this.createError({ message: PASSWORD_REQUIREMENTS_MESSAGE });
|
|
85
|
-
return true;
|
|
86
|
-
}),
|
|
87
|
-
terms: Yup.bool().oneOf([true], "Please agree to continue"),
|
|
88
|
-
newsletter: Yup.bool()
|
|
89
|
-
// .oneOf([true], 'Newsletter accept is required'),
|
|
90
|
-
});
|
|
91
|
-
const { isModalOpen, onModalClose, onFormSend, onModalSwitch, onTermsClicked, popupError, isActionLoading } = props;
|
|
92
|
-
return /* @__PURE__ */ jsx(Modal, { isOpen: isModalOpen, onClose: onModalClose, children: /* @__PURE__ */ jsxs(Row, { children: [
|
|
93
|
-
/* @__PURE__ */ jsxs(Column, { part: 8, children: [
|
|
94
|
-
/* @__PURE__ */ jsx(ModalInner, { modalTop: true, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
95
|
-
/* @__PURE__ */ jsx("h3", { children: "CREATE YOUR STOKR ACCOUNT" }),
|
|
96
|
-
/* @__PURE__ */ jsx("p", { children: "Register on STOKR to access digital securities offerings and manage your investments." })
|
|
97
|
-
] }) }),
|
|
98
|
-
/* @__PURE__ */ jsx(ModalInner, { modalBot: true, children: /* @__PURE__ */ jsxs(ModalLinkWrap, { children: [
|
|
99
|
-
"Already registered?",
|
|
100
|
-
" ",
|
|
101
|
-
/* @__PURE__ */ jsx(
|
|
102
|
-
ModalLink,
|
|
103
|
-
{
|
|
104
|
-
to: "#",
|
|
105
|
-
as: "button",
|
|
106
|
-
type: "button",
|
|
107
|
-
"data-cy": "register-modal-switch-to-login",
|
|
108
|
-
onClick: onModalSwitch,
|
|
109
|
-
children: "Log in"
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
] }) })
|
|
113
|
-
] }),
|
|
114
|
-
/* @__PURE__ */ jsx(Column, { part: 8, children: /* @__PURE__ */ jsx(ModalInner, { children: /* @__PURE__ */ jsx(
|
|
115
|
-
Formik,
|
|
116
|
-
{
|
|
117
|
-
initialValues: {
|
|
118
|
-
email: "",
|
|
119
|
-
password: "",
|
|
120
|
-
newsletter: false,
|
|
121
|
-
terms: false
|
|
122
|
-
},
|
|
123
|
-
validationSchema,
|
|
124
|
-
onSubmit: (values) => {
|
|
125
|
-
onFormSend(values);
|
|
126
|
-
},
|
|
127
|
-
children: ({ values, errors, touched, handleChange, handleBlur, setFieldValue, setFieldTouched }) => {
|
|
128
|
-
if (popupError.popup === "register" && !popupErrorWithValue.value) {
|
|
129
|
-
let value = popupError.field === "email" ? values.email : values.password;
|
|
130
|
-
setpopupErrorWithValue({ ...popupErrorWithValue, value });
|
|
131
|
-
}
|
|
132
|
-
if (email && values.email !== email) {
|
|
133
|
-
setFieldValue("email", email);
|
|
134
|
-
}
|
|
135
|
-
const handleChangeCustom = (e, withTouch = false) => {
|
|
136
|
-
const { clearPopupError, setPopupError } = props;
|
|
137
|
-
const field = e.target;
|
|
138
|
-
if (field.value === popupErrorWithValue.value || field.value.length > 128) {
|
|
139
|
-
setPopupError("register", popupErrorWithValue.message, field.name);
|
|
140
|
-
} else {
|
|
141
|
-
clearPopupError();
|
|
142
|
-
}
|
|
143
|
-
if (withTouch) {
|
|
144
|
-
setFieldValue(field.name, field.value, true);
|
|
145
|
-
setFieldTouched(field.name, true, false);
|
|
146
|
-
} else {
|
|
147
|
-
handleChange(e);
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
const submitDisabled = !values.email || !!errors.email || !!errors.terms || !isPasswordValid(values.password) || isActionLoading === "signUp" || popupError.popup === "register";
|
|
151
|
-
return /* @__PURE__ */ jsxs(stdin_default$1, { children: [
|
|
152
|
-
/* @__PURE__ */ jsx(ComponentWrapper, { noPadding: true, children: /* @__PURE__ */ jsxs(FormField, { children: [
|
|
153
|
-
/* @__PURE__ */ jsx(
|
|
154
|
-
Input,
|
|
155
|
-
{
|
|
156
|
-
id: "sign-up-email",
|
|
157
|
-
name: "email",
|
|
158
|
-
type: "email",
|
|
159
|
-
label: "Your email",
|
|
160
|
-
value: values.email,
|
|
161
|
-
onChange: handleChangeCustom,
|
|
162
|
-
onBlur: handleBlur,
|
|
163
|
-
error: !!errors.email,
|
|
164
|
-
touched: !!touched.email,
|
|
165
|
-
readOnly: email ? true : false,
|
|
166
|
-
autoComplete: "email",
|
|
167
|
-
"data-cy": "register-modal-email-input"
|
|
168
|
-
}
|
|
169
|
-
),
|
|
170
|
-
/* @__PURE__ */ jsx(FormError, { show: errors.email && touched.email, children: errors.email })
|
|
171
|
-
] }) }),
|
|
172
|
-
/* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsxs(FormField, { children: [
|
|
173
|
-
/* @__PURE__ */ jsx(
|
|
174
|
-
stdin_default$2,
|
|
175
|
-
{
|
|
176
|
-
id: "sign-up-password",
|
|
177
|
-
name: "password",
|
|
178
|
-
type: "password",
|
|
179
|
-
label: "Password",
|
|
180
|
-
value: values.password,
|
|
181
|
-
onChange: (e) => handleChangeCustom(e, true),
|
|
182
|
-
onBlur: handleBlur,
|
|
183
|
-
error: !!errors.password,
|
|
184
|
-
touched: !!touched.password,
|
|
185
|
-
info: "For a stronger password, try a mix of lowercase, capitals, numbers and special characters.",
|
|
186
|
-
autoComplete: "new-password",
|
|
187
|
-
"data-cy": "register-modal-password-input",
|
|
188
|
-
showStrength: true
|
|
189
|
-
}
|
|
190
|
-
),
|
|
191
|
-
/* @__PURE__ */ jsx(FormError, { show: errors.password && touched.password, children: errors.password })
|
|
192
|
-
] }) }),
|
|
193
|
-
/* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true }),
|
|
194
|
-
/* @__PURE__ */ jsxs(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true, children: [
|
|
195
|
-
/* @__PURE__ */ jsxs(FormField, { children: [
|
|
196
|
-
/* @__PURE__ */ jsx(
|
|
197
|
-
stdin_default$3,
|
|
198
|
-
{
|
|
199
|
-
id: newsletterCheckbox.title,
|
|
200
|
-
name: "newsletter",
|
|
201
|
-
text: parse(newsletterCheckbox.agreementText),
|
|
202
|
-
value: "yes",
|
|
203
|
-
checked: !!values.newsletter,
|
|
204
|
-
onChange: handleChange,
|
|
205
|
-
onBlur: handleBlur,
|
|
206
|
-
error: !!errors.newsletter,
|
|
207
|
-
touched: !!touched.newsletter,
|
|
208
|
-
"data-cy": "register-modal-newsletter-checkbox"
|
|
209
|
-
}
|
|
210
|
-
),
|
|
211
|
-
/* @__PURE__ */ jsx(FormError, { show: errors.newsletter && touched.newsletter, children: errors.newsletter })
|
|
212
|
-
] }),
|
|
213
|
-
/* @__PURE__ */ jsxs(FormField, { children: [
|
|
214
|
-
privacyTermsCheckbox && /* @__PURE__ */ jsx(
|
|
215
|
-
stdin_default$3,
|
|
216
|
-
{
|
|
217
|
-
id: privacyTermsCheckbox.title,
|
|
218
|
-
name: "terms",
|
|
219
|
-
"data-cy": "register-modal-terms-checkbox",
|
|
220
|
-
text: parse(privacyTermsCheckbox.agreementText, {
|
|
221
|
-
replace: (domNode) => {
|
|
222
|
-
if (domNode.type === "tag" && domNode.name === "u") {
|
|
223
|
-
return /* @__PURE__ */ jsx(
|
|
224
|
-
TermsStyled,
|
|
225
|
-
{
|
|
226
|
-
"data-cy": "register-modal-privacy-terms-link",
|
|
227
|
-
onClick: (e) => {
|
|
228
|
-
e.stopPropagation();
|
|
229
|
-
e.preventDefault();
|
|
230
|
-
onTermsClicked(privacyTermsCheckbox);
|
|
231
|
-
},
|
|
232
|
-
children: domNode.children[0]?.data
|
|
233
|
-
}
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}),
|
|
238
|
-
value: "yes",
|
|
239
|
-
checked: !!values.terms,
|
|
240
|
-
onChange: handleChange,
|
|
241
|
-
onBlur: handleBlur,
|
|
242
|
-
error: errors.terms && touched.terms,
|
|
243
|
-
touched: !!touched.terms,
|
|
244
|
-
marginTop: true
|
|
245
|
-
}
|
|
246
|
-
),
|
|
247
|
-
/* @__PURE__ */ jsx(FormError, { show: errors.terms && touched.terms, withMarginLeft: true, children: errors.terms })
|
|
248
|
-
] })
|
|
249
|
-
] }),
|
|
250
|
-
/* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(
|
|
251
|
-
stdin_default$4,
|
|
252
|
-
{
|
|
253
|
-
type: "submit",
|
|
254
|
-
fluid: true,
|
|
255
|
-
disabled: submitDisabled,
|
|
256
|
-
id: "signup-button",
|
|
257
|
-
"data-cy": "register-modal-submit",
|
|
258
|
-
children: isActionLoading === "signUp" ? "Creating account" : "Create account"
|
|
259
|
-
}
|
|
260
|
-
) }),
|
|
261
|
-
/* @__PURE__ */ jsx(ComponentWrapper, { paddingVeticalHalf: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(FormError, { show: popupError.popup === "register", children: popupError.message }) })
|
|
262
|
-
] });
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
) }) })
|
|
266
|
-
] }) });
|
|
267
|
-
};
|
|
268
|
-
RegisterModal.propTypes = {
|
|
269
|
-
// isModalOpen: PropTypes.bool.isRequired,
|
|
270
|
-
// onModalClose: PropTypes.func.isRequired,
|
|
271
|
-
// onFormSend: PropTypes.func.isRequired,
|
|
272
|
-
// onModalSwitch: PropTypes.func.isRequired,
|
|
273
|
-
};
|
|
274
|
-
var stdin_default = RegisterModal;
|
|
275
|
-
export {
|
|
276
|
-
RegisterModal,
|
|
277
|
-
stdin_default as default
|
|
278
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import styled from "styled-components";
|
|
5
|
-
import { RED_BASE_HEX } from "../../constants/style.js";
|
|
6
|
-
import { Modal } from "../Modal/Modal.js";
|
|
7
|
-
import stdin_default$1 from "../Button/Button.styles.js";
|
|
8
|
-
import { Text } from "../Text/Text.styles.js";
|
|
9
|
-
import { Row, Column } from "../Grid/Grid.styles.js";
|
|
10
|
-
import { ContainerWithLine } from "./ResetConfirmModal.styles.js";
|
|
11
|
-
import { ModalInner } from "../Modal/Modal.styles.js";
|
|
12
|
-
const RedBar = styled.div`
|
|
13
|
-
background: ${RED_BASE_HEX};
|
|
14
|
-
bottom: 0;
|
|
15
|
-
height: 30%;
|
|
16
|
-
position: absolute;
|
|
17
|
-
right: 0;
|
|
18
|
-
width: 50%;
|
|
19
|
-
`;
|
|
20
|
-
const ResetConfirmModal = ({ isModalOpen, onModalClose, onModalSwitch }) => /* @__PURE__ */ jsxs(Modal, { isOpen: isModalOpen, onClose: onModalClose, closeIsFullHeight: true, children: [
|
|
21
|
-
/* @__PURE__ */ jsx(Row, { isConfirmModal: true, children: /* @__PURE__ */ jsx(Column, { relative: true, part: 10, isConfirmModal: true, children: /* @__PURE__ */ jsx(ModalInner, { isConfirmModal: true, children: /* @__PURE__ */ jsxs(ContainerWithLine, { children: [
|
|
22
|
-
/* @__PURE__ */ jsxs(Text, { withBorder: true, isConfirm: true, children: [
|
|
23
|
-
/* @__PURE__ */ jsx("h3", { children: "PASSWORD UPDATED" }),
|
|
24
|
-
/* @__PURE__ */ jsx("p", { children: "Your password has been updated. You may now sign in with your new credentials." })
|
|
25
|
-
] }),
|
|
26
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
27
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
28
|
-
/* @__PURE__ */ jsx(stdin_default$1, { "data-cy": "reset-confirm-modal-login", onClick: onModalSwitch, children: "Log in" })
|
|
29
|
-
] }) }) }) }),
|
|
30
|
-
/* @__PURE__ */ jsx(RedBar, {})
|
|
31
|
-
] });
|
|
32
|
-
ResetConfirmModal.propTypes = {
|
|
33
|
-
isModalOpen: PropTypes.bool.isRequired,
|
|
34
|
-
onModalClose: PropTypes.func.isRequired
|
|
35
|
-
};
|
|
36
|
-
var stdin_default = ResetConfirmModal;
|
|
37
|
-
export {
|
|
38
|
-
ResetConfirmModal,
|
|
39
|
-
stdin_default as default
|
|
40
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { Text } from "../Text/Text.styles.js";
|
|
3
|
-
import { colors } from "../../styles/colors.js";
|
|
4
|
-
const ContainerWithLine = styled(Text)`
|
|
5
|
-
position: relative;
|
|
6
|
-
padding-left: 48px;
|
|
7
|
-
|
|
8
|
-
&::before {
|
|
9
|
-
content: '';
|
|
10
|
-
width: 8px;
|
|
11
|
-
height: 72px;
|
|
12
|
-
background: ${colors.blue};
|
|
13
|
-
position: absolute;
|
|
14
|
-
left: 0;
|
|
15
|
-
top: 6px;
|
|
16
|
-
@media screen and (max-width: 767px) {
|
|
17
|
-
top: 33px;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// &::after {
|
|
22
|
-
// content: '';
|
|
23
|
-
// width: 1px;
|
|
24
|
-
// height: 800px;
|
|
25
|
-
// background: #ededed;
|
|
26
|
-
// position: absolute;
|
|
27
|
-
// left: 0;
|
|
28
|
-
// top: -200px;
|
|
29
|
-
|
|
30
|
-
// @media screen and (max-width: 767px) {
|
|
31
|
-
// height: 200vh;
|
|
32
|
-
// }
|
|
33
|
-
// }
|
|
34
|
-
|
|
35
|
-
@media screen and (max-width: 767px) {
|
|
36
|
-
top: -20vh;
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
export {
|
|
40
|
-
ContainerWithLine
|
|
41
|
-
};
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import { Formik } from "formik";
|
|
5
|
-
import * as Yup from "yup";
|
|
6
|
-
import { Modal } from "../Modal/Modal.js";
|
|
7
|
-
import stdin_default$1 from "../Form/Form.js";
|
|
8
|
-
import { Text } from "../Text/Text.styles.js";
|
|
9
|
-
import stdin_default$2 from "../Input/InputPassword.js";
|
|
10
|
-
import stdin_default$3 from "../Button/Button.styles.js";
|
|
11
|
-
import { Row, Column } from "../Grid/Grid.styles.js";
|
|
12
|
-
import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
|
|
13
|
-
import { isPasswordValid, PASSWORD_REQUIREMENTS_MESSAGE } from "../../utils/password-validation.js";
|
|
14
|
-
import { ModalInner, ModalLinkWrap, ModalLink } from "../Modal/Modal.styles.js";
|
|
15
|
-
import { FormField, FormError } from "../Form/Form.styles.js";
|
|
16
|
-
const ResetPasswordModal = ({
|
|
17
|
-
isModalOpen,
|
|
18
|
-
onModalClose,
|
|
19
|
-
onFormSend,
|
|
20
|
-
onModalSwitch,
|
|
21
|
-
popupError,
|
|
22
|
-
isActionLoading,
|
|
23
|
-
onLoad
|
|
24
|
-
}) => {
|
|
25
|
-
const initialValues = {
|
|
26
|
-
password: "",
|
|
27
|
-
confirmPassword: ""
|
|
28
|
-
};
|
|
29
|
-
const validationSchema = Yup.object().shape({
|
|
30
|
-
password: Yup.string().test("password-full", function(val) {
|
|
31
|
-
if (!val) return this.createError({ message: "Oops, this can’t be blank" });
|
|
32
|
-
if (!isPasswordValid(val)) return this.createError({ message: PASSWORD_REQUIREMENTS_MESSAGE });
|
|
33
|
-
return true;
|
|
34
|
-
}),
|
|
35
|
-
confirmPassword: Yup.string().required("Oops, this can‘t be blank")
|
|
36
|
-
});
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
onLoad?.();
|
|
39
|
-
}, []);
|
|
40
|
-
return /* @__PURE__ */ jsx(Modal, { isOpen: isModalOpen, onClose: onModalClose, children: /* @__PURE__ */ jsxs(Row, { children: [
|
|
41
|
-
/* @__PURE__ */ jsxs(Column, { part: 8, children: [
|
|
42
|
-
/* @__PURE__ */ jsx(ModalInner, { modalTop: true, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
43
|
-
/* @__PURE__ */ jsx("h3", { children: "SET A NEW PASSWORD" }),
|
|
44
|
-
/* @__PURE__ */ jsx("p", { children: "Enter and confirm your new password." })
|
|
45
|
-
] }) }),
|
|
46
|
-
/* @__PURE__ */ jsx(ModalInner, { modalBot: true, children: /* @__PURE__ */ jsxs(ModalLinkWrap, { children: [
|
|
47
|
-
"Remember your password? ",
|
|
48
|
-
/* @__PURE__ */ jsx(ModalLink, { "data-cy": "reset-password-modal-switch-to-login", to: "#", onClick: onModalSwitch, children: "Log in" })
|
|
49
|
-
] }) })
|
|
50
|
-
] }),
|
|
51
|
-
/* @__PURE__ */ jsx(Column, { part: 8, children: /* @__PURE__ */ jsx(ModalInner, { children: /* @__PURE__ */ jsx(
|
|
52
|
-
Formik,
|
|
53
|
-
{
|
|
54
|
-
initialValues,
|
|
55
|
-
validationSchema,
|
|
56
|
-
onSubmit: (values) => {
|
|
57
|
-
onFormSend(values);
|
|
58
|
-
},
|
|
59
|
-
children: ({ values, errors, touched, handleBlur, setFieldValue, setFieldTouched }) => {
|
|
60
|
-
const onChangeWithTouch = (e) => {
|
|
61
|
-
const field = e.target;
|
|
62
|
-
setFieldValue(field.name, field.value, true);
|
|
63
|
-
setFieldTouched(field.name, true, false);
|
|
64
|
-
};
|
|
65
|
-
const submitDisabled = !isPasswordValid(values.password) || values.password !== values.confirmPassword || isActionLoading === "resetPassword";
|
|
66
|
-
return /* @__PURE__ */ jsxs(stdin_default$1, { children: [
|
|
67
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
68
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
69
|
-
/* @__PURE__ */ jsx(ComponentWrapper, { noPadding: true, children: /* @__PURE__ */ jsxs(FormField, { children: [
|
|
70
|
-
/* @__PURE__ */ jsx(
|
|
71
|
-
stdin_default$2,
|
|
72
|
-
{
|
|
73
|
-
id: "reset-password",
|
|
74
|
-
name: "password",
|
|
75
|
-
type: "password",
|
|
76
|
-
label: "Password",
|
|
77
|
-
value: values.password,
|
|
78
|
-
onChange: onChangeWithTouch,
|
|
79
|
-
onBlur: handleBlur,
|
|
80
|
-
error: !!errors.password,
|
|
81
|
-
touched: !!touched.password,
|
|
82
|
-
info: "For a stronger password, try a mix of lowercase, capitals, numbers and special characters.",
|
|
83
|
-
autoComplete: "new-password",
|
|
84
|
-
"data-cy": "reset-password-modal-password-input",
|
|
85
|
-
showStrength: true
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
/* @__PURE__ */ jsx(FormError, { show: errors.password && touched.password, children: errors.password })
|
|
89
|
-
] }) }),
|
|
90
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
91
|
-
/* @__PURE__ */ jsx(ComponentWrapper, { noPadding: true, children: /* @__PURE__ */ jsxs(FormField, { children: [
|
|
92
|
-
/* @__PURE__ */ jsx(
|
|
93
|
-
stdin_default$2,
|
|
94
|
-
{
|
|
95
|
-
id: "confirm-reset-password",
|
|
96
|
-
name: "confirmPassword",
|
|
97
|
-
type: "password",
|
|
98
|
-
label: "Confirm password",
|
|
99
|
-
value: values.confirmPassword,
|
|
100
|
-
onChange: onChangeWithTouch,
|
|
101
|
-
onBlur: handleBlur,
|
|
102
|
-
error: !!errors.confirmPassword,
|
|
103
|
-
touched: !!touched.confirmPassword,
|
|
104
|
-
autoComplete: "new-password",
|
|
105
|
-
"data-cy": "reset-password-modal-confirm-password-input"
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
/* @__PURE__ */ jsx(FormError, { show: errors.confirmPassword && touched.confirmPassword, children: errors.confirmPassword })
|
|
109
|
-
] }) }),
|
|
110
|
-
/* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(
|
|
111
|
-
stdin_default$3,
|
|
112
|
-
{
|
|
113
|
-
type: "submit",
|
|
114
|
-
id: "reset-password-submit-btn",
|
|
115
|
-
"data-cy": "reset-password-modal-submit",
|
|
116
|
-
fluid: true,
|
|
117
|
-
disabled: submitDisabled,
|
|
118
|
-
children: isActionLoading === "resetPassword" ? "Resetting" : "Reset"
|
|
119
|
-
}
|
|
120
|
-
) }),
|
|
121
|
-
/* @__PURE__ */ jsx(ComponentWrapper, { paddingVeticalHalf: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(
|
|
122
|
-
FormError,
|
|
123
|
-
{
|
|
124
|
-
show: touched.password && touched.confirmPassword && values.password !== values.confirmPassword,
|
|
125
|
-
children: "The passwords must match"
|
|
126
|
-
}
|
|
127
|
-
) }),
|
|
128
|
-
/* @__PURE__ */ jsx(ComponentWrapper, { paddingVeticalHalf: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(FormError, { show: popupError.popup === "resetPassword", children: popupError.message }) })
|
|
129
|
-
] });
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
) }) })
|
|
133
|
-
] }) });
|
|
134
|
-
};
|
|
135
|
-
ResetPasswordModal.propTypes = {
|
|
136
|
-
isModalOpen: PropTypes.bool.isRequired,
|
|
137
|
-
onModalClose: PropTypes.func.isRequired,
|
|
138
|
-
onFormSend: PropTypes.func.isRequired,
|
|
139
|
-
onModalSwitch: PropTypes.func.isRequired
|
|
140
|
-
};
|
|
141
|
-
var stdin_default = ResetPasswordModal;
|
|
142
|
-
export {
|
|
143
|
-
ResetPasswordModal,
|
|
144
|
-
stdin_default as default
|
|
145
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React__default from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import { StepIndicatorContainer, StepItem, StepCircle, StepLabel, StepConnector } from "./StepIndicator.styles.js";
|
|
5
|
-
import SvgCheckIcon from "../../static/images/check-icon.svg.js";
|
|
6
|
-
const StepIndicator = ({ steps, currentStep, onStepClick = null, showLabels = true, marginBottom = "32px" }) => {
|
|
7
|
-
return /* @__PURE__ */ jsx(StepIndicatorContainer, { marginBottom, children: steps.map((step, index) => {
|
|
8
|
-
const isCompleted = index < currentStep;
|
|
9
|
-
const isActive = index === currentStep;
|
|
10
|
-
return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
11
|
-
/* @__PURE__ */ jsxs(
|
|
12
|
-
StepItem,
|
|
13
|
-
{
|
|
14
|
-
onClick: () => onStepClick && onStepClick(index),
|
|
15
|
-
style: { cursor: onStepClick ? "pointer" : "default" },
|
|
16
|
-
children: [
|
|
17
|
-
/* @__PURE__ */ jsx(StepCircle, { isCompleted, isActive, children: isCompleted ? /* @__PURE__ */ jsx(SvgCheckIcon, { width: 14, height: 11 }) : index + 1 }),
|
|
18
|
-
showLabels && /* @__PURE__ */ jsx(StepLabel, { children: step.label })
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
),
|
|
22
|
-
index < steps.length - 1 && /* @__PURE__ */ jsx(StepConnector, { isCompleted })
|
|
23
|
-
] }, step.id);
|
|
24
|
-
}) });
|
|
25
|
-
};
|
|
26
|
-
StepIndicator.propTypes = {
|
|
27
|
-
steps: PropTypes.arrayOf(
|
|
28
|
-
PropTypes.shape({
|
|
29
|
-
id: PropTypes.string.isRequired,
|
|
30
|
-
label: PropTypes.string.isRequired
|
|
31
|
-
})
|
|
32
|
-
).isRequired,
|
|
33
|
-
currentStep: PropTypes.number.isRequired,
|
|
34
|
-
onStepClick: PropTypes.func,
|
|
35
|
-
showLabels: PropTypes.bool,
|
|
36
|
-
marginBottom: PropTypes.string
|
|
37
|
-
};
|
|
38
|
-
export {
|
|
39
|
-
StepIndicator
|
|
40
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import styled, { css } from "styled-components";
|
|
2
|
-
import { colors } from "../../styles/colors.js";
|
|
3
|
-
const StepIndicatorContainer = styled.div.withConfig({
|
|
4
|
-
shouldForwardProp: (props) => !["marginBottom"].includes(props)
|
|
5
|
-
})`
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
gap: 16px;
|
|
9
|
-
margin-bottom: ${(props) => props.marginBottom || "32px"};
|
|
10
|
-
`;
|
|
11
|
-
const StepItem = styled.div`
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
gap: 12px;
|
|
15
|
-
`;
|
|
16
|
-
const StepCircle = styled.div.withConfig({
|
|
17
|
-
shouldForwardProp: (props) => !["isCompleted", "isActive"].includes(props)
|
|
18
|
-
})`
|
|
19
|
-
width: 32px;
|
|
20
|
-
height: 32px;
|
|
21
|
-
border-radius: 50%;
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
font-size: 16px;
|
|
26
|
-
font-weight: 600;
|
|
27
|
-
transition: all 0.2s ease;
|
|
28
|
-
|
|
29
|
-
${(props) => props.isCompleted && css`
|
|
30
|
-
background-color: ${colors.progressGreen};
|
|
31
|
-
color: ${colors.white};
|
|
32
|
-
|
|
33
|
-
svg path {
|
|
34
|
-
stroke: ${colors.white};
|
|
35
|
-
}
|
|
36
|
-
`}
|
|
37
|
-
|
|
38
|
-
${(props) => props.isActive && !props.isCompleted && css`
|
|
39
|
-
background-color: ${colors.black};
|
|
40
|
-
color: ${colors.white};
|
|
41
|
-
`}
|
|
42
|
-
|
|
43
|
-
${(props) => !props.isActive && !props.isCompleted && css`
|
|
44
|
-
background-color: ${colors.grey};
|
|
45
|
-
color: ${colors.black};
|
|
46
|
-
`}
|
|
47
|
-
`;
|
|
48
|
-
const StepLabel = styled.span`
|
|
49
|
-
font-size: 16px;
|
|
50
|
-
font-weight: 600;
|
|
51
|
-
line-height: 24px;
|
|
52
|
-
letter-spacing: 0.6px;
|
|
53
|
-
word-wrap: break-word;
|
|
54
|
-
`;
|
|
55
|
-
const StepConnector = styled.div.withConfig({
|
|
56
|
-
shouldForwardProp: (props) => !["isCompleted"].includes(props)
|
|
57
|
-
})`
|
|
58
|
-
flex: 1;
|
|
59
|
-
height: 2px;
|
|
60
|
-
max-width: 80px;
|
|
61
|
-
background-color: ${(props) => props.isCompleted ? colors.progressGreen : colors.grey};
|
|
62
|
-
`;
|
|
63
|
-
export {
|
|
64
|
-
StepCircle,
|
|
65
|
-
StepConnector,
|
|
66
|
-
StepIndicatorContainer,
|
|
67
|
-
StepItem,
|
|
68
|
-
StepLabel
|
|
69
|
-
};
|