@stokr/components-library 2.3.44-beta.1 → 2.3.44-beta.4

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.
@@ -36,8 +36,16 @@ function ReactTable(props) {
36
36
  isSubTable = props.isSubTable,
37
37
  customTdStyles = props.customTdStyles,
38
38
  customThStyles = props.customThStyles,
39
+ customRowHoverStyles = props.customRowHoverStyles,
40
+ customRowHoverContent = props.customRowHoverContent,
39
41
  calculateSubData = props.calculateSubData;
40
42
 
43
+ // State to track which row is being hovered
44
+ var _useState = (0, _react.useState)(null),
45
+ _useState2 = _slicedToArray(_useState, 2),
46
+ hoveredRowIndex = _useState2[0],
47
+ setHoveredRowIndex = _useState2[1];
48
+
41
49
  // Use the state and functions returned from useTable to build UI
42
50
  var _useTable = (0, _reactTable.useTable)({
43
51
  columns: columns,
@@ -58,13 +66,24 @@ function ReactTable(props) {
58
66
  _useTable$state = _useTable.state,
59
67
  pageIndex = _useTable$state.pageIndex,
60
68
  pageSize = _useTable$state.pageSize;
61
- var _useState = (0, _react.useState)(isSubTable ? 10000 : 10),
62
- _useState2 = _slicedToArray(_useState, 2),
63
- inputPageSize = _useState2[0],
64
- setInputPageSize = _useState2[1];
69
+ var _useState3 = (0, _react.useState)(isSubTable ? 10000 : 10),
70
+ _useState4 = _slicedToArray(_useState3, 2),
71
+ inputPageSize = _useState4[0],
72
+ setInputPageSize = _useState4[1];
65
73
  _react.default.useEffect(function () {
66
74
  setInputPageSize(pageSize);
67
75
  }, [pageSize]);
76
+
77
+ // Function to render cell content with hover support
78
+ var renderCellContent = function renderCellContent(cell, rowIndex, rowData) {
79
+ if (customRowHoverContent && hoveredRowIndex === rowIndex) {
80
+ var hoverContent = customRowHoverContent(cell.column.id, rowIndex, rowData);
81
+ if (hoverContent !== undefined) {
82
+ return hoverContent;
83
+ }
84
+ }
85
+ return cell.render('Cell');
86
+ };
68
87
  return /*#__PURE__*/_react.default.createElement(_Table.Styles, null, /*#__PURE__*/_react.default.createElement(_Table.TableWrap, null, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable, getTableProps(), /*#__PURE__*/_react.default.createElement("thead", null, headerGroups.map(function (headerGroup) {
69
88
  return /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, headerGroup.getHeaderGroupProps(), headerGroup.headers.map(function (column) {
70
89
  var cellStyles = customThStyles ? customThStyles(column) : {};
@@ -72,21 +91,37 @@ function ReactTable(props) {
72
91
  className: column.collapse ? 'collapse' : '',
73
92
  style: _objectSpread({}, cellStyles)
74
93
  }), {
75
- blue: blue
94
+ blue: blue,
95
+ width: column.width,
96
+ minWidth: column.minWidth,
97
+ maxWidth: column.maxWidth
76
98
  }), column.render('Header'));
77
99
  }));
78
100
  })), /*#__PURE__*/_react.default.createElement("tbody", getTableBodyProps(), page.map(function (row, i) {
79
101
  prepareRow(row);
80
102
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
81
103
  key: row.id
82
- }, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, row.getRowProps(), row.cells.map(function (cell) {
104
+ }, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, _extends({}, row.getRowProps(), {
105
+ customRowHoverStyles: customRowHoverStyles,
106
+ rowIndex: i,
107
+ rowData: row.original,
108
+ onMouseEnter: function onMouseEnter() {
109
+ return setHoveredRowIndex(i);
110
+ },
111
+ onMouseLeave: function onMouseLeave() {
112
+ return setHoveredRowIndex(null);
113
+ }
114
+ }), row.cells.map(function (cell) {
83
115
  var cellStyles = customTdStyles ? customTdStyles(i, row.original) : {};
84
116
  return /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Td, _extends({}, cell.row.getToggleRowExpandedProps(), cell.getCellProps({
85
117
  className: cell.column.collapse ? 'collapse' : '',
86
118
  style: _objectSpread({}, cellStyles)
87
119
  }), {
88
- blue: blue
89
- }), cell.render('Cell'));
120
+ blue: blue,
121
+ width: cell.column.width,
122
+ minWidth: cell.column.minWidth,
123
+ maxWidth: cell.column.maxWidth
124
+ }), renderCellContent(cell, i, row.original));
90
125
  })), withSubTable && row.isExpanded && /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, {
91
126
  key: "".concat(row.id, "-").concat(i)
92
127
  }, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Td, {
@@ -118,7 +153,9 @@ ReactTable.propTypes = {
118
153
  blue: _propTypes.default.bool,
119
154
  noPagination: _propTypes.default.bool,
120
155
  withSubTable: _propTypes.default.bool,
121
- isSubTable: _propTypes.default.bool
156
+ isSubTable: _propTypes.default.bool,
157
+ customRowHoverStyles: _propTypes.default.func,
158
+ customRowHoverContent: _propTypes.default.func
122
159
  };
123
160
  ReactTable.defaultProps = {
124
161
  blue: false,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.WrapperWithSubTable = exports.WithoutPagination = exports.WithSubTable = exports.WithCustomStyling = exports.DefaultWrapper = exports.Default = exports.BlueWrapper = exports.BlueTable = void 0;
6
+ exports.default = exports.WrapperWithSubTable = exports.WithoutPagination = exports.WithSubTable = exports.WithStatusBasedHover = exports.WithRowSpecificHover = exports.WithRowHover = exports.WithHoverStylesAndContent = exports.WithHoverContent = exports.WithFixedColumnWidths = exports.WithCustomStyling = exports.DefaultWrapper = exports.Default = exports.BlueWrapper = exports.BlueTable = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _ReactTable = require("./ReactTable");
9
9
  var _ReactTableWrapper = require("./ReactTableWrapper");
@@ -46,35 +46,57 @@ var _default = {
46
46
  },
47
47
  customThStyles: {
48
48
  control: 'function'
49
+ },
50
+ customRowHoverStyles: {
51
+ control: 'function'
52
+ },
53
+ customRowHoverContent: {
54
+ control: 'function'
49
55
  }
50
56
  }
51
57
  }; // Sample columns and data for demonstration
52
58
  exports.default = _default;
53
59
  var columns = [{
54
60
  Header: 'ID',
55
- accessor: 'id'
61
+ accessor: 'id',
62
+ width: '10%',
63
+ minWidth: '80px'
56
64
  }, {
57
65
  Header: 'Name',
58
- accessor: 'name'
66
+ accessor: 'name',
67
+ width: '30%',
68
+ minWidth: '150px'
59
69
  }, {
60
70
  Header: 'Status',
61
- accessor: 'status'
71
+ accessor: 'status',
72
+ width: '20%',
73
+ minWidth: '100px'
62
74
  }, {
63
75
  Header: '',
64
- accessor: 'dropdown'
76
+ accessor: 'dropdown',
77
+ width: '40%',
78
+ minWidth: '120px'
65
79
  }];
66
80
  var columnsWrapper = [{
67
81
  label: 'ID',
68
- key: 'id'
82
+ key: 'id',
83
+ width: '10%',
84
+ minWidth: '80px'
69
85
  }, {
70
86
  label: 'Name',
71
- key: 'name'
87
+ key: 'name',
88
+ width: '30%',
89
+ minWidth: '150px'
72
90
  }, {
73
91
  label: 'Status',
74
- key: 'status'
92
+ key: 'status',
93
+ width: '20%',
94
+ minWidth: '100px'
75
95
  }, {
76
96
  label: '',
77
- key: 'dropdown'
97
+ key: 'dropdown',
98
+ width: '40%',
99
+ minWidth: '120px'
78
100
  }];
79
101
  var subColumns = [{
80
102
  Header: 'Detail ID',
@@ -152,6 +174,115 @@ var customThStyles = function customThStyles(column) {
152
174
  };
153
175
  };
154
176
 
177
+ // Custom row hover styles function
178
+ var customRowHoverStyles = function customRowHoverStyles(rowIndex, rowData) {
179
+ return "\n background-color: #f0f8ff !important;\n transform: scale(1.01);\n transition: all 0.2s ease-in-out;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n \n td {\n background-color: #f0f8ff !important;\n border-bottom-color: #0050ca !important;\n }\n ";
180
+ };
181
+
182
+ // Custom row hover content function
183
+ var customRowHoverContent = function customRowHoverContent(columnId, rowIndex, rowData) {
184
+ switch (columnId) {
185
+ case 'name':
186
+ // Show underlined link on hover
187
+ return /*#__PURE__*/_react.default.createElement("a", {
188
+ href: "/user/".concat(rowData.id),
189
+ style: {
190
+ textDecoration: 'underline',
191
+ color: '#0050ca',
192
+ fontWeight: 'bold'
193
+ }
194
+ }, rowData.name);
195
+ case 'dropdown':
196
+ // Show action buttons on hover
197
+ return /*#__PURE__*/_react.default.createElement("div", {
198
+ style: {
199
+ display: 'flex',
200
+ gap: '8px'
201
+ }
202
+ }, /*#__PURE__*/_react.default.createElement("button", {
203
+ style: {
204
+ padding: '4px 8px',
205
+ fontSize: '12px',
206
+ backgroundColor: '#0050ca',
207
+ color: 'white',
208
+ border: 'none',
209
+ borderRadius: '4px',
210
+ cursor: 'pointer'
211
+ },
212
+ onClick: function onClick() {
213
+ return alert("Edit ".concat(rowData.name));
214
+ }
215
+ }, "Edit"), /*#__PURE__*/_react.default.createElement("button", {
216
+ style: {
217
+ padding: '4px 8px',
218
+ fontSize: '12px',
219
+ backgroundColor: '#dc3545',
220
+ color: 'white',
221
+ border: 'none',
222
+ borderRadius: '4px',
223
+ cursor: 'pointer'
224
+ },
225
+ onClick: function onClick() {
226
+ return alert("Delete ".concat(rowData.name));
227
+ }
228
+ }, "Delete"));
229
+ case 'status':
230
+ // Show status with icon on hover
231
+ var statusColors = {
232
+ Active: '#28a745',
233
+ Inactive: '#dc3545',
234
+ Pending: '#ffc107'
235
+ };
236
+ return /*#__PURE__*/_react.default.createElement("div", {
237
+ style: {
238
+ display: 'flex',
239
+ alignItems: 'center',
240
+ gap: '4px'
241
+ }
242
+ }, /*#__PURE__*/_react.default.createElement("span", {
243
+ style: {
244
+ width: '8px',
245
+ height: '8px',
246
+ borderRadius: '50%',
247
+ backgroundColor: statusColors[rowData.status] || '#6c757d'
248
+ }
249
+ }), rowData.status);
250
+ default:
251
+ return undefined;
252
+ // Return undefined to use default content
253
+ }
254
+ };
255
+
256
+ // Status-based hover styles
257
+ var statusBasedHoverStyles = function statusBasedHoverStyles(rowIndex, rowData) {
258
+ switch (rowData.status) {
259
+ case 'Active':
260
+ return "\n background-color: #e8f5e8 !important;\n td {\n background-color: #e8f5e8 !important;\n border-bottom-color: #28a745 !important;\n }\n ";
261
+ case 'Inactive':
262
+ return "\n background-color: #ffe8e8 !important;\n td {\n background-color: #ffe8e8 !important;\n border-bottom-color: #dc3545 !important;\n }\n ";
263
+ case 'Pending':
264
+ return "\n background-color: #fff3cd !important;\n td {\n background-color: #fff3cd !important;\n border-bottom-color: #ffc107 !important;\n }\n ";
265
+ default:
266
+ return "\n background-color: #f8f9fa !important;\n td {\n background-color: #f8f9fa !important;\n }\n ";
267
+ }
268
+ };
269
+
270
+ // Row-specific hover styles (example: different styles for first and last rows)
271
+ var rowSpecificHoverStyles = function rowSpecificHoverStyles(rowIndex, rowData) {
272
+ // Special styling for first row
273
+ if (rowIndex === 0) {
274
+ return "\n background-color: #e3f2fd !important;\n transform: scale(1.02);\n box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);\n td {\n background-color: #e3f2fd !important;\n border-bottom-color: #2196f3 !important;\n font-weight: bold;\n }\n ";
275
+ }
276
+
277
+ // Special styling for last row
278
+ if (rowIndex === data.length - 1) {
279
+ return "\n background-color: #f3e5f5 !important;\n transform: scale(1.02);\n box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);\n td {\n background-color: #f3e5f5 !important;\n border-bottom-color: #9c27b0 !important;\n font-weight: bold;\n }\n ";
280
+ }
281
+
282
+ // Default styling for other rows
283
+ return "\n background-color: #f0f8ff !important;\n transform: scale(1.01);\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n td {\n background-color: #f0f8ff !important;\n border-bottom-color: #0050ca !important;\n }\n ";
284
+ };
285
+
155
286
  // Function to calculate sub data
156
287
  var calculateSubData = function calculateSubData(row) {
157
288
  return row.original.subData || [];
@@ -180,6 +311,38 @@ WithCustomStyling.args = _objectSpread(_objectSpread({}, Default.args), {}, {
180
311
  customTdStyles: customTdStyles,
181
312
  customThStyles: customThStyles
182
313
  });
314
+ var WithRowHover = Template.bind({});
315
+ exports.WithRowHover = WithRowHover;
316
+ WithRowHover.args = _objectSpread(_objectSpread({}, Default.args), {}, {
317
+ customRowHoverStyles: customRowHoverStyles
318
+ });
319
+ var WithHoverContent = Template.bind({});
320
+ exports.WithHoverContent = WithHoverContent;
321
+ WithHoverContent.args = _objectSpread(_objectSpread({}, Default.args), {}, {
322
+ customRowHoverContent: customRowHoverContent
323
+ });
324
+ var WithHoverStylesAndContent = Template.bind({});
325
+ exports.WithHoverStylesAndContent = WithHoverStylesAndContent;
326
+ WithHoverStylesAndContent.args = _objectSpread(_objectSpread({}, Default.args), {}, {
327
+ customRowHoverStyles: customRowHoverStyles,
328
+ customRowHoverContent: customRowHoverContent
329
+ });
330
+ var WithStatusBasedHover = Template.bind({});
331
+ exports.WithStatusBasedHover = WithStatusBasedHover;
332
+ WithStatusBasedHover.args = _objectSpread(_objectSpread({}, Default.args), {}, {
333
+ customRowHoverStyles: statusBasedHoverStyles
334
+ });
335
+ var WithRowSpecificHover = Template.bind({});
336
+ exports.WithRowSpecificHover = WithRowSpecificHover;
337
+ WithRowSpecificHover.args = _objectSpread(_objectSpread({}, Default.args), {}, {
338
+ customRowHoverStyles: rowSpecificHoverStyles
339
+ });
340
+ var WithFixedColumnWidths = Template.bind({});
341
+ exports.WithFixedColumnWidths = WithFixedColumnWidths;
342
+ WithFixedColumnWidths.args = _objectSpread(_objectSpread({}, Default.args), {}, {
343
+ customRowHoverContent: customRowHoverContent,
344
+ customRowHoverStyles: customRowHoverStyles
345
+ });
183
346
  var WithSubTable = Template.bind({});
184
347
  exports.WithSubTable = WithSubTable;
185
348
  WithSubTable.args = _objectSpread(_objectSpread({}, Default.args), {}, {
@@ -99,23 +99,37 @@ exports.TableWrap = TableWrap;
99
99
  var StyledTh = _styledComponents.default.th.withConfig({
100
100
  displayName: "Tablestyles__StyledTh",
101
101
  componentId: "sc-pdcd6r-12"
102
- })(["text-transform:uppercase;padding:10px;font-size:11px;letter-spacing:1.6px;font-weight:600;background-color:white;color:#000000de;border-bottom:1px solid #e1e1e1;line-height:20px;", ""], function (props) {
102
+ })(["text-transform:uppercase;padding:10px;font-size:11px;letter-spacing:1.6px;font-weight:600;background-color:white;color:#000000de;border-bottom:1px solid #e1e1e1;line-height:20px;", " ", " ", " ", ""], function (props) {
103
103
  return props.blue && "\n background-color: #0050ca;\n color: #ffffff;\n border:none;\n ";
104
+ }, function (props) {
105
+ return props.width && "\n width: ".concat(props.width, ";\n min-width: ").concat(props.width, ";\n max-width: ").concat(props.width, ";\n ");
106
+ }, function (props) {
107
+ return props.minWidth && "\n min-width: ".concat(props.minWidth, ";\n ");
108
+ }, function (props) {
109
+ return props.maxWidth && "\n max-width: ".concat(props.maxWidth, ";\n ");
104
110
  });
105
111
  exports.StyledTh = StyledTh;
106
112
  var StyledTd = _styledComponents.default.td.withConfig({
107
113
  displayName: "Tablestyles__StyledTd",
108
114
  componentId: "sc-pdcd6r-13"
109
- })(["padding:26px 15px;border-bottom:1px solid #e1e1e1;font-size:14px;", " ", ""], function (props) {
115
+ })(["padding:26px 15px;border-bottom:1px solid #e1e1e1;font-size:14px;", " ", " ", " ", " ", ""], function (props) {
110
116
  return props.blue && "\n background-color: #004bb7;\n color: #ffffff;\n ";
111
117
  }, function (props) {
112
118
  return props.subTable && "\n padding: 0;\n &:last-child {\n border-bottom: 0;\n }\n ";
119
+ }, function (props) {
120
+ return props.width && "\n width: ".concat(props.width, ";\n min-width: ").concat(props.width, ";\n max-width: ").concat(props.width, ";\n ");
121
+ }, function (props) {
122
+ return props.minWidth && "\n min-width: ".concat(props.minWidth, ";\n ");
123
+ }, function (props) {
124
+ return props.maxWidth && "\n max-width: ".concat(props.maxWidth, ";\n ");
113
125
  });
114
126
  exports.StyledTd = StyledTd;
115
127
  var StyledTr = _styledComponents.default.tr.withConfig({
116
128
  displayName: "Tablestyles__StyledTr",
117
129
  componentId: "sc-pdcd6r-14"
118
- })([""]);
130
+ })(["", ""], function (props) {
131
+ return props.customRowHoverStyles && "\n &:hover {\n ".concat(props.customRowHoverStyles(props.rowIndex, props.rowData), "\n }\n ");
132
+ });
119
133
  exports.StyledTr = StyledTr;
120
134
  var StyledReactTable = _styledComponents.default.table.withConfig({
121
135
  displayName: "Tablestyles__StyledReactTable",
@@ -12,7 +12,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
12
12
  var CardContainer = _styledComponents.default.div.withConfig({
13
13
  displayName: "ChecklistCardstyles__CardContainer",
14
14
  componentId: "sc-rufrg1-0"
15
- })(["display:flex;flex-direction:column;align-items:flex-start;border:1px solid #eaeaea;border-radius:1px;background:#fff;padding:32px 32px 32px 32px;min-width:320px;min-height:220px;box-sizing:border-box;transition:box-shadow 0.2s;box-shadow:0 2px 8px rgba(0,0,0,0.01);position:relative;cursor:pointer;&:hover{box-shadow:0 4px 16px rgba(0,0,0,0.04);}&[aria-disabled='true']{opacity:0.5;cursor:not-allowed;}"]);
15
+ })(["display:flex;flex-direction:column;align-items:flex-start;border:1px solid #eaeaea;border-radius:1px;background:#fff;padding:32px 32px 32px 32px;min-width:320px;min-height:220px;height:100%;box-sizing:border-box;transition:box-shadow 0.2s;box-shadow:0 2px 8px rgba(0,0,0,0.01);position:relative;cursor:pointer;&:hover{box-shadow:0 4px 16px rgba(0,0,0,0.04);}&[aria-disabled='true']{opacity:0.5;cursor:not-allowed;}"]);
16
16
  exports.CardContainer = CardContainer;
17
17
  var IconBlock = _styledComponents.default.div.withConfig({
18
18
  displayName: "ChecklistCardstyles__IconBlock",
@@ -8,7 +8,7 @@ var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _reactTippy = require("react-tippy");
10
10
  var _InfoIcon = require("./InfoIcon.styles");
11
- var _excluded = ["title", "html", "position", "noMargin", "noMarginLeft", "noMarginRight", "noIcon", "disabled"];
11
+ var _excluded = ["title", "html", "position", "noMargin", "noMarginLeft", "noMarginRight", "noIcon", "disabled", "fullWidth"];
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
  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; }
14
14
  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; }
@@ -21,11 +21,13 @@ var InfoIcon = function InfoIcon(_ref) {
21
21
  noMarginRight = _ref.noMarginRight,
22
22
  noIcon = _ref.noIcon,
23
23
  disabled = _ref.disabled,
24
+ fullWidth = _ref.fullWidth,
24
25
  props = _objectWithoutProperties(_ref, _excluded);
25
26
  return /*#__PURE__*/_react.default.createElement(_InfoIcon.Container, {
26
27
  noMargin: noMargin,
27
28
  noMarginLeft: noMarginLeft,
28
- noMarginRight: noMarginRight
29
+ noMarginRight: noMarginRight,
30
+ fullWidth: fullWidth
29
31
  }, /*#__PURE__*/_react.default.createElement(_reactTippy.Tooltip, {
30
32
  position: position,
31
33
  title: title,
@@ -10,12 +10,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
10
10
  var Container = _styledComponents.default.div.withConfig({
11
11
  displayName: "InfoIconstyles__Container",
12
12
  componentId: "sc-d3sdn3-0"
13
- })(["display:inline-block;vertical-align:middle;margin:0 12px;font-size:0;line-height:0;", " ", " ", " & > div{position:relative;display:inline-block!important;}"], function (props) {
13
+ })(["display:inline-block;vertical-align:middle;margin:0 12px;font-size:0;line-height:0;", " ", " ", " ", " & > div{position:relative;display:inline-block !important;", "}"], function (props) {
14
14
  return props.noMargin && "\n margin: 0;\n ";
15
15
  }, function (props) {
16
16
  return props.noMarginLeft && "\n margin-left: 0;\n ";
17
17
  }, function (props) {
18
18
  return props.noMarginRight && "\n margin-right: 0;\n ";
19
+ }, function (props) {
20
+ return props.fullWidth && "\n width: 100%;\n height: 100%;\n ";
21
+ }, function (props) {
22
+ return props.fullWidth && "\n width: 100%;\n height: 100%;\n display: flex !important;\n align-content: center;\n flex-wrap: wrap;\n justify-content: center;\n ";
19
23
  });
20
24
  exports.Container = Container;
21
25
  var Icon = _styledComponents.default.i.attrs({
@@ -0,0 +1,456 @@
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.NewVentureModal = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ var _formik = require("formik");
11
+ var Yup = _interopRequireWildcard(require("yup"));
12
+ var _fetchDataPublic = _interopRequireDefault(require("../../../api/fetchDataPublic"));
13
+ var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
14
+ var _AuthContext = require("../../../context/AuthContext");
15
+ var _globalVariables = require("../../../constants/globalVariables");
16
+ var _Modal = require("../Modal");
17
+ var _Grid = require("../../Grid/Grid.styles");
18
+ var _Text = _interopRequireDefault(require("../../Text/Text.styles"));
19
+ var _Form = _interopRequireWildcard(require("../../Form/Form"));
20
+ var _ComponentWrapper = _interopRequireDefault(require("../../ComponentWrapper/ComponentWrapper.styles"));
21
+ var _Input = _interopRequireDefault(require("../../Input/Input"));
22
+ var _Checkbox = _interopRequireDefault(require("../../Checkbox/Checkbox"));
23
+ var _Button = _interopRequireDefault(require("../../Button/Button.styles"));
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+ 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); }
26
+ 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; }
27
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
28
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
30
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
31
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
32
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
33
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
34
+ 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; }
35
+ 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; }
36
+ 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; }
37
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
38
+ 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); }
39
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
40
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
41
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
42
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
43
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
44
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
45
+ var initialFormValues = {
46
+ email: '',
47
+ name: '',
48
+ mailingList: false,
49
+ mailingListDisabled: false,
50
+ mailingListText: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "You just want to be updated on the project. Subscribe here for further information going forward."),
51
+ privateInvestorList: false,
52
+ privateInvestorListDisabled: false,
53
+ privateInvestorListText: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "You are a professional investor or an investor willing to invest in private offerings. Subscribe here to be contacted by a dedicated team to help you confirm your eligibility for this investment.", /*#__PURE__*/_react.default.createElement("br", null), " ", /*#__PURE__*/_react.default.createElement("br", null), "You are seeking to invest on your own initiative and any potential investments arose as a result of your direct inquiry and outreach."),
54
+ optionalCheckBox: false,
55
+ optionalCheckBoxText: '',
56
+ optionalCheckBoxChecked: false
57
+ };
58
+ var NewVentureModal = /*#__PURE__*/(0, _react.memo)(function (props) {
59
+ var title = props.title,
60
+ description = props.description,
61
+ isModalOpen = props.isModalOpen,
62
+ onModalClose = props.onModalClose,
63
+ onFormSend = props.onFormSend,
64
+ popupError = props.popupError,
65
+ project = props.project,
66
+ _props$salesChannel = props.salesChannel,
67
+ salesChannel = _props$salesChannel === void 0 ? 'investor' : _props$salesChannel,
68
+ successMsg = props.successMsg,
69
+ errorMsg = props.errorMsg,
70
+ modalBotContent = props.modalBotContent;
71
+ var _useState = (0, _react.useState)(initialFormValues),
72
+ _useState2 = _slicedToArray(_useState, 2),
73
+ formValues = _useState2[0],
74
+ setformValues = _useState2[1];
75
+ var _useState3 = (0, _react.useState)(undefined),
76
+ _useState4 = _slicedToArray(_useState3, 2),
77
+ successMessage = _useState4[0],
78
+ setSuccessMessage = _useState4[1];
79
+ var _useState5 = (0, _react.useState)(null),
80
+ _useState6 = _slicedToArray(_useState5, 2),
81
+ errorMessage = _useState6[0],
82
+ seterrorMessage = _useState6[1];
83
+ var _React$useContext = _react.default.useContext(_AuthContext.AuthContext),
84
+ user = _React$useContext.user,
85
+ setUser = _React$useContext.setUser,
86
+ checkIfPrivateInvestor = _React$useContext.checkIfPrivateInvestor,
87
+ checkIfUserSubscribed = _React$useContext.checkIfUserSubscribed;
88
+ var _useState7 = (0, _react.useState)(),
89
+ _useState8 = _slicedToArray(_useState7, 2),
90
+ checkboxes = _useState8[0],
91
+ setcheckboxes = _useState8[1];
92
+ var _useState9 = (0, _react.useState)([]),
93
+ _useState10 = _slicedToArray(_useState9, 2),
94
+ checkedCheckboxes = _useState10[0],
95
+ setcheckedCheckboxes = _useState10[1];
96
+ var _useState11 = (0, _react.useState)(false),
97
+ _useState12 = _slicedToArray(_useState11, 2),
98
+ isActionLoading = _useState12[0],
99
+ setisActionLoading = _useState12[1];
100
+ (0, _react.useEffect)(function () {
101
+ fecthCheckboxes();
102
+ }, []);
103
+ (0, _react.useEffect)(function () {
104
+ //we need to check if userData is subscribed for the selected project
105
+ //every time the userData or project is updated
106
+ //check only if these userData properties weren't checked already
107
+ var project = props.project;
108
+ if (!user || !user._id || !(project && project._id)) return;
109
+ if (user.isPrivateInvestor === undefined) {
110
+ checkIfPrivateInvestor(project);
111
+ }
112
+ if (user.isSubscribed === undefined) {
113
+ checkIfUserSubscribed(project);
114
+ }
115
+ }, [user, props.project]);
116
+ (0, _react.useEffect)(function () {
117
+ //when the checkboxes are fetched, set the text of the checkboxes
118
+ if (checkboxes) {
119
+ var formValuesCopy = _objectSpread({}, formValues);
120
+ Object.values(checkboxes).forEach(function (checkbox) {
121
+ if (checkbox.label === 'createPrivateInvestor') {
122
+ formValuesCopy.privateInvestorListText = (0, _htmlReactParser.default)(checkbox.agreementText);
123
+ } else if (checkbox.label === 'subscribeToProject') {
124
+ formValuesCopy.mailingListText = (0, _htmlReactParser.default)(checkbox.agreementText);
125
+ }
126
+ });
127
+ setformValues(formValuesCopy);
128
+ }
129
+
130
+ //change text of checkboxes if user is logged in and is already subscribed
131
+ if (user) {
132
+ var _formValuesCopy = _objectSpread({}, formValues);
133
+ _formValuesCopy.email = user.email;
134
+ _formValuesCopy.name = user.username;
135
+ if (user.isPrivateInvestor) {
136
+ _formValuesCopy.privateInvestorListText = 'You are already registered on the whitelist.';
137
+ _formValuesCopy.privateInvestorList = true;
138
+ _formValuesCopy.privateInvestorListDisabled = true;
139
+ } else if (user.privateInvestorStatus && user.privateInvestorStatus !== 'Admitted') {
140
+ //if private investor status is under review
141
+ _formValuesCopy.privateInvestorListText = 'Your profile is under review. An account manager will reach out to you to confirm your eligibility.';
142
+ _formValuesCopy.privateInvestorList = true;
143
+ _formValuesCopy.privateInvestorListDisabled = true;
144
+ }
145
+ if (user.isSubscribed) {
146
+ _formValuesCopy.mailingList = true;
147
+ _formValuesCopy.mailingListText = 'You already subscribed to the email notification list.';
148
+ _formValuesCopy.mailingListDisabled = true;
149
+ }
150
+ setformValues(_formValuesCopy);
151
+ }
152
+ }, [user, checkboxes]);
153
+ var fecthCheckboxes = /*#__PURE__*/function () {
154
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
155
+ var response;
156
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
157
+ while (1) switch (_context.prev = _context.next) {
158
+ case 0:
159
+ _context.prev = 0;
160
+ _context.next = 3;
161
+ return (0, _fetchDataPublic.default)('compliance/get-checkbox-group', {
162
+ group: 'newVentureModal'
163
+ });
164
+ case 3:
165
+ response = _context.sent;
166
+ if (response != null) {
167
+ setcheckboxes(response);
168
+ }
169
+ _context.next = 10;
170
+ break;
171
+ case 7:
172
+ _context.prev = 7;
173
+ _context.t0 = _context["catch"](0);
174
+ console.log('🚀 ~ file: NewVentureModal.js:111 ~ error:', _context.t0);
175
+ case 10:
176
+ case "end":
177
+ return _context.stop();
178
+ }
179
+ }, _callee, null, [[0, 7]]);
180
+ }));
181
+ return function fecthCheckboxes() {
182
+ return _ref.apply(this, arguments);
183
+ };
184
+ }();
185
+ var validationSchema = Yup.object().shape({
186
+ email: Yup.string().matches(_globalVariables.emailRegex, "Oops, that's not a valid address").required('Oops, this can‘t be blank'),
187
+ name: Yup.string().required('Oops, this can‘t be blank')
188
+ });
189
+ var onSubmitButton = /*#__PURE__*/function () {
190
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(values) {
191
+ var project, dataToSend, response, userCopy, _error$response, _error$response$data, errorParsed;
192
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
193
+ while (1) switch (_context2.prev = _context2.next) {
194
+ case 0:
195
+ project = props.project;
196
+ dataToSend = {
197
+ email: values.email,
198
+ projectId: project._id,
199
+ name: values.name,
200
+ checkedCheckboxes: checkedCheckboxes,
201
+ salesChannel: salesChannel
202
+ };
203
+ setisActionLoading(true);
204
+ _context2.prev = 3;
205
+ if (values.privateInvestorList && !formValues.privateInvestorListDisabled) {
206
+ dataToSend.createPrivateInvestor = true;
207
+ }
208
+ if (values.mailingList && !formValues.mailingListDisabled) {
209
+ dataToSend.subscribeToProject = true;
210
+ }
211
+ _context2.next = 8;
212
+ return (0, _fetchDataPublic.default)('private-investor/public/create', dataToSend);
213
+ case 8:
214
+ response = _context2.sent;
215
+ setSuccessMessage(successMsg ? successMsg : "An account manager will reach out to you with further details on the offering and the investment procedure.");
216
+ userCopy = _objectSpread({}, user);
217
+ if (!userCopy.email) {
218
+ //add email and username when subscribing without being logged in
219
+ userCopy.email = values.email;
220
+ userCopy.username = values.name;
221
+ }
222
+ if (response !== null && response !== void 0 && response.privateInvestor) {
223
+ userCopy.privateInvestorStatus = response.privateInvestor.status;
224
+ }
225
+ if (response !== null && response !== void 0 && response.subscribedToProject) {
226
+ userCopy.isSubscribed = true;
227
+ }
228
+ setUser(userCopy);
229
+ _context2.next = 21;
230
+ break;
231
+ case 17:
232
+ _context2.prev = 17;
233
+ _context2.t0 = _context2["catch"](3);
234
+ console.log('🚀 ~ error', _context2.t0);
235
+ //show error message from BE only for 406 error
236
+ if ((_context2.t0 === null || _context2.t0 === void 0 || (_error$response = _context2.t0.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 406) {
237
+ errorParsed = (_error$response$data = _context2.t0.response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.substring(7);
238
+ seterrorMessage(errorMsg ? errorMsg : errorParsed);
239
+ } else {
240
+ seterrorMessage( /*#__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", {
241
+ href: "mailto:support@stokr.io",
242
+ style: {
243
+ color: 'inherit'
244
+ }
245
+ }, "support@stokr.io"), ' '));
246
+ }
247
+ case 21:
248
+ _context2.prev = 21;
249
+ setisActionLoading(false);
250
+ return _context2.finish(21);
251
+ case 24:
252
+ case "end":
253
+ return _context2.stop();
254
+ }
255
+ }, _callee2, null, [[3, 17, 21, 24]]);
256
+ }));
257
+ return function onSubmitButton(_x) {
258
+ return _ref2.apply(this, arguments);
259
+ };
260
+ }();
261
+ return /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
262
+ isOpen: isModalOpen,
263
+ onClose: function onClose() {
264
+ setformValues(function (prevState) {
265
+ return _objectSpread(_objectSpread({}, prevState), {}, {
266
+ mailingList: false,
267
+ privateInvestorList: false,
268
+ optionalCheckBox: false
269
+ });
270
+ });
271
+ onModalClose();
272
+ }
273
+ }, /*#__PURE__*/_react.default.createElement(_Grid.Row, null, /*#__PURE__*/_react.default.createElement(_Grid.Column, {
274
+ part: 8
275
+ }, /*#__PURE__*/_react.default.createElement(_Modal.ModalInner, {
276
+ modalTop: true
277
+ }, /*#__PURE__*/_react.default.createElement(_Text.default, null, /*#__PURE__*/_react.default.createElement("h3", null, errorMessage ? 'OOPS..' : successMessage ? 'AWESOME!' : title), !(successMessage || errorMessage) && /*#__PURE__*/_react.default.createElement("p", null, description))), /*#__PURE__*/_react.default.createElement(_Modal.ModalInner, {
278
+ modalBot: true
279
+ }, modalBotContent)), /*#__PURE__*/_react.default.createElement(_Grid.Column, {
280
+ part: 8
281
+ }, /*#__PURE__*/_react.default.createElement(_Modal.ModalInner, null, successMessage || errorMessage ? /*#__PURE__*/_react.default.createElement(_Text.default, null, /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("p", null, errorMessage ? errorMessage : successMessage)) : /*#__PURE__*/_react.default.createElement(_formik.Formik, {
282
+ initialValues: formValues,
283
+ validationSchema: validationSchema,
284
+ onSubmit: function onSubmit(values) {
285
+ onFormSend(values);
286
+ onSubmitButton(values);
287
+ },
288
+ id: "register-interest-form"
289
+ }, function (_ref3) {
290
+ var values = _ref3.values,
291
+ errors = _ref3.errors,
292
+ touched = _ref3.touched,
293
+ handleBlur = _ref3.handleBlur,
294
+ handleChange = _ref3.handleChange,
295
+ setFieldValue = _ref3.setFieldValue,
296
+ setFieldTouched = _ref3.setFieldTouched;
297
+ var onChangeWithTouch = function onChangeWithTouch(e) {
298
+ var field = e.target;
299
+ setFieldValue(field.name, field.value, false);
300
+ setFieldTouched(field.name);
301
+ };
302
+ var oneOfCheckbox = values.mailingList && !formValues.mailingListDisabled || values.privateInvestorList;
303
+ var optionalCheckBox = formValues.optionalCheckBox ? values.optionalCheckBoxChecked : true;
304
+ if (formValues.email && !values.email) {
305
+ setFieldValue('email', formValues.email);
306
+ setFieldTouched('email');
307
+ }
308
+ if (formValues.name && !values.name) {
309
+ setFieldValue('name', formValues.name);
310
+ setFieldTouched('name');
311
+ }
312
+ if (formValues.mailingList && !values.mailingList) {
313
+ setFieldValue('mailingList', formValues.mailingList);
314
+ }
315
+ if (formValues.privateInvestorList && !values.privateInvestorList) {
316
+ setFieldValue('privateInvestorList', formValues.privateInvestorList);
317
+ }
318
+
319
+ //create custom handleCheckboxChange to add the checkbox to the checkedCheckboxes array
320
+ var handleCheckboxChange = function handleCheckboxChange(e) {
321
+ handleChange(e);
322
+
323
+ //we set id of the checkbox to be the same string as checkbox label, so we can identify the checkbox
324
+ if (e.target.checked) {
325
+ setcheckedCheckboxes([].concat(_toConsumableArray(checkedCheckboxes), [e.target.id]));
326
+ } else {
327
+ setcheckedCheckboxes(checkedCheckboxes.filter(function (item) {
328
+ return item !== e.target.id;
329
+ }));
330
+ }
331
+ };
332
+ var submitDisabled = !touched.email || !!errors.email || !touched.name || !!errors.name || isActionLoading || !oneOfCheckbox || !optionalCheckBox;
333
+ return /*#__PURE__*/_react.default.createElement(_Form.default, null, /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
334
+ noPadding: true
335
+ }, /*#__PURE__*/_react.default.createElement(_Form.FormField, null, !user && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Input.default, {
336
+ id: "new-venture-email",
337
+ name: "email",
338
+ type: "email",
339
+ label: "Your email",
340
+ value: values.email,
341
+ onChange: onChangeWithTouch,
342
+ onBlur: handleBlur,
343
+ error: !!errors.email,
344
+ touched: !!touched.email
345
+ }), /*#__PURE__*/_react.default.createElement(_Form.FormError, {
346
+ show: touched.email && errors.email
347
+ }, errors.email), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
348
+ noPaddingHorizontal: true,
349
+ paddingVeticalHalf: true,
350
+ noPaddingBottom: true
351
+ }, /*#__PURE__*/_react.default.createElement(_Input.default, {
352
+ id: "new-venture-name",
353
+ name: "name",
354
+ type: "text",
355
+ label: "Your name",
356
+ value: values.name,
357
+ onChange: onChangeWithTouch,
358
+ onBlur: handleBlur,
359
+ error: !!errors.name,
360
+ touched: !!touched.name
361
+ }), /*#__PURE__*/_react.default.createElement(_Form.FormError, {
362
+ show: touched.name && errors.name
363
+ }, errors.name))), /*#__PURE__*/_react.default.createElement(_Form.FormField, {
364
+ style: {
365
+ marginTop: '1rem',
366
+ marginBottom: -5
367
+ }
368
+ }, /*#__PURE__*/_react.default.createElement(_Checkbox.default, {
369
+ id: 'createPrivateInvestor' //same as checkbox label
370
+ ,
371
+ name: "privateInvestorList",
372
+ text: formValues.privateInvestorListText,
373
+ checked: values.privateInvestorList,
374
+ disabled: formValues.privateInvestorListDisabled,
375
+ onChange: handleCheckboxChange,
376
+ onBlur: handleBlur
377
+ })), /*#__PURE__*/_react.default.createElement(_Form.FormField, {
378
+ style: {
379
+ marginTop: '2rem',
380
+ marginBottom: -5
381
+ }
382
+ }, /*#__PURE__*/_react.default.createElement(_Checkbox.default, {
383
+ id: "subscribeToProject",
384
+ name: "mailingList",
385
+ text: formValues.mailingListText,
386
+ checked: values.mailingList,
387
+ disabled: formValues.mailingListDisabled,
388
+ onChange: handleCheckboxChange,
389
+ onBlur: handleBlur
390
+ })), formValues.optionalCheckBox && /*#__PURE__*/_react.default.createElement(_Form.FormField, {
391
+ style: {
392
+ marginTop: '2rem',
393
+ marginBottom: -5
394
+ }
395
+ }, /*#__PURE__*/_react.default.createElement(_Checkbox.default, {
396
+ id: "optionalCheckBox",
397
+ name: "optionalCheckBoxChecked",
398
+ text: formValues.optionalCheckBoxText,
399
+ value: values.optionalCheckBoxChecked,
400
+ checked: values.optionalCheckBoxChecked,
401
+ onChange: handleChange,
402
+ onBlur: handleBlur
403
+ })), project.type === _globalVariables.ProjectTypes.FUND && /*#__PURE__*/_react.default.createElement(_Form.FormField, {
404
+ style: {
405
+ marginTop: '2rem',
406
+ marginBottom: -5
407
+ }
408
+ }, /*#__PURE__*/_react.default.createElement("p", {
409
+ style: {
410
+ margin: 0,
411
+ fontSize: 12
412
+ }
413
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "The fund, as well as its fund manager(s) and affiliates, may not be subject to any registration or other local marketing or private placement laws in your jurisdiction."))))), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
414
+ noPaddingBottom: true,
415
+ noPaddingHorizontal: true,
416
+ center: true
417
+ }, /*#__PURE__*/_react.default.createElement(_Button.default, {
418
+ type: "submit",
419
+ id: "private-investor-subscribe-button",
420
+ disabled: submitDisabled // fluid
421
+ }, "register")), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
422
+ paddingVeticalHalf: true,
423
+ noPaddingHorizontal: true
424
+ }, /*#__PURE__*/_react.default.createElement(_Form.FormError, {
425
+ show: popupError
426
+ }, popupError)));
427
+ })))));
428
+ });
429
+ exports.NewVentureModal = NewVentureModal;
430
+ NewVentureModal.propTypes = {
431
+ isModalOpen: _propTypes.default.bool.isRequired,
432
+ onModalClose: _propTypes.default.func.isRequired,
433
+ onFormSend: _propTypes.default.func.isRequired,
434
+ onModalSwitch: _propTypes.default.func,
435
+ title: _propTypes.default.string,
436
+ description: _propTypes.default.string,
437
+ popupError: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
438
+ project: _propTypes.default.object,
439
+ successMsg: _propTypes.default.node,
440
+ errorMsg: _propTypes.default.node,
441
+ modalBotContent: _propTypes.default.node
442
+ };
443
+ NewVentureModal.defaultProps = {
444
+ title: 'Register Your Interest',
445
+ description: 'Join us in this exciting investment opportunity.',
446
+ popupError: null,
447
+ project: {
448
+ _id: '',
449
+ name: '',
450
+ type: 'fund',
451
+ title: '',
452
+ description: ''
453
+ }
454
+ };
455
+ var _default = NewVentureModal;
456
+ exports.default = _default;
@@ -0,0 +1,170 @@
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.WithTokenProject = exports.WithLongDescription = exports.WithError = exports.WithCustomTitle = exports.Interactive = exports.EquityProject = exports.Default = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _NewVentureModal = require("./NewVentureModal");
10
+ var _global = _interopRequireDefault(require("../../../styles/global"));
11
+ var _AuthContext = require("../../../context/AuthContext");
12
+ var _reactRouterDom = require("react-router-dom");
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ 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); }
15
+ 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; }
16
+ 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; }
17
+ 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; }
18
+ 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; }
19
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
20
+ 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); }
21
+ 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); }
22
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
23
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
25
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
26
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
27
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
28
+ var _default = {
29
+ title: 'Components Library/Modal/NewVentureModal',
30
+ component: _NewVentureModal.NewVentureModal,
31
+ parameters: {
32
+ docs: {
33
+ description: {
34
+ component: 'A modal component for new venture registration with form validation, checkbox management, and user authentication integration.'
35
+ }
36
+ }
37
+ },
38
+ argTypes: {
39
+ isModalOpen: {
40
+ control: 'boolean'
41
+ },
42
+ title: {
43
+ control: 'text'
44
+ },
45
+ description: {
46
+ control: 'text'
47
+ },
48
+ popupError: {
49
+ control: 'text'
50
+ },
51
+ project: {
52
+ control: 'object'
53
+ },
54
+ successMsg: {
55
+ control: 'text'
56
+ },
57
+ errorMsg: {
58
+ control: 'text'
59
+ },
60
+ modalBotContent: {
61
+ control: 'text'
62
+ },
63
+ onModalClose: {
64
+ action: 'modal closed'
65
+ },
66
+ onFormSend: {
67
+ action: 'form submitted'
68
+ }
69
+ }
70
+ }; // Sample project data
71
+ exports.default = _default;
72
+ var sampleProject = {
73
+ _id: 'project-123',
74
+ name: 'aquarius',
75
+ type: 'fund',
76
+ title: 'Aquarius Fund',
77
+ description: 'A revolutionary investment opportunity in sustainable technology.'
78
+ };
79
+ var sampleTokenProject = {
80
+ _id: 'project-456',
81
+ name: 'tech-token',
82
+ type: 'token',
83
+ title: 'Tech Token',
84
+ description: 'Invest in the future of technology with our innovative token offering.'
85
+ };
86
+ var Template = function Template(args) {
87
+ var _useState = (0, _react.useState)(args.isModalOpen || false),
88
+ _useState2 = _slicedToArray(_useState, 2),
89
+ isOpen = _useState2[0],
90
+ setIsOpen = _useState2[1];
91
+ var handleModalClose = function handleModalClose() {
92
+ var _args$onModalClose;
93
+ setIsOpen(false);
94
+ (_args$onModalClose = args.onModalClose) === null || _args$onModalClose === void 0 || _args$onModalClose.call(args);
95
+ };
96
+ var handleFormSend = function handleFormSend(values) {
97
+ var _args$onFormSend;
98
+ console.log('Form submitted with values:', values);
99
+ (_args$onFormSend = args.onFormSend) === null || _args$onFormSend === void 0 || _args$onFormSend.call(args, values);
100
+ };
101
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement("button", {
102
+ onClick: function onClick() {
103
+ return setIsOpen(true);
104
+ },
105
+ style: {
106
+ padding: '10px 20px'
107
+ }
108
+ }, "Open New Venture Modal"), /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(_AuthContext.AuthProvider, null, /*#__PURE__*/_react.default.createElement(_NewVentureModal.NewVentureModal, _extends({}, args, {
109
+ isModalOpen: isOpen,
110
+ onModalClose: handleModalClose,
111
+ onFormSend: handleFormSend
112
+ })))));
113
+ };
114
+ var Default = Template.bind({});
115
+ exports.Default = Default;
116
+ Default.args = {
117
+ title: 'Register Your Interest',
118
+ description: 'Join us in this exciting investment opportunity. Fill out the form below to get started.',
119
+ project: sampleProject,
120
+ popupError: null
121
+ };
122
+ var WithTokenProject = Template.bind({});
123
+ exports.WithTokenProject = WithTokenProject;
124
+ WithTokenProject.args = _objectSpread(_objectSpread({}, Default.args), {}, {
125
+ project: sampleTokenProject,
126
+ title: 'Token Investment Opportunity',
127
+ description: 'Get early access to our innovative token offering.'
128
+ });
129
+ var WithError = Template.bind({});
130
+ exports.WithError = WithError;
131
+ WithError.args = _objectSpread(_objectSpread({}, Default.args), {}, {
132
+ popupError: 'This email is already registered. Please try a different email address.'
133
+ });
134
+ var WithCustomTitle = Template.bind({});
135
+ exports.WithCustomTitle = WithCustomTitle;
136
+ WithCustomTitle.args = _objectSpread(_objectSpread({}, Default.args), {}, {
137
+ title: 'Join the Innovation Revolution',
138
+ description: 'Be part of the next big thing in sustainable technology investments.'
139
+ });
140
+ var WithLongDescription = Template.bind({});
141
+ exports.WithLongDescription = WithLongDescription;
142
+ WithLongDescription.args = _objectSpread(_objectSpread({}, Default.args), {}, {
143
+ title: 'Comprehensive Investment Opportunity',
144
+ description: 'This is a detailed description of the investment opportunity that provides comprehensive information about the project, its goals, potential returns, and the team behind it. Investors can learn about the technology, market potential, and strategic vision.'
145
+ });
146
+
147
+ // Interactive example with form submission handling
148
+ var Interactive = Template.bind({});
149
+ exports.Interactive = Interactive;
150
+ Interactive.args = _objectSpread(_objectSpread({}, Default.args), {}, {
151
+ onFormSend: function onFormSend(values) {
152
+ console.log('Interactive form submitted:', values);
153
+ alert("Form submitted successfully!\nEmail: ".concat(values.email, "\nName: ").concat(values.name, "\nPrivate Investor: ").concat(values.privateInvestorList, "\nMailing List: ").concat(values.mailingList));
154
+ }
155
+ });
156
+
157
+ // Example with different project types
158
+ var EquityProject = Template.bind({});
159
+ exports.EquityProject = EquityProject;
160
+ EquityProject.args = _objectSpread(_objectSpread({}, Default.args), {}, {
161
+ project: {
162
+ _id: 'project-789',
163
+ name: 'startup-equity',
164
+ type: 'equity',
165
+ title: 'Startup Equity Investment',
166
+ description: 'Invest in early-stage startup with high growth potential.'
167
+ },
168
+ title: 'Equity Investment Opportunity',
169
+ description: 'Get equity in a promising startup and be part of their growth journey.'
170
+ });
@@ -15,7 +15,8 @@ exports.walletTypes = walletTypes;
15
15
  var ProjectTypes = {
16
16
  FUND: 'fund',
17
17
  COMPANY: 'company',
18
- TRANCHES: 'tranches'
18
+ TRANCHES: 'tranches',
19
+ EQUITY: 'equity'
19
20
  };
20
21
  exports.ProjectTypes = ProjectTypes;
21
22
  var ProjectStatus = {
package/dist/index.js CHANGED
@@ -630,6 +630,17 @@ Object.keys(_PaymentModal).forEach(function (key) {
630
630
  }
631
631
  });
632
632
  });
633
+ var _NewVentureModal = require("./components/Modal/NewVentureModal/NewVentureModal");
634
+ Object.keys(_NewVentureModal).forEach(function (key) {
635
+ if (key === "default" || key === "__esModule") return;
636
+ if (key in exports && exports[key] === _NewVentureModal[key]) return;
637
+ Object.defineProperty(exports, key, {
638
+ enumerable: true,
639
+ get: function get() {
640
+ return _NewVentureModal[key];
641
+ }
642
+ });
643
+ });
633
644
  var _MultiProgressBar = require("./components/MultiProgressBar/MultiProgressBar");
634
645
  Object.keys(_MultiProgressBar).forEach(function (key) {
635
646
  if (key === "default" || key === "__esModule") return;
@@ -51,7 +51,8 @@ var colors = {
51
51
  grey3: '#f8f8f8',
52
52
  grey4: '#DCDCDC',
53
53
  midRed: '#e3210d',
54
- warningYellow: '#facc33'
54
+ warningYellow: '#facc33',
55
+ darkRed: '#D2200D'
55
56
  };
56
57
  exports.colors = colors;
57
58
  var _default = colors;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.3.44-beta.1",
3
+ "version": "2.3.44-beta.4",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",