@deque/cauldron-react 4.5.0-canary.0c764a21 → 4.5.0-canary.16adb900

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/lib/index.js CHANGED
@@ -279,19 +279,19 @@ var Icon = React.forwardRef(function (_a, ref) {
279
279
  if (process.env.NODE_ENV === 'test') {
280
280
  return;
281
281
  }
282
- __variableDynamicImportRuntime0__("./icons/" + name + ".svg")
282
+ __variableDynamicImportRuntime0__("./icons/".concat(name, ".svg"))
283
283
  .then(function (icon) {
284
284
  isMounted.current && setIcon(function () { return icon["default"]; });
285
285
  })["catch"](function () {
286
- console.error("Could not find icon type \"" + type + "\".");
286
+ console.error("Could not find icon type \"".concat(type, "\"."));
287
287
  isMounted.current && setIcon(null);
288
288
  });
289
289
  return function () {
290
290
  isMounted.current = false;
291
291
  };
292
292
  }, [type]);
293
- var data = tslib.__assign(tslib.__assign({}, other), { 'aria-hidden': !label, className: classNames('Icon', "Icon--" + type, className, (_b = {},
294
- _b["Icon__" + direction] = !!direction,
293
+ var data = tslib.__assign(tslib.__assign({}, other), { 'aria-hidden': !label, className: classNames('Icon', "Icon--".concat(type), className, (_b = {},
294
+ _b["Icon__".concat(direction)] = !!direction,
295
295
  _b)) });
296
296
  return (React__default.createElement("div", tslib.__assign({ ref: ref }, data),
297
297
  label && React__default.createElement(Offscreen, null, label),
@@ -364,7 +364,7 @@ var Scrim = /** @class */ (function (_super) {
364
364
  if (destroy) {
365
365
  return null;
366
366
  }
367
- return (React__default.createElement("div", { ref: function (el) { return (_this.el = el); }, className: "Scrim " + animationClass }));
367
+ return (React__default.createElement("div", { ref: function (el) { return (_this.el = el); }, className: "Scrim ".concat(animationClass) }));
368
368
  };
369
369
  Scrim.propTypes = {
370
370
  show: PropTypes.bool.isRequired
@@ -498,9 +498,9 @@ var TopBar = /** @class */ (function (_super) {
498
498
  args[_i] = arguments[_i];
499
499
  }
500
500
  // @ts-ignore we're just spreading the original args
501
- _this.onKeyDown.apply(_this, tslib.__spread(args));
501
+ _this.onKeyDown.apply(_this, tslib.__spreadArray([], tslib.__read(args), false));
502
502
  if (child.props.onKeyDown) {
503
- (_a = child.props).onKeyDown.apply(_a, tslib.__spread(args));
503
+ (_a = child.props).onKeyDown.apply(_a, tslib.__spreadArray([], tslib.__read(args), false));
504
504
  }
505
505
  },
506
506
  tabIndex: 0,
@@ -536,7 +536,7 @@ var TopBar = /** @class */ (function (_super) {
536
536
  };
537
537
  TopBar.prototype.onKeyDown = function (e) {
538
538
  var key = keyname(e.which);
539
- var menuItems = tslib.__spread(this.menuItems);
539
+ var menuItems = tslib.__spreadArray([], tslib.__read(this.menuItems), false);
540
540
  // account for hidden side bar trigger (hamburger)
541
541
  if (this.state.wide && this.props.hasTrigger) {
542
542
  menuItems.shift();
@@ -592,6 +592,7 @@ var TopBarTrigger = function (_a) {
592
592
  };
593
593
  TopBarTrigger.displayName = 'TopBarTrigger';
594
594
  TopBarTrigger.propTypes = {
595
+ // @ts-expect-error
595
596
  children: PropTypes.node.isRequired,
596
597
  className: PropTypes.string
597
598
  };
@@ -787,7 +788,7 @@ var OptionsMenuList = /** @class */ (function (_super) {
787
788
  /* eslint-enable @typescript-eslint/no-unused-vars */
788
789
  var items = React__default.Children.toArray(children).map(function (child, i) {
789
790
  var _a = child.props, className = _a.className, other = tslib.__rest(_a, ["className"]);
790
- return React__default.cloneElement(child, tslib.__assign({ key: "list-item-" + i, className: classNames('OptionsMenu__list-item', className), tabIndex: -1, role: 'menuitem', ref: function (el) { return (_this.itemRefs[i] = el); } }, other));
791
+ return React__default.cloneElement(child, tslib.__assign({ key: "list-item-".concat(i), className: classNames('OptionsMenu__list-item', className), tabIndex: -1, role: 'menuitem', ref: function (el) { return (_this.itemRefs[i] = el); } }, other));
791
792
  });
792
793
  // Key event is being handled in componentDidMount
793
794
  /* eslint-disable jsx-a11y/click-events-have-key-events */
@@ -1167,7 +1168,8 @@ var SideBar = /** @class */ (function (_super) {
1167
1168
  setTimeout(function () {
1168
1169
  var _a, _b;
1169
1170
  _this.setState({ animateClass: second });
1170
- var firstFocusable = show && ((_b = (_a = _this.navList) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.querySelector(focusableSelector));
1171
+ var firstFocusable = show &&
1172
+ ((_b = (_a = _this.navList) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.querySelector(focusableSelector));
1171
1173
  if (firstFocusable) {
1172
1174
  firstFocusable.focus();
1173
1175
  }
@@ -1216,6 +1218,7 @@ SideBarItem.defaultProps = {
1216
1218
  autoClickLink: true
1217
1219
  };
1218
1220
  SideBarItem.propTypes = {
1221
+ // @ts-expect-error
1219
1222
  children: PropTypes.node.isRequired,
1220
1223
  autoClickLink: PropTypes.bool
1221
1224
  };
@@ -1305,7 +1308,7 @@ var Dialog = /** @class */ (function (_super) {
1305
1308
  var close = !forceAction ? (React__default.createElement("button", { className: "Dialog__close", type: "button", onClick: this.close },
1306
1309
  React__default.createElement(Icon, { type: "close", "aria-hidden": "true" }),
1307
1310
  React__default.createElement(Offscreen, null, closeButtonText))) : null;
1308
- var Heading = "h" + (typeof heading === 'object' && 'level' in heading && !!heading.level
1311
+ var Heading = "h".concat(typeof heading === 'object' && 'level' in heading && !!heading.level
1309
1312
  ? heading.level
1310
1313
  : 2);
1311
1314
  var Dialog = (React__default.createElement(FocusTrap, { focusTrapOptions: {
@@ -1464,7 +1467,7 @@ var SkipLink = /** @class */ (function (_super) {
1464
1467
  target: function (props, propName, componentName) {
1465
1468
  var value = props[propName];
1466
1469
  if (!value || typeof value !== 'string' || value[0] !== '#') {
1467
- return new Error("Invalid prop " + propName + " supplied to " + componentName + " (must be string starting with \"#\")");
1470
+ return new Error("Invalid prop ".concat(propName, " supplied to ").concat(componentName, " (must be string starting with \"#\")"));
1468
1471
  }
1469
1472
  },
1470
1473
  skipText: PropTypes.string,
@@ -1609,8 +1612,8 @@ function Tooltip(_a) {
1609
1612
  targetElement === null || targetElement === void 0 ? void 0 : targetElement.setAttribute(association, [id, attrText].filter(Boolean).join(' '));
1610
1613
  }
1611
1614
  }, [targetElement, id]);
1612
- return (showTooltip || hideElementOnHidden) && isBrowser()
1613
- ? reactDom.createPortal(React__default.createElement("div", tslib.__assign({ id: id, className: classNames('Tooltip', "Tooltip--" + placement, className, {
1615
+ return (React__default.createElement(React__default.Fragment, null, (showTooltip || hideElementOnHidden) && isBrowser()
1616
+ ? reactDom.createPortal(React__default.createElement("div", tslib.__assign({ id: id, className: classNames('Tooltip', "Tooltip--".concat(placement), className, {
1614
1617
  TooltipInfo: variant === 'info',
1615
1618
  'Tooltip--hidden': !showTooltip && hideElementOnHidden,
1616
1619
  'Tooltip--big': variant === 'big'
@@ -1618,7 +1621,7 @@ function Tooltip(_a) {
1618
1621
  variant !== 'big' && (React__default.createElement("div", { className: "TooltipArrow", ref: setArrowElement, style: styles.arrow })),
1619
1622
  children), (portal && 'current' in portal ? portal.current : portal) ||
1620
1623
  document.body)
1621
- : null;
1624
+ : null));
1622
1625
  }
1623
1626
  Tooltip.displayName = 'Tooltip';
1624
1627
  Tooltip.propTypes = {
@@ -1681,6 +1684,7 @@ IconButton.propTypes = {
1681
1684
  as: PropTypes.elementType,
1682
1685
  // @ts-expect-error
1683
1686
  icon: PropTypes.string.isRequired,
1687
+ // @ts-expect-error
1684
1688
  label: PropTypes.node.isRequired,
1685
1689
  // @ts-expect-error
1686
1690
  tooltipPlacement: PropTypes.string,
@@ -1695,7 +1699,7 @@ IconButton.displayName = 'IconButton';
1695
1699
  var i = 0;
1696
1700
  var randomId = function () {
1697
1701
  var num = Math.floor(Math.random() * 10000) + 1;
1698
- return "x_" + i++ + "_" + num;
1702
+ return "x_".concat(i++, "_").concat(num);
1699
1703
  };
1700
1704
 
1701
1705
  /*
@@ -1790,16 +1794,15 @@ var Pointout = /** @class */ (function (_super) {
1790
1794
  visibleFocusable[elementIndex].classList.remove('Pointout--focus-active');
1791
1795
  };
1792
1796
  _this.positionRelativeToTarget = function () {
1793
- var _a, _b;
1794
- var _c = _this.props, target = _c.target, portal = _c.portal, arrowPosition = _c.arrowPosition, position = _c.position;
1797
+ var _a = _this.props, target = _a.target, portal = _a.portal, arrowPosition = _a.arrowPosition, position = _a.position;
1795
1798
  if (!target) {
1796
1799
  return;
1797
1800
  }
1798
- var targetNode = ((_a = target) === null || _a === void 0 ? void 0 : _a.current) ||
1801
+ var targetNode = (target === null || target === void 0 ? void 0 : target.current) ||
1799
1802
  target;
1800
- var portalNode = ((_b = portal) === null || _b === void 0 ? void 0 : _b.current) ||
1803
+ var portalNode = (portal === null || portal === void 0 ? void 0 : portal.current) ||
1801
1804
  portal;
1802
- var _d = targetNode.getBoundingClientRect(), top = _d.top, left = _d.left, width = _d.width, height = _d.height;
1805
+ var _b = targetNode.getBoundingClientRect(), top = _b.top, left = _b.left, width = _b.width, height = _b.height;
1803
1806
  if (portalNode && portalNode !== document.body) {
1804
1807
  // If the portal is not placed on document.body
1805
1808
  // position the FTPO relative to the portal
@@ -1807,48 +1810,48 @@ var Pointout = /** @class */ (function (_super) {
1807
1810
  top -= rect.top - portalNode.scrollTop;
1808
1811
  left -= rect.left - portalNode.scrollLeft;
1809
1812
  }
1810
- var _e = tslib.__read(arrowPosition.split('-'), 1), arrowBoxSide = _e[0];
1813
+ var _c = tslib.__read(arrowPosition.split('-'), 1), arrowBoxSide = _c[0];
1811
1814
  var style;
1812
1815
  switch (arrowBoxSide) {
1813
1816
  case 'right':
1814
1817
  style = {
1815
- left: left + "px",
1816
- top: (position === 'center'
1818
+ left: "".concat(left, "px"),
1819
+ top: "".concat(position === 'center'
1817
1820
  ? top + height / 2
1818
1821
  : position === 'start'
1819
1822
  ? top
1820
- : top + height) + "px"
1823
+ : top + height, "px")
1821
1824
  };
1822
1825
  break;
1823
1826
  case 'bottom':
1824
1827
  style = {
1825
- top: top + "px",
1826
- left: (position === 'center'
1828
+ top: "".concat(top, "px"),
1829
+ left: "".concat(position === 'center'
1827
1830
  ? left + width / 2
1828
1831
  : position === 'start'
1829
1832
  ? left
1830
- : left + width) + "px"
1833
+ : left + width, "px")
1831
1834
  };
1832
1835
  break;
1833
1836
  case 'left':
1834
1837
  style = {
1835
- left: left + width + "px",
1836
- top: (position === 'center'
1838
+ left: "".concat(left + width, "px"),
1839
+ top: "".concat(position === 'center'
1837
1840
  ? top + height / 2
1838
1841
  : position === 'start'
1839
1842
  ? top
1840
- : top + height) + "px"
1843
+ : top + height, "px")
1841
1844
  };
1842
1845
  break;
1843
1846
  case 'top':
1844
1847
  default:
1845
1848
  style = {
1846
- top: top + height + "px",
1847
- left: (position === 'center'
1849
+ top: "".concat(top + height, "px"),
1850
+ left: "".concat(position === 'center'
1848
1851
  ? left + width / 2
1849
1852
  : position === 'start'
1850
1853
  ? left
1851
- : left + width) + "px"
1854
+ : left + width, "px")
1852
1855
  };
1853
1856
  break;
1854
1857
  }
@@ -1860,7 +1863,7 @@ var Pointout = /** @class */ (function (_super) {
1860
1863
  }
1861
1864
  Pointout.prototype.getFocusableElements = function (root) {
1862
1865
  return root
1863
- ? Array.from(root.querySelectorAll(focusable + ", [data-focusable]"))
1866
+ ? Array.from(root.querySelectorAll("".concat(focusable, ", [data-focusable]")))
1864
1867
  : [];
1865
1868
  };
1866
1869
  Pointout.prototype.componentDidMount = function () {
@@ -1930,11 +1933,11 @@ var Pointout = /** @class */ (function (_super) {
1930
1933
  'Pointout--no-arrow': noArrow,
1931
1934
  'Pointout--auto': !!target
1932
1935
  },
1933
- _a["Pointout__arrow--" + arrowPosition] = !!arrowPosition && !noArrow,
1934
- _a["Pointout--" + position] = !!target,
1936
+ _a["Pointout__arrow--".concat(arrowPosition)] = !!arrowPosition && !noArrow,
1937
+ _a["Pointout--".concat(position)] = !!target,
1935
1938
  _a)), style: style, role: target ? undefined : 'region', "aria-labelledby": heading ? headingId : undefined, "aria-hidden": !!target && !disableOffscreenPointout, ref: function (el) { return (_this.visibleRef = el); } },
1936
1939
  noArrow ? null : (React__default.createElement("div", { className: classNames('Pointout__arrow', (_b = {},
1937
- _b["Pointout__arrow--" + arrowPosition] = !!arrowPosition && !noArrow,
1940
+ _b["Pointout__arrow--".concat(arrowPosition)] = !!arrowPosition && !noArrow,
1938
1941
  _b)) },
1939
1942
  React__default.createElement("div", { className: "Pointout__arrow-pointer" }))),
1940
1943
  React__default.createElement("div", { className: "Pointout__box" },
@@ -2115,7 +2118,7 @@ var Toast = /** @class */ (function (_super) {
2115
2118
  var scrim = type === 'action-needed' && show ? (React__default.createElement("div", { className: "Scrim--light Scrim--show Scrim--fade-in" })) : null;
2116
2119
  var defaultProps = {
2117
2120
  tabIndex: -1,
2118
- className: "Toast Toast--" + typeMap[type].className + " " + animationClass
2121
+ className: "Toast Toast--".concat(typeMap[type].className, " ").concat(animationClass)
2119
2122
  };
2120
2123
  if (!focus) {
2121
2124
  defaultProps.role = 'alert';
@@ -2301,9 +2304,10 @@ var Select = React__default.forwardRef(function (_a, ref) {
2301
2304
  'Field__select--disabled': disabled,
2302
2305
  'Field--has-error': !!error
2303
2306
  }) },
2304
- React__default.createElement("select", tslib.__assign({ ref: ref, id: selectId, disabled: disabled, required: required, onChange: handleChange }, dynamicProps, rest), (options === null || options === void 0 ? void 0 : options.length) ? options.map(function (option) {
2305
- return (React__default.createElement("option", { className: "Field__option", key: option.key, value: option.value, disabled: option.disabled }, option.label || option.value));
2306
- })
2307
+ React__default.createElement("select", tslib.__assign({ ref: ref, id: selectId, disabled: disabled, required: required, onChange: handleChange }, dynamicProps, rest), (options === null || options === void 0 ? void 0 : options.length)
2308
+ ? options.map(function (option) {
2309
+ return (React__default.createElement("option", { className: "Field__option", key: option.key, value: option.value, disabled: option.disabled }, option.label || option.value));
2310
+ })
2307
2311
  : children),
2308
2312
  React__default.createElement("div", { className: "arrow-down" })),
2309
2313
  error && (React__default.createElement("div", { id: errorId, className: "Error" }, error))));
@@ -2352,7 +2356,7 @@ var RadioGroup = function (_a) {
2352
2356
  var _a;
2353
2357
  handleChange(radioValue);
2354
2358
  onChange(radio, (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index]);
2355
- }, disabled: disabled, checked: isChecked, "aria-describedby": labelDescription ? id + "Desc" : undefined }, other)),
2359
+ }, disabled: disabled, checked: isChecked, "aria-describedby": labelDescription ? "".concat(id, "Desc") : undefined }, other)),
2356
2360
  React__default.createElement("label", { htmlFor: id, className: classNames('Field__label', {
2357
2361
  'Field__label--disabled': disabled
2358
2362
  }) }, label),
@@ -2360,7 +2364,7 @@ var RadioGroup = function (_a) {
2360
2364
  'Radio__overlay--focused': isFocused,
2361
2365
  'Radio__overlay--disabled': disabled
2362
2366
  }), type: isChecked ? 'radio-checked' : 'radio-unchecked', "aria-hidden": "true", onClick: function () { return onRadioClick(index); } }),
2363
- labelDescription && (React__default.createElement("span", { id: id + "Desc", className: classNames('Field__labelDescription', {
2367
+ labelDescription && (React__default.createElement("span", { id: "".concat(id, "Desc"), className: classNames('Field__labelDescription', {
2364
2368
  'Field__labelDescription--disabled': disabled
2365
2369
  }) }, labelDescription))));
2366
2370
  });
@@ -2380,7 +2384,7 @@ RadioGroup.propTypes = {
2380
2384
  })).isRequired,
2381
2385
  hasLabel: function (props, propName, componentName) {
2382
2386
  if (!props['aria-label'] && !props['aria-labelledby']) {
2383
- return new Error(componentName + " must have an \"aria-label\" or \"aria-labelledby\" prop");
2387
+ return new Error("".concat(componentName, " must have an \"aria-label\" or \"aria-labelledby\" prop"));
2384
2388
  }
2385
2389
  },
2386
2390
  className: PropTypes.string,
@@ -2389,6 +2393,125 @@ RadioGroup.propTypes = {
2389
2393
  };
2390
2394
  RadioGroup.displayName = 'RadioGroup';
2391
2395
 
2396
+ var Card = function (_a) {
2397
+ var className = _a.className, variant = _a.variant, other = tslib.__rest(_a, ["className", "variant"]);
2398
+ return (React__default.createElement("div", tslib.__assign({ className: classNames(className, {
2399
+ 'Card--simple': variant === 'simple',
2400
+ Card: !variant
2401
+ }) }, other)));
2402
+ };
2403
+ Card.displayName = 'Card';
2404
+ Card.propTypes = {
2405
+ className: PropTypes.string,
2406
+ variant: PropTypes.string
2407
+ };
2408
+
2409
+ var CardHeader = function (_a) {
2410
+ var className = _a.className, other = tslib.__rest(_a, ["className"]);
2411
+ return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__header', className) }, other)));
2412
+ };
2413
+ CardHeader.displayName = 'CardHeader';
2414
+ CardHeader.propTypes = {
2415
+ className: PropTypes.string
2416
+ };
2417
+
2418
+ var CardContent = function (_a) {
2419
+ var className = _a.className, other = tslib.__rest(_a, ["className"]);
2420
+ return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__content', className) }, other)));
2421
+ };
2422
+ CardContent.displayName = 'CardContent';
2423
+ CardContent.propTypes = {
2424
+ className: PropTypes.string
2425
+ };
2426
+
2427
+ var CardFooter = function (_a) {
2428
+ var className = _a.className, other = tslib.__rest(_a, ["className"]);
2429
+ return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__footer', className) }, other)));
2430
+ };
2431
+ CardFooter.displayName = 'CardFooter';
2432
+ CardFooter.propTypes = {
2433
+ className: PropTypes.string
2434
+ };
2435
+
2436
+ var RadioCardGroup = function (_a) {
2437
+ var name = _a.name, radios = _a.radios, defaultValue = _a.defaultValue, value = _a.value,
2438
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2439
+ _b = _a.onChange,
2440
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2441
+ onChange = _b === void 0 ? function () { } : _b, className = _a.className, other = tslib.__rest(_a, ["name", "radios", "defaultValue", "value", "onChange", "className"]);
2442
+ var _c = tslib.__read(React.useState(value !== null && value !== void 0 ? value : defaultValue), 2), currentValue = _c[0], setCurrentValue = _c[1];
2443
+ var _d = tslib.__read(React.useState(null), 2), focusIndex = _d[0], setFocusIndex = _d[1];
2444
+ var inputs = React.useRef([]);
2445
+ var handleChange = function (value) { return setCurrentValue(value); };
2446
+ var onRadioFocus = function (index) { return setFocusIndex(index); };
2447
+ var onRadioBlur = function () { return setFocusIndex(null); };
2448
+ var onRadioClick = function (index) {
2449
+ var _a;
2450
+ var radio = (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index];
2451
+ if (!radio) {
2452
+ return;
2453
+ }
2454
+ radio.click();
2455
+ radio.focus();
2456
+ };
2457
+ React.useEffect(function () {
2458
+ if (typeof value === 'undefined') {
2459
+ return;
2460
+ }
2461
+ setCurrentValue(value);
2462
+ }, [value]);
2463
+ var radioButtons = radios.map(function (radio, index) {
2464
+ var label = radio.label, disabled = radio.disabled, radioValue = radio.value, cardImg = radio.cardImg, cardIcon = radio.cardIcon, id = radio.id, className = radio.className, other = tslib.__rest(radio, ["label", "disabled", "value", "cardImg", "cardIcon", "id", "className"]);
2465
+ var isChecked = currentValue === radioValue;
2466
+ var isFocused = focusIndex === index;
2467
+ return (React__default.createElement("div", { className: classNames('RadioCard'), key: index },
2468
+ React__default.createElement(Card, { variant: "simple", className: classNames('RadioCardGroup__Card RadioCard__overlay', {
2469
+ 'RadioCard__overlay--focused': isFocused,
2470
+ 'RadioCard__overlay--checked': isChecked,
2471
+ 'RadioCard__overlay--disabled': disabled
2472
+ }), onClick: function () { return onRadioClick(index); } },
2473
+ React__default.createElement("input", tslib.__assign({ type: "radio", name: name, value: radioValue, id: id, ref: function (input) {
2474
+ if (!input) {
2475
+ return;
2476
+ }
2477
+ inputs.current.push(input);
2478
+ }, onFocus: function () { return onRadioFocus(index); }, onBlur: function () { return onRadioBlur(); }, onChange: function () {
2479
+ var _a;
2480
+ handleChange(radioValue);
2481
+ onChange(radio, (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index]);
2482
+ }, disabled: disabled, checked: isChecked }, other)),
2483
+ React__default.createElement(CardContent, null,
2484
+ React__default.createElement("div", { className: classNames('RadioCardGroup__Checked') }, isChecked && (React__default.createElement(Icon, { className: classNames('RadioCardGroup__Icon'), type: cardIcon }))),
2485
+ React__default.createElement("div", { className: classNames('RadioCardGroup__Base') },
2486
+ React__default.createElement("div", { className: classNames('RadioCardGroup__Image') }, cardImg),
2487
+ React__default.createElement("label", { htmlFor: id, className: classNames('RadioCardGroup__Label') }, label))))));
2488
+ });
2489
+ // reset the input refs array
2490
+ // refs get clobbered every re-render anyway and this supports "dynamic" radios
2491
+ // (changing the number of radio buttons for example)
2492
+ inputs.current = [];
2493
+ return (React__default.createElement("div", tslib.__assign({ className: classNames('RadioCardGroup'), role: "radiogroup" }, other), radioButtons));
2494
+ };
2495
+ RadioCardGroup.propTypes = {
2496
+ name: PropTypes.string,
2497
+ radios: PropTypes.arrayOf(PropTypes.shape({
2498
+ value: PropTypes.string.isRequired,
2499
+ id: PropTypes.string.isRequired,
2500
+ label: PropTypes.string.isRequired,
2501
+ cardImg: PropTypes.element.isRequired,
2502
+ cardIcon: PropTypes.string.isRequired
2503
+ })).isRequired,
2504
+ hasLabel: function (props, propName, componentName) {
2505
+ if (!props['aria-label'] && !props['aria-labelledby']) {
2506
+ return new Error("".concat(componentName, " must have an \"aria-label\" or \"aria-labelledby\" prop"));
2507
+ }
2508
+ },
2509
+ className: PropTypes.string,
2510
+ defaultValue: PropTypes.string,
2511
+ onChange: PropTypes.func
2512
+ };
2513
+ RadioCardGroup.displayName = 'RadioCardGroup';
2514
+
2392
2515
  var Checkbox = React.forwardRef(function (_a, ref) {
2393
2516
  var id = _a.id, label = _a.label, labelDescription = _a.labelDescription, error = _a.error, checkboxRef = _a.checkboxRef, className = _a.className, onChange = _a.onChange, ariaDescribedby = _a["aria-describedby"], _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.checked, checked = _c === void 0 ? false : _c, other = tslib.__rest(_a, ["id", "label", "labelDescription", "error", "checkboxRef", "className", "onChange", 'aria-describedby', "disabled", "checked"]);
2394
2517
  var _d = tslib.__read(React.useState(checked), 2), isChecked = _d[0], setIsChecked = _d[1];
@@ -2458,46 +2581,6 @@ function TooltipTabstop(_a) {
2458
2581
  }
2459
2582
  TooltipTabstop.displayName = 'TooltipTabstop';
2460
2583
 
2461
- var Card = function (_a) {
2462
- var className = _a.className, variant = _a.variant, other = tslib.__rest(_a, ["className", "variant"]);
2463
- return (React__default.createElement("div", tslib.__assign({ className: classNames(className, {
2464
- 'Card--simple': variant === 'simple',
2465
- Card: !variant
2466
- }) }, other)));
2467
- };
2468
- Card.displayName = 'Card';
2469
- Card.propTypes = {
2470
- className: PropTypes.string,
2471
- variant: PropTypes.string
2472
- };
2473
-
2474
- var CardHeader = function (_a) {
2475
- var className = _a.className, other = tslib.__rest(_a, ["className"]);
2476
- return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__header', className) }, other)));
2477
- };
2478
- CardHeader.displayName = 'CardHeader';
2479
- CardHeader.propTypes = {
2480
- className: PropTypes.string
2481
- };
2482
-
2483
- var CardContent = function (_a) {
2484
- var className = _a.className, other = tslib.__rest(_a, ["className"]);
2485
- return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__content', className) }, other)));
2486
- };
2487
- CardContent.displayName = 'CardContent';
2488
- CardContent.propTypes = {
2489
- className: PropTypes.string
2490
- };
2491
-
2492
- var CardFooter = function (_a) {
2493
- var className = _a.className, other = tslib.__rest(_a, ["className"]);
2494
- return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__footer', className) }, other)));
2495
- };
2496
- CardFooter.displayName = 'CardFooter';
2497
- CardFooter.propTypes = {
2498
- className: PropTypes.string
2499
- };
2500
-
2501
2584
  var TextField = /** @class */ (function (_super) {
2502
2585
  tslib.__extends(TextField, _super);
2503
2586
  function TextField(props) {
@@ -2650,7 +2733,7 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
2650
2733
  if (!_this.styleTag) {
2651
2734
  _this.styleTag = injectStyleTag();
2652
2735
  }
2653
- setStyle(_this.styleTag, "\n @keyframes expandOpenAnimation {\n 0% { opacity: 0; height: 0; }\n 100% { opacity: 1; height: " + rect.height + "px; }\n }\n\n .cauldron-expand-open {\n will-change: opacity, height;\n overflow: hidden;\n animation: expandOpenAnimation ease-in-out " + animationTiming + "ms forwards;\n }\n ");
2736
+ setStyle(_this.styleTag, "\n @keyframes expandOpenAnimation {\n 0% { opacity: 0; height: 0; }\n 100% { opacity: 1; height: ".concat(rect.height, "px; }\n }\n\n .cauldron-expand-open {\n will-change: opacity, height;\n overflow: hidden;\n animation: expandOpenAnimation ease-in-out ").concat(animationTiming, "ms forwards;\n }\n "));
2654
2737
  _this.setState({ animationClass: 'cauldron-expand-open' }, function () {
2655
2738
  setTimeout(function () {
2656
2739
  _this.setState({ animationClass: '', isAnimating: false });
@@ -2671,7 +2754,7 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
2671
2754
  var rect = panel === null || panel === void 0 ? void 0 : panel.getBoundingClientRect();
2672
2755
  if (!rect)
2673
2756
  return;
2674
- setStyle(_this.styleTag, "\n @keyframes collapseCloseAnimation {\n 0% { opacity: 1; height: " + rect.height + "px; }\n 100% { opacity: 0; height: 0; }\n }\n\n .cauldron-collapse-close {\n will-change: opacity, height;\n overflow: hidden;\n animation: collapseCloseAnimation ease-in-out " + animationTiming + "ms forwards;\n }\n ");
2757
+ setStyle(_this.styleTag, "\n @keyframes collapseCloseAnimation {\n 0% { opacity: 1; height: ".concat(rect.height, "px; }\n 100% { opacity: 0; height: 0; }\n }\n\n .cauldron-collapse-close {\n will-change: opacity, height;\n overflow: hidden;\n animation: collapseCloseAnimation ease-in-out ").concat(animationTiming, "ms forwards;\n }\n "));
2675
2758
  _this.setState({ animationClass: 'cauldron-collapse-close' }, function () {
2676
2759
  setTimeout(function () {
2677
2760
  _this.setState({ animationClass: '', isAnimating: false });
@@ -2839,27 +2922,6 @@ function _defineProperty(obj, key, value) {
2839
2922
 
2840
2923
  var defineProperty = _defineProperty;
2841
2924
 
2842
- function _objectSpread(target) {
2843
- for (var i = 1; i < arguments.length; i++) {
2844
- var source = arguments[i] != null ? Object(arguments[i]) : {};
2845
- var ownKeys = Object.keys(source);
2846
-
2847
- if (typeof Object.getOwnPropertySymbols === 'function') {
2848
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
2849
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
2850
- }));
2851
- }
2852
-
2853
- ownKeys.forEach(function (key) {
2854
- defineProperty(target, key, source[key]);
2855
- });
2856
- }
2857
-
2858
- return target;
2859
- }
2860
-
2861
- var objectSpread = _objectSpread;
2862
-
2863
2925
  function createCommonjsModule(fn, basedir, module) {
2864
2926
  return module = {
2865
2927
  path: basedir,
@@ -2896,6 +2958,9 @@ function _extends() {
2896
2958
  module.exports = _extends;
2897
2959
  });
2898
2960
 
2961
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2962
+
2963
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2899
2964
  //
2900
2965
  // Super simple, non-algorithmic solution since the
2901
2966
  // number of class names will not be greater than 4
@@ -2941,7 +3006,7 @@ function createStyleObject(classNames) {
2941
3006
  });
2942
3007
  var classNamesCombinations = getClassNameCombinations(nonTokenClassNames);
2943
3008
  return classNamesCombinations.reduce(function (styleObject, className) {
2944
- return objectSpread({}, styleObject, stylesheet[className]);
3009
+ return _objectSpread(_objectSpread({}, styleObject), stylesheet[className]);
2945
3010
  }, elementStyle);
2946
3011
  }
2947
3012
  function createClassNameString(classNames) {
@@ -2980,7 +3045,7 @@ function createElement(_ref) {
2980
3045
  var props;
2981
3046
 
2982
3047
  if (!useInlineStyles) {
2983
- props = objectSpread({}, properties, {
3048
+ props = _objectSpread(_objectSpread({}, properties), {}, {
2984
3049
  className: createClassNameString(properties.className)
2985
3050
  });
2986
3051
  } else {
@@ -2995,14 +3060,14 @@ function createElement(_ref) {
2995
3060
  var className = properties.className && startingClassName.concat(properties.className.filter(function (className) {
2996
3061
  return !allStylesheetSelectors.includes(className);
2997
3062
  }));
2998
- props = objectSpread({}, properties, {
3063
+ props = _objectSpread(_objectSpread({}, properties), {}, {
2999
3064
  className: createClassNameString(className) || undefined,
3000
3065
  style: createStyleObject(properties.className, Object.assign({}, properties.style, style), stylesheet)
3001
3066
  });
3002
3067
  }
3003
3068
 
3004
3069
  var children = childrenCreator(node.children);
3005
- return React__default.createElement(TagName, _extends_1({
3070
+ return /*#__PURE__*/React__default.createElement(TagName, _extends_1({
3006
3071
  key: key
3007
3072
  }, props), children);
3008
3073
  }
@@ -3013,6 +3078,11 @@ var checkForListedLanguage = (function (astGenerator, language) {
3013
3078
  return langs.indexOf(language) !== -1;
3014
3079
  });
3015
3080
 
3081
+ var _excluded = ["language", "children", "style", "customStyle", "codeTagProps", "useInlineStyles", "showLineNumbers", "showInlineLineNumbers", "startingLineNumber", "lineNumberContainerStyle", "lineNumberStyle", "wrapLines", "wrapLongLines", "lineProps", "renderer", "PreTag", "CodeTag", "code", "astGenerator"];
3082
+
3083
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3084
+
3085
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3016
3086
  var newLineRegex = /\n/g;
3017
3087
 
3018
3088
  function getNewLines(str) {
@@ -3025,7 +3095,7 @@ function getAllLineNumbers(_ref) {
3025
3095
  style = _ref.style;
3026
3096
  return lines.map(function (_, i) {
3027
3097
  var number = i + startingLineNumber;
3028
- return React__default.createElement("span", {
3098
+ return /*#__PURE__*/React__default.createElement("span", {
3029
3099
  key: "line-".concat(i),
3030
3100
  className: "react-syntax-highlighter-line-number",
3031
3101
  style: typeof style === 'function' ? style(number) : style
@@ -3038,13 +3108,13 @@ function AllLineNumbers(_ref2) {
3038
3108
  codeStyle = _ref2.codeStyle,
3039
3109
  _ref2$containerStyle = _ref2.containerStyle,
3040
3110
  containerStyle = _ref2$containerStyle === void 0 ? {
3041
- float: 'left',
3111
+ "float": 'left',
3042
3112
  paddingRight: '10px'
3043
3113
  } : _ref2$containerStyle,
3044
3114
  _ref2$numberStyle = _ref2.numberStyle,
3045
3115
  numberStyle = _ref2$numberStyle === void 0 ? {} : _ref2$numberStyle,
3046
3116
  startingLineNumber = _ref2.startingLineNumber;
3047
- return React__default.createElement("code", {
3117
+ return /*#__PURE__*/React__default.createElement("code", {
3048
3118
  style: Object.assign({}, codeStyle, containerStyle)
3049
3119
  }, getAllLineNumbers({
3050
3120
  lines: codeString.replace(/\n$/, '').split('\n'),
@@ -3085,7 +3155,7 @@ function assembleLineNumberStyles(lineNumberStyle, lineNumber, largestLineNumber
3085
3155
 
3086
3156
  var customLineNumberStyle = typeof lineNumberStyle === 'function' ? lineNumberStyle(lineNumber) : lineNumberStyle; // combine
3087
3157
 
3088
- var assembledStyle = objectSpread({}, defaultLineNumberStyle, customLineNumberStyle);
3158
+ var assembledStyle = _objectSpread$1(_objectSpread$1({}, defaultLineNumberStyle), customLineNumberStyle);
3089
3159
 
3090
3160
  return assembledStyle;
3091
3161
  }
@@ -3111,7 +3181,7 @@ function createLineElement(_ref3) {
3111
3181
  }
3112
3182
 
3113
3183
  if (wrapLongLines & showLineNumbers) {
3114
- properties.style = objectSpread({}, properties.style, {
3184
+ properties.style = _objectSpread$1(_objectSpread$1({}, properties.style), {}, {
3115
3185
  display: 'flex'
3116
3186
  });
3117
3187
  }
@@ -3138,7 +3208,9 @@ function flattenCodeTree(tree) {
3138
3208
  }));
3139
3209
  } else if (node.children) {
3140
3210
  var classNames = className.concat(node.properties.className);
3141
- newTree = newTree.concat(flattenCodeTree(node.children, classNames));
3211
+ flattenCodeTree(node.children, classNames).forEach(function (i) {
3212
+ return newTree.push(i);
3213
+ });
3142
3214
  }
3143
3215
  }
3144
3216
 
@@ -3207,19 +3279,19 @@ function processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlin
3207
3279
  newTree.push(_line); // if it's the last line
3208
3280
  } else if (i === splitValue.length - 1) {
3209
3281
  var stringChild = tree[index + 1] && tree[index + 1].children && tree[index + 1].children[0];
3282
+ var lastLineInPreviousSpan = {
3283
+ type: 'text',
3284
+ value: "".concat(text)
3285
+ };
3210
3286
 
3211
3287
  if (stringChild) {
3212
- var lastLineInPreviousSpan = {
3213
- type: 'text',
3214
- value: "".concat(text)
3215
- };
3216
3288
  var newElem = createLineElement({
3217
3289
  children: [lastLineInPreviousSpan],
3218
3290
  className: node.properties.className
3219
3291
  });
3220
3292
  tree.splice(index + 1, 0, newElem);
3221
3293
  } else {
3222
- var _children2 = [newChild];
3294
+ var _children2 = [lastLineInPreviousSpan];
3223
3295
 
3224
3296
  var _line2 = createLine(_children2, lineNumber, node.properties.className);
3225
3297
 
@@ -3325,7 +3397,7 @@ function highlight (defaultAstGenerator, defaultStyle) {
3325
3397
  _ref7$codeTagProps = _ref7.codeTagProps,
3326
3398
  codeTagProps = _ref7$codeTagProps === void 0 ? {
3327
3399
  className: language ? "language-".concat(language) : undefined,
3328
- style: objectSpread({}, style['code[class*="language-"]'], style["code[class*=\"language-".concat(language, "\"]")])
3400
+ style: _objectSpread$1(_objectSpread$1({}, style['code[class*="language-"]']), style["code[class*=\"language-".concat(language, "\"]")])
3329
3401
  } : _ref7$codeTagProps,
3330
3402
  _ref7$useInlineStyles = _ref7.useInlineStyles,
3331
3403
  useInlineStyles = _ref7$useInlineStyles === void 0 ? true : _ref7$useInlineStyles,
@@ -3349,12 +3421,12 @@ function highlight (defaultAstGenerator, defaultStyle) {
3349
3421
  _ref7$CodeTag = _ref7.CodeTag,
3350
3422
  CodeTag = _ref7$CodeTag === void 0 ? 'code' : _ref7$CodeTag,
3351
3423
  _ref7$code = _ref7.code,
3352
- code = _ref7$code === void 0 ? Array.isArray(children) ? children[0] : children : _ref7$code,
3424
+ code = _ref7$code === void 0 ? (Array.isArray(children) ? children[0] : children) || '' : _ref7$code,
3353
3425
  astGenerator = _ref7.astGenerator,
3354
- rest = objectWithoutProperties(_ref7, ["language", "children", "style", "customStyle", "codeTagProps", "useInlineStyles", "showLineNumbers", "showInlineLineNumbers", "startingLineNumber", "lineNumberContainerStyle", "lineNumberStyle", "wrapLines", "wrapLongLines", "lineProps", "renderer", "PreTag", "CodeTag", "code", "astGenerator"]);
3426
+ rest = objectWithoutProperties(_ref7, _excluded);
3355
3427
 
3356
3428
  astGenerator = astGenerator || defaultAstGenerator;
3357
- var allLineNumbers = showLineNumbers ? React__default.createElement(AllLineNumbers, {
3429
+ var allLineNumbers = showLineNumbers ? /*#__PURE__*/React__default.createElement(AllLineNumbers, {
3358
3430
  containerStyle: lineNumberContainerStyle,
3359
3431
  codeStyle: codeTagProps.style || {},
3360
3432
  numberStyle: lineNumberStyle,
@@ -3372,8 +3444,18 @@ function highlight (defaultAstGenerator, defaultStyle) {
3372
3444
  style: Object.assign({}, customStyle)
3373
3445
  });
3374
3446
 
3447
+ if (wrapLongLines) {
3448
+ codeTagProps.style = _objectSpread$1(_objectSpread$1({}, codeTagProps.style), {}, {
3449
+ whiteSpace: 'pre-wrap'
3450
+ });
3451
+ } else {
3452
+ codeTagProps.style = _objectSpread$1(_objectSpread$1({}, codeTagProps.style), {}, {
3453
+ whiteSpace: 'pre'
3454
+ });
3455
+ }
3456
+
3375
3457
  if (!astGenerator) {
3376
- return React__default.createElement(PreTag, preProps, allLineNumbers, React__default.createElement(CodeTag, codeTagProps, code));
3458
+ return /*#__PURE__*/React__default.createElement(PreTag, preProps, allLineNumbers, /*#__PURE__*/React__default.createElement(CodeTag, codeTagProps, code));
3377
3459
  }
3378
3460
  /*
3379
3461
  * Some custom renderers rely on individual row elements so we need to turn wrapLines on
@@ -3401,18 +3483,7 @@ function highlight (defaultAstGenerator, defaultStyle) {
3401
3483
 
3402
3484
  var largestLineNumber = codeTree.value.length + startingLineNumber;
3403
3485
  var rows = processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlineLineNumbers, startingLineNumber, largestLineNumber, lineNumberStyle, wrapLongLines);
3404
-
3405
- if (wrapLongLines) {
3406
- codeTagProps.style = objectSpread({}, codeTagProps.style, {
3407
- whiteSpace: 'pre-wrap'
3408
- });
3409
- } else {
3410
- codeTagProps.style = objectSpread({}, codeTagProps.style, {
3411
- whiteSpace: 'pre'
3412
- });
3413
- }
3414
-
3415
- return React__default.createElement(PreTag, preProps, React__default.createElement(CodeTag, codeTagProps, !showInlineLineNumbers && allLineNumbers, renderer({
3486
+ return /*#__PURE__*/React__default.createElement(PreTag, preProps, /*#__PURE__*/React__default.createElement(CodeTag, codeTagProps, !showInlineLineNumbers && allLineNumbers, renderer({
3416
3487
  rows: rows,
3417
3488
  stylesheet: style,
3418
3489
  useInlineStyles: useInlineStyles
@@ -7977,15 +8048,19 @@ SyntaxHighlighter.registerLanguage('javascript', javascript_1);
7977
8048
  SyntaxHighlighter.registerLanguage('css', css_1);
7978
8049
  SyntaxHighlighter.registerLanguage('html', xml_1);
7979
8050
  SyntaxHighlighter.registerLanguage('yaml', yaml_1);
8051
+ // HACK: This is a workaround for a bug in react-syntax-highlighter's types.
8052
+ var Highlighter = SyntaxHighlighter;
7980
8053
  var Code = function (_a) {
7981
8054
  var children = _a.children, className = _a.className, tabIndex = _a.tabIndex, props = tslib.__rest(_a, ["children", "className", "tabIndex"]);
7982
- return (React__default.createElement(SyntaxHighlighter, tslib.__assign({}, props, { useInlineStyles: false, className: classNames('Code', className), tabIndex: tabIndex }), children));
8055
+ return (React__default.createElement(React__default.Fragment, null,
8056
+ React__default.createElement(Highlighter, tslib.__assign({}, props, { useInlineStyles: false, className: classNames('Code', className), tabIndex: tabIndex }), children)));
7983
8057
  };
7984
8058
  Code.displayName = 'Code';
7985
8059
  Code.propTypes = {
7986
8060
  children: PropTypes.string.isRequired,
7987
8061
  language: PropTypes.oneOf(['javascript', 'css', 'html', 'yaml']),
7988
- className: PropTypes.string
8062
+ className: PropTypes.string,
8063
+ tabIndex: PropTypes.number
7989
8064
  };
7990
8065
 
7991
8066
  function AxeLoader() {
@@ -8064,6 +8139,7 @@ LoaderOverlay.propTypes = {
8064
8139
  variant: PropTypes.oneOf(['large', 'small']),
8065
8140
  label: PropTypes.string,
8066
8141
  focusOnInitialRender: PropTypes.bool,
8142
+ // @ts-expect-error
8067
8143
  children: PropTypes.node
8068
8144
  };
8069
8145
  LoaderOverlay.displayName = 'LoaderOverlay';
@@ -8183,6 +8259,7 @@ Tab.displayName = 'Tab';
8183
8259
  Tab.propTypes = {
8184
8260
  target: PropTypes.any.isRequired,
8185
8261
  id: PropTypes.string,
8262
+ // @ts-expect-error
8186
8263
  children: PropTypes.node
8187
8264
  };
8188
8265
 
@@ -8277,7 +8354,8 @@ var Tabs = function (_a) {
8277
8354
  React.useEffect(function () {
8278
8355
  var _a, _b;
8279
8356
  index === activeIndex
8280
- ? (_a = target.current) === null || _a === void 0 ? void 0 : _a.classList.remove('TabPanel--hidden') : (_b = target.current) === null || _b === void 0 ? void 0 : _b.classList.add('TabPanel--hidden');
8357
+ ? (_a = target.current) === null || _a === void 0 ? void 0 : _a.classList.remove('TabPanel--hidden')
8358
+ : (_b = target.current) === null || _b === void 0 ? void 0 : _b.classList.add('TabPanel--hidden');
8281
8359
  }, [activeIndex]);
8282
8360
  var config = tslib.__assign((_a = { id: id, className: classNames('Tab', {
8283
8361
  'Tab--active': selected
@@ -8317,6 +8395,7 @@ var TabPanel = React.forwardRef(function (_a, ref) {
8317
8395
  TabPanel.displayName = 'TabPanel';
8318
8396
  TabPanel.propTypes = {
8319
8397
  id: PropTypes.string,
8398
+ // @ts-expect-error
8320
8399
  children: PropTypes.node,
8321
8400
  className: PropTypes.string
8322
8401
  };
@@ -8363,12 +8442,12 @@ var Step = function (props) {
8363
8442
  var liProps;
8364
8443
  var isTooltip = isTooltipProps(other);
8365
8444
  if (isTooltip) {
8366
- (_a = other, (tooltip = _a.tooltip, tooltipText = _a.tooltipText, _a), liProps = tslib.__rest(_a, ["tooltip", "tooltipText"]));
8445
+ (_a = other, (tooltip = _a.tooltip, tooltipText = _a.tooltipText), liProps = tslib.__rest(_a, ["tooltip", "tooltipText"]));
8367
8446
  }
8368
8447
  else {
8369
8448
  liProps = other;
8370
8449
  }
8371
- return (React__default.createElement("li", tslib.__assign({ className: classNames('Stepper__step', "Stepper__step--" + status, className), "aria-current": status === 'current' ? 'step' : 'false' }, liProps),
8450
+ return (React__default.createElement("li", tslib.__assign({ className: classNames('Stepper__step', "Stepper__step--".concat(status), className), "aria-current": status === 'current' ? 'step' : 'false' }, liProps),
8372
8451
  React__default.createElement("div", { className: "Stepper__step-line" }),
8373
8452
  React__default.createElement("div", { className: "Stepper__step-content" }, isTooltip ? (React__default.createElement(TooltipTabstop, { placement: "bottom", tooltip: tooltip,
8374
8453
  // the pseudo content (ex: "1") is conveyed
@@ -8410,7 +8489,7 @@ var Panel = React.forwardRef(function (_a, ref) {
8410
8489
  if (!headingId) {
8411
8490
  return null;
8412
8491
  }
8413
- var HeadingComponent = "h" + (heading &&
8492
+ var HeadingComponent = "h".concat(heading &&
8414
8493
  typeof heading === 'object' &&
8415
8494
  'level' in heading &&
8416
8495
  !!heading.level
@@ -8428,7 +8507,9 @@ var Panel = React.forwardRef(function (_a, ref) {
8428
8507
  });
8429
8508
  Panel.displayName = 'Panel';
8430
8509
  Panel.propTypes = {
8510
+ // @ts-expect-error
8431
8511
  children: PropTypes.node.isRequired,
8512
+ // @ts-expect-error
8432
8513
  heading: PropTypes.oneOfType([PropTypes.object, PropTypes.node]),
8433
8514
  className: PropTypes.string
8434
8515
  };
@@ -8438,7 +8519,7 @@ var IssuePanel = function (_a) {
8438
8519
  return (React__default.createElement("div", { className: classNames('IssuePanel', className) },
8439
8520
  React__default.createElement("div", { className: "IssuePanel__Header" },
8440
8521
  title && React__default.createElement("div", { className: "IssuePanel__Header-title" }, title),
8441
- actions && React__default.createElement("div", { className: "IssuePanel__Header-actions" }, actions)),
8522
+ actions && (React__default.createElement("div", { className: "IssuePanel__Header-actions" }, actions))),
8442
8523
  React__default.createElement("div", { className: "IssuePanel__Content" }, children)));
8443
8524
  };
8444
8525
  IssuePanel.displayName = 'IssuePanel';
@@ -8451,7 +8532,7 @@ var ProgressBar = React.forwardRef(function (_a, ref) {
8451
8532
  var _b = _a.progress, progress = _b === void 0 ? 0 : _b, _c = _a.progressMax, progressMax = _c === void 0 ? 100 : _c, _d = _a.progressMin, progressMin = _d === void 0 ? 0 : _d, props = tslib.__rest(_a, ["progress", "progressMax", "progressMin"]);
8452
8533
  var className = props.className, otherProps = tslib.__rest(props, ["className"]);
8453
8534
  return (React__default.createElement("div", tslib.__assign({ className: classNames('ProgressBar', className), role: "progressbar", "aria-valuemin": progressMin, "aria-valuemax": progressMax, "aria-valuenow": progress, ref: ref }, otherProps),
8454
- React__default.createElement("div", { className: "ProgressBar--fill", style: { width: Math.min((progress / progressMax) * 100, 100) + "%" } })));
8535
+ React__default.createElement("div", { className: "ProgressBar--fill", style: { width: "".concat(Math.min((progress / progressMax) * 100, 100), "%") } })));
8455
8536
  });
8456
8537
  ProgressBar.displayName = 'ProgressBar';
8457
8538
 
@@ -8532,12 +8613,41 @@ Pagination.propTypes = {
8532
8613
  className: PropTypes.string
8533
8614
  };
8534
8615
 
8616
+ var usePagination = function (_a) {
8617
+ var totalItems = _a.totalItems, _b = _a.initialPageSize, initialPageSize = _b === void 0 ? 10 : _b, _c = _a.initialPage, initialPage = _c === void 0 ? 1 : _c;
8618
+ var _d = tslib.__read(React.useState(initialPage), 2), currentPage = _d[0], setCurrentPage = _d[1];
8619
+ var pageStart = currentPage * initialPageSize - initialPageSize + 1;
8620
+ var pageEnd = Math.min(pageStart + initialPageSize - 1, totalItems);
8621
+ var onFirstPageClick = function () { return setCurrentPage(1); };
8622
+ var onPreviousPageClick = function () { return setCurrentPage(currentPage - 1); };
8623
+ var onNextPageClick = function () { return setCurrentPage(currentPage + 1); };
8624
+ var onLastPageClick = function () {
8625
+ return setCurrentPage(Math.ceil(totalItems / initialPageSize));
8626
+ };
8627
+ var pagination = {
8628
+ totalItems: totalItems,
8629
+ currentPage: currentPage,
8630
+ itemsPerPage: initialPageSize,
8631
+ onFirstPageClick: onFirstPageClick,
8632
+ onPreviousPageClick: onPreviousPageClick,
8633
+ onNextPageClick: onNextPageClick,
8634
+ onLastPageClick: onLastPageClick
8635
+ };
8636
+ var pageStatus = {
8637
+ currentPage: currentPage,
8638
+ pageStart: pageStart,
8639
+ pageEnd: pageEnd
8640
+ };
8641
+ return { pagination: pagination, pageStatus: pageStatus };
8642
+ };
8643
+
8535
8644
  var FieldWrap = React__default.forwardRef(function (_a, ref) {
8536
8645
  var children = _a.children, className = _a.className, _b = _a.as, Component = _b === void 0 ? 'div' : _b, props = tslib.__rest(_a, ["children", "className", "as"]);
8537
8646
  return (React__default.createElement(Component, tslib.__assign({ ref: ref, className: classNames('Panel', className) }, props), children));
8538
8647
  });
8539
8648
  FieldWrap.displayName = 'FieldWrap';
8540
8649
  FieldWrap.propTypes = {
8650
+ // @ts-expect-error
8541
8651
  children: PropTypes.node.isRequired,
8542
8652
  className: PropTypes.string,
8543
8653
  as: PropTypes.string
@@ -8558,7 +8668,7 @@ var Breadcrumb = React.forwardRef(function (_a, ref) {
8558
8668
  }
8559
8669
  });
8560
8670
  return (React__default.createElement("nav", tslib.__assign({ className: classNames('Breadcrumb', className), ref: ref }, props),
8561
- React__default.createElement("ol", null, childrenWithSeparators.map(function (child, index) { return (React__default.createElement("li", { className: "Breadcrumb__Item", key: "breadcrumb-" + index }, child)); }))));
8671
+ React__default.createElement("ol", null, childrenWithSeparators.map(function (child, index) { return (React__default.createElement("li", { className: "Breadcrumb__Item", key: "breadcrumb-".concat(index) }, child)); }))));
8562
8672
  });
8563
8673
  Breadcrumb.displayName = 'Breadcrumb';
8564
8674
 
@@ -8589,6 +8699,11 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8589
8699
  var _f = tslib.__read(React.useState(initialCollapsed), 2), isCollapsed = _f[0], setCollapsed = _f[1];
8590
8700
  var _g = tslib.__read(React.useState(false), 2), isFocusTrap = _g[0], setIsFocusTrap = _g[1];
8591
8701
  var _h = tslib.__read(React.useState(!initialCollapsed), 2), showPanel = _h[0], setShowPanel = _h[1];
8702
+ var toggleButtonRef = React.useRef(null);
8703
+ var closeButtonRef = React.useRef(null);
8704
+ var columnLeftRef = React.useRef(null);
8705
+ var columnRightRef = React.useRef(null);
8706
+ var columnLeft = React__default.Children.toArray(children).find(function (child) { return child.type === ColumnLeft; });
8592
8707
  var togglePanel = function () {
8593
8708
  if (isCollapsed) {
8594
8709
  setShowPanel(true);
@@ -8606,11 +8721,6 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8606
8721
  }
8607
8722
  });
8608
8723
  };
8609
- var toggleButtonRef = React.useRef(null);
8610
- var closeButtonRef = React.useRef(null);
8611
- var columnLeftRef = React.useRef(null);
8612
- var columnRightRef = React.useRef(null);
8613
- var columnLeft = React__default.Children.toArray(children).find(function (child) { return child.type === ColumnLeft; });
8614
8724
  // The ColumnLeftComponent will end up being a focus trap when < 720px
8615
8725
  // This component also gets unmounted when not visible meaning that any
8616
8726
  // aria relationships cannot be set to items inside the component since
@@ -8625,11 +8735,11 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8625
8735
  React__default.createElement("button", { type: "button", onClick: togglePanel, ref: closeButtonRef, "aria-label": hideCollapsedPanelLabel },
8626
8736
  React__default.createElement(Icon, { type: "close" })),
8627
8737
  React__default.createElement(Tooltip, { target: closeButtonRef, association: "aria-labelledby", hideElementOnHidden: true }, hideCollapsedPanelLabel)));
8628
- var children_1 = tslib.__spread([
8738
+ var children_1 = tslib.__spreadArray([
8629
8739
  CloseButton
8630
- ], React__default.Children.toArray(columnLeft.props.children));
8740
+ ], tslib.__read(React__default.Children.toArray(columnLeft.props.children)), false);
8631
8741
  ColumnLeftComponent = React.cloneElement(columnLeft, { id: id, ref: ref_1, tabIndex: -1 }, children_1.map(function (child, index) {
8632
- return React.cloneElement(child, { key: "left-" + index });
8742
+ return React.cloneElement(child, { key: "left-".concat(index) });
8633
8743
  }));
8634
8744
  }
8635
8745
  var columnRight = React__default.Children.toArray(children).find(function (child) { return child.type === ColumnRight; });
@@ -8640,11 +8750,11 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8640
8750
  React__default.createElement("button", { type: "button", onClick: togglePanel, ref: toggleButtonRef, "aria-label": !isCollapsed ? hideCollapsedPanelLabel : showCollapsedPanelLabel, "aria-expanded": !isCollapsed, "aria-controls": columnLeftId },
8641
8751
  React__default.createElement(Icon, { type: !isCollapsed ? 'chevron-double-left' : 'chevron-double-right' })),
8642
8752
  React__default.createElement(Tooltip, { target: toggleButtonRef, association: "aria-labelledby", hideElementOnHidden: true }, !isCollapsed ? hideCollapsedPanelLabel : showCollapsedPanelLabel)));
8643
- var children_2 = tslib.__spread([
8753
+ var children_2 = tslib.__spreadArray([
8644
8754
  ToggleButton
8645
- ], React__default.Children.toArray(columnRight.props.children));
8755
+ ], tslib.__read(React__default.Children.toArray(columnRight.props.children)), false);
8646
8756
  ColumnRightComponent = React.cloneElement(columnRight, { ref: ref_2, tabIndex: -1 }, children_2.map(function (child, index) {
8647
- return React.cloneElement(child, { key: "right-" + index });
8757
+ return React.cloneElement(child, { key: "right-".concat(index) });
8648
8758
  }));
8649
8759
  }
8650
8760
  React.useLayoutEffect(function () {
@@ -8709,15 +8819,16 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8709
8819
  'TwoColumnPanel--show': !isCollapsed,
8710
8820
  'TwoColumnPanel--hide': isCollapsed
8711
8821
  }) }, props, { ref: ref }),
8712
- React__default.createElement(FocusTrap, { active: !isCollapsed && isFocusTrap, focusTrapOptions: {
8713
- escapeDeactivates: true,
8714
- allowOutsideClick: true,
8715
- fallbackFocus: columnLeftRef.current
8716
- }, containerElements: [columnLeftRef.current] }),
8717
- React__default.createElement(ClickOutsideListener, { onClickOutside: handleClickOutside, target: columnLeftRef.current }),
8718
- isCollapsed ? null : skipLink,
8719
- showPanel ? ColumnLeftComponent : null,
8720
- ColumnRightComponent));
8822
+ React__default.createElement(React__default.Fragment, null,
8823
+ React__default.createElement(FocusTrap, { active: !isCollapsed && isFocusTrap, focusTrapOptions: {
8824
+ escapeDeactivates: true,
8825
+ allowOutsideClick: true,
8826
+ fallbackFocus: columnLeftRef.current
8827
+ }, containerElements: [columnLeftRef.current] }),
8828
+ React__default.createElement(ClickOutsideListener, { onClickOutside: handleClickOutside, target: columnLeftRef.current }),
8829
+ isCollapsed ? null : skipLink,
8830
+ showPanel ? ColumnLeftComponent : null,
8831
+ ColumnRightComponent)));
8721
8832
  });
8722
8833
  TwoColumnPanel.displayName = 'TwoColumnPanel';
8723
8834
 
@@ -8857,6 +8968,7 @@ exports.Panel = Panel;
8857
8968
  exports.PanelTrigger = PanelTrigger$1;
8858
8969
  exports.Pointout = Pointout;
8859
8970
  exports.ProgressBar = ProgressBar;
8971
+ exports.RadioCardGroup = RadioCardGroup;
8860
8972
  exports.RadioGroup = RadioGroup;
8861
8973
  exports.Scrim = Scrim;
8862
8974
  exports.Select = Select;
@@ -8894,4 +9006,5 @@ exports.Workspace = Workspace;
8894
9006
  exports.focusableSelector = focusableSelector;
8895
9007
  exports.iconTypes = iconTypes;
8896
9008
  exports.useDidUpdate = useDidUpdate;
9009
+ exports.usePagination = usePagination;
8897
9010
  exports.useThemeContext = useThemeContext;