@stokr/components-library 3.0.40 → 3.0.42

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 (30) hide show
  1. package/dist/components/2FA/Connect2FA.js +3 -4
  2. package/dist/components/Button/Button.styles.js +0 -1
  3. package/dist/components/Header/Header.js +10 -2
  4. package/dist/components/HeroBlock/HeroVideoBlock.js +47 -22
  5. package/dist/components/Input/Select.js +11 -2
  6. package/dist/components/icons/LinkIcon.js +2 -2
  7. package/dist/runtime-config.js +1 -1
  8. package/dist/static/country-list.json +251 -251
  9. package/dist/static/fonts/Ionicons/ionicons.min.css +2810 -2810
  10. package/dist/static/fonts/Ionicons/ionicons.min.css.js +1 -1
  11. package/dist/static/fonts/icomoon/selection.json +910 -910
  12. package/dist/static/fonts/icomoon/style.css +139 -139
  13. package/dist/static/images/copy_icon.svg +4 -4
  14. package/dist/static/images/download_icon.svg +3 -3
  15. package/dist/static/images/face-scan-icon.svg +7 -7
  16. package/dist/static/images/numbers/number_eight.svg +3 -3
  17. package/dist/static/images/numbers/number_five.svg +4 -4
  18. package/dist/static/images/numbers/number_four.svg +3 -3
  19. package/dist/static/images/numbers/number_nine.svg +4 -4
  20. package/dist/static/images/numbers/number_one.svg +4 -4
  21. package/dist/static/images/numbers/number_seven.svg +4 -4
  22. package/dist/static/images/numbers/number_six.svg +4 -4
  23. package/dist/static/images/numbers/number_three.svg +3 -3
  24. package/dist/static/images/numbers/number_two.svg +4 -4
  25. package/dist/static/images/numbers/number_zero.svg +3 -3
  26. package/dist/static/images/plus-icon.svg +4 -4
  27. package/dist/static/images/search-icon.svg +3 -3
  28. package/dist/static/images/transfer-icon.svg +10 -10
  29. package/dist/static/images/warning-filled.svg +3 -3
  30. package/package.json +152 -153
@@ -5,7 +5,7 @@ import { Text } from "../Text/Text.styles.js";
5
5
  import { Button } from "../Button/Button.styles.js";
6
6
  import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
7
7
  import { ModalWrapper, ModalInner } from "../Modal/Modal.styles.js";
8
- import QRCode from "react-qr-code";
8
+ import { QRCodeSVG } from "qrcode.react";
9
9
  import { Row, Column } from "../Grid/Grid.styles.js";
10
10
  import stdin_default$1 from "../CryptoAddress/CryptoAddress.js";
11
11
  import { useMobileView } from "../../utils/customHooks.js";
@@ -24,11 +24,10 @@ const Connect2FA = (props) => {
24
24
  /* @__PURE__ */ jsx(Column, { part: 8, children: /* @__PURE__ */ jsxs(ModalInner, { children: [
25
25
  totpData && /* @__PURE__ */ jsxs(ComponentWrapper, { center: true, noPaddingHorizontal: true, children: [
26
26
  !isMobile && /* @__PURE__ */ jsx(
27
- QRCode,
27
+ QRCodeSVG,
28
28
  {
29
29
  size: 180,
30
- value: totpData?.totpUri,
31
- viewBox: `0 0 256 256`
30
+ value: totpData?.totpUri
32
31
  }
33
32
  ),
34
33
  /* @__PURE__ */ jsx(
@@ -45,7 +45,6 @@ const Button = styled.button.withConfig({
45
45
  user-select: none;
46
46
  cursor: pointer;
47
47
  transition:
48
- color 0.2s,
49
48
  background-color 0.2s,
50
49
  border-color 0.2s;
51
50
 
@@ -298,7 +298,15 @@ function HeaderView({
298
298
  ] }),
299
299
  /* @__PURE__ */ jsxs(MobileMenu, { isActive: currentActiveMenu === "main", withSidebar, children: [
300
300
  /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(MobileMenuPart, { withPadding: true, children: /* @__PURE__ */ jsx(MenuNav, { mobile: true, children: /* @__PURE__ */ jsxs("ul", { children: [
301
- /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(MobileMenuLink, { to: newPlatformUrl + "/featured-assets", "data-cy": "invest-nav-link", children: "Invest" }) }),
301
+ /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(
302
+ MobileMenuLink,
303
+ {
304
+ to: newPlatformUrl + "/featured-assets",
305
+ "data-cy": "invest-nav-link",
306
+ onClick: () => toggleMenu("main"),
307
+ children: "Invest"
308
+ }
309
+ ) }),
302
310
  /* @__PURE__ */ jsx(
303
311
  RenderSubMenu,
304
312
  {
@@ -323,7 +331,7 @@ function HeaderView({
323
331
  }
324
332
  }
325
333
  ),
326
- /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(MobileMenuLink, { to: newPlatformUrl + "/team", children: "Team" }) })
334
+ /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(MobileMenuLink, { to: newPlatformUrl + "/team", onClick: () => toggleMenu("main"), children: "Team" }) })
327
335
  ] }) }) }) }),
328
336
  hasLoggedInSession(user) ? /* @__PURE__ */ jsxs(Fragment, { children: [
329
337
  !signupFlow && /* @__PURE__ */ jsx(MobileMenuPart, { withPadding: true, flexColumn: true, borderTop: true, children: /* @__PURE__ */ jsx(MenuNav, { mobile: true, children: /* @__PURE__ */ jsx("ul", { children: isAdmin ? /* @__PURE__ */ jsx(Fragment, { children: isVentureDashboard ? /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(stdin_default$1, { to: "/settings", children: "Settings" }) }) : /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(stdin_default$1, { to: getConfig("adminUrl"), onClick: () => toggleMenu("main"), children: "Dashboard" }) }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1,6 +1,6 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
- import { useRef, useEffect } from "react";
3
+ import { useRef, useState, useCallback, useEffect } from "react";
4
4
  import { useInView } from "react-intersection-observer";
5
5
  const VideoContainer = styled.div`
6
6
  position: relative;
@@ -16,14 +16,41 @@ const VideoBackground = styled.video`
16
16
  top: 0;
17
17
  left: 0;
18
18
  `;
19
- const now = Date.now();
19
+ const CLOUDINARY_BASE = "https://res.cloudinary.com/stokr/video/upload";
20
+ const CLOUDINARY_VERSION = "v1745923531";
21
+ const CLOUDINARY_PUBLIC_ID = "Static/Hero_section_video_kuatj1";
22
+ const VIDEO_SRC_DESKTOP = `${CLOUDINARY_BASE}/f_auto,q_auto:good,vc_auto,w_1920,c_limit/${CLOUDINARY_VERSION}/${CLOUDINARY_PUBLIC_ID}.mp4`;
23
+ const VIDEO_SRC_MOBILE = `${CLOUDINARY_BASE}/f_auto,q_auto:good,vc_auto,w_1280,c_limit/${CLOUDINARY_VERSION}/${CLOUDINARY_PUBLIC_ID}.mp4`;
24
+ const VIDEO_POSTER = `${CLOUDINARY_BASE}/so_0,f_auto,q_auto:good,w_1920,c_limit/${CLOUDINARY_VERSION}/${CLOUDINARY_PUBLIC_ID}.jpg`;
25
+ const shouldLoadVideo = () => {
26
+ if (typeof navigator === "undefined") return true;
27
+ const conn = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
28
+ if (conn) {
29
+ if (conn.saveData) return false;
30
+ if (conn.effectiveType && ["slow-2g", "2g"].includes(conn.effectiveType)) return false;
31
+ }
32
+ if (typeof window !== "undefined" && window.matchMedia) {
33
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return false;
34
+ }
35
+ return true;
36
+ };
20
37
  const HeroVideoBlock = () => {
21
38
  const videoRef = useRef(null);
22
39
  const lastTimeRef = useRef(0);
23
- const lastVisibleTime = useRef(now);
24
- const playVideo = () => {
25
- if (!videoRef.current) return;
40
+ const lastVisibleTime = useRef(0);
41
+ const visibilityTimeoutRef = useRef(null);
42
+ const hasTriggeredLoadRef = useRef(false);
43
+ const [shouldAutoplay] = useState(() => shouldLoadVideo());
44
+ const playVideo = useCallback(() => {
45
+ if (!videoRef.current || !shouldAutoplay) return;
26
46
  const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
47
+ if (!hasTriggeredLoadRef.current) {
48
+ hasTriggeredLoadRef.current = true;
49
+ try {
50
+ videoRef.current.load();
51
+ } catch (_e) {
52
+ }
53
+ }
27
54
  if (videoRef.current.currentTime > 0) {
28
55
  lastTimeRef.current = videoRef.current.currentTime;
29
56
  }
@@ -40,7 +67,7 @@ const HeroVideoBlock = () => {
40
67
  }
41
68
  });
42
69
  }
43
- };
70
+ }, [shouldAutoplay]);
44
71
  const handleVisibilityChange = (isVisible) => {
45
72
  if (isVisible) {
46
73
  lastVisibleTime.current = Date.now();
@@ -59,13 +86,13 @@ const HeroVideoBlock = () => {
59
86
  }
60
87
  });
61
88
  useEffect(() => {
62
- let visibilityTimeoutId;
63
89
  const handleDocVisibilityChange = () => {
64
90
  if (document.visibilityState === "visible") {
65
91
  lastVisibleTime.current = Date.now();
66
- if (visibilityTimeoutId != null) clearTimeout(visibilityTimeoutId);
67
- visibilityTimeoutId = setTimeout(() => {
92
+ if (visibilityTimeoutRef.current) clearTimeout(visibilityTimeoutRef.current);
93
+ visibilityTimeoutRef.current = setTimeout(() => {
68
94
  playVideo();
95
+ visibilityTimeoutRef.current = null;
69
96
  }, 300);
70
97
  } else if (videoRef.current) {
71
98
  lastTimeRef.current = videoRef.current.currentTime;
@@ -74,29 +101,27 @@ const HeroVideoBlock = () => {
74
101
  document.addEventListener("visibilitychange", handleDocVisibilityChange);
75
102
  playVideo();
76
103
  return () => {
77
- if (visibilityTimeoutId != null) clearTimeout(visibilityTimeoutId);
104
+ if (visibilityTimeoutRef.current) clearTimeout(visibilityTimeoutRef.current);
78
105
  document.removeEventListener("visibilitychange", handleDocVisibilityChange);
79
106
  };
80
- }, []);
107
+ }, [playVideo]);
81
108
  return /* @__PURE__ */ jsx("div", { ref: windowViewportRef, children: /* @__PURE__ */ jsx(VideoContainer, { children: /* @__PURE__ */ jsx(
82
109
  VideoBackground,
83
110
  {
84
111
  ref: videoRef,
85
- autoPlay: true,
112
+ autoPlay: shouldAutoplay,
86
113
  muted: true,
87
114
  loop: true,
88
115
  playsInline: true,
89
- preload: "metadata",
116
+ preload: "none",
117
+ disableRemotePlayback: true,
118
+ poster: VIDEO_POSTER,
90
119
  "data-vsc-ignore": "true",
91
120
  fetchPriority: "high",
92
- children: /* @__PURE__ */ jsx(
93
- "source",
94
- {
95
- src: "https://res.cloudinary.com/stokr/video/upload/f_auto,q_auto:best/v1745923531/Static/Hero_section_video_kuatj1.mp4",
96
- type: "video/mp4",
97
- fetchPriority: "high"
98
- }
99
- )
121
+ children: shouldAutoplay && /* @__PURE__ */ jsxs(Fragment, { children: [
122
+ /* @__PURE__ */ jsx("source", { src: VIDEO_SRC_MOBILE, type: "video/mp4", media: "(max-width: 767px)" }),
123
+ /* @__PURE__ */ jsx("source", { src: VIDEO_SRC_DESKTOP, type: "video/mp4", media: "(min-width: 768px)" })
124
+ ] })
100
125
  }
101
126
  ) }) });
102
127
  };
@@ -97,6 +97,7 @@ const Select = (props) => {
97
97
  multiple = false,
98
98
  menuHeight,
99
99
  selectedLabel = "Selected",
100
+ floatingLabel = true,
100
101
  formatCreateLabel,
101
102
  dataCy,
102
103
  onChange,
@@ -157,9 +158,15 @@ const Select = (props) => {
157
158
  }
158
159
  return options?.find((o) => o.value === value) || null;
159
160
  }, [multiple, creatable, value, options]);
161
+ const hasValue = useMemo(() => {
162
+ if (multiple) return currentValue.length > 0;
163
+ return currentValue != null && currentValue.value !== "";
164
+ }, [multiple, currentValue]);
165
+ const isLabelUp = floatingLabel ? hasFocus || hasValue : Boolean(label);
166
+ const effectivePlaceholder = label ? hasFocus && placeholder ? placeholder : "" : placeholder;
160
167
  return /* @__PURE__ */ jsxs(Wrapper, { children: [
161
168
  /* @__PURE__ */ jsx(IoniconsStyles, {}),
162
- label && /* @__PURE__ */ jsx(Label, { isUp: Boolean(label), active: hasFocus, error: error && touched, htmlFor: id, children: label }),
169
+ label && /* @__PURE__ */ jsx(Label, { isUp: isLabelUp, active: hasFocus, error: error && touched, htmlFor: id, children: label }),
163
170
  /* @__PURE__ */ jsx(
164
171
  SelectComponent,
165
172
  {
@@ -168,7 +175,7 @@ const Select = (props) => {
168
175
  name,
169
176
  options,
170
177
  value: currentValue,
171
- placeholder,
178
+ placeholder: effectivePlaceholder,
172
179
  isMulti: multiple,
173
180
  isDisabled: disabled,
174
181
  isSearchable: search,
@@ -242,6 +249,8 @@ Select.propTypes = {
242
249
  menuHeight: PropTypes.number,
243
250
  /** Heading shown above the chips list in multi mode (default: "Selected"). */
244
251
  selectedLabel: PropTypes.string,
252
+ /** Input-like floating label behavior: label starts in-field, moves up on focus/value. */
253
+ floatingLabel: PropTypes.bool,
245
254
  formatCreateLabel: PropTypes.func,
246
255
  onChange: PropTypes.func,
247
256
  onBlur: PropTypes.func,
@@ -17,13 +17,13 @@ const LinkIcon = () => /* @__PURE__ */ jsxs(
17
17
  /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx(
18
18
  "path",
19
19
  {
20
- d: "M312.453,199.601c-6.066-6.102-12.792-11.511-20.053-16.128c-19.232-12.315-41.59-18.859-64.427-18.859\n c-31.697-0.059-62.106,12.535-84.48,34.987L34.949,308.23c-22.336,22.379-34.89,52.7-34.91,84.318\n c-0.042,65.98,53.41,119.501,119.39,119.543c31.648,0.11,62.029-12.424,84.395-34.816l89.6-89.6\n c1.628-1.614,2.537-3.816,2.524-6.108c-0.027-4.713-3.87-8.511-8.583-8.484h-3.413c-18.72,0.066-37.273-3.529-54.613-10.581\n c-3.195-1.315-6.867-0.573-9.301,1.877l-64.427,64.512c-20.006,20.006-52.442,20.006-72.448,0\n c-20.006-20.006-20.006-52.442,0-72.448l108.971-108.885c19.99-19.965,52.373-19.965,72.363,0\n c13.472,12.679,34.486,12.679,47.957,0c5.796-5.801,9.31-13.495,9.899-21.675C322.976,216.108,319.371,206.535,312.453,199.601z"
20
+ d: "M312.453,199.601c-6.066-6.102-12.792-11.511-20.053-16.128c-19.232-12.315-41.59-18.859-64.427-18.859\r\n c-31.697-0.059-62.106,12.535-84.48,34.987L34.949,308.23c-22.336,22.379-34.89,52.7-34.91,84.318\r\n c-0.042,65.98,53.41,119.501,119.39,119.543c31.648,0.11,62.029-12.424,84.395-34.816l89.6-89.6\r\n c1.628-1.614,2.537-3.816,2.524-6.108c-0.027-4.713-3.87-8.511-8.583-8.484h-3.413c-18.72,0.066-37.273-3.529-54.613-10.581\r\n c-3.195-1.315-6.867-0.573-9.301,1.877l-64.427,64.512c-20.006,20.006-52.442,20.006-72.448,0\r\n c-20.006-20.006-20.006-52.442,0-72.448l108.971-108.885c19.99-19.965,52.373-19.965,72.363,0\r\n c13.472,12.679,34.486,12.679,47.957,0c5.796-5.801,9.31-13.495,9.899-21.675C322.976,216.108,319.371,206.535,312.453,199.601z"
21
21
  }
22
22
  ) }) }),
23
23
  /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx(
24
24
  "path",
25
25
  {
26
- d: "M477.061,34.993c-46.657-46.657-122.303-46.657-168.96,0l-89.515,89.429c-2.458,2.47-3.167,6.185-1.792,9.387\n c1.359,3.211,4.535,5.272,8.021,5.205h3.157c18.698-0.034,37.221,3.589,54.528,10.667c3.195,1.315,6.867,0.573,9.301-1.877\n l64.256-64.171c20.006-20.006,52.442-20.006,72.448,0c20.006,20.006,20.006,52.442,0,72.448l-80.043,79.957l-0.683,0.768\n l-27.989,27.819c-19.99,19.965-52.373,19.965-72.363,0c-13.472-12.679-34.486-12.679-47.957,0\n c-5.833,5.845-9.35,13.606-9.899,21.845c-0.624,9.775,2.981,19.348,9.899,26.283c9.877,9.919,21.433,18.008,34.133,23.893\n c1.792,0.853,3.584,1.536,5.376,2.304c1.792,0.768,3.669,1.365,5.461,2.048c1.792,0.683,3.669,1.28,5.461,1.792l5.035,1.365\n c3.413,0.853,6.827,1.536,10.325,2.133c4.214,0.626,8.458,1.025,12.715,1.195h5.973h0.512l5.12-0.597\n c1.877-0.085,3.84-0.512,6.059-0.512h2.901l5.888-0.853l2.731-0.512l4.949-1.024h0.939c20.961-5.265,40.101-16.118,55.381-31.403\n l108.629-108.629C523.718,157.296,523.718,81.65,477.061,34.993z"
26
+ d: "M477.061,34.993c-46.657-46.657-122.303-46.657-168.96,0l-89.515,89.429c-2.458,2.47-3.167,6.185-1.792,9.387\r\n c1.359,3.211,4.535,5.272,8.021,5.205h3.157c18.698-0.034,37.221,3.589,54.528,10.667c3.195,1.315,6.867,0.573,9.301-1.877\r\n l64.256-64.171c20.006-20.006,52.442-20.006,72.448,0c20.006,20.006,20.006,52.442,0,72.448l-80.043,79.957l-0.683,0.768\r\n l-27.989,27.819c-19.99,19.965-52.373,19.965-72.363,0c-13.472-12.679-34.486-12.679-47.957,0\r\n c-5.833,5.845-9.35,13.606-9.899,21.845c-0.624,9.775,2.981,19.348,9.899,26.283c9.877,9.919,21.433,18.008,34.133,23.893\r\n c1.792,0.853,3.584,1.536,5.376,2.304c1.792,0.768,3.669,1.365,5.461,2.048c1.792,0.683,3.669,1.28,5.461,1.792l5.035,1.365\r\n c3.413,0.853,6.827,1.536,10.325,2.133c4.214,0.626,8.458,1.025,12.715,1.195h5.973h0.512l5.12-0.597\r\n c1.877-0.085,3.84-0.512,6.059-0.512h2.901l5.888-0.853l2.731-0.512l4.949-1.024h0.939c20.961-5.265,40.101-16.118,55.381-31.403\r\n l108.629-108.629C523.718,157.296,523.718,81.65,477.061,34.993z"
27
27
  }
28
28
  ) }) }),
29
29
  /* @__PURE__ */ jsx("g", {}),
@@ -1,4 +1,4 @@
1
- const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false, "VITE_ADMIN_URL": "https://admin.stokr.info", "VITE_API_URL": "https://platform-api.stokr.info/api/v1", "VITE_BASE_URL_PUBLIC": "https://platform-api-no-auth.stokr.info/api/v1", "VITE_COOKIE_DOMAIN": "localhost", "VITE_DASHBOARD_URL": "https://dashboard.stokr.info", "VITE_FIREBASE_API_KEY": "AIzaSyBBp_3Romnfv--YpUuV0mJgDymvSp3oq0c", "VITE_FIREBASE_APP_ID": "1:568229412804:web:2391857e3e2a0b02346e91", "VITE_FIREBASE_AUTH_DOMAIN": "stokr-development-env.firebaseapp.com", "VITE_FIREBASE_MEASUREMENT_ID": "G-CP53SZVSMN", "VITE_FIREBASE_MESSAGING_SENDER_ID": "568229412804", "VITE_FIREBASE_PROJECT_ID": "stokr-development-env", "VITE_FIREBASE_STORAGE_BUCKET": "stokr-development-env.appspot.com", "VITE_MIXPANEL_TOKEN": "a7bb1e881f9b2600762fded84d8ce0ea", "VITE_ONBOARDING_URL": "https://signup.stokr.info", "VITE_PHOTO_API_URL": "https://platform-api.stokr.info/api/v1", "VITE_REGISTER_URL": "https://stokr.info/signup", "VITE_WEBSITE_DOMAIN": "stokr.info" };
1
+ const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
2
2
  const _overrides = {};
3
3
  const ENV_KEY_BY_CONFIG = {
4
4
  apiUrl: "VITE_API_URL",