@stokr/components-library 2.3.44-beta.4 → 2.3.45
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/AdminDashboard/Table/ReactTableWrapper.js +8 -2
- package/dist/components/ButtonContainer/ButtonContainer.styles.js +6 -1
- package/dist/components/CryptoAddress/CryptoAddress.js +6 -3
- package/dist/components/CryptoAddress/RadioWrap.js +2 -2
- package/dist/components/HeroBlock/HeroVideoBlock.js +108 -0
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +104 -265
- package/dist/components/Modal/NewVentureModal/NewVentureModal.stories.js +3 -2
- package/dist/context/AuthContext.js +159 -107
- package/dist/context/Checkbox/CheckboxContext.js +164 -0
- package/dist/hooks/useNewVentureForm.js +310 -0
- package/dist/index.js +11 -0
- package/package.json +1 -1
|
@@ -10,9 +10,15 @@ var _Table = require("./Table.styles");
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _excluded = ["columns", "subColumns"];
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
22
|
//This components is used only to memoize the values before we sent them to the react-table
|
|
17
23
|
var ReactTableWrapper = function ReactTableWrapper(props) {
|
|
18
24
|
var makeNewColumns = function makeNewColumns(data) {
|
|
@@ -38,10 +44,10 @@ var ReactTableWrapper = function ReactTableWrapper(props) {
|
|
|
38
44
|
}
|
|
39
45
|
};
|
|
40
46
|
}
|
|
41
|
-
return {
|
|
47
|
+
return _objectSpread({
|
|
42
48
|
Header: column.label || column.Header,
|
|
43
49
|
accessor: column.key || column.accessor
|
|
44
|
-
};
|
|
50
|
+
}, column);
|
|
45
51
|
});
|
|
46
52
|
};
|
|
47
53
|
var memoizedColumns = _react.default.useMemo(function () {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.ButtonContainer = void 0;
|
|
6
|
+
exports.default = exports.ButtonGridContainer = exports.ButtonContainer = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
8
|
var _Button = _interopRequireDefault(require("../Button/Button.styles"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -14,5 +14,10 @@ var ButtonContainer = _styledComponents.default.div.withConfig({
|
|
|
14
14
|
return props.flexColumn && "\n flex-direction:column;\n ";
|
|
15
15
|
}, _Button.default, _Button.default);
|
|
16
16
|
exports.ButtonContainer = ButtonContainer;
|
|
17
|
+
var ButtonGridContainer = _styledComponents.default.div.withConfig({
|
|
18
|
+
displayName: "ButtonContainerstyles__ButtonGridContainer",
|
|
19
|
+
componentId: "sc-1no5512-1"
|
|
20
|
+
})(["display:grid;grid-template-columns:repeat(2,1fr);gap:10px;justify-items:center;align-items:center;", "{min-width:150px;max-width:300px;width:100%;}@media screen and (max-width:767px){grid-template-columns:repeat(1,1fr);", "{max-width:400px;}}"], _Button.default, _Button.default);
|
|
21
|
+
exports.ButtonGridContainer = ButtonGridContainer;
|
|
17
22
|
var _default = ButtonContainer;
|
|
18
23
|
exports.default = _default;
|
|
@@ -47,7 +47,8 @@ var CryptoAddress = function CryptoAddress(_ref) {
|
|
|
47
47
|
infoBoxStyle = _ref.infoBoxStyle,
|
|
48
48
|
wrapperStyle = _ref.wrapperStyle,
|
|
49
49
|
bodyStyle = _ref.bodyStyle,
|
|
50
|
-
containerStyle = _ref.containerStyle
|
|
50
|
+
containerStyle = _ref.containerStyle,
|
|
51
|
+
dataValueStyle = _ref.dataValueStyle;
|
|
51
52
|
var _useState = (0, _react.useState)(false),
|
|
52
53
|
_useState2 = _slicedToArray(_useState, 2),
|
|
53
54
|
copiedAddressToClipboard = _useState2[0],
|
|
@@ -95,7 +96,8 @@ var CryptoAddress = function CryptoAddress(_ref) {
|
|
|
95
96
|
}, /*#__PURE__*/_react.default.createElement(_CryptoAddress.DataBox, {
|
|
96
97
|
style: dataBoxStyle
|
|
97
98
|
}, data.value && /*#__PURE__*/_react.default.createElement(_CryptoAddress.Value, {
|
|
98
|
-
fontSize: fontSize
|
|
99
|
+
fontSize: fontSize,
|
|
100
|
+
style: dataValueStyle
|
|
99
101
|
}, data.unit && "".concat(data.unit, " "), data.shortAddress ? /*#__PURE__*/_react.default.createElement(_reactTippy.Tooltip, {
|
|
100
102
|
position: "top",
|
|
101
103
|
title: data.value,
|
|
@@ -161,7 +163,8 @@ CryptoAddress.propTypes = {
|
|
|
161
163
|
dataBoxStyle: _propTypes.default.object,
|
|
162
164
|
headStyle: _propTypes.default.object,
|
|
163
165
|
infoBoxStyle: _propTypes.default.object,
|
|
164
|
-
wrapperStyle: _propTypes.default.object
|
|
166
|
+
wrapperStyle: _propTypes.default.object,
|
|
167
|
+
dataValueStyle: _propTypes.default.object
|
|
165
168
|
};
|
|
166
169
|
//address not required in IIS, instead wrapping {address &&( .. now doing both which is redundant
|
|
167
170
|
|
|
@@ -16,8 +16,8 @@ var RadioWrap = function RadioWrap(_ref) {
|
|
|
16
16
|
radio = _ref.radio;
|
|
17
17
|
var handleOnClick = function handleOnClick(e) {
|
|
18
18
|
if (radio) {
|
|
19
|
-
radio.handleCheckedAddressRadio(e.target.id);
|
|
20
|
-
radio.handleSelectedCryptoAddress(radio.address);
|
|
19
|
+
radio.handleCheckedAddressRadio && radio.handleCheckedAddressRadio(e.target.id);
|
|
20
|
+
radio.handleSelectedCryptoAddress && radio.handleSelectedCryptoAddress(radio.address);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
return radio ? /*#__PURE__*/_react.default.createElement(_CryptoAddress.Radio, {
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.HeroVideoBlock = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactVisibilitySensor = _interopRequireDefault(require("react-visibility-sensor"));
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
var VideoContainer = _styledComponents.default.div.withConfig({
|
|
15
|
+
displayName: "HeroVideoBlock__VideoContainer",
|
|
16
|
+
componentId: "sc-53qnrg-0"
|
|
17
|
+
})(["position:relative;width:100%;height:100%;overflow:hidden;"]);
|
|
18
|
+
var VideoBackground = _styledComponents.default.video.withConfig({
|
|
19
|
+
displayName: "HeroVideoBlock__VideoBackground",
|
|
20
|
+
componentId: "sc-53qnrg-1"
|
|
21
|
+
})(["width:100%;height:100%;object-fit:cover;position:absolute;top:0;left:0;"]);
|
|
22
|
+
var HeroVideoBlock = function HeroVideoBlock() {
|
|
23
|
+
var videoRef = (0, _react.useRef)(null);
|
|
24
|
+
var lastTimeRef = (0, _react.useRef)(0);
|
|
25
|
+
var lastVisibleTime = (0, _react.useRef)(Date.now());
|
|
26
|
+
var playVideo = function playVideo() {
|
|
27
|
+
if (!videoRef.current) return;
|
|
28
|
+
var isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
|
|
29
|
+
|
|
30
|
+
// Store current time before attempting to play
|
|
31
|
+
if (videoRef.current.currentTime > 0) {
|
|
32
|
+
lastTimeRef.current = videoRef.current.currentTime;
|
|
33
|
+
}
|
|
34
|
+
var playPromise = videoRef.current.play();
|
|
35
|
+
if (playPromise !== undefined) {
|
|
36
|
+
playPromise.catch(function (error) {
|
|
37
|
+
console.log('Video play error:', error);
|
|
38
|
+
|
|
39
|
+
// If play fails on mobile, try the reset approach as a fallback
|
|
40
|
+
if (isMobile && videoRef.current) {
|
|
41
|
+
// Only reset if we've been away for a while (more than 2 seconds)
|
|
42
|
+
var resetNeeded = Date.now() - lastVisibleTime.current > 2000;
|
|
43
|
+
if (resetNeeded) {
|
|
44
|
+
// Small adjustment to current time to force refresh
|
|
45
|
+
videoRef.current.currentTime = lastTimeRef.current || 0.1;
|
|
46
|
+
videoRef.current.play().catch(function (e) {
|
|
47
|
+
return console.log('Retry failed:', e);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var handleVisibilityChange = function handleVisibilityChange(isVisible) {
|
|
55
|
+
if (isVisible) {
|
|
56
|
+
lastVisibleTime.current = Date.now();
|
|
57
|
+
if (videoRef.current) {
|
|
58
|
+
playVideo();
|
|
59
|
+
}
|
|
60
|
+
} else if (videoRef.current) {
|
|
61
|
+
// Save the current time when leaving
|
|
62
|
+
lastTimeRef.current = videoRef.current.currentTime;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Effect for document visibility (tab switching/browser minimizing)
|
|
67
|
+
(0, _react.useEffect)(function () {
|
|
68
|
+
var handleDocVisibilityChange = function handleDocVisibilityChange() {
|
|
69
|
+
if (document.visibilityState === 'visible') {
|
|
70
|
+
lastVisibleTime.current = Date.now();
|
|
71
|
+
// Small delay to ensure the browser is ready
|
|
72
|
+
setTimeout(function () {
|
|
73
|
+
playVideo();
|
|
74
|
+
}, 300);
|
|
75
|
+
} else if (videoRef.current) {
|
|
76
|
+
// Save the current time when leaving
|
|
77
|
+
lastTimeRef.current = videoRef.current.currentTime;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
document.addEventListener('visibilitychange', handleDocVisibilityChange);
|
|
81
|
+
|
|
82
|
+
// Initial play
|
|
83
|
+
playVideo();
|
|
84
|
+
return function () {
|
|
85
|
+
document.removeEventListener('visibilitychange', handleDocVisibilityChange);
|
|
86
|
+
};
|
|
87
|
+
}, []);
|
|
88
|
+
return /*#__PURE__*/_react.default.createElement(_reactVisibilitySensor.default, {
|
|
89
|
+
onChange: handleVisibilityChange,
|
|
90
|
+
partialVisibility: true
|
|
91
|
+
}, /*#__PURE__*/_react.default.createElement(VideoContainer, null, /*#__PURE__*/_react.default.createElement(VideoBackground, {
|
|
92
|
+
ref: videoRef,
|
|
93
|
+
autoPlay: true,
|
|
94
|
+
muted: true,
|
|
95
|
+
loop: true,
|
|
96
|
+
playsInline: true,
|
|
97
|
+
preload: "metadata",
|
|
98
|
+
"data-vsc-ignore": "true",
|
|
99
|
+
fetchPriority: "high"
|
|
100
|
+
}, /*#__PURE__*/_react.default.createElement("source", {
|
|
101
|
+
src: "https://res.cloudinary.com/stokr/video/upload/f_auto,q_auto:best/v1745923531/Static/Hero_section_video_kuatj1.mp4",
|
|
102
|
+
type: "video/mp4",
|
|
103
|
+
fetchPriority: "high"
|
|
104
|
+
}))));
|
|
105
|
+
};
|
|
106
|
+
exports.HeroVideoBlock = HeroVideoBlock;
|
|
107
|
+
var _default = HeroVideoBlock;
|
|
108
|
+
exports.default = _default;
|