@stokr/components-library 3.0.30 → 3.0.32

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 (39) hide show
  1. package/dist/analytics/index.js +2 -1
  2. package/dist/components/2FA/Connect2FA.js +11 -1
  3. package/dist/components/2FA/EnterCode.js +13 -2
  4. package/dist/components/2FA/InstallAuthApp.js +4 -0
  5. package/dist/components/2FA/ResetCode.js +2 -1
  6. package/dist/components/2FA/Sucess2FA.js +14 -2
  7. package/dist/components/2FA/disable-2fa-flow.js +15 -2
  8. package/dist/components/2FA/enable-2fa-flow.js +5 -0
  9. package/dist/components/2FA/main-flow.js +3 -0
  10. package/dist/components/BackButton/BackButton.js +4 -2
  11. package/dist/components/Checklist/ChecklistCard.js +2 -1
  12. package/dist/components/ConfirmModal/ConfirmModal.js +21 -2
  13. package/dist/components/FAQ/FAQ.js +37 -23
  14. package/dist/components/Footer/FooterMenu.styles.js +2 -1
  15. package/dist/components/ForgotPasswordModal/ForgotPasswordModal.js +24 -3
  16. package/dist/components/Header/Header.js +20 -25
  17. package/dist/components/Header/Header.styles.js +2 -1
  18. package/dist/components/Input/InputPassword.js +27 -12
  19. package/dist/components/Input/OtpInput.js +21 -7
  20. package/dist/components/Input/Select.js +11 -2
  21. package/dist/components/Input/TableFilterDropdown.js +23 -7
  22. package/dist/components/LoginModal/LoginModal.js +7 -4
  23. package/dist/components/Modal/Modal.styles.js +10 -2
  24. package/dist/components/Modal/NewVentureModal/NewVentureModal.js +21 -6
  25. package/dist/components/Modal/PaymentModal.js +16 -16
  26. package/dist/components/RegisterConfirmModal/RegisterConfirmModal.js +1 -1
  27. package/dist/components/RegisterModal/RegisterModal.js +30 -5
  28. package/dist/components/ResetConfirmModal/ResetConfirmModal.js +1 -1
  29. package/dist/components/ResetPasswordModal/ResetPasswordModal.js +16 -4
  30. package/dist/components/StepController/StepControllerProgress.js +1 -0
  31. package/dist/components/Switch/Switch.js +5 -3
  32. package/dist/components/ToDoList/ToDoListTask.js +1 -0
  33. package/dist/components/VerifyEmailModal/VerifyEmailModal.js +14 -2
  34. package/dist/components/headerHo/HeaderHo.js +2 -0
  35. package/dist/components/taxId/complete.js +23 -2
  36. package/dist/components/taxId/flow.js +11 -1
  37. package/dist/components/taxId/register-taxid.js +25 -4
  38. package/dist/utils/formatCurrencyValue.js +4 -2
  39. package/package.json +1 -1
@@ -32,6 +32,8 @@ import { emailRegex } from "../../constants/globalVariables.js";
32
32
  const renderSuccessModal = (continueUrl) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
33
33
  stdin_default$1,
34
34
  {
35
+ continueButtonId: "verify-email-success-continue-btn",
36
+ continueButtonDataCy: "verify-email-success-continue",
35
37
  onClick: () => {
36
38
  window.open(continueUrl, "_self");
37
39
  },
@@ -87,12 +89,22 @@ const RenderErrorModal = (props) => {
87
89
  onChange: handleChange,
88
90
  onBlur: handleBlur,
89
91
  error: !!errors.email,
90
- touched: !!touched.email
92
+ touched: !!touched.email,
93
+ "data-cy": "verify-email-modal-email-input"
91
94
  }
92
95
  ),
93
96
  /* @__PURE__ */ jsx(FormError, { show: errors.email && touched.email, children: errors.email })
94
97
  ] }) }),
95
- /* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(Button, { type: "submit", id: "verify-email-submit-btn", disabled: submitDisabled, children: isActionLoading === "resend" ? "Resending email" : "Resend email" }) }),
98
+ /* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(
99
+ Button,
100
+ {
101
+ type: "submit",
102
+ id: "verify-email-submit-btn",
103
+ "data-cy": "verify-email-modal-resend-submit",
104
+ disabled: submitDisabled,
105
+ children: isActionLoading === "resend" ? "Resending email" : "Resend email"
106
+ }
107
+ ) }),
96
108
  /* @__PURE__ */ jsx(ComponentWrapper, { paddingVeticalHalf: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(FormError, { show: popupError.popup === "resend", children: popupError.message }) }),
97
109
  isDisabled && /* @__PURE__ */ jsx(ComponentWrapper, { noPaddingVertical: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(FormError, { show: isDisabled, children: `You can try again in ${secondsRemaining} seconds` }) })
98
110
  ] });
@@ -40,6 +40,7 @@ import fetchDataPublic from "../../api/fetchDataPublic.js";
40
40
  import { withRouter } from "../../utils/withRouter.js";
41
41
  import { checkActionCode } from "firebase/auth";
42
42
  import { auth } from "../../firebase-config.js";
43
+ import { track } from "../../analytics/index.js";
43
44
  const Outer = styled.div.withConfig({
44
45
  shouldForwardProp: (props) => !["fixed"].includes(props)
45
46
  })`
@@ -454,6 +455,7 @@ const _HeaderHoClass = class _HeaderHoClass extends Component {
454
455
  listName: "newsletter"
455
456
  });
456
457
  }
458
+ track("signup_account_created", { newsletter_opt_in: !!_userInfo.newsletter });
457
459
  this.setUserInfo(_userInfo);
458
460
  this.switchOpenModal("signUp", "confirm");
459
461
  this.setIsActionLoading(void 0);
@@ -1,5 +1,6 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import "react";
3
+ import { track } from "../../analytics/index.js";
3
4
  import { Text } from "../Text/Text.styles.js";
4
5
  import { useNavigate } from "react-router-dom";
5
6
  import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
@@ -10,12 +11,32 @@ const noop = () => {
10
11
  const RegisterTaxIdComplete = ({ showBackButton, onClick = noop }) => {
11
12
  let navigate = useNavigate();
12
13
  return /* @__PURE__ */ jsxs(Fragment, { children: [
13
- showBackButton && /* @__PURE__ */ jsx(ComponentWrapper, { noPaddingVertical: true, children: /* @__PURE__ */ jsx(TextButton, { onClick: () => navigate("/verify-identity"), children: "Back to verify identity" }) }),
14
+ showBackButton && /* @__PURE__ */ jsx(ComponentWrapper, { noPaddingVertical: true, children: /* @__PURE__ */ jsx(
15
+ TextButton,
16
+ {
17
+ "data-cy": "tax-id-complete-back-button",
18
+ onClick: () => {
19
+ track("tax_id_back_clicked", { surface: "tax_id_complete" });
20
+ navigate("/verify-identity");
21
+ },
22
+ children: "Back to verify identity"
23
+ }
24
+ ) }),
14
25
  /* @__PURE__ */ jsx(ComponentWrapper, { children: /* @__PURE__ */ jsxs(Text, { children: [
15
26
  /* @__PURE__ */ jsx("h1", { children: "Your Tax Id has been submitted" }),
16
27
  /* @__PURE__ */ jsx("p", { children: "You have successfully submitted your Tax ID information. You will be ready to invest once you have completed all required steps on your checklist. Please continue!" })
17
28
  ] }) }),
18
- /* @__PURE__ */ jsx(ComponentWrapper, { noPaddingTop: true, children: /* @__PURE__ */ jsx(Button, { onClick, children: "Continue" }) })
29
+ /* @__PURE__ */ jsx(ComponentWrapper, { noPaddingTop: true, children: /* @__PURE__ */ jsx(
30
+ Button,
31
+ {
32
+ "data-cy": "tax-id-complete-continue-button",
33
+ onClick: () => {
34
+ track("tax_id_complete_continue_clicked");
35
+ onClick();
36
+ },
37
+ children: "Continue"
38
+ }
39
+ ) })
19
40
  ] });
20
41
  };
21
42
  var stdin_default = RegisterTaxIdComplete;
@@ -1,5 +1,6 @@
1
1
  import { jsx, Fragment } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useRef } from "react";
3
+ import { track } from "../../analytics/index.js";
3
4
  import { Modal } from "../Modal/Modal.js";
4
5
  import stdin_default$3 from "./register-taxid.js";
5
6
  import stdin_default$1 from "../ComponentScroll/ComponentScroll.js";
@@ -20,13 +21,22 @@ const RegisterTaxIdFlow = ({
20
21
  onComplete();
21
22
  }
22
23
  }, [showComplete]);
24
+ useEffect(() => {
25
+ if (showFlow) {
26
+ track("tax_id_modal_opened");
27
+ }
28
+ }, [showFlow]);
29
+ const handleClose = () => {
30
+ track("tax_id_modal_closed", { flow_step: showComplete ? "complete" : "form" });
31
+ setShowFlow(false);
32
+ };
23
33
  const scrollRef = useRef();
24
34
  const handleScroll = (values, ref) => {
25
35
  if (ref) {
26
36
  scrollRef.current = ref;
27
37
  }
28
38
  };
29
- return /* @__PURE__ */ jsx(Modal, { fullscreen: true, isOpen: showFlow, onClose: () => setShowFlow(false), children: /* @__PURE__ */ jsx(ModalInner, { noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(stdin_default$1, { handleScroll, fullHeight: true, children: showComplete ? /* @__PURE__ */ jsx(
39
+ return /* @__PURE__ */ jsx(Modal, { fullscreen: true, isOpen: showFlow, onClose: handleClose, children: /* @__PURE__ */ jsx(ModalInner, { noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(stdin_default$1, { handleScroll, fullHeight: true, children: showComplete ? /* @__PURE__ */ jsx(
30
40
  stdin_default$2,
31
41
  {
32
42
  showBackButton,
@@ -2,6 +2,7 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useContext, useState } from "react";
3
3
  import { useNavigate } from "react-router-dom";
4
4
  import { AuthContext } from "../../context/AuthContext.js";
5
+ import { track } from "../../analytics/index.js";
5
6
  import { Text } from "../Text/Text.styles.js";
6
7
  import * as Yup from "yup";
7
8
  import { Formik } from "formik";
@@ -71,8 +72,10 @@ const RegisterTaxId = ({
71
72
  await updateUser({
72
73
  taxId: e.taxId
73
74
  });
75
+ track("tax_id_form_submitted_success");
74
76
  setShowComplete(true);
75
77
  } catch (_error) {
78
+ track("tax_id_form_submit_failed");
76
79
  setError("Something went wrong. Try again.");
77
80
  setIsUpdatingUser(false);
78
81
  }
@@ -81,7 +84,17 @@ const RegisterTaxId = ({
81
84
  setError(false);
82
85
  };
83
86
  return /* @__PURE__ */ jsxs(Fragment, { children: [
84
- showBackButton ? /* @__PURE__ */ jsx(ComponentWrapper, { noPaddingVertical: true, children: /* @__PURE__ */ jsx(TextButton, { onClick: () => navigate("/verify-identity"), children: backButtonText }) }) : /* @__PURE__ */ jsx("div", { style: { height: 14 } }),
87
+ showBackButton ? /* @__PURE__ */ jsx(ComponentWrapper, { noPaddingVertical: true, children: /* @__PURE__ */ jsx(
88
+ TextButton,
89
+ {
90
+ "data-cy": "tax-id-back-button",
91
+ onClick: () => {
92
+ track("tax_id_back_clicked", { surface: "tax_id_form" });
93
+ navigate("/verify-identity");
94
+ },
95
+ children: backButtonText
96
+ }
97
+ ) }) : /* @__PURE__ */ jsx("div", { style: { height: 14 } }),
85
98
  /* @__PURE__ */ jsx(ComponentWrapper, { children: /* @__PURE__ */ jsxs(Text, { children: [
86
99
  textHeader && textHeader,
87
100
  additionalTextHeader && additionalTextHeader
@@ -102,7 +115,8 @@ const RegisterTaxId = ({
102
115
  onChange: handleChange,
103
116
  onBlur: handleBlur,
104
117
  error: !!errors.taxId,
105
- touched: !!touched.taxId
118
+ touched: !!touched.taxId,
119
+ "data-cy": "tax-id-input"
106
120
  }
107
121
  ),
108
122
  /* @__PURE__ */ jsx(FormError, { show: errors.taxId && touched.taxId, children: errors.taxId })
@@ -114,6 +128,7 @@ const RegisterTaxId = ({
114
128
  minWidth: "230px",
115
129
  type: "submit",
116
130
  id: "tax-id-submit-btn",
131
+ "data-cy": "tax-id-submit-btn",
117
132
  disabled: submitDisabled || isUpdatingUser || taxId,
118
133
  children: "Submit"
119
134
  }
@@ -129,7 +144,7 @@ const RegisterTaxId = ({
129
144
  failed: error
130
145
  }
131
146
  ) }),
132
- error && /* @__PURE__ */ jsx(ComponentWrapper, { center: true, noPaddingBottom: true, children: /* @__PURE__ */ jsx(stdin_default$3, { onClick: onRefreshClick, children: "TRY AGAIN" }) }),
147
+ error && /* @__PURE__ */ jsx(ComponentWrapper, { center: true, noPaddingBottom: true, children: /* @__PURE__ */ jsx(stdin_default$3, { "data-cy": "tax-id-try-again", onClick: onRefreshClick, children: "TRY AGAIN" }) }),
133
148
  taxId && /* @__PURE__ */ jsx(ComponentWrapper, { noPaddingVertical: true, children: /* @__PURE__ */ jsx(
134
149
  stdin_default$4,
135
150
  {
@@ -142,7 +157,13 @@ const RegisterTaxId = ({
142
157
  showSkipButton && /* @__PURE__ */ jsx(ComponentWrapper, { children: /* @__PURE__ */ jsx(
143
158
  TextButton,
144
159
  {
160
+ "data-cy": taxId ? "tax-id-flow-continue" : "tax-id-skip-later",
145
161
  onClick: () => {
162
+ if (taxId) {
163
+ track("tax_id_continue_clicked", { variant: "after_saved" });
164
+ } else {
165
+ track("tax_id_skip_clicked");
166
+ }
146
167
  if (redirectUrl) {
147
168
  if (onContinueClick) {
148
169
  onContinueClick();
@@ -157,7 +178,7 @@ const RegisterTaxId = ({
157
178
  }
158
179
  ) }),
159
180
  /* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, children: /* @__PURE__ */ jsx(SectionTitle, { children: "Frequently Asked Questions" }) }),
160
- /* @__PURE__ */ jsx(ComponentWrapper, { children: /* @__PURE__ */ jsx(stdin_default$5, { scrollRef, items: faqItems }) })
181
+ /* @__PURE__ */ jsx(ComponentWrapper, { children: /* @__PURE__ */ jsx(stdin_default$5, { scrollRef, items: faqItems, dataCyPrefix: "tax-id-faq" }) })
161
182
  ] });
162
183
  };
163
184
  var stdin_default = RegisterTaxId;
@@ -27,7 +27,8 @@ const formatCurrencyValue = (currency, value, tokenDecimals = 2, options = {}) =
27
27
  "btc-fb": ["BTC", 8],
28
28
  "usdc-fb": ["USDC", 2],
29
29
  "usdq-fb": ["USDQ", 2],
30
- xaut: ["XAUt", 6]
30
+ xaut: ["XAUt", 6],
31
+ "usd-in-kind": ["USD", 2]
31
32
  }[currency] || [currency, tokenDecimals];
32
33
  const formattedValue = parseFloat(Math.abs(value)).toFixed(decimals);
33
34
  return valueFirst ? `${formattedValue} ${symbol}` : `${symbol} ${formattedValue}`;
@@ -50,7 +51,8 @@ const getCurrencySymbol = (currencySelected) => ({
50
51
  "usdc-fb": "USDC",
51
52
  "usdq-fb": "USDQ",
52
53
  xaut: "XAUt",
53
- "eth-fb": "ETH"
54
+ "eth-fb": "ETH",
55
+ "usd-in-kind": "$"
54
56
  })[currencySelected] || currencySelected;
55
57
  const getProjectCurrencySign = (tokenCurrency) => {
56
58
  return tokenCurrency === "EUR" ? "€" : tokenCurrency === "USD" ? "$" : tokenCurrency === "BTC" ? "₿" : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "3.0.30",
3
+ "version": "3.0.32",
4
4
  "description": "STOKR - Components Library",
5
5
  "author": "Bilal Hodzic <bilal@stokr.io>",
6
6
  "license": "MIT",