@thecb/components 6.1.0-beta.7 → 6.1.2

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/index.esm.js CHANGED
@@ -6092,17 +6092,9 @@ var safeChildren = function safeChildren(children) {
6092
6092
 
6093
6093
  return unsafeValues.includes(children) ? replacement : children;
6094
6094
  };
6095
- var generateClickHandler = function generateClickHandler(form, handleErrors, submitForm, resetErrors) {
6095
+ var generateClickHandler = function generateClickHandler(form, handleErrors, submitForm) {
6096
6096
  return function (e) {
6097
6097
  e.preventDefault();
6098
-
6099
- if (resetErrors) {
6100
- console.log("reset errors", resetErrors); // if provided, will reset error state tracker
6101
- // allows hooks that depend on error state to re-run
6102
-
6103
- resetErrors(false);
6104
- }
6105
-
6106
6098
  var formHasError = Object.values(form.fields).reduce(function (acc, curr) {
6107
6099
  return acc || curr.hasErrors;
6108
6100
  }, false);
@@ -19169,7 +19161,9 @@ var Checkbox = function Checkbox(_ref4) {
19169
19161
  "aria-label": name,
19170
19162
  checked: checked,
19171
19163
  onChange: onChange,
19172
- tabIndex: "-1"
19164
+ tabIndex: "-1",
19165
+ "aria-invalid": error,
19166
+ "aria-describedby": "".concat(name, "-error-message")
19173
19167
  }), /*#__PURE__*/React.createElement(StyledCheckbox, {
19174
19168
  error: error,
19175
19169
  disabled: disabled,
@@ -43317,12 +43311,14 @@ var PeriscopeDashboardIframe = function PeriscopeDashboardIframe(_ref) {
43317
43311
  };
43318
43312
  useEffect$1(function () {
43319
43313
  time.timer = setTimeout(function () {
43320
- periscopeDataRequestFailure();
43314
+ if (!periscopeDataSuccess) {
43315
+ periscopeDataRequestFailure();
43316
+ }
43321
43317
  }, 10000);
43322
43318
  return function () {
43323
43319
  return clearTimeout(time.timer);
43324
43320
  };
43325
- }, []);
43321
+ }, [periscopeDataSuccess]);
43326
43322
 
43327
43323
  var Dashboard = function Dashboard(height) {
43328
43324
  return function (url) {
@@ -43657,18 +43653,15 @@ var index$4 = /*#__PURE__*/Object.freeze({
43657
43653
 
43658
43654
  var useFocusInvalidInput = function useFocusInvalidInput(hasErrors) {
43659
43655
  var resetHasErrors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
43660
- console.log("hey show errors", hasErrors); // Only move focus when "hasErrors" is true
43656
+ // Only move focus when "hasErrors" is true
43661
43657
  // "hasErrors" is managed by container page of form
43662
43658
  // typically set to "true" on attempted form submission, if errors exist
43663
-
43659
+ // Reset errors, if provided, resets the error state tracking in order to properly re-run
43664
43660
  useEffect$1(function () {
43665
- console.log("inside use effect show errors", hasErrors);
43666
-
43667
43661
  if (hasErrors) {
43668
43662
  var _inputsWithErrors$;
43669
43663
 
43670
43664
  var inputsWithErrors = document.querySelectorAll("input[aria-invalid=true]");
43671
- console.log("inputs with errors is", inputsWithErrors);
43672
43665
  inputsWithErrors === null || inputsWithErrors === void 0 ? void 0 : (_inputsWithErrors$ = inputsWithErrors[0]) === null || _inputsWithErrors$ === void 0 ? void 0 : _inputsWithErrors$.focus();
43673
43666
  }
43674
43667