@stokr/components-library 3.0.35 → 3.0.37
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/auth/index.js +9 -9
- package/dist/components/2FA/login-with-otp-flow.js +1 -1
- package/dist/components/BlogPost/BlogPost.js +1 -1
- package/dist/components/BlogPost/BlogPost.styles.js +1 -1
- package/dist/components/Button/GlareButton.js +1 -1
- package/dist/components/ConfirmModal/ConfirmModal.js +4 -4
- package/dist/components/Country/CountrySelect.js +117 -0
- package/dist/components/Header/Header.js +2 -3
- package/dist/components/InfoBox/InfoBox.js +22 -18
- package/dist/components/Input/InputPassword.js +0 -1
- package/dist/components/Input/Select.js +183 -81
- package/dist/components/Input/Select.styles.js +111 -1
- package/dist/components/LearnMoreSection/LearnMore.js +1 -1
- package/dist/components/MainMenu/MainMenu.js +1 -1
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +1 -1
- package/dist/components/Modal/PaymentModal.js +1 -2
- package/dist/components/Newsletter/Newsletter.styles.js +1 -1
- package/dist/components/RefreshButton/RefreshButton.js +0 -1
- package/dist/components/Snackbar/Snackbar.styles.js +1 -1
- package/dist/components/TabsNav/TabsNav.js +0 -2
- package/dist/components/TaxResidenceCard/TaxResidenceCard.js +209 -0
- package/dist/components/TaxResidenceCard/TaxResidenceCard.styles.js +169 -0
- package/dist/components/TeamOverview/TeamOverview.js +0 -1
- package/dist/components/ToDoList/ToDoListTask.js +0 -20
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +1 -15
- package/dist/components/headerHo/HeaderHo.js +5 -22
- package/dist/context/AuthContext.js +25 -12
- package/dist/index.js +137 -130
- package/dist/static/images/globe.svg +16 -0
- package/dist/static/images/globe.svg.js +5 -0
- package/dist/static/images/trash.svg +17 -0
- package/dist/static/images/trash.svg.js +5 -0
- package/dist/utils/customHooks.js +1 -1
- package/dist/utils/get-cookie-domain.js +0 -4
- package/dist/utils/set-redirect-cookie.js +0 -4
- package/package.json +153 -145
package/dist/auth/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { configure } from "../config.js";
|
|
2
|
+
import { Auth, DEFAULT_TOKEN_EXPIRY_MS } from "../context/Auth.js";
|
|
3
|
+
import { AuthConsumer, AuthContext, AuthProvider } from "../context/AuthContext.js";
|
|
4
|
+
import { LoadingDots, StokrLoader, StokrLoaderBox } from "../components/StokrLoader/StokrLoader.js";
|
|
2
5
|
import { default as default2 } from "../components/2FA/Connect2FA.js";
|
|
3
6
|
import { default as default3 } from "../components/2FA/enable-2fa-flow.js";
|
|
4
7
|
import { default as default4 } from "../components/2FA/EnterCode.js";
|
|
5
8
|
import { default as default5 } from "../components/2FA/InstallAuthApp.js";
|
|
6
9
|
import { default as default6 } from "../components/2FA/login-with-otp-flow.js";
|
|
7
|
-
import { default as default7 } from "../components/2FA/
|
|
8
|
-
import { default as default8 } from "../components/2FA/
|
|
9
|
-
import { default as default9 } from "../components/2FA/
|
|
10
|
-
import { Auth, DEFAULT_TOKEN_EXPIRY_MS } from "../context/Auth.js";
|
|
11
|
-
import { AuthConsumer, AuthContext, AuthProvider } from "../context/AuthContext.js";
|
|
12
|
-
import { LoadingDots, StokrLoader, StokrLoaderBox } from "../components/StokrLoader/StokrLoader.js";
|
|
10
|
+
import { default as default7 } from "../components/2FA/main-flow.js";
|
|
11
|
+
import { default as default8 } from "../components/2FA/ResetCode.js";
|
|
12
|
+
import { default as default9 } from "../components/2FA/Sucess2FA.js";
|
|
13
13
|
import { getConfig, resetRuntimeConfig } from "../runtime-config.js";
|
|
14
14
|
export {
|
|
15
15
|
Auth,
|
|
@@ -23,11 +23,11 @@ export {
|
|
|
23
23
|
default5 as InstallAuthApp,
|
|
24
24
|
LoadingDots,
|
|
25
25
|
default6 as LoginWithOTPFlow,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
default7 as Main2FAFlow,
|
|
27
|
+
default8 as ResetCode,
|
|
28
28
|
StokrLoader,
|
|
29
29
|
StokrLoaderBox,
|
|
30
|
-
|
|
30
|
+
default9 as Sucess2FA,
|
|
31
31
|
configure,
|
|
32
32
|
getConfig,
|
|
33
33
|
resetRuntimeConfig
|
|
@@ -8,9 +8,9 @@ import stdin_default$2 from "./EnterCode.js";
|
|
|
8
8
|
import background from "../../static/images/background3.png.js";
|
|
9
9
|
import stdin_default$3 from "./ResetCode.js";
|
|
10
10
|
import { authenticationApi } from "../../api/authenticationApi.js";
|
|
11
|
+
import { useNavigate } from "react-router-dom";
|
|
11
12
|
import { getConfig, getPlatformURL } from "../../runtime-config.js";
|
|
12
13
|
import { navigateToHref } from "../../routing/navigate-app.js";
|
|
13
|
-
import { useNavigate } from "react-router-dom";
|
|
14
14
|
const LoginWithOTP = ({ withBackground, useRelativePathForMenu = false }) => {
|
|
15
15
|
const navigate = useNavigate();
|
|
16
16
|
const { loginUser, waitingFor2fa, firebaseError, loginUserWithTotp, reset2faFlow } = useContext(AuthContext);
|
|
@@ -2,8 +2,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useRef, useEffect } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { Container, ImageWrapper, LoaderWrapper, LoaderImage, Image, Content, Category, TextWrapper, BottomRow, StyledButton } from "./BlogPost.styles.js";
|
|
5
|
-
import { Breakdown } from "../breakdown/Breakdown.js";
|
|
6
5
|
import { loaderGif } from "../StokrLoader/StokrLoader.js";
|
|
6
|
+
import { Breakdown } from "../breakdown/Breakdown.js";
|
|
7
7
|
const BlogPost = ({
|
|
8
8
|
layout = "image-left",
|
|
9
9
|
category,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import rwd from "../../styles/rwd.js";
|
|
2
|
-
import { Breakdown } from "../breakdown/Breakdown.js";
|
|
3
2
|
import theme from "../../styles/theme.js";
|
|
4
3
|
import { Button } from "../Button/Button.styles.js";
|
|
5
4
|
import styled, { css } from "styled-components";
|
|
5
|
+
import { Breakdown } from "../breakdown/Breakdown.js";
|
|
6
6
|
const Content = styled.div.withConfig({
|
|
7
7
|
shouldForwardProp: (props) => props !== "layout"
|
|
8
8
|
})`
|
|
@@ -4,7 +4,7 @@ import { Button } from "./Button.styles.js";
|
|
|
4
4
|
import { colors } from "../../styles/colors.js";
|
|
5
5
|
import { useInView } from "react-intersection-observer";
|
|
6
6
|
import { useState, useRef, useId, useEffect } from "react";
|
|
7
|
-
import styled, {
|
|
7
|
+
import styled, { css, keyframes } from "styled-components";
|
|
8
8
|
const config = {
|
|
9
9
|
colorDark: "rgb(41, 112, 225)",
|
|
10
10
|
colorLight: "#9bfcfd",
|
|
@@ -25,8 +25,8 @@ const ConfirmModalComponent = ({
|
|
|
25
25
|
barColor,
|
|
26
26
|
renderFooter,
|
|
27
27
|
modalProps,
|
|
28
|
-
buttonProps,
|
|
29
|
-
cancelButtonProps,
|
|
28
|
+
buttonProps = {},
|
|
29
|
+
cancelButtonProps = {},
|
|
30
30
|
barStyle,
|
|
31
31
|
maxWidth,
|
|
32
32
|
modalStyles,
|
|
@@ -96,7 +96,7 @@ const ConfirmModalComponent = ({
|
|
|
96
96
|
minWidth: "120px",
|
|
97
97
|
onClick: handleCancel,
|
|
98
98
|
...cancelButtonProps,
|
|
99
|
-
"data-cy": cancelButtonProps["data-cy"] ?? "confirm-modal-cancel",
|
|
99
|
+
"data-cy": cancelButtonProps?.["data-cy"] ?? "confirm-modal-cancel",
|
|
100
100
|
children: cancelText
|
|
101
101
|
}
|
|
102
102
|
),
|
|
@@ -106,7 +106,7 @@ const ConfirmModalComponent = ({
|
|
|
106
106
|
minWidth: "120px",
|
|
107
107
|
onClick: () => handleConfirm(true),
|
|
108
108
|
...buttonProps,
|
|
109
|
-
"data-cy": buttonProps["data-cy"] ?? "confirm-modal-confirm",
|
|
109
|
+
"data-cy": buttonProps?.["data-cy"] ?? "confirm-modal-confirm",
|
|
110
110
|
children: confirmText
|
|
111
111
|
}
|
|
112
112
|
)
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { Select } from "../Input/Select.js";
|
|
6
|
+
import * as Flags from "country-flag-icons/react/3x2";
|
|
7
|
+
import { SelectedChipsTitle, SelectedChipsList, SelectedChip, SelectedChipRemove } from "../Input/Select.styles.js";
|
|
8
|
+
const PillChipsWrapper = styled.div`
|
|
9
|
+
${SelectedChipsTitle} {
|
|
10
|
+
color: #9b9b9b;
|
|
11
|
+
margin-bottom: 10px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
${SelectedChipsList} {
|
|
15
|
+
gap: 10px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
${SelectedChip} {
|
|
19
|
+
padding: 6px 12px 6px 10px;
|
|
20
|
+
border-color: #d8d8d8;
|
|
21
|
+
border-radius: 999px;
|
|
22
|
+
font-size: 13px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
${SelectedChipRemove} {
|
|
26
|
+
color: #9b9b9b;
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
transition:
|
|
30
|
+
color 0.15s,
|
|
31
|
+
background-color 0.15s;
|
|
32
|
+
|
|
33
|
+
&:hover {
|
|
34
|
+
color: #202020;
|
|
35
|
+
background-color: #f0f0f0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:disabled {
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
opacity: 0.5;
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
color: #9b9b9b;
|
|
44
|
+
background-color: transparent;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
const FlagFor = ({ code }) => {
|
|
50
|
+
if (!code) return null;
|
|
51
|
+
const Cmp = Flags[code.toUpperCase()];
|
|
52
|
+
if (!Cmp) return null;
|
|
53
|
+
return /* @__PURE__ */ jsx(Cmp, { "aria-hidden": "true", focusable: "false" });
|
|
54
|
+
};
|
|
55
|
+
FlagFor.propTypes = {
|
|
56
|
+
code: PropTypes.string
|
|
57
|
+
};
|
|
58
|
+
const CountrySelect = (props) => {
|
|
59
|
+
const {
|
|
60
|
+
countries,
|
|
61
|
+
multiple = false,
|
|
62
|
+
placeholder = multiple ? "Search and select countries" : "Search countries",
|
|
63
|
+
selectedLabel = "Selected",
|
|
64
|
+
...rest
|
|
65
|
+
} = props;
|
|
66
|
+
const options = useMemo(
|
|
67
|
+
() => (countries ?? []).map((c) => ({
|
|
68
|
+
key: c?.key || c.value?.toString(),
|
|
69
|
+
...c,
|
|
70
|
+
icon: c.icon ? c.icon : /* @__PURE__ */ jsx(FlagFor, { code: c.value })
|
|
71
|
+
})),
|
|
72
|
+
[countries]
|
|
73
|
+
);
|
|
74
|
+
return /* @__PURE__ */ jsx(PillChipsWrapper, { children: /* @__PURE__ */ jsx(
|
|
75
|
+
Select,
|
|
76
|
+
{
|
|
77
|
+
...rest,
|
|
78
|
+
options,
|
|
79
|
+
multiple,
|
|
80
|
+
search: true,
|
|
81
|
+
placeholder,
|
|
82
|
+
selectedLabel
|
|
83
|
+
}
|
|
84
|
+
) });
|
|
85
|
+
};
|
|
86
|
+
CountrySelect.propTypes = {
|
|
87
|
+
id: PropTypes.string.isRequired,
|
|
88
|
+
name: PropTypes.string.isRequired,
|
|
89
|
+
label: PropTypes.string,
|
|
90
|
+
/** Dynamic list returned by your API. `code` must be ISO 3166-1 alpha-2 (e.g. 'be', 'us'). */
|
|
91
|
+
countries: PropTypes.arrayOf(
|
|
92
|
+
PropTypes.shape({
|
|
93
|
+
key: PropTypes.string,
|
|
94
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
95
|
+
label: PropTypes.string.isRequired,
|
|
96
|
+
icon: PropTypes.node
|
|
97
|
+
})
|
|
98
|
+
).isRequired,
|
|
99
|
+
/** string for single mode, string[] for multi mode */
|
|
100
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
|
101
|
+
multiple: PropTypes.bool,
|
|
102
|
+
placeholder: PropTypes.string,
|
|
103
|
+
selectedLabel: PropTypes.string,
|
|
104
|
+
error: PropTypes.bool,
|
|
105
|
+
touched: PropTypes.bool,
|
|
106
|
+
disabled: PropTypes.bool,
|
|
107
|
+
onChange: PropTypes.func,
|
|
108
|
+
onBlur: PropTypes.func,
|
|
109
|
+
onFocus: PropTypes.func,
|
|
110
|
+
/** Playwright / autocapture: selector on the underlying react-select control */
|
|
111
|
+
dataCy: PropTypes.string
|
|
112
|
+
};
|
|
113
|
+
export {
|
|
114
|
+
CountrySelect,
|
|
115
|
+
FlagFor,
|
|
116
|
+
Flags
|
|
117
|
+
};
|
|
@@ -4,7 +4,6 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import stdin_default$1 from "../SmartLink/SmartLink.js";
|
|
5
5
|
import { Button } from "../Button/Button.styles.js";
|
|
6
6
|
import stdin_default$2 from "../SvgIcons/LogoSvg.js";
|
|
7
|
-
import "../SvgIcons/SocialInstagram.js";
|
|
8
7
|
import { MenuNav } from "../MenuNav/MenuNav.styles.js";
|
|
9
8
|
import stdin_default$4 from "../MainMenu/MainMenu.js";
|
|
10
9
|
import { StepsProgressSignup, StepsProgressHeader } from "../StepsProgress/StepsProgress.js";
|
|
@@ -17,15 +16,15 @@ import { Collapse } from "react-collapse";
|
|
|
17
16
|
import { usePrevious, useMobileView } from "../../utils/customHooks.js";
|
|
18
17
|
import { checkTodoStatus } from "../../utils/check-todo-status.js";
|
|
19
18
|
import { hasLoggedInSession } from "../../utils/user-identity.js";
|
|
20
|
-
import { Breakdown } from "../breakdown/Breakdown.js";
|
|
21
19
|
import { socialSvg } from "../Footer/FooterMenu.js";
|
|
22
20
|
import { Wrapper, FlexContainer } from "../Grid/Grid.styles.js";
|
|
23
21
|
import { getFooterGroups } from "../Footer/FooterLayout.js";
|
|
24
22
|
import { getPlatformURL, getConfig } from "../../runtime-config.js";
|
|
25
|
-
import { navigateToHref } from "../../routing/navigate-app.js";
|
|
26
23
|
import { withRouter } from "../../utils/withRouter.js";
|
|
27
24
|
import { sizes } from "../../styles/rwd.js";
|
|
28
25
|
import { track } from "../../analytics/index.js";
|
|
26
|
+
import { navigateToHref } from "../../routing/navigate-app.js";
|
|
27
|
+
import { Breakdown } from "../breakdown/Breakdown.js";
|
|
29
28
|
const UserAvatarComponent = ({ avatar }) => {
|
|
30
29
|
const [photo, setphoto] = useState(avatarPlaceholder);
|
|
31
30
|
const prevAvatar = usePrevious(avatar);
|
|
@@ -5,22 +5,23 @@ import { colors } from "../../styles/colors.js";
|
|
|
5
5
|
const VARIANTS = {
|
|
6
6
|
warning: {
|
|
7
7
|
background: "#FFFBEB",
|
|
8
|
-
border: colors.
|
|
9
|
-
iconColor:
|
|
8
|
+
border: colors.warningYellow,
|
|
9
|
+
iconColor: colors.warningYellow
|
|
10
10
|
},
|
|
11
11
|
info: {
|
|
12
12
|
background: "#F8FAFC",
|
|
13
13
|
border: colors.blueDark,
|
|
14
|
-
|
|
14
|
+
// border: `${colors.blueDark}80`, // 128 (100% opacity in hex): 50% opacity
|
|
15
|
+
iconColor: colors.blueDark
|
|
15
16
|
},
|
|
16
17
|
error: {
|
|
17
18
|
background: "#FDEDEC",
|
|
18
19
|
border: colors.darkRed,
|
|
19
|
-
iconColor:
|
|
20
|
+
iconColor: colors.darkRed
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
23
|
const Container = styled.div`
|
|
23
|
-
position: relative;
|
|
24
|
+
position: relative;
|
|
24
25
|
display: flex;
|
|
25
26
|
overflow: hidden;
|
|
26
27
|
align-items: flex-start;
|
|
@@ -28,7 +29,7 @@ position: relative;
|
|
|
28
29
|
gap: 12px;
|
|
29
30
|
padding: 12px 20px 12px 16px;
|
|
30
31
|
background: ${(props) => props.$bg};
|
|
31
|
-
border: 1px solid ${(props) => props.$border};
|
|
32
|
+
// border: 1px solid ${(props) => props.$border};
|
|
32
33
|
border-radius: 8px;
|
|
33
34
|
font-size: 12px;
|
|
34
35
|
line-height: 18px;
|
|
@@ -68,14 +69,7 @@ const Content = styled.div`
|
|
|
68
69
|
flex: 1;
|
|
69
70
|
min-width: 0;
|
|
70
71
|
`;
|
|
71
|
-
const InfoBox = ({
|
|
72
|
-
variant = "warning",
|
|
73
|
-
children,
|
|
74
|
-
icon,
|
|
75
|
-
style,
|
|
76
|
-
className,
|
|
77
|
-
noLeftBorder
|
|
78
|
-
}) => {
|
|
72
|
+
const InfoBox = ({ variant = "warning", children, icon, style, className, noLeftBorder }) => {
|
|
79
73
|
const theme = VARIANTS[variant] || VARIANTS.warning;
|
|
80
74
|
const renderIcon = () => {
|
|
81
75
|
if (icon) {
|
|
@@ -83,10 +77,20 @@ const InfoBox = ({
|
|
|
83
77
|
}
|
|
84
78
|
return /* @__PURE__ */ jsx(DefaultIcon, { $color: theme.iconColor });
|
|
85
79
|
};
|
|
86
|
-
return /* @__PURE__ */ jsxs(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
80
|
+
return /* @__PURE__ */ jsxs(
|
|
81
|
+
Container,
|
|
82
|
+
{
|
|
83
|
+
$bg: theme.background,
|
|
84
|
+
$noLeftBorder: noLeftBorder,
|
|
85
|
+
$border: theme.border,
|
|
86
|
+
style,
|
|
87
|
+
className,
|
|
88
|
+
children: [
|
|
89
|
+
renderIcon(),
|
|
90
|
+
/* @__PURE__ */ jsx(Content, { children })
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
);
|
|
90
94
|
};
|
|
91
95
|
export {
|
|
92
96
|
InfoBox
|
|
@@ -2,7 +2,6 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import stdin_default$1 from "../SvgIcons/CapsLockSvg.js";
|
|
5
|
-
import "../SvgIcons/SocialInstagram.js";
|
|
6
5
|
import { InfoIcon } from "../InfoIcon/InfoIcon.js";
|
|
7
6
|
import { Wrapper, Label, InputWrap } from "./Input.styles.js";
|
|
8
7
|
import { InfoIconWrapper, ShowPassword, BottomWrap, PasswordStrengthWrap, PasswordStrengthIndicators, PasswordStrengthIndicator, PasswordStrengthText, CapslockIndicator } from "./InputPassword.styles.js";
|