@thecb/components 7.7.8-beta.4 → 7.7.8-beta.5

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
@@ -24458,14 +24458,11 @@ var useOutsideClickHook = function useOutsideClickHook(handler) {
24458
24458
  Hook that determines whether every element in an array of DOM selectors is fully present
24459
24459
  within the user's current viewport.
24460
24460
 
24461
- (elements: Array<String>, Function) => undefined;
24461
+ (elements: Array<String>) => Boolean;
24462
24462
 
24463
24463
  Takes an array of strings that correspond to DOM selectors. Examples:
24464
24464
  "#submit-button", ".module-small", "h2.alert-title"
24465
24465
 
24466
- Also takes a handler function (such as a useState updater) to receive the Boolean
24467
- that the hook generates
24468
-
24469
24466
  The document query function will return the *first* element in the document that matches
24470
24467
  the string given.
24471
24468
 
@@ -24475,13 +24472,10 @@ var useOutsideClickHook = function useOutsideClickHook(handler) {
24475
24472
  This will return the first element that matches *any* of the provided selectors
24476
24473
 
24477
24474
  If every element in the array is fully within the viewport, function returns true
24478
-
24479
- Calls the provided handler function with the Boolean result
24480
24475
  */
24481
24476
 
24482
24477
  var useCheckElementsInViewport = function useCheckElementsInViewport() {
24483
24478
  var elements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
24484
- var handler = arguments.length > 1 ? arguments[1] : undefined;
24485
24479
 
24486
24480
  var _useState = useState(false),
24487
24481
  _useState2 = _slicedToArray(_useState, 2),
@@ -24500,7 +24494,7 @@ var useCheckElementsInViewport = function useCheckElementsInViewport() {
24500
24494
  }
24501
24495
  });
24502
24496
  }, [elements, viewportWidth, viewportHeight]);
24503
- handler(elementsVisible);
24497
+ return elementsVisible;
24504
24498
  };
24505
24499
 
24506
24500