@stokr/components-library 3.0.21 → 3.0.22

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 (58) hide show
  1. package/README.md +467 -261
  2. package/dist/analytics/index.js +5 -1
  3. package/dist/api/authenticationApi.js +13 -0
  4. package/dist/auth/index.js +4 -2
  5. package/dist/components/2FA/login-with-otp-flow.js +9 -4
  6. package/dist/components/Footer/FooterLayout.js +98 -95
  7. package/dist/components/Footer/FooterMenu.js +1 -1
  8. package/dist/components/Header/Header.js +102 -54
  9. package/dist/components/MainMenu/MainMenu.js +14 -4
  10. package/dist/components/Modal/NewVentureModal/NewVentureModal.js +6 -2
  11. package/dist/components/Payment/PaymentDetailsCard.js +1 -1
  12. package/dist/components/VerifyEmailModal/VerifyEmailModal.js +2 -1
  13. package/dist/components/headerHo/HeaderHo.js +8 -5
  14. package/dist/components/icons/LinkIcon.js +2 -2
  15. package/dist/config.js +5 -21
  16. package/dist/constants/globalVariables.js +6 -4
  17. package/dist/context/Auth.js +5 -2
  18. package/dist/context/AuthContext.js +22 -8
  19. package/dist/firebase-config.js +4 -18
  20. package/dist/index.js +36 -5
  21. package/dist/model/axios.js +3 -1
  22. package/dist/model/axiosPublic.js +2 -2
  23. package/dist/routing/RouterWrapper.js +17 -0
  24. package/dist/routing/app-routes.js +22 -0
  25. package/dist/routing/navigate-app.js +36 -0
  26. package/dist/routing/resolve-app-href.js +149 -0
  27. package/dist/runtime-config.js +94 -0
  28. package/dist/static/country-list.json +251 -251
  29. package/dist/static/fonts/Ionicons/ionicons.min.css +2810 -2810
  30. package/dist/static/fonts/Ionicons/ionicons.min.css.js +1 -1
  31. package/dist/static/fonts/icomoon/selection.json +910 -910
  32. package/dist/static/fonts/icomoon/style.css +139 -139
  33. package/dist/static/images/copy_icon.svg +4 -4
  34. package/dist/static/images/download_icon.svg +3 -3
  35. package/dist/static/images/numbers/number_eight.svg +3 -3
  36. package/dist/static/images/numbers/number_five.svg +4 -4
  37. package/dist/static/images/numbers/number_four.svg +3 -3
  38. package/dist/static/images/numbers/number_nine.svg +4 -4
  39. package/dist/static/images/numbers/number_one.svg +4 -4
  40. package/dist/static/images/numbers/number_seven.svg +4 -4
  41. package/dist/static/images/numbers/number_six.svg +4 -4
  42. package/dist/static/images/numbers/number_three.svg +3 -3
  43. package/dist/static/images/numbers/number_two.svg +4 -4
  44. package/dist/static/images/numbers/number_zero.svg +3 -3
  45. package/dist/static/images/plus-icon.svg +4 -4
  46. package/dist/static/images/search-icon.svg +3 -3
  47. package/dist/static/images/transfer-icon.svg +10 -10
  48. package/dist/static/images/warning-filled.svg +3 -3
  49. package/dist/utils/app-urls-analytics-backoffice.js +30 -0
  50. package/dist/utils/app-urls.js +28 -0
  51. package/dist/utils/checklistGenerator.js +6 -5
  52. package/dist/utils/customHooks.js +1 -1
  53. package/dist/utils/formatCurrencyValue.js +2 -1
  54. package/dist/utils/get-cookie-domain.js +4 -1
  55. package/dist/utils/set-redirect-cookie.js +4 -1
  56. package/dist/utils/withRouter.js +5 -3
  57. package/package.json +1 -1
  58. package/dist/api/auth.js +0 -15
@@ -1,9 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { useInRouterContext, useNavigate, useLocation } from "react-router-dom";
4
- const noopNavigate = () => {
5
- };
6
4
  const fallbackLocation = { pathname: "/", search: "", hash: "", state: null, key: "default" };
5
+ const NAVIGATE_OUTSIDE_ROUTER_MSG = "[@stokr/components-library] Navigation requires a React Router context. Wrap the app root with BrowserRouter, or with RouterWrapper from this package (it adds BrowserRouter only when useInRouterContext() is false so you avoid duplicate routers in a host app).";
6
+ function navigateOutsideRouter() {
7
+ throw new Error(NAVIGATE_OUTSIDE_ROUTER_MSG);
8
+ }
7
9
  const withRouter = (Component) => {
8
10
  const InnerWithRouter = (props) => {
9
11
  const navigate = useNavigate();
@@ -15,7 +17,7 @@ const withRouter = (Component) => {
15
17
  if (inRouter) {
16
18
  return /* @__PURE__ */ jsx(InnerWithRouter, { ...props });
17
19
  }
18
- return /* @__PURE__ */ jsx(Component, { navigate: noopNavigate, location: fallbackLocation, ...props });
20
+ return /* @__PURE__ */ jsx(Component, { navigate: navigateOutsideRouter, location: fallbackLocation, ...props });
19
21
  };
20
22
  return Wrapper;
21
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "3.0.21",
3
+ "version": "3.0.22",
4
4
  "description": "STOKR - Components Library",
5
5
  "author": "Bilal Hodzic <bilal@stokr.io>",
6
6
  "license": "MIT",
package/dist/api/auth.js DELETED
@@ -1,15 +0,0 @@
1
- import axiosInstance from "../model/axios.js";
2
- const authAPI = async (url, data) => {
3
- try {
4
- const result = await axiosInstance.post(`auth/${url}`, data);
5
- console.log("Success!");
6
- return result;
7
- } catch (error) {
8
- console.log(`Error: ${error}`);
9
- throw error;
10
- }
11
- };
12
- export {
13
- authAPI,
14
- authAPI as default
15
- };