@stokr/components-library 2.3.54 → 2.3.55

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.
@@ -17,7 +17,7 @@ exports.CardContainer = CardContainer;
17
17
  var IconBlock = _styledComponents.default.div.withConfig({
18
18
  displayName: "ChecklistCardstyles__IconBlock",
19
19
  componentId: "sc-rufrg1-1"
20
- })(["display:flex;align-items:center;margin-bottom:64px;"]);
20
+ })(["display:flex;align-items:center;margin-bottom:32px;"]);
21
21
  exports.IconBlock = IconBlock;
22
22
  var IconCopy = _styledComponents.default.span.withConfig({
23
23
  displayName: "ChecklistCardstyles__IconCopy",
@@ -148,20 +148,20 @@ var getVerifyIdentityChecklist = function getVerifyIdentityChecklist(isFromAllow
148
148
  var state;
149
149
  var hasLink = false;
150
150
  if (!isFromAllowedCountry) {
151
- message = 'Sorry, you are living in a country where this is not available';
151
+ message = 'Sorry, you are living in a country where this is not available.';
152
152
  state = _ToDoList.ToDoTaskState.NOT_AVAILABLE;
153
153
  } else if (!kyc_status || kyc_status.toUpperCase() === 'DRAFT') {
154
- message = user_type === _globalVariables.UserTypes.investor_entity ? 'Upload your entity documents to get verified' : 'Scan your ID to get the green light from the anti-fraud squad';
154
+ message = user_type === _globalVariables.UserTypes.investor_entity ? 'Submit your entity documents for verification.' : 'Submit identity verification for compliance clearance.';
155
155
  state = _ToDoList.ToDoTaskState.SKIPPED;
156
156
  hasLink = true;
157
157
  } else if (kyc_status.toUpperCase() === 'REJECTED' || kyc_status.toUpperCase() === 'ESCALATED' || kyc_status.toUpperCase() === 'IN PROGRESS' || kyc_status.toUpperCase() === 'INCONCLUSIVE' || kyc_status.toUpperCase() === 'APPROVED' || kyc_status.toUpperCase() === 'DENIED') {
158
- message = 'Our anti-fraud squad is still working';
158
+ message = 'Identity verification is in progress.';
159
159
  state = _ToDoList.ToDoTaskState.IN_PROGRESS;
160
160
  } else if (kyc_status.toUpperCase() === 'ACCEPTED') {
161
- message = user_type === _globalVariables.UserTypes.investor_entity ? 'Your entity is verified' : 'Your ID is verified';
161
+ message = user_type === _globalVariables.UserTypes.investor_entity ? 'Entity verification complete.' : 'Identity verification complete.';
162
162
  state = _ToDoList.ToDoTaskState.APPROVED;
163
163
  } else if (kyc_status.toUpperCase() === 'REAPPLY' || kyc_status.toUpperCase() === 'CANCELLED') {
164
- message = user_type === _globalVariables.UserTypes.investor_entity ? 'Please verify again your entity' : 'Please verify again your identity';
164
+ message = user_type === _globalVariables.UserTypes.investor_entity ? 'Please re-verify your entity documentation.' : 'Please re-verify your identity.';
165
165
  state = _ToDoList.ToDoTaskState.DENIED;
166
166
  hasLink = true;
167
167
  }
@@ -79,8 +79,9 @@ var Modal = function Modal(_ref) {
79
79
  onClose = _ref.onClose,
80
80
  className = _ref.className,
81
81
  isRegisterEntity = _ref.isRegisterEntity,
82
- modalLogin = _ref.modalLogin,
83
- background = _ref.background;
82
+ background = _ref.background,
83
+ maxHeight = _ref.maxHeight,
84
+ boxStyles = _ref.boxStyles;
84
85
  (0, _react.useEffect)(function () {
85
86
  //if modal open, disable scroll on the background
86
87
  if (isOpen) {
@@ -115,7 +116,9 @@ var Modal = function Modal(_ref) {
115
116
  kyc: kyc,
116
117
  fullscreen: fullscreen,
117
118
  thin: thin,
118
- isRegisterEntity: isRegisterEntity
119
+ isRegisterEntity: isRegisterEntity,
120
+ style: boxStyles,
121
+ maxHeight: maxHeight
119
122
  }, /*#__PURE__*/_react.default.createElement(_Modal.ModalClose, {
120
123
  onClick: onClose
121
124
  }), children)));
@@ -130,7 +133,8 @@ Modal.propTypes = {
130
133
  thin: _propTypes.default.bool,
131
134
  isOpen: _propTypes.default.bool.isRequired,
132
135
  onClose: _propTypes.default.func.isRequired,
133
- background: _propTypes.default.string
136
+ background: _propTypes.default.string,
137
+ boxStyle: _propTypes.default.object
134
138
  };
135
139
  Modal.defaultProps = {
136
140
  className: '',
@@ -32,7 +32,9 @@ exports.Dimmer = Dimmer;
32
32
  var Box = _styledComponents.default.div.withConfig({
33
33
  displayName: "Modalstyles__Box",
34
34
  componentId: "sc-9hc271-2"
35
- })(["display:inline-block;vertical-align:middle;position:relative;left:0;top:0;width:100%;background-color:", ";font-size:10px;text-align:left;box-shadow:0 2px 20px 0 rgba(0,0,0,0.1);", " ", " ", " ", " @media screen and (max-width:767px){min-height:100vh;}", ""], _colors.default.white, function (props) {
35
+ })(["display:inline-block;vertical-align:middle;position:relative;left:0;top:0;width:100%;background-color:", ";font-size:10px;text-align:left;box-shadow:0 2px 20px 0 rgba(0,0,0,0.1);max-height:", ";", " ", " ", " ", " @media screen and (max-width:767px){min-height:100vh;}", ""], _colors.default.white, function (props) {
36
+ return props.maxHeight || 'auto';
37
+ }, function (props) {
36
38
  return props.fullscreen && "\n height: 90vh;\n ";
37
39
  }, function (props) {
38
40
  return props.kyc && "\n width: 100vw;\n height: 100vh;\n max-width: 1024px!important;\n max-height: 768px!important;\n ";
@@ -45,8 +45,9 @@ var NewVentureModal = function NewVentureModal(props) {
45
45
  _props$salesChannel = props.salesChannel,
46
46
  salesChannel = _props$salesChannel === void 0 ? 'investor' : _props$salesChannel,
47
47
  modalBotContent = props.modalBotContent,
48
- onSuccessMessageBtnClick = props.onSuccessMessageBtnClick;
49
- var _useNewVentureForm = (0, _useNewVentureForm2.useNewVentureForm)(props.project, user, salesChannel),
48
+ onSuccessMessageBtnClick = props.onSuccessMessageBtnClick,
49
+ customSuccessMessage = props.customSuccessMessage;
50
+ var _useNewVentureForm = (0, _useNewVentureForm2.useNewVentureForm)(props.project, user, salesChannel, customSuccessMessage),
50
51
  email = _useNewVentureForm.email,
51
52
  name = _useNewVentureForm.name,
52
53
  mailingList = _useNewVentureForm.mailingList,
@@ -107,7 +107,11 @@ var updateUserSubscription = function updateUserSubscription(user, project, upda
107
107
  // Single project mode
108
108
  return _objectSpread(_objectSpread({}, user), updates);
109
109
  };
110
- var useNewVentureForm = function useNewVentureForm(project, user, salesChannel) {
110
+ var useNewVentureForm = function useNewVentureForm(_ref) {
111
+ var project = _ref.project,
112
+ user = _ref.user,
113
+ salesChannel = _ref.salesChannel,
114
+ customSuccessMessage = _ref.customSuccessMessage;
111
115
  var _useState = (0, _react.useState)(initialState),
112
116
  _useState2 = _slicedToArray(_useState, 2),
113
117
  formValues = _useState2[0],
@@ -162,7 +166,7 @@ var useNewVentureForm = function useNewVentureForm(project, user, salesChannel)
162
166
  setFormValues(formValuesCopy);
163
167
  }, [user, checkboxes, project === null || project === void 0 ? void 0 : project._id]);
164
168
  var handleSubmit = (0, _react.useCallback)( /*#__PURE__*/function () {
165
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
169
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
166
170
  var dataToSend, response, updates, updatedUser, _error$response, errorMessage, _error$response$data;
167
171
  return _regeneratorRuntime().wrap(function _callee$(_context) {
168
172
  while (1) switch (_context.prev = _context.next) {
@@ -204,7 +208,7 @@ var useNewVentureForm = function useNewVentureForm(project, user, salesChannel)
204
208
  setUser(updatedUser);
205
209
  setFormValues(function (prev) {
206
210
  return _objectSpread(_objectSpread({}, prev), {}, {
207
- successMessage: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Please continue onboarding, an account manager will reach out to you.", /*#__PURE__*/_react.default.createElement("br", null), "If you are an existing account holder, kindly log in and make sure your account is fully verified."),
211
+ successMessage: customSuccessMessage ? customSuccessMessage : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Please continue onboarding, an account manager will reach out to you.", /*#__PURE__*/_react.default.createElement("br", null), "If you are an existing account holder, kindly log in and make sure your account is fully verified."),
208
212
  errorMessage: null,
209
213
  isSubmitting: false
210
214
  });
@@ -214,7 +218,7 @@ var useNewVentureForm = function useNewVentureForm(project, user, salesChannel)
214
218
  _context.prev = 17;
215
219
  _context.t0 = _context["catch"](1);
216
220
  if ((_context.t0 === null || _context.t0 === void 0 || (_error$response = _context.t0.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 406) {
217
- errorMessage = (project === null || project === void 0 ? void 0 : project.name) === 'microstrategy' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "You are already added to this project.", /*#__PURE__*/_react.default.createElement("br", null), " ", /*#__PURE__*/_react.default.createElement("br", null)) : ((_error$response$data = _context.t0.response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.substring(7)) || 'You are already added to this project.';
221
+ errorMessage = ((_error$response$data = _context.t0.response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.substring(7)) || 'You are already added to this project.';
218
222
  } else {
219
223
  errorMessage = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Something went wrong. Please try again a bit later or contact us at", ' ', /*#__PURE__*/_react.default.createElement("a", {
220
224
  href: "mailto:support@stokr.io",
@@ -238,11 +242,11 @@ var useNewVentureForm = function useNewVentureForm(project, user, salesChannel)
238
242
  }, _callee, null, [[1, 17]]);
239
243
  }));
240
244
  return function (_x) {
241
- return _ref.apply(this, arguments);
245
+ return _ref2.apply(this, arguments);
242
246
  };
243
247
  }(), [project, formValues.checkedCheckboxes, formValues.privateInvestorListDisabled, formValues.mailingListDisabled, user, setUser]);
244
248
  var checkUserProjectStatus = /*#__PURE__*/function () {
245
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
249
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
246
250
  var promises, projectSubscription, needsPrivateInvestorData, needsSubscriptionData, results, updatedUser;
247
251
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
248
252
  while (1) switch (_context2.prev = _context2.next) {
@@ -289,7 +293,7 @@ var useNewVentureForm = function useNewVentureForm(project, user, salesChannel)
289
293
  }, _callee2, null, [[8, 17]]);
290
294
  }));
291
295
  return function checkUserProjectStatus() {
292
- return _ref2.apply(this, arguments);
296
+ return _ref3.apply(this, arguments);
293
297
  };
294
298
  }();
295
299
 
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.useMobileView = exports.useCooldown = exports.cooldownHOC = void 0;
7
+ exports.useMobileView = exports.useCooldown = exports.useContainerSize = exports.cooldownHOC = void 0;
8
8
  exports.usePrevious = usePrevious;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _rwd = _interopRequireWildcard(require("../styles/rwd"));
@@ -45,7 +45,35 @@ var useMobileView = function useMobileView() {
45
45
  };
46
46
  return isMobile;
47
47
  };
48
+
49
+ // Custom hook for container size detection
48
50
  exports.useMobileView = useMobileView;
51
+ var useContainerSize = function useContainerSize(ref) {
52
+ var breakpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
53
+ var _useState = (0, _react.useState)(false),
54
+ _useState2 = _slicedToArray(_useState, 2),
55
+ isMobile = _useState2[0],
56
+ setIsMobile = _useState2[1];
57
+ (0, _react.useEffect)(function () {
58
+ if (!ref.current) return;
59
+
60
+ // Initial check
61
+ checkSize();
62
+ var resizeObserver = new ResizeObserver(function () {
63
+ checkSize();
64
+ });
65
+ resizeObserver.observe(ref.current);
66
+ return function () {
67
+ resizeObserver.disconnect();
68
+ };
69
+ }, [breakpoint]);
70
+ var checkSize = function checkSize() {
71
+ var width = ref.current.offsetWidth;
72
+ setIsMobile(width < breakpoint);
73
+ };
74
+ return isMobile;
75
+ };
76
+ exports.useContainerSize = useContainerSize;
49
77
  function usePrevious(value) {
50
78
  var ref = (0, _react.useRef)();
51
79
  (0, _react.useEffect)(function () {
@@ -56,18 +84,18 @@ function usePrevious(value) {
56
84
 
57
85
  //use this hook when you need timer functionality
58
86
  var useCooldown = function useCooldown(cooldownInSeconds) {
59
- var _useState = (0, _react.useState)(false),
60
- _useState2 = _slicedToArray(_useState, 2),
61
- isDisabled = _useState2[0],
62
- setIsDisabled = _useState2[1];
63
87
  var _useState3 = (0, _react.useState)(false),
64
88
  _useState4 = _slicedToArray(_useState3, 2),
65
- hasTimerFinished = _useState4[0],
66
- sethasTimerFinished = _useState4[1];
67
- var _useState5 = (0, _react.useState)(0),
89
+ isDisabled = _useState4[0],
90
+ setIsDisabled = _useState4[1];
91
+ var _useState5 = (0, _react.useState)(false),
68
92
  _useState6 = _slicedToArray(_useState5, 2),
69
- secondsRemaining = _useState6[0],
70
- setSecondsRemaining = _useState6[1];
93
+ hasTimerFinished = _useState6[0],
94
+ sethasTimerFinished = _useState6[1];
95
+ var _useState7 = (0, _react.useState)(0),
96
+ _useState8 = _slicedToArray(_useState7, 2),
97
+ secondsRemaining = _useState8[0],
98
+ setSecondsRemaining = _useState8[1];
71
99
  var lastCalled = (0, _react.useRef)(null);
72
100
  var startCooldown = function startCooldown(actionCallback) {
73
101
  if (!isDisabled) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.3.54",
3
+ "version": "2.3.55",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",