@stokr/components-library 3.0.54 → 3.0.56
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/BackButton/BackButton.js +1 -3
- package/dist/components/ComponentScroll/ComponentScroll.js +1 -1
- package/dist/components/FAQ/FAQ.js +2 -5
- package/dist/components/Input/InputPassword.js +7 -11
- package/dist/components/MultiProgressBar/MultiProgressBar.js +1 -3
- package/dist/components/RegisterModal/RegisterModal.js +12 -7
- package/dist/components/ResetPasswordModal/ResetPasswordModal.js +12 -13
- package/dist/components/Tabs/Tabs.js +1 -3
- package/dist/components/TabsNav/TabsNav.js +1 -3
- package/dist/index.js +8 -17
- package/dist/utils/password-validation.js +49 -0
- package/dist/utils/scrollUtils.js +9 -9
- package/package.json +4 -13
- package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.js +0 -18
- package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.styles.js +0 -41
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.js +0 -32
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.styles.js +0 -208
- package/dist/components/LearnMorePage/LearnMore.js +0 -190
- package/dist/components/LearnMorePage/LearnMore.propTypes.js +0 -20
- package/dist/components/LearnMorePage/LearnMore.shared.styles.js +0 -56
- package/dist/components/LearnMorePage/LearnMore.styles.js +0 -276
- package/dist/components/LearnMorePage/LearnMoreExampleObject.js +0 -120
- package/dist/components/LearnMorePage/LearnMoreItem.js +0 -57
- package/dist/components/LearnMorePage/LearnMoreItem.styles.js +0 -234
- package/dist/components/LearnMoreSection/LearnMore.js +0 -138
- package/dist/components/LearnMoreSection/LearnMore.styles.js +0 -147
- package/dist/components/LearnMoreSection/LearnMoreItem.js +0 -33
- package/dist/components/LearnMoreSection/LearnMoreItem.styles.js +0 -60
|
@@ -25,12 +25,10 @@ BackButton.propTypes = {
|
|
|
25
25
|
to: PropTypes.string,
|
|
26
26
|
href: PropTypes.string
|
|
27
27
|
};
|
|
28
|
-
var stdin_default = BackButton;
|
|
29
28
|
export {
|
|
30
29
|
BackButton,
|
|
31
30
|
BackButtonIcon,
|
|
32
31
|
StyledBackButton,
|
|
33
32
|
StyledBackButtonExternal,
|
|
34
|
-
StyledWindowBackButton
|
|
35
|
-
stdin_default as default
|
|
33
|
+
StyledWindowBackButton
|
|
36
34
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useEffect } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { Scrollbars } from "react-custom-scrollbars-
|
|
4
|
+
import { Scrollbars } from "react-custom-scrollbars-4";
|
|
5
5
|
import { Container, Outer, Inner, ThumbV, TrackV, ThumbH, TrackH } from "./ComponentScroll.styles.js";
|
|
6
6
|
const ComponentScroll = (props) => {
|
|
7
7
|
const {
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { Text } from "../Text/Text.styles.js";
|
|
4
4
|
import { useState } from "react";
|
|
5
|
-
import scrollToElement from "
|
|
5
|
+
import { scrollToElement } from "../../utils/scrollUtils.js";
|
|
6
6
|
import { FaqItems, FaqItem, FaqTitle, FaqDropdownIcon, FaqContent, FaqText } from "./FAQ.styles.js";
|
|
7
7
|
function slugFromTitle(title) {
|
|
8
8
|
if (title == null) return "";
|
|
@@ -22,10 +22,7 @@ const FAQ = (props) => {
|
|
|
22
22
|
scrollRef?.current.scrollToBottom();
|
|
23
23
|
}, 0);
|
|
24
24
|
} else {
|
|
25
|
-
scrollToElement
|
|
26
|
-
duration: 300,
|
|
27
|
-
offset: 20
|
|
28
|
-
});
|
|
25
|
+
scrollToElement(e.target.parentElement, { offset: 20 });
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
28
|
};
|
|
@@ -4,12 +4,13 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import stdin_default$1 from "../SvgIcons/CapsLockSvg.js";
|
|
5
5
|
import { InfoIcon } from "../InfoIcon/InfoIcon.js";
|
|
6
6
|
import { Wrapper, Label, InputWrap } from "./Input.styles.js";
|
|
7
|
+
import { getPasswordEntropy, ENTROPY_WEAK, ENTROPY_MEDIUM } from "../../utils/password-validation.js";
|
|
7
8
|
import { InfoIconWrapper, ShowPassword, BottomWrap, PasswordStrengthWrap, PasswordStrengthIndicators, PasswordStrengthIndicator, PasswordStrengthText, CapslockIndicator } from "./InputPassword.styles.js";
|
|
8
9
|
const PasswordStrength = {
|
|
9
10
|
NONE: "none",
|
|
10
11
|
WEAK: "Weak",
|
|
11
|
-
MEDIUM: "
|
|
12
|
-
STRONG: "
|
|
12
|
+
MEDIUM: "Good",
|
|
13
|
+
STRONG: "Strong"
|
|
13
14
|
};
|
|
14
15
|
const InputPassword = (props) => {
|
|
15
16
|
const {
|
|
@@ -53,15 +54,10 @@ const InputPassword = (props) => {
|
|
|
53
54
|
onChange?.(e, field);
|
|
54
55
|
};
|
|
55
56
|
const passwordStrengthFunction = () => {
|
|
56
|
-
if (value
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
return PasswordStrength.WEAK;
|
|
61
|
-
}
|
|
62
|
-
if (value.length < 11) {
|
|
63
|
-
return PasswordStrength.MEDIUM;
|
|
64
|
-
}
|
|
57
|
+
if (!value) return PasswordStrength.NONE;
|
|
58
|
+
const entropy = getPasswordEntropy(value);
|
|
59
|
+
if (entropy < ENTROPY_WEAK) return PasswordStrength.WEAK;
|
|
60
|
+
if (entropy < ENTROPY_MEDIUM) return PasswordStrength.MEDIUM;
|
|
65
61
|
return PasswordStrength.STRONG;
|
|
66
62
|
};
|
|
67
63
|
const passwordStrength = passwordStrengthFunction();
|
|
@@ -22,9 +22,7 @@ const MultiProgressBarPropTypes = {
|
|
|
22
22
|
fill: PropTypes.number.isRequired
|
|
23
23
|
};
|
|
24
24
|
MultiProgressBar.propTypes = MultiProgressBarPropTypes;
|
|
25
|
-
var stdin_default = MultiProgressBar;
|
|
26
25
|
export {
|
|
27
26
|
MultiProgressBar,
|
|
28
|
-
MultiProgressBarPropTypes
|
|
29
|
-
stdin_default as default
|
|
27
|
+
MultiProgressBarPropTypes
|
|
30
28
|
};
|
|
@@ -16,6 +16,7 @@ import { Row, Column } from "../Grid/Grid.styles.js";
|
|
|
16
16
|
import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
|
|
17
17
|
import fetchDataPublic from "../../api/fetchDataPublic.js";
|
|
18
18
|
import { emailRegex } from "../../constants/globalVariables.js";
|
|
19
|
+
import { isPasswordValid, PASSWORD_REQUIREMENTS_MESSAGE } from "../../utils/password-validation.js";
|
|
19
20
|
import { ModalInner, ModalLinkWrap, ModalLink } from "../Modal/Modal.styles.js";
|
|
20
21
|
import { FormField, FormError } from "../Form/Form.styles.js";
|
|
21
22
|
const TermsStyled = styled.span`
|
|
@@ -78,7 +79,11 @@ const RegisterModal = (props) => {
|
|
|
78
79
|
}, [props.popupError]);
|
|
79
80
|
const validationSchema = Yup.object().shape({
|
|
80
81
|
email: Yup.string().matches(emailRegex, "Oops, that's not a valid address").required("Oops, this can‘t be blank"),
|
|
81
|
-
password: Yup.string().
|
|
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
|
+
}),
|
|
82
87
|
terms: Yup.bool().oneOf([true], "Please agree to continue"),
|
|
83
88
|
newsletter: Yup.bool()
|
|
84
89
|
// .oneOf([true], 'Newsletter accept is required'),
|
|
@@ -136,13 +141,13 @@ const RegisterModal = (props) => {
|
|
|
136
141
|
clearPopupError();
|
|
137
142
|
}
|
|
138
143
|
if (withTouch) {
|
|
139
|
-
setFieldValue(field.name, field.value,
|
|
140
|
-
setFieldTouched(field.name);
|
|
144
|
+
setFieldValue(field.name, field.value, true);
|
|
145
|
+
setFieldTouched(field.name, true, false);
|
|
141
146
|
} else {
|
|
142
147
|
handleChange(e);
|
|
143
148
|
}
|
|
144
149
|
};
|
|
145
|
-
const submitDisabled = !values.email || !!errors.email || !!errors.terms || values.password
|
|
150
|
+
const submitDisabled = !values.email || !!errors.email || !!errors.terms || !isPasswordValid(values.password) || isActionLoading === "signUp" || popupError.popup === "register";
|
|
146
151
|
return /* @__PURE__ */ jsxs(stdin_default$1, { children: [
|
|
147
152
|
/* @__PURE__ */ jsx(ComponentWrapper, { noPadding: true, children: /* @__PURE__ */ jsxs(FormField, { children: [
|
|
148
153
|
/* @__PURE__ */ jsx(
|
|
@@ -179,11 +184,11 @@ const RegisterModal = (props) => {
|
|
|
179
184
|
touched: !!touched.password,
|
|
180
185
|
info: "For a stronger password, try a mix of lowercase, capitals, numbers and special characters.",
|
|
181
186
|
autoComplete: "new-password",
|
|
182
|
-
"data-cy": "register-modal-password-input"
|
|
187
|
+
"data-cy": "register-modal-password-input",
|
|
188
|
+
showStrength: true
|
|
183
189
|
}
|
|
184
190
|
),
|
|
185
|
-
/* @__PURE__ */ jsx(FormError, { show: errors.password && touched.password, children: errors.password })
|
|
186
|
-
/* @__PURE__ */ jsx(FormError, { show: !errors.password && touched.password && values.password.length <= 5, children: "The password must be at least 6 characters long" })
|
|
191
|
+
/* @__PURE__ */ jsx(FormError, { show: errors.password && touched.password, children: errors.password })
|
|
187
192
|
] }) }),
|
|
188
193
|
/* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true }),
|
|
189
194
|
/* @__PURE__ */ jsxs(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true, children: [
|
|
@@ -10,6 +10,7 @@ import stdin_default$2 from "../Input/InputPassword.js";
|
|
|
10
10
|
import { Button } from "../Button/Button.styles.js";
|
|
11
11
|
import { Row, Column } from "../Grid/Grid.styles.js";
|
|
12
12
|
import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
|
|
13
|
+
import { isPasswordValid, PASSWORD_REQUIREMENTS_MESSAGE } from "../../utils/password-validation.js";
|
|
13
14
|
import { ModalInner, ModalLinkWrap, ModalLink } from "../Modal/Modal.styles.js";
|
|
14
15
|
import { FormField, FormError } from "../Form/Form.styles.js";
|
|
15
16
|
const ResetPasswordModal = ({
|
|
@@ -26,7 +27,11 @@ const ResetPasswordModal = ({
|
|
|
26
27
|
confirmPassword: ""
|
|
27
28
|
};
|
|
28
29
|
const validationSchema = Yup.object().shape({
|
|
29
|
-
password: Yup.string().
|
|
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
|
+
}),
|
|
30
35
|
confirmPassword: Yup.string().required("Oops, this can‘t be blank")
|
|
31
36
|
});
|
|
32
37
|
useEffect(() => {
|
|
@@ -54,10 +59,10 @@ const ResetPasswordModal = ({
|
|
|
54
59
|
children: ({ values, errors, touched, handleBlur, setFieldValue, setFieldTouched }) => {
|
|
55
60
|
const onChangeWithTouch = (e) => {
|
|
56
61
|
const field = e.target;
|
|
57
|
-
setFieldValue(field.name, field.value,
|
|
58
|
-
setFieldTouched(field.name);
|
|
62
|
+
setFieldValue(field.name, field.value, true);
|
|
63
|
+
setFieldTouched(field.name, true, false);
|
|
59
64
|
};
|
|
60
|
-
const submitDisabled = values.password
|
|
65
|
+
const submitDisabled = !isPasswordValid(values.password) || values.password !== values.confirmPassword || isActionLoading === "resetPassword";
|
|
61
66
|
return /* @__PURE__ */ jsxs(stdin_default$1, { children: [
|
|
62
67
|
/* @__PURE__ */ jsx("br", {}),
|
|
63
68
|
/* @__PURE__ */ jsx("br", {}),
|
|
@@ -76,17 +81,11 @@ const ResetPasswordModal = ({
|
|
|
76
81
|
touched: !!touched.password,
|
|
77
82
|
info: "For a stronger password, try a mix of lowercase, capitals, numbers and special characters.",
|
|
78
83
|
autoComplete: "new-password",
|
|
79
|
-
"data-cy": "reset-password-modal-password-input"
|
|
84
|
+
"data-cy": "reset-password-modal-password-input",
|
|
85
|
+
showStrength: true
|
|
80
86
|
}
|
|
81
87
|
),
|
|
82
|
-
/* @__PURE__ */ jsx(FormError, { show: errors.password && touched.password, children: errors.password })
|
|
83
|
-
/* @__PURE__ */ jsx(
|
|
84
|
-
FormError,
|
|
85
|
-
{
|
|
86
|
-
show: !errors.password && touched.password && values.password.length <= 5,
|
|
87
|
-
children: "The password must be at least 6 characters long"
|
|
88
|
-
}
|
|
89
|
-
)
|
|
88
|
+
/* @__PURE__ */ jsx(FormError, { show: errors.password && touched.password, children: errors.password })
|
|
90
89
|
] }) }),
|
|
91
90
|
/* @__PURE__ */ jsx("br", {}),
|
|
92
91
|
/* @__PURE__ */ jsx(ComponentWrapper, { noPadding: true, children: /* @__PURE__ */ jsxs(FormField, { children: [
|
|
@@ -16,13 +16,11 @@ TabsNav.propTypes = {
|
|
|
16
16
|
noBorderBottom: PropTypes.bool,
|
|
17
17
|
noWrapperPadding: PropTypes.bool
|
|
18
18
|
};
|
|
19
|
-
var stdin_default = TabsNav;
|
|
20
19
|
export {
|
|
21
20
|
LinkText,
|
|
22
21
|
Scroll,
|
|
23
22
|
StyledTab,
|
|
24
23
|
StyledTabs,
|
|
25
24
|
TabsNav,
|
|
26
|
-
TabsWrapper
|
|
27
|
-
stdin_default as default
|
|
25
|
+
TabsWrapper
|
|
28
26
|
};
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,6 @@ import { HeroVideoBlock } from "./components/HeroBlock/HeroVideoBlock.js";
|
|
|
9
9
|
import { BasicTable } from "./components/BasicTable/BasicTable.js";
|
|
10
10
|
import { Button } from "./components/Button/Button.styles.js";
|
|
11
11
|
import { ButtonContainer, ButtonGridContainer } from "./components/ButtonContainer/ButtonContainer.styles.js";
|
|
12
|
-
import { CaptialRaisedSummary } from "./components/CapitalRaisedSummary/CaptialRaisedSummary.js";
|
|
13
12
|
import { ChartLegend } from "./components/ChartLegend/ChartLegend.js";
|
|
14
13
|
import { CheckBoxCaption, Checkbox } from "./components/Checkbox/Checkbox.js";
|
|
15
14
|
import { ComponentScroll } from "./components/ComponentScroll/ComponentScroll.js";
|
|
@@ -45,12 +44,6 @@ import { TableFilterDropdown } from "./components/Input/TableFilterDropdown.js";
|
|
|
45
44
|
import { InvestmentStat } from "./components/InvestmentStat/InvestmentStat.js";
|
|
46
45
|
import { SpanButton } from "./components/SpanButton/SpanButton.styles.js";
|
|
47
46
|
import { LatestUpdate } from "./components/LatestUpdate/LatestUpdate.js";
|
|
48
|
-
import { LearnMoreCarousel } from "./components/LearnMoreCarousel/LearnMoreCarousel.js";
|
|
49
|
-
import { LearnMore } from "./components/LearnMorePage/LearnMore.js";
|
|
50
|
-
import { LearnMoreExampleObject } from "./components/LearnMorePage/LearnMoreExampleObject.js";
|
|
51
|
-
import { LearnMoreItem } from "./components/LearnMorePage/LearnMoreItem.js";
|
|
52
|
-
import { LearnMoreSection } from "./components/LearnMoreSection/LearnMore.js";
|
|
53
|
-
import { LearnMoreItemSection } from "./components/LearnMoreSection/LearnMoreItem.js";
|
|
54
47
|
import { MainMenu } from "./components/MainMenu/MainMenu.js";
|
|
55
48
|
import { MenuNav } from "./components/MenuNav/MenuNav.styles.js";
|
|
56
49
|
import { GlareButton } from "./components/Button/GlareButton.js";
|
|
@@ -132,6 +125,7 @@ import { cooldownHOC, useComponentVisible, useContainerSize, useCooldown, useMob
|
|
|
132
125
|
import { fixDecimals } from "./utils/fix-decimals.js";
|
|
133
126
|
import { CURRENCY_CONFIG, formatCurrencyValue, getCurrencyConfig, getCurrencyIcon, getCurrencySymbol, getLiquidAssetIcon, getProjectCurrencySign } from "./utils/formatCurrencyValue.js";
|
|
134
127
|
import { isUSInvestor, usCountries } from "./utils/isUSInvestor.js";
|
|
128
|
+
import { ENTROPY_MEDIUM, ENTROPY_WEAK, PASSWORD_MIN_LENGTH, PASSWORD_REQUIREMENTS_MESSAGE, getPasswordCriteria, getPasswordEntropy, isPasswordValid } from "./utils/password-validation.js";
|
|
135
129
|
import { km_ify } from "./utils/km_ify.js";
|
|
136
130
|
import { momentUtils } from "./utils/moment.js";
|
|
137
131
|
import { openFile, saveAs } from "./utils/saveAs.js";
|
|
@@ -243,7 +237,6 @@ import { Youtube } from "./components/icons/Youtube.js";
|
|
|
243
237
|
import { format } from "date-fns";
|
|
244
238
|
import { getAnalyticsIngestUrl, getBackofficeAppUrl } from "./utils/app-urls-analytics-backoffice.js";
|
|
245
239
|
import { getConfig, resetRuntimeConfig } from "./runtime-config.js";
|
|
246
|
-
import { learnMoreCategoryPropTypes, learnMorePostPropTypes } from "./components/LearnMorePage/LearnMore.propTypes.js";
|
|
247
240
|
import { useSnackbar } from "./components/Snackbar/useSnackbar.js";
|
|
248
241
|
export {
|
|
249
242
|
AccountBalance,
|
|
@@ -279,7 +272,6 @@ export {
|
|
|
279
272
|
CURRENCY_CONFIG,
|
|
280
273
|
default10 as CameraSvg,
|
|
281
274
|
default11 as CapsLockSvg,
|
|
282
|
-
CaptialRaisedSummary,
|
|
283
275
|
Card,
|
|
284
276
|
CardHeader,
|
|
285
277
|
CardHeaderRegular,
|
|
@@ -331,6 +323,8 @@ export {
|
|
|
331
323
|
default14 as DocumentSmallSvg,
|
|
332
324
|
default15 as DocumentSvg,
|
|
333
325
|
DoubleButtons,
|
|
326
|
+
ENTROPY_MEDIUM,
|
|
327
|
+
ENTROPY_WEAK,
|
|
334
328
|
default16 as Enable2FAFlow,
|
|
335
329
|
default17 as EnterCode,
|
|
336
330
|
ErrorMessage,
|
|
@@ -402,12 +396,6 @@ export {
|
|
|
402
396
|
LatestUpdate,
|
|
403
397
|
LatestUpdateWrapper,
|
|
404
398
|
Layout,
|
|
405
|
-
LearnMore,
|
|
406
|
-
LearnMoreCarousel,
|
|
407
|
-
LearnMoreExampleObject,
|
|
408
|
-
LearnMoreItem,
|
|
409
|
-
LearnMoreItemSection,
|
|
410
|
-
LearnMoreSection,
|
|
411
399
|
LinkIcon,
|
|
412
400
|
LinkText,
|
|
413
401
|
LinkedIn,
|
|
@@ -448,6 +436,8 @@ export {
|
|
|
448
436
|
OptionLabel,
|
|
449
437
|
OtpInput,
|
|
450
438
|
Outer,
|
|
439
|
+
PASSWORD_MIN_LENGTH,
|
|
440
|
+
PASSWORD_REQUIREMENTS_MESSAGE,
|
|
451
441
|
PHONE_MEDIA,
|
|
452
442
|
PageTransition,
|
|
453
443
|
PageWrapper,
|
|
@@ -620,6 +610,8 @@ export {
|
|
|
620
610
|
getFooterGroups,
|
|
621
611
|
getLiquidAssetIcon,
|
|
622
612
|
getMedia,
|
|
613
|
+
getPasswordCriteria,
|
|
614
|
+
getPasswordEntropy,
|
|
623
615
|
getProjectCurrencySign,
|
|
624
616
|
getTokenBucket,
|
|
625
617
|
getVerifyIdentityChecklist,
|
|
@@ -631,10 +623,9 @@ export {
|
|
|
631
623
|
isAccountLockedError,
|
|
632
624
|
isAlreadyOnOnboardingFlow,
|
|
633
625
|
isExternalUrl,
|
|
626
|
+
isPasswordValid,
|
|
634
627
|
isUSInvestor,
|
|
635
628
|
km_ify,
|
|
636
|
-
learnMoreCategoryPropTypes,
|
|
637
|
-
learnMorePostPropTypes,
|
|
638
629
|
loaderGif,
|
|
639
630
|
momentUtils,
|
|
640
631
|
navigateToHref,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const PASSWORD_MIN_LENGTH = 8;
|
|
2
|
+
const PASSWORD_REQUIREMENTS_MESSAGE = "Use at least 8 characters with a mix of letters, numbers, and symbols.";
|
|
3
|
+
const ENTROPY_WEAK = 50;
|
|
4
|
+
const ENTROPY_MEDIUM = 80;
|
|
5
|
+
const getCharsetSize = (password) => {
|
|
6
|
+
let size = 0;
|
|
7
|
+
if (/[a-z]/.test(password)) size += 26;
|
|
8
|
+
if (/[A-Z]/.test(password)) size += 26;
|
|
9
|
+
if (/[0-9]/.test(password)) size += 10;
|
|
10
|
+
if (/[^A-Za-z0-9]/.test(password)) size += 32;
|
|
11
|
+
return size;
|
|
12
|
+
};
|
|
13
|
+
const getPasswordEntropy = (value) => {
|
|
14
|
+
const password = value || "";
|
|
15
|
+
if (password.length === 0) return 0;
|
|
16
|
+
const charsetSize = getCharsetSize(password);
|
|
17
|
+
const uniqueChars = new Set(password).size;
|
|
18
|
+
const effectiveLength = (password.length + uniqueChars) / 2;
|
|
19
|
+
return effectiveLength * Math.log2(charsetSize);
|
|
20
|
+
};
|
|
21
|
+
const getPasswordCriteria = (value) => {
|
|
22
|
+
const password = value || "";
|
|
23
|
+
const hasLowercase = /[a-z]/.test(password);
|
|
24
|
+
const hasUppercase = /[A-Z]/.test(password);
|
|
25
|
+
const hasNumber = /[0-9]/.test(password);
|
|
26
|
+
const hasSpecial = /[^A-Za-z0-9]/.test(password);
|
|
27
|
+
return {
|
|
28
|
+
length: password.length,
|
|
29
|
+
hasLength: password.length >= PASSWORD_MIN_LENGTH,
|
|
30
|
+
hasLowercase,
|
|
31
|
+
hasUppercase,
|
|
32
|
+
hasNumber,
|
|
33
|
+
hasSpecial,
|
|
34
|
+
classesMet: [hasLowercase, hasUppercase, hasNumber, hasSpecial].filter(Boolean).length
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
const isPasswordValid = (value) => {
|
|
38
|
+
const password = value || "";
|
|
39
|
+
return password.length >= PASSWORD_MIN_LENGTH && getPasswordEntropy(password) >= ENTROPY_WEAK;
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
ENTROPY_MEDIUM,
|
|
43
|
+
ENTROPY_WEAK,
|
|
44
|
+
PASSWORD_MIN_LENGTH,
|
|
45
|
+
PASSWORD_REQUIREMENTS_MESSAGE,
|
|
46
|
+
getPasswordCriteria,
|
|
47
|
+
getPasswordEntropy,
|
|
48
|
+
isPasswordValid
|
|
49
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { useEffect, useCallback } from "react";
|
|
2
2
|
import { useLocation } from "react-router-dom";
|
|
3
|
-
const scrollToElement = (
|
|
4
|
-
const { behavior = "smooth", block = "start", delay = 0 } = options;
|
|
3
|
+
const scrollToElement = (elementOrRef, options = {}) => {
|
|
4
|
+
const { behavior = "smooth", block = "start", delay = 0, offset = 0 } = options;
|
|
5
5
|
const performScroll = () => {
|
|
6
|
-
|
|
6
|
+
const element = elementOrRef?.current ?? elementOrRef;
|
|
7
|
+
if (!element) return;
|
|
7
8
|
const isAppleDevice = /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
8
9
|
requestAnimationFrame(() => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const rect = element.getBoundingClientRect();
|
|
11
|
+
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
12
|
+
const targetY = rect.top + scrollTop - offset;
|
|
13
|
+
if (isAppleDevice || offset !== 0) {
|
|
13
14
|
window.scrollTo({
|
|
14
15
|
top: targetY,
|
|
15
16
|
behavior: behavior === "smooth" ? "auto" : behavior
|
|
16
|
-
// Use 'auto' for Apple devices
|
|
17
17
|
});
|
|
18
18
|
} else {
|
|
19
|
-
|
|
19
|
+
element.scrollIntoView({
|
|
20
20
|
behavior,
|
|
21
21
|
block
|
|
22
22
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stokr/components-library",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.56",
|
|
4
4
|
"description": "STOKR - Components Library",
|
|
5
5
|
"author": "Bilal Hodzic <bilal@stokr.io>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,32 +54,25 @@
|
|
|
54
54
|
"serve": "npx http-server ./storybook-static -p 9009"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@lottiefiles/dotlottie-react": "^0.
|
|
58
|
-
"ajv": "^8.18.0",
|
|
57
|
+
"@lottiefiles/dotlottie-react": "^0.19.4",
|
|
59
58
|
"axios": "^1.13.5",
|
|
60
|
-
"bignumber.js": "^9.1.1",
|
|
61
59
|
"country-flag-icons": "^1.6.17",
|
|
62
60
|
"date-fns": "^4.1.0",
|
|
63
61
|
"date-fns-tz": "^3.2.0",
|
|
64
62
|
"dompurify": "^3.2.4",
|
|
65
63
|
"firebase": "^12.4.0",
|
|
66
64
|
"formik": "^2.2.9",
|
|
67
|
-
"formik-persist": "^1.1.0",
|
|
68
65
|
"html-react-parser": "^5.0.6",
|
|
69
66
|
"js-cookie": "^3.0.5",
|
|
70
67
|
"mixpanel-browser": "^2.74.0",
|
|
71
|
-
"mobile-detect": "^1.4.5",
|
|
72
68
|
"moment": "^2.30.1",
|
|
73
69
|
"moment-timezone": "^0.6.0",
|
|
74
70
|
"prop-types": "^15.8.1",
|
|
75
71
|
"qrcode.react": "^4.2.0",
|
|
76
72
|
"react-collapse": "^5.1.1",
|
|
77
73
|
"react-copy-to-clipboard": "^5.1.0",
|
|
78
|
-
"react-
|
|
79
|
-
"react-custom-scrollbars-2": "^4.5.0",
|
|
74
|
+
"react-custom-scrollbars-4": "^4.5.1",
|
|
80
75
|
"react-day-picker": "^9.11.1",
|
|
81
|
-
"react-device-detect": "^2.2.3",
|
|
82
|
-
"react-ga4": "^2.1.0",
|
|
83
76
|
"react-helmet": "^6.1.0",
|
|
84
77
|
"react-intersection-observer": "^10.0.2",
|
|
85
78
|
"react-otp-input": "^3.1.0",
|
|
@@ -89,15 +82,13 @@
|
|
|
89
82
|
"react-slick": "^0.31.0",
|
|
90
83
|
"react-table": "^7.8.0",
|
|
91
84
|
"react-tippy": "^1.4.0",
|
|
92
|
-
"scroll-to-element": "^2.0.3",
|
|
93
|
-
"semantic-ui-react": "^2.1.4",
|
|
94
85
|
"slick-carousel": "^1.8.1",
|
|
95
86
|
"yup": "^1.0.0"
|
|
96
87
|
},
|
|
97
88
|
"peerDependencies": {
|
|
98
89
|
"react": "^18.0.0 || ^19.0.0",
|
|
99
90
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
100
|
-
"react-router-dom": "^6.0.0",
|
|
91
|
+
"react-router-dom": "^6.0.0 || ^7.0.0",
|
|
101
92
|
"styled-components": "^6.0.0"
|
|
102
93
|
},
|
|
103
94
|
"devDependencies": {
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import CountUp from "react-countup";
|
|
4
|
-
import PropTypes from "prop-types";
|
|
5
|
-
import stdin_default, { MultiProgressBarPropTypes } from "../MultiProgressBar/MultiProgressBar.js";
|
|
6
|
-
import { Wrapper, Title, Amount } from "./CaptialRaisedSummary.styles.js";
|
|
7
|
-
const CaptialRaisedSummary = ({ capital, multiProgressBar }) => /* @__PURE__ */ jsxs(Wrapper, { children: [
|
|
8
|
-
/* @__PURE__ */ jsx(Title, { children: "CAPITAL RAISED" }),
|
|
9
|
-
/* @__PURE__ */ jsx(Amount, { children: /* @__PURE__ */ jsx(CountUp, { end: capital, prefix: "€ ", duration: 0.01, separator: "," }) }),
|
|
10
|
-
/* @__PURE__ */ jsx(stdin_default, { ...multiProgressBar })
|
|
11
|
-
] });
|
|
12
|
-
CaptialRaisedSummary.propTypes = {
|
|
13
|
-
capital: PropTypes.number.isRequired,
|
|
14
|
-
multiProgressBar: PropTypes.shape(MultiProgressBarPropTypes).isRequired
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
CaptialRaisedSummary
|
|
18
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
|
|
3
|
-
import rwd from "../../styles/rwd.js";
|
|
4
|
-
import theme from "../../styles/theme.js";
|
|
5
|
-
const Wrapper = styled(ComponentWrapper)`
|
|
6
|
-
background: ${() => theme.cPrimary};
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
height: 100%;
|
|
11
|
-
margin-top: -1px;
|
|
12
|
-
`;
|
|
13
|
-
const Title = styled.div`
|
|
14
|
-
font-size: 11px;
|
|
15
|
-
line-height: 20px;
|
|
16
|
-
letter-spacing: 2px;
|
|
17
|
-
margin-bottom: 14px;
|
|
18
|
-
color: ${() => theme.cWhite};
|
|
19
|
-
`;
|
|
20
|
-
const Amount = styled.div`
|
|
21
|
-
font-size: 34px;
|
|
22
|
-
line-height: 40px;
|
|
23
|
-
font-weight: 300;
|
|
24
|
-
margin-bottom: 20px;
|
|
25
|
-
letter-spacing: 2px;
|
|
26
|
-
color: ${() => theme.cWhite};
|
|
27
|
-
white-space: nowrap;
|
|
28
|
-
|
|
29
|
-
${rwd.Medium`
|
|
30
|
-
font-size: 28px;
|
|
31
|
-
`}
|
|
32
|
-
|
|
33
|
-
${rwd.Large`
|
|
34
|
-
font-size: 34px;
|
|
35
|
-
`}
|
|
36
|
-
`;
|
|
37
|
-
export {
|
|
38
|
-
Amount,
|
|
39
|
-
Title,
|
|
40
|
-
Wrapper
|
|
41
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import Slick from "react-slick";
|
|
5
|
-
import "slick-carousel/slick/slick.css";
|
|
6
|
-
import "slick-carousel/slick/slick-theme.css";
|
|
7
|
-
import { Container, Offset, Wrapper } from "./LearnMoreCarousel.styles.js";
|
|
8
|
-
const LearnMoreCarousel = ({ children, autoplay = 0, dots = false, arrows = false, isMobile = false }) => {
|
|
9
|
-
const settings = {
|
|
10
|
-
dots,
|
|
11
|
-
arrows,
|
|
12
|
-
infinite: false,
|
|
13
|
-
speed: 600,
|
|
14
|
-
autoplay: !!autoplay,
|
|
15
|
-
autoplaySpeed: autoplay,
|
|
16
|
-
slidesToShow: isMobile ? 1 : 2,
|
|
17
|
-
slidesToScroll: isMobile ? 1 : 1
|
|
18
|
-
};
|
|
19
|
-
return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(Offset, { children: /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsx(Slick, { ...settings, children }) }) }) });
|
|
20
|
-
};
|
|
21
|
-
LearnMoreCarousel.propTypes = {
|
|
22
|
-
children: PropTypes.node.isRequired,
|
|
23
|
-
autoplay: PropTypes.number,
|
|
24
|
-
dots: PropTypes.bool,
|
|
25
|
-
arrows: PropTypes.bool,
|
|
26
|
-
isMobile: PropTypes.bool
|
|
27
|
-
};
|
|
28
|
-
var stdin_default = LearnMoreCarousel;
|
|
29
|
-
export {
|
|
30
|
-
LearnMoreCarousel,
|
|
31
|
-
stdin_default as default
|
|
32
|
-
};
|