@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.esm.js CHANGED
@@ -24458,24 +24458,30 @@ 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>) => Boolean;
24461
+ (elements: Array<String>, Function) => undefined;
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
+
24466
24469
  The document query function will return the *first* element in the document that matches
24467
24470
  the string given.
24468
24471
 
24469
- A combination string of multiple selectors can also be provided, e.g.:
24472
+ A combination string of multiple selectors can also be provided as an item in the array, e.g.:
24470
24473
  ".alert-info, .alert-warning, .alert-error"
24471
24474
 
24472
24475
  This will return the first element that matches *any* of the provided selectors
24473
24476
 
24474
24477
  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
24475
24480
  */
24476
24481
 
24477
24482
  var useCheckElementsInViewport = function useCheckElementsInViewport() {
24478
24483
  var elements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
24484
+ var handler = arguments.length > 1 ? arguments[1] : undefined;
24479
24485
 
24480
24486
  var _useState = useState(false),
24481
24487
  _useState2 = _slicedToArray(_useState, 2),
@@ -24494,7 +24500,7 @@ var useCheckElementsInViewport = function useCheckElementsInViewport() {
24494
24500
  }
24495
24501
  });
24496
24502
  }, [elements]);
24497
- return elementsVisible;
24503
+ handler(elementsVisible);
24498
24504
  };
24499
24505
 
24500
24506
 
@@ -40322,6 +40328,8 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
40322
40328
  useOrderedList: useOrderedList,
40323
40329
  useUnorderedList: useUnorderedList
40324
40330
  }, repeat( /*#__PURE__*/React.createElement(Box, null), boxesBefore), tabs.map(function (t, i) {
40331
+ var _t$toLowerCase;
40332
+
40325
40333
  return /*#__PURE__*/React.createElement(Box, {
40326
40334
  key: t,
40327
40335
  borderSize: "3px",
@@ -40336,7 +40344,7 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
40336
40344
  color: themeValues.textColor,
40337
40345
  weight: FONT_WEIGHT_SEMIBOLD,
40338
40346
  extraStyles: "display: block; white-space: nowrap;",
40339
- id: "".concat(t, "-tab-text")
40347
+ 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")
40340
40348
  }, t));
40341
40349
  }), repeat( /*#__PURE__*/React.createElement(Box, null), boxesAfter))));
40342
40350
  };
@@ -45530,19 +45538,27 @@ var Module = function Module(_ref) {
45530
45538
  variant = _ref$variant === void 0 ? "default" : _ref$variant,
45531
45539
  fontSize = _ref.fontSize,
45532
45540
  as = _ref.as,
45541
+ _ref$titleID = _ref.titleID,
45542
+ titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
45543
+ rightTitleContent = _ref.rightTitleContent,
45533
45544
  children = _ref.children;
45534
45545
  var themedFontSize = variant === "small" ? "1.25rem" : variant === "default" ? "1.375rem" : "2rem";
45535
45546
  var computedFontSize = fontSize || themedFontSize;
45536
45547
  var themedElemType = variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
45537
45548
  var computedElemType = as || themedElemType;
45538
- return /*#__PURE__*/React.createElement(Fragment$1, null, heading && /*#__PURE__*/React.createElement(Title$1, {
45549
+ var headingText = /*#__PURE__*/React.createElement(Title$1, {
45539
45550
  weight: themeValues.fontWeight,
45540
45551
  color: themeValues.fontColor,
45541
45552
  margin: "".concat(spacing, " 0 ").concat(themeValues.titleSpacing, " 0"),
45542
45553
  textAlign: themeValues.textAlign,
45543
45554
  as: computedElemType,
45544
- extraStyles: "font-size: ".concat(computedFontSize, ";")
45545
- }, heading), /*#__PURE__*/React.createElement(Box, {
45555
+ extraStyles: "font-size: ".concat(computedFontSize, ";"),
45556
+ id: titleID
45557
+ }, heading);
45558
+ return /*#__PURE__*/React.createElement(Fragment$1, null, heading && !rightTitleContent && headingText, heading && rightTitleContent && /*#__PURE__*/React.createElement(Cluster, {
45559
+ justify: "center",
45560
+ align: "space-between"
45561
+ }, headingText, rightTitleContent), /*#__PURE__*/React.createElement(Box, {
45546
45562
  padding: "0 0 ".concat(spacingBottom)
45547
45563
  }, /*#__PURE__*/React.createElement(Box, {
45548
45564
  padding: padding,