@thecb/components 7.7.8-beta.1 → 7.7.8-beta.3

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.cjs.js CHANGED
@@ -24466,24 +24466,30 @@ var useOutsideClickHook = function useOutsideClickHook(handler) {
24466
24466
  Hook that determines whether every element in an array of DOM selectors is fully present
24467
24467
  within the user's current viewport.
24468
24468
 
24469
- (elements: Array<String>) => Boolean;
24469
+ (elements: Array<String>, Function) => undefined;
24470
24470
 
24471
24471
  Takes an array of strings that correspond to DOM selectors. Examples:
24472
24472
  "#submit-button", ".module-small", "h2.alert-title"
24473
24473
 
24474
+ Also takes a handler function (such as a useState updater) to receive the Boolean
24475
+ that the hook generates
24476
+
24474
24477
  The document query function will return the *first* element in the document that matches
24475
24478
  the string given.
24476
24479
 
24477
- A combination string of multiple selectors can also be provided, e.g.:
24480
+ A combination string of multiple selectors can also be provided as an item in the array, e.g.:
24478
24481
  ".alert-info, .alert-warning, .alert-error"
24479
24482
 
24480
24483
  This will return the first element that matches *any* of the provided selectors
24481
24484
 
24482
24485
  If every element in the array is fully within the viewport, function returns true
24486
+
24487
+ Calls the provided handler function with the Boolean result
24483
24488
  */
24484
24489
 
24485
24490
  var useCheckElementsInViewport = function useCheckElementsInViewport() {
24486
24491
  var elements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
24492
+ var handler = arguments.length > 1 ? arguments[1] : undefined;
24487
24493
 
24488
24494
  var _useState = React.useState(false),
24489
24495
  _useState2 = _slicedToArray(_useState, 2),
@@ -24502,7 +24508,7 @@ var useCheckElementsInViewport = function useCheckElementsInViewport() {
24502
24508
  }
24503
24509
  });
24504
24510
  }, [elements]);
24505
- return elementsVisible;
24511
+ handler(elementsVisible);
24506
24512
  };
24507
24513
 
24508
24514
 
@@ -40330,6 +40336,8 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
40330
40336
  useOrderedList: useOrderedList,
40331
40337
  useUnorderedList: useUnorderedList
40332
40338
  }, repeat( /*#__PURE__*/React__default.createElement(Box, null), boxesBefore), tabs.map(function (t, i) {
40339
+ var _t$toLowerCase;
40340
+
40333
40341
  return /*#__PURE__*/React__default.createElement(Box, {
40334
40342
  key: t,
40335
40343
  borderSize: "3px",
@@ -40344,7 +40352,7 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
40344
40352
  color: themeValues.textColor,
40345
40353
  weight: FONT_WEIGHT_SEMIBOLD,
40346
40354
  extraStyles: "display: block; white-space: nowrap;",
40347
- id: "".concat(t, "-tab-text")
40355
+ id: "".concat(t === null || t === void 0 ? void 0 : (_t$toLowerCase = t.toLowerCase()) === null || _t$toLowerCase === void 0 ? void 0 : _t$toLowerCase.replace(/\s/g, "-"), "-tab-text")
40348
40356
  }, t));
40349
40357
  }), repeat( /*#__PURE__*/React__default.createElement(Box, null), boxesAfter))));
40350
40358
  };
@@ -45538,19 +45546,27 @@ var Module = function Module(_ref) {
45538
45546
  variant = _ref$variant === void 0 ? "default" : _ref$variant,
45539
45547
  fontSize = _ref.fontSize,
45540
45548
  as = _ref.as,
45549
+ _ref$titleID = _ref.titleID,
45550
+ titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
45551
+ rightTitleContent = _ref.rightTitleContent,
45541
45552
  children = _ref.children;
45542
45553
  var themedFontSize = variant === "small" ? "1.25rem" : variant === "default" ? "1.375rem" : "2rem";
45543
45554
  var computedFontSize = fontSize || themedFontSize;
45544
45555
  var themedElemType = variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
45545
45556
  var computedElemType = as || themedElemType;
45546
- return /*#__PURE__*/React__default.createElement(React.Fragment, null, heading && /*#__PURE__*/React__default.createElement(Title$1, {
45557
+ var headingText = /*#__PURE__*/React__default.createElement(Title$1, {
45547
45558
  weight: themeValues.fontWeight,
45548
45559
  color: themeValues.fontColor,
45549
45560
  margin: "".concat(spacing, " 0 ").concat(themeValues.titleSpacing, " 0"),
45550
45561
  textAlign: themeValues.textAlign,
45551
45562
  as: computedElemType,
45552
- extraStyles: "font-size: ".concat(computedFontSize, ";")
45553
- }, heading), /*#__PURE__*/React__default.createElement(Box, {
45563
+ extraStyles: "font-size: ".concat(computedFontSize, ";"),
45564
+ id: titleID
45565
+ }, heading);
45566
+ return /*#__PURE__*/React__default.createElement(React.Fragment, null, heading && !rightTitleContent && headingText, heading && rightTitleContent && /*#__PURE__*/React__default.createElement(Cluster, {
45567
+ justify: "center",
45568
+ align: "space-between"
45569
+ }, headingText, rightTitleContent), /*#__PURE__*/React__default.createElement(Box, {
45554
45570
  padding: "0 0 ".concat(spacingBottom)
45555
45571
  }, /*#__PURE__*/React__default.createElement(Box, {
45556
45572
  padding: padding,