@stokr/components-library 3.0.31 → 3.0.33

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 (40) hide show
  1. package/README.md +72 -287
  2. package/dist/analytics/index.js +2 -1
  3. package/dist/components/2FA/Connect2FA.js +11 -1
  4. package/dist/components/2FA/EnterCode.js +13 -2
  5. package/dist/components/2FA/InstallAuthApp.js +4 -0
  6. package/dist/components/2FA/ResetCode.js +2 -1
  7. package/dist/components/2FA/Sucess2FA.js +14 -2
  8. package/dist/components/2FA/disable-2fa-flow.js +15 -2
  9. package/dist/components/2FA/enable-2fa-flow.js +5 -0
  10. package/dist/components/2FA/login-with-otp-flow.js +2 -2
  11. package/dist/components/2FA/main-flow.js +3 -0
  12. package/dist/components/Button/GlareButton.js +273 -0
  13. package/dist/components/ConfirmModal/ConfirmModal.js +21 -2
  14. package/dist/components/FAQ/FAQ.js +37 -23
  15. package/dist/components/ForgotPasswordModal/ForgotPasswordModal.js +24 -3
  16. package/dist/components/Header/Header.js +1 -1
  17. package/dist/components/Input/InputPassword.js +27 -12
  18. package/dist/components/Input/OtpInput.js +21 -7
  19. package/dist/components/Input/Select.js +11 -2
  20. package/dist/components/Input/TableFilterDropdown.js +23 -7
  21. package/dist/components/Layout/Layout.js +6 -3
  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/index.js +2 -0
  39. package/dist/utils/formatCurrencyValue.js +4 -2
  40. package/package.json +1 -1
@@ -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;
package/dist/index.js CHANGED
@@ -55,6 +55,7 @@ import { LearnMoreSection } from "./components/LearnMoreSection/LearnMore.js";
55
55
  import { LearnMoreItemSection } from "./components/LearnMoreSection/LearnMoreItem.js";
56
56
  import { MainMenu } from "./components/MainMenu/MainMenu.js";
57
57
  import { MenuNav } from "./components/MenuNav/MenuNav.styles.js";
58
+ import { GlareButton } from "./components/Button/GlareButton.js";
58
59
  import { Modal } from "./components/Modal/Modal.js";
59
60
  import { PaymentModal } from "./components/Modal/PaymentModal.js";
60
61
  import { NewVentureModal } from "./components/Modal/NewVentureModal/NewVentureModal.js";
@@ -351,6 +352,7 @@ export {
351
352
  GRAY_DEEP_HEX,
352
353
  GRAY_SECONDARY_HEX,
353
354
  GREEN,
355
+ GlareButton,
354
356
  default26 as Glassess,
355
357
  GlobalStyle,
356
358
  Header,
@@ -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.31",
3
+ "version": "3.0.33",
4
4
  "description": "STOKR - Components Library",
5
5
  "author": "Bilal Hodzic <bilal@stokr.io>",
6
6
  "license": "MIT",