@stokr/components-library 2.3.58-beta.9 → 2.3.58

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.
@@ -33,6 +33,10 @@ function ReactTable(props) {
33
33
  customRowHoverContent,
34
34
  customRowStyles,
35
35
  customTableStyles,
36
+ tableWrapStyles,
37
+ getRowDataCy,
38
+ // Function to generate data-cy attribute: (rowData, rowIndex) => string
39
+
36
40
  //instead of passing the subData, we pass a function that will calculate the subData
37
41
  //subData must be part of the data array (an array or whatever)
38
42
  //calculateSubData is a function that receives the row and returns the subData
@@ -81,7 +85,9 @@ function ReactTable(props) {
81
85
  }
82
86
  return cell.render('Cell');
83
87
  };
84
- return /*#__PURE__*/_react.default.createElement(_Table.Styles, null, /*#__PURE__*/_react.default.createElement(_Table.TableWrap, null, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable, _extends({}, getTableProps(), {
88
+ return /*#__PURE__*/_react.default.createElement(_Table.Styles, null, /*#__PURE__*/_react.default.createElement(_Table.TableWrap, {
89
+ style: tableWrapStyles
90
+ }, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable, _extends({}, getTableProps(), {
85
91
  customTableStyles: customTableStyles
86
92
  }), /*#__PURE__*/_react.default.createElement("thead", null, headerGroups.map(headerGroup => /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, headerGroup.getHeaderGroupProps(), headerGroup.headers.map(column => {
87
93
  const cellStyles = customThStyles ? customThStyles(column) : {};
@@ -98,7 +104,9 @@ function ReactTable(props) {
98
104
  prepareRow(row);
99
105
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
100
106
  key: row.id
101
- }, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, _extends({}, row.getRowProps(), {
107
+ }, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, _extends({}, row.getRowProps({
108
+ 'data-cy': getRowDataCy ? getRowDataCy(row.original, i) : undefined
109
+ }), {
102
110
  customRowHoverStyles: customRowHoverStyles,
103
111
  customRowStyles: customRowStyles,
104
112
  rowIndex: i,
@@ -151,7 +159,8 @@ ReactTable.propTypes = {
151
159
  customRowHoverStyles: _propTypes.default.func,
152
160
  customRowHoverContent: _propTypes.default.func,
153
161
  customRowStyles: _propTypes.default.func,
154
- customTableStyles: _propTypes.default.func
162
+ customTableStyles: _propTypes.default.func,
163
+ getRowDataCy: _propTypes.default.func // (rowData, rowIndex) => string
155
164
  };
156
165
  ReactTable.defaultProps = {
157
166
  blue: false,
@@ -69,7 +69,7 @@ const StyledTd = exports.StyledTd = _styledComponents.default.td.withConfig({
69
69
  const StyledTr = exports.StyledTr = _styledComponents.default.tr.withConfig({
70
70
  displayName: "Tablestyles__StyledTr",
71
71
  componentId: "sc-pdcd6r-14"
72
- })(["", " ", ""], props => props.customRowStyles && (0, _styledComponents.css)(["", ""], props.customRowStyles(props.rowIndex, props.rowData)), props => props.customRowHoverStyles && (0, _styledComponents.css)(["&:hover{", "}"], props.customRowHoverStyles(props.rowIndex, props.rowData)));
72
+ })(["", " ", ""], props => props.customRowStyles && (0, _styledComponents.css)(["", ""], props.customRowStyles(props.rowIndex, props.rowData)), props => props.customRowHoverStyles && (0, _styledComponents.css)(["&:hover,&:focus,&:active{", "}"], props.customRowHoverStyles(props.rowIndex, props.rowData)));
73
73
  const StyledReactTable = exports.StyledReactTable = _styledComponents.default.table.withConfig({
74
74
  displayName: "Tablestyles__StyledReactTable",
75
75
  componentId: "sc-pdcd6r-15"
@@ -54,7 +54,7 @@ const footerGroups = exports.footerGroups = [{
54
54
  url: "".concat(_globalVariables.platformURL, "/101")
55
55
  }, {
56
56
  name: 'Support',
57
- url: 'https://stokr.zendesk.com/',
57
+ url: 'https://support.stokr.io/',
58
58
  external: true
59
59
  }, {
60
60
  name: 'STOKE POST',
@@ -43,7 +43,7 @@ FooterMenu1.args = {
43
43
  }, */
44
44
  {
45
45
  name: 'Support',
46
- url: 'https://stokr.zendesk.com/',
46
+ url: 'https://support.stokr.io/',
47
47
  external: true
48
48
  }, {
49
49
  name: 'STOKE POST',
@@ -480,14 +480,22 @@ class HeaderHoClass extends _react.Component {
480
480
  this.switchOpenModal('signUp', 'confirm');
481
481
  this.setIsActionLoading(undefined);
482
482
  } catch (error) {
483
+ var _error$response;
483
484
  console.log(error);
485
+ let errorMessage = 'Oops, something went wrong';
486
+ if ((error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 429) {
487
+ var _error$response$data;
488
+ errorMessage = (_error$response$data = error.response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.message;
489
+ }
484
490
  this.setIsActionLoading(undefined);
485
491
  if ((error === null || error === void 0 ? void 0 : error.code) === 'auth/email-already-in-use') {
486
492
  this.setPopupError('register', 'This email address is already taken', 'email');
487
493
  } else if ((error === null || error === void 0 ? void 0 : error.code) === 'auth/weak-password') {
488
494
  this.setPopupError('register', 'The password is too weak. Please try again.', 'password');
495
+ } else if ((error === null || error === void 0 ? void 0 : error.code) === 'auth/error-code:-47') {
496
+ this.setPopupError('register', 'Too many signup attempts. Please try again later.');
489
497
  } else {
490
- this.setPopupError('register', 'Oops, something went wrong');
498
+ this.setPopupError('register', errorMessage);
491
499
  }
492
500
  }
493
501
  }
@@ -573,8 +581,14 @@ class HeaderHoClass extends _react.Component {
573
581
  this.setPopupSuccess('forgot', "We sent a message to ".concat(email, " (you might need to check your junk or spam folder) \u2014 tap the link inside to create a new password."));
574
582
  this.setIsActionLoading(undefined);
575
583
  } catch (error) {
584
+ var _error$response2;
576
585
  console.log(error);
577
- this.setPopupError('forgot', 'This email is not registered.');
586
+ let errorMessage = "Too many requests. Please try again later.";
587
+ if ((error === null || error === void 0 || (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status) === 429) {
588
+ var _error$response$data2;
589
+ errorMessage = (_error$response$data2 = error.response.data) === null || _error$response$data2 === void 0 ? void 0 : _error$response$data2.message;
590
+ }
591
+ this.setPopupError('forgot', errorMessage);
578
592
  this.setIsActionLoading(undefined);
579
593
  }
580
594
  }
@@ -52,6 +52,7 @@ const colors = exports.colors = {
52
52
  grey4: '#DCDCDC',
53
53
  midRed: '#e3210d',
54
54
  warningYellow: '#facc33',
55
- darkRed: '#D2200D'
55
+ darkRed: '#D2200D',
56
+ warningOrange: '#EB8003'
56
57
  };
57
58
  var _default = exports.default = colors;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.3.58-beta.9",
3
+ "version": "2.3.58",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "ajv": "^8.17.1",
34
- "axios": "^1.13.0",
34
+ "axios": "^0.30.2",
35
35
  "bignumber.js": "^9.1.1",
36
36
  "cross-env": "^10.1.0",
37
37
  "d3": "^7.8.3",