@stokr/components-library 3.0.40 → 3.0.41
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/components/2FA/Connect2FA.js +3 -4
- package/dist/components/Button/Button.styles.js +0 -1
- package/dist/components/HeroBlock/HeroVideoBlock.js +47 -22
- package/dist/components/icons/LinkIcon.js +2 -2
- package/dist/runtime-config.js +1 -1
- package/dist/static/country-list.json +251 -251
- package/dist/static/fonts/Ionicons/ionicons.min.css +2810 -2810
- package/dist/static/fonts/Ionicons/ionicons.min.css.js +1 -1
- package/dist/static/fonts/icomoon/selection.json +910 -910
- package/dist/static/fonts/icomoon/style.css +139 -139
- package/dist/static/images/copy_icon.svg +4 -4
- package/dist/static/images/download_icon.svg +3 -3
- package/dist/static/images/face-scan-icon.svg +7 -7
- package/dist/static/images/numbers/number_eight.svg +3 -3
- package/dist/static/images/numbers/number_five.svg +4 -4
- package/dist/static/images/numbers/number_four.svg +3 -3
- package/dist/static/images/numbers/number_nine.svg +4 -4
- package/dist/static/images/numbers/number_one.svg +4 -4
- package/dist/static/images/numbers/number_seven.svg +4 -4
- package/dist/static/images/numbers/number_six.svg +4 -4
- package/dist/static/images/numbers/number_three.svg +3 -3
- package/dist/static/images/numbers/number_two.svg +4 -4
- package/dist/static/images/numbers/number_zero.svg +3 -3
- package/dist/static/images/plus-icon.svg +4 -4
- package/dist/static/images/search-icon.svg +3 -3
- package/dist/static/images/transfer-icon.svg +10 -10
- package/dist/static/images/warning-filled.svg +3 -3
- 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
|
|
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
|
-
|
|
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(
|
|
@@ -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
|
|
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(
|
|
24
|
-
const
|
|
25
|
-
|
|
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 (
|
|
67
|
-
|
|
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 (
|
|
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:
|
|
112
|
+
autoPlay: shouldAutoplay,
|
|
86
113
|
muted: true,
|
|
87
114
|
loop: true,
|
|
88
115
|
playsInline: true,
|
|
89
|
-
preload: "
|
|
116
|
+
preload: "none",
|
|
117
|
+
disableRemotePlayback: true,
|
|
118
|
+
poster: VIDEO_POSTER,
|
|
90
119
|
"data-vsc-ignore": "true",
|
|
91
120
|
fetchPriority: "high",
|
|
92
|
-
children: /* @__PURE__ */
|
|
93
|
-
"source",
|
|
94
|
-
{
|
|
95
|
-
|
|
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
|
};
|
|
@@ -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", {}),
|
package/dist/runtime-config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false
|
|
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",
|