@deque/cauldron-react 4.5.0 → 4.6.0

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
@@ -9,9 +9,9 @@ var React = require('react');
9
9
  var React__default = _interopDefault(React);
10
10
  var PropTypes = _interopDefault(require('prop-types'));
11
11
  var classNames = _interopDefault(require('classnames'));
12
- var keyname = _interopDefault(require('keyname'));
13
12
  var nextId = require('react-id-generator');
14
13
  var nextId__default = _interopDefault(nextId);
14
+ var keyname = _interopDefault(require('keyname'));
15
15
  var reactDom = require('react-dom');
16
16
  var FocusTrap = _interopDefault(require('focus-trap-react'));
17
17
  var reactPopper = require('react-popper');
@@ -151,6 +151,7 @@ var iconTypes = [
151
151
  'exchange',
152
152
  'external-link',
153
153
  'eye',
154
+ 'filter-solid',
154
155
  'filter',
155
156
  'flag',
156
157
  'gears',
@@ -170,10 +171,12 @@ var iconTypes = [
170
171
  'new',
171
172
  'no',
172
173
  'pencil',
174
+ 'play',
173
175
  'plus',
174
176
  'question-circle',
175
177
  'radio-checked',
176
178
  'radio-unchecked',
179
+ 'recycle-square',
177
180
  'recycle',
178
181
  'resend',
179
182
  'robot',
@@ -218,6 +221,7 @@ function __variableDynamicImportRuntime0__(path) {
218
221
  case './icons/exchange.svg': return Promise.resolve().then(function () { return require('./exchange.js'); });
219
222
  case './icons/external-link.svg': return Promise.resolve().then(function () { return require('./external-link.js'); });
220
223
  case './icons/eye.svg': return Promise.resolve().then(function () { return require('./eye.js'); });
224
+ case './icons/filter-solid.svg': return Promise.resolve().then(function () { return require('./filter-solid.js'); });
221
225
  case './icons/filter.svg': return Promise.resolve().then(function () { return require('./filter.js'); });
222
226
  case './icons/flag.svg': return Promise.resolve().then(function () { return require('./flag.js'); });
223
227
  case './icons/gears.svg': return Promise.resolve().then(function () { return require('./gears.js'); });
@@ -237,10 +241,12 @@ function __variableDynamicImportRuntime0__(path) {
237
241
  case './icons/new.svg': return Promise.resolve().then(function () { return require('./new.js'); });
238
242
  case './icons/no.svg': return Promise.resolve().then(function () { return require('./no.js'); });
239
243
  case './icons/pencil.svg': return Promise.resolve().then(function () { return require('./pencil.js'); });
244
+ case './icons/play.svg': return Promise.resolve().then(function () { return require('./play.js'); });
240
245
  case './icons/plus.svg': return Promise.resolve().then(function () { return require('./plus.js'); });
241
246
  case './icons/question-circle.svg': return Promise.resolve().then(function () { return require('./question-circle.js'); });
242
247
  case './icons/radio-checked.svg': return Promise.resolve().then(function () { return require('./radio-checked.js'); });
243
248
  case './icons/radio-unchecked.svg': return Promise.resolve().then(function () { return require('./radio-unchecked.js'); });
249
+ case './icons/recycle-square.svg': return Promise.resolve().then(function () { return require('./recycle-square.js'); });
244
250
  case './icons/recycle.svg': return Promise.resolve().then(function () { return require('./recycle.js'); });
245
251
  case './icons/resend.svg': return Promise.resolve().then(function () { return require('./resend.js'); });
246
252
  case './icons/robot.svg': return Promise.resolve().then(function () { return require('./robot.js'); });
@@ -279,19 +285,19 @@ var Icon = React.forwardRef(function (_a, ref) {
279
285
  if (process.env.NODE_ENV === 'test') {
280
286
  return;
281
287
  }
282
- __variableDynamicImportRuntime0__("./icons/" + name + ".svg")
288
+ __variableDynamicImportRuntime0__("./icons/".concat(name, ".svg"))
283
289
  .then(function (icon) {
284
290
  isMounted.current && setIcon(function () { return icon["default"]; });
285
291
  })["catch"](function () {
286
- console.error("Could not find icon type \"" + type + "\".");
292
+ console.error("Could not find icon type \"".concat(type, "\"."));
287
293
  isMounted.current && setIcon(null);
288
294
  });
289
295
  return function () {
290
296
  isMounted.current = false;
291
297
  };
292
298
  }, [type]);
293
- var data = tslib.__assign(tslib.__assign({}, other), { 'aria-hidden': !label, className: classNames('Icon', "Icon--" + type, className, (_b = {},
294
- _b["Icon__" + direction] = !!direction,
299
+ var data = tslib.__assign(tslib.__assign({}, other), { 'aria-hidden': !label, className: classNames('Icon', "Icon--".concat(type), className, (_b = {},
300
+ _b["Icon__".concat(direction)] = !!direction,
295
301
  _b)) });
296
302
  return (React__default.createElement("div", tslib.__assign({ ref: ref }, data),
297
303
  label && React__default.createElement(Offscreen, null, label),
@@ -305,6 +311,207 @@ Icon.propTypes = {
305
311
  };
306
312
  Icon.displayName = 'Icon';
307
313
 
314
+ var PanelTrigger = function (_a) {
315
+ var children = _a.children, className = _a.className, open = _a.open, fullWidth = _a.fullWidth, onClick = _a.onClick, _b = _a.iconExpanded, iconExpanded = _b === void 0 ? 'chevron-down' : _b, _c = _a.iconCollapsed, iconCollapsed = _c === void 0 ? 'chevron-right' : _c, heading = _a.heading, otherProps = tslib.__rest(_a, ["children", "className", "open", "fullWidth", "onClick", "iconExpanded", "iconCollapsed", "heading"]);
316
+ var Header = typeof heading === 'object' && 'level' in heading && !!heading.level
317
+ ? "h".concat(heading.level)
318
+ : React__default.Fragment;
319
+ return (React__default.createElement(Header, null,
320
+ React__default.createElement("button", tslib.__assign({ className: classNames(className, 'ExpandCollapse__trigger', {
321
+ fullWidth: fullWidth
322
+ }), type: "button", "aria-expanded": open, onClick: onClick }, otherProps),
323
+ React__default.createElement("div", { className: "ExpandCollapse__trigger-title" }, typeof children === 'function'
324
+ ? children({ open: !!open })
325
+ : children),
326
+ React__default.createElement(Icon, { type: open ? iconExpanded : iconCollapsed }))));
327
+ };
328
+ PanelTrigger.propTypes = {
329
+ children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
330
+ open: PropTypes.bool,
331
+ iconExpanded: PropTypes.string,
332
+ iconCollapsed: PropTypes.string,
333
+ heading: PropTypes.number
334
+ };
335
+ PanelTrigger.displayName = 'PanelTrigger';
336
+ var PanelTrigger$1 = React__default.memo(PanelTrigger);
337
+
338
+ var injectStyleTag = function () {
339
+ var style = document.createElement('style');
340
+ document.head.appendChild(style);
341
+ return style;
342
+ };
343
+ var setStyle = function (tag, cssString) {
344
+ tag.textContent = cssString;
345
+ };
346
+ var removeStyleTag = function (tag) {
347
+ document.head.removeChild(tag);
348
+ };
349
+
350
+ var ExpandCollapsePanel = /** @class */ (function (_super) {
351
+ tslib.__extends(ExpandCollapsePanel, _super);
352
+ function ExpandCollapsePanel() {
353
+ var _this = _super !== null && _super.apply(this, arguments) || this;
354
+ _this.state = {
355
+ controlled: typeof _this.props.open !== 'undefined',
356
+ isOpen: typeof _this.props.open !== 'undefined' ? _this.props.open : false
357
+ };
358
+ _this.panel = React__default.createRef();
359
+ _this.handleToggle = function (e) {
360
+ var onToggle = _this.props.onToggle;
361
+ var _a = _this.state, isOpen = _a.isOpen, controlled = _a.controlled;
362
+ onToggle(e);
363
+ if (!controlled) {
364
+ _this.setState({ isOpen: !isOpen, isAnimating: true });
365
+ }
366
+ };
367
+ _this.animateOpen = function () {
368
+ var panel = _this.panel.current;
369
+ var animationTiming = _this.props.animationTiming;
370
+ if (!animationTiming) {
371
+ _this.setState({ isAnimating: false });
372
+ return;
373
+ }
374
+ var rect = panel === null || panel === void 0 ? void 0 : panel.getBoundingClientRect();
375
+ if (!rect) {
376
+ return;
377
+ }
378
+ if (!_this.styleTag) {
379
+ _this.styleTag = injectStyleTag();
380
+ }
381
+ 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 "));
382
+ _this.setState({ animationClass: 'cauldron-expand-open' }, function () {
383
+ setTimeout(function () {
384
+ _this.setState({ animationClass: '', isAnimating: false });
385
+ setStyle(_this.styleTag, '');
386
+ }, animationTiming);
387
+ });
388
+ };
389
+ _this.animateClose = function () {
390
+ var panel = _this.panel.current;
391
+ var animationTiming = _this.props.animationTiming;
392
+ if (!animationTiming) {
393
+ _this.setState({ isAnimating: false });
394
+ return;
395
+ }
396
+ if (!_this.styleTag) {
397
+ _this.styleTag = injectStyleTag();
398
+ }
399
+ var rect = panel === null || panel === void 0 ? void 0 : panel.getBoundingClientRect();
400
+ if (!rect)
401
+ return;
402
+ 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 "));
403
+ _this.setState({ animationClass: 'cauldron-collapse-close' }, function () {
404
+ setTimeout(function () {
405
+ _this.setState({ animationClass: '', isAnimating: false });
406
+ setStyle(_this.styleTag, '');
407
+ }, animationTiming);
408
+ });
409
+ };
410
+ return _this;
411
+ }
412
+ ExpandCollapsePanel.prototype.componentWillUnmount = function () {
413
+ var styleTag = this.styleTag;
414
+ if (styleTag) {
415
+ removeStyleTag(styleTag);
416
+ }
417
+ };
418
+ ExpandCollapsePanel.prototype.componentDidUpdate = function (prevProps, prevState) {
419
+ var _a = this.state, openState = _a.isOpen, controlled = _a.controlled;
420
+ var openProp = this.props.open;
421
+ if (controlled && openState !== openProp) {
422
+ this.setState({ isOpen: !!openProp, isAnimating: true });
423
+ }
424
+ if (typeof openProp !== typeof prevProps.open) {
425
+ this.setState({ controlled: typeof openProp !== 'undefined' });
426
+ }
427
+ if (prevState.isOpen !== openState && openState) {
428
+ this.animateOpen();
429
+ }
430
+ else if (prevState.isOpen !== openState && !openState) {
431
+ this.animateClose();
432
+ }
433
+ };
434
+ ExpandCollapsePanel.prototype.render = function () {
435
+ var _a = this.props, children = _a.children, animationTiming = _a.animationTiming, className = _a.className, onToggle = _a.onToggle, open = _a.open, otherProps = tslib.__rest(_a, ["children", "animationTiming", "className", "onToggle", "open"]);
436
+ var _b = this.state, isOpen = _b.isOpen, isAnimating = _b.isAnimating, animationClass = _b.animationClass;
437
+ var trigger = React__default.Children.toArray(children).find(function (child) { return child.type === PanelTrigger$1; });
438
+ var panelElements = React__default.Children.toArray(children).filter(function (child) {
439
+ return typeof child === 'string' ||
440
+ child.type !== PanelTrigger$1;
441
+ });
442
+ return (React__default.createElement(React__default.Fragment, null,
443
+ trigger &&
444
+ React__default.cloneElement(trigger, {
445
+ open: isOpen,
446
+ onClick: this.handleToggle
447
+ }),
448
+ React__default.createElement("div", tslib.__assign({ className: classNames(className, 'ExpandCollapse__panel', animationClass, {
449
+ 'is--hidden': !isOpen && !isAnimating
450
+ }), ref: this.panel }, otherProps), panelElements)));
451
+ };
452
+ ExpandCollapsePanel.defaultProps = {
453
+ animationTiming: 250,
454
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
455
+ onToggle: function () { }
456
+ };
457
+ ExpandCollapsePanel.propTypes = {
458
+ open: PropTypes.bool,
459
+ children: PropTypes.node.isRequired,
460
+ className: PropTypes.string,
461
+ animationTiming: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),
462
+ onToggle: PropTypes.func
463
+ };
464
+ return ExpandCollapsePanel;
465
+ }(React__default.Component));
466
+
467
+ var AccordionTrigger = function (_a) {
468
+ var children = _a.children, triggerProps = tslib.__rest(_a, ["children"]);
469
+ return React__default.createElement(React__default.Fragment, null, children);
470
+ };
471
+ var AccordionContent = function (_a) {
472
+ var children = _a.children, className = _a.className, otherProps = tslib.__rest(_a, ["children", "className"]);
473
+ return (React__default.createElement("div", tslib.__assign({ className: classNames('Accordion__panel', className) }, otherProps), children));
474
+ };
475
+ var Accordion = function (_a) {
476
+ var children = _a.children;
477
+ var childrenArray = React__default.Children.toArray(children);
478
+ var trigger = childrenArray.find(function (child) { return child.type === AccordionTrigger; });
479
+ var panelElement = childrenArray.find(function (child) {
480
+ return typeof child === 'string' ||
481
+ child.type === AccordionContent;
482
+ });
483
+ var isValid = !!(React__default.isValidElement(trigger) && React__default.isValidElement(panelElement));
484
+ if (!isValid) {
485
+ console.warn('Must provide <AccordionTrigger /> and <AccordionContent /> element(s). You provided:', {
486
+ trigger: trigger,
487
+ panelElement: panelElement,
488
+ isValid: isValid
489
+ });
490
+ return null;
491
+ }
492
+ var _b = trigger.props, triggerClassName = _b.className, triggerProps = tslib.__rest(_b, ["className"]);
493
+ var elementId = nextId.useId();
494
+ return (React__default.createElement("div", { className: "Accordion" },
495
+ React__default.createElement(ExpandCollapsePanel, tslib.__assign({ id: panelElement.props.id || "".concat(elementId, "-panel") }, panelElement.props),
496
+ React__default.createElement(PanelTrigger$1, tslib.__assign({ iconCollapsed: "triangle-right", iconExpanded: "triangle-down", className: classNames('Accordion__trigger', trigger.props.className), "aria-controls": panelElement.props.id || "".concat(elementId, "-panel"), heading: trigger.props.heading }, trigger.props), trigger),
497
+ panelElement)));
498
+ };
499
+ Accordion.displayName = 'Accordion';
500
+ AccordionContent.displayName = 'AccordionContent';
501
+ AccordionTrigger.displayName = 'AccordionTrigger';
502
+ Accordion.propTypes = {
503
+ children: PropTypes.node,
504
+ className: PropTypes.string
505
+ };
506
+ AccordionTrigger.propTypes = {
507
+ children: PropTypes.node,
508
+ heading: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6', undefined])
509
+ };
510
+ AccordionContent.propTypes = {
511
+ children: PropTypes.node.isRequired,
512
+ className: PropTypes.string
513
+ };
514
+
308
515
  var Scrim = /** @class */ (function (_super) {
309
516
  tslib.__extends(Scrim, _super);
310
517
  function Scrim(props) {
@@ -364,7 +571,7 @@ var Scrim = /** @class */ (function (_super) {
364
571
  if (destroy) {
365
572
  return null;
366
573
  }
367
- return (React__default.createElement("div", { ref: function (el) { return (_this.el = el); }, className: "Scrim " + animationClass }));
574
+ return (React__default.createElement("div", { ref: function (el) { return (_this.el = el); }, className: "Scrim ".concat(animationClass) }));
368
575
  };
369
576
  Scrim.propTypes = {
370
577
  show: PropTypes.bool.isRequired
@@ -498,9 +705,9 @@ var TopBar = /** @class */ (function (_super) {
498
705
  args[_i] = arguments[_i];
499
706
  }
500
707
  // @ts-ignore we're just spreading the original args
501
- _this.onKeyDown.apply(_this, tslib.__spread(args));
708
+ _this.onKeyDown.apply(_this, tslib.__spreadArray([], tslib.__read(args), false));
502
709
  if (child.props.onKeyDown) {
503
- (_a = child.props).onKeyDown.apply(_a, tslib.__spread(args));
710
+ (_a = child.props).onKeyDown.apply(_a, tslib.__spreadArray([], tslib.__read(args), false));
504
711
  }
505
712
  },
506
713
  tabIndex: 0,
@@ -536,7 +743,7 @@ var TopBar = /** @class */ (function (_super) {
536
743
  };
537
744
  TopBar.prototype.onKeyDown = function (e) {
538
745
  var key = keyname(e.which);
539
- var menuItems = tslib.__spread(this.menuItems);
746
+ var menuItems = tslib.__spreadArray([], tslib.__read(this.menuItems), false);
540
747
  // account for hidden side bar trigger (hamburger)
541
748
  if (this.state.wide && this.props.hasTrigger) {
542
749
  menuItems.shift();
@@ -592,6 +799,7 @@ var TopBarTrigger = function (_a) {
592
799
  };
593
800
  TopBarTrigger.displayName = 'TopBarTrigger';
594
801
  TopBarTrigger.propTypes = {
802
+ // @ts-expect-error
595
803
  children: PropTypes.node.isRequired,
596
804
  className: PropTypes.string
597
805
  };
@@ -787,11 +995,15 @@ var OptionsMenuList = /** @class */ (function (_super) {
787
995
  /* eslint-enable @typescript-eslint/no-unused-vars */
788
996
  var items = React__default.Children.toArray(children).map(function (child, i) {
789
997
  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));
998
+ 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
999
  });
1000
+ // This allows the ClickOutsideListener to only be activated when the menu is
1001
+ // currently open. This prevents an obscure behavior where the activation of a
1002
+ // different menu would cause all menus to close
1003
+ var clickOutsideEventActive = !show ? false : undefined;
792
1004
  // Key event is being handled in componentDidMount
793
1005
  /* eslint-disable jsx-a11y/click-events-have-key-events */
794
- return (React__default.createElement(ClickOutsideListener, { onClickOutside: this.handleClickOutside },
1006
+ return (React__default.createElement(ClickOutsideListener, { onClickOutside: this.handleClickOutside, mouseEvent: clickOutsideEventActive, touchEvent: clickOutsideEventActive },
795
1007
  React__default.createElement("ul", tslib.__assign({}, other, { className: classNames('OptionsMenu__list', className), "aria-expanded": show, role: "menu", onClick: handleClick, ref: function (el) {
796
1008
  _this.menuRef = el;
797
1009
  if (menuRef) {
@@ -830,7 +1042,6 @@ var OptionsMenu = /** @class */ (function (_super) {
830
1042
  var show = _a.show;
831
1043
  return ({ show: !show });
832
1044
  });
833
- event.preventDefault();
834
1045
  };
835
1046
  _this.handleClose = function () {
836
1047
  var _a;
@@ -1167,7 +1378,8 @@ var SideBar = /** @class */ (function (_super) {
1167
1378
  setTimeout(function () {
1168
1379
  var _a, _b;
1169
1380
  _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));
1381
+ var firstFocusable = show &&
1382
+ ((_b = (_a = _this.navList) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.querySelector(focusableSelector));
1171
1383
  if (firstFocusable) {
1172
1384
  firstFocusable.focus();
1173
1385
  }
@@ -1216,6 +1428,7 @@ SideBarItem.defaultProps = {
1216
1428
  autoClickLink: true
1217
1429
  };
1218
1430
  SideBarItem.propTypes = {
1431
+ // @ts-expect-error
1219
1432
  children: PropTypes.node.isRequired,
1220
1433
  autoClickLink: PropTypes.bool
1221
1434
  };
@@ -1305,7 +1518,7 @@ var Dialog = /** @class */ (function (_super) {
1305
1518
  var close = !forceAction ? (React__default.createElement("button", { className: "Dialog__close", type: "button", onClick: this.close },
1306
1519
  React__default.createElement(Icon, { type: "close", "aria-hidden": "true" }),
1307
1520
  React__default.createElement(Offscreen, null, closeButtonText))) : null;
1308
- var Heading = "h" + (typeof heading === 'object' && 'level' in heading && !!heading.level
1521
+ var Heading = "h".concat(typeof heading === 'object' && 'level' in heading && !!heading.level
1309
1522
  ? heading.level
1310
1523
  : 2);
1311
1524
  var Dialog = (React__default.createElement(FocusTrap, { focusTrapOptions: {
@@ -1464,7 +1677,7 @@ var SkipLink = /** @class */ (function (_super) {
1464
1677
  target: function (props, propName, componentName) {
1465
1678
  var value = props[propName];
1466
1679
  if (!value || typeof value !== 'string' || value[0] !== '#') {
1467
- return new Error("Invalid prop " + propName + " supplied to " + componentName + " (must be string starting with \"#\")");
1680
+ return new Error("Invalid prop ".concat(propName, " supplied to ").concat(componentName, " (must be string starting with \"#\")"));
1468
1681
  }
1469
1682
  },
1470
1683
  skipText: PropTypes.string,
@@ -1480,6 +1693,8 @@ var Button = React.forwardRef(function (_a, ref) {
1480
1693
  'Button--secondary': variant === 'secondary',
1481
1694
  'Button--error': variant === 'error',
1482
1695
  Link: variant === 'link',
1696
+ Tag: variant === 'tag',
1697
+ 'Button--tag': variant === 'tag',
1483
1698
  'Button--thin': thin
1484
1699
  }), ref: ref || buttonRef }, other), children));
1485
1700
  });
@@ -1609,8 +1824,8 @@ function Tooltip(_a) {
1609
1824
  targetElement === null || targetElement === void 0 ? void 0 : targetElement.setAttribute(association, [id, attrText].filter(Boolean).join(' '));
1610
1825
  }
1611
1826
  }, [targetElement, id]);
1612
- return (showTooltip || hideElementOnHidden) && isBrowser()
1613
- ? reactDom.createPortal(React__default.createElement("div", tslib.__assign({ id: id, className: classNames('Tooltip', "Tooltip--" + placement, className, {
1827
+ return (React__default.createElement(React__default.Fragment, null, (showTooltip || hideElementOnHidden) && isBrowser()
1828
+ ? reactDom.createPortal(React__default.createElement("div", tslib.__assign({ id: id, className: classNames('Tooltip', "Tooltip--".concat(placement), className, {
1614
1829
  TooltipInfo: variant === 'info',
1615
1830
  'Tooltip--hidden': !showTooltip && hideElementOnHidden,
1616
1831
  'Tooltip--big': variant === 'big'
@@ -1618,7 +1833,7 @@ function Tooltip(_a) {
1618
1833
  variant !== 'big' && (React__default.createElement("div", { className: "TooltipArrow", ref: setArrowElement, style: styles.arrow })),
1619
1834
  children), (portal && 'current' in portal ? portal.current : portal) ||
1620
1835
  document.body)
1621
- : null;
1836
+ : null));
1622
1837
  }
1623
1838
  Tooltip.displayName = 'Tooltip';
1624
1839
  Tooltip.propTypes = {
@@ -1681,6 +1896,7 @@ IconButton.propTypes = {
1681
1896
  as: PropTypes.elementType,
1682
1897
  // @ts-expect-error
1683
1898
  icon: PropTypes.string.isRequired,
1899
+ // @ts-expect-error
1684
1900
  label: PropTypes.node.isRequired,
1685
1901
  // @ts-expect-error
1686
1902
  tooltipPlacement: PropTypes.string,
@@ -1695,7 +1911,7 @@ IconButton.displayName = 'IconButton';
1695
1911
  var i = 0;
1696
1912
  var randomId = function () {
1697
1913
  var num = Math.floor(Math.random() * 10000) + 1;
1698
- return "x_" + i++ + "_" + num;
1914
+ return "x_".concat(i++, "_").concat(num);
1699
1915
  };
1700
1916
 
1701
1917
  /*
@@ -1790,16 +2006,15 @@ var Pointout = /** @class */ (function (_super) {
1790
2006
  visibleFocusable[elementIndex].classList.remove('Pointout--focus-active');
1791
2007
  };
1792
2008
  _this.positionRelativeToTarget = function () {
1793
- var _a, _b;
1794
- var _c = _this.props, target = _c.target, portal = _c.portal, arrowPosition = _c.arrowPosition, position = _c.position;
2009
+ var _a = _this.props, target = _a.target, portal = _a.portal, arrowPosition = _a.arrowPosition, position = _a.position;
1795
2010
  if (!target) {
1796
2011
  return;
1797
2012
  }
1798
- var targetNode = ((_a = target) === null || _a === void 0 ? void 0 : _a.current) ||
2013
+ var targetNode = (target === null || target === void 0 ? void 0 : target.current) ||
1799
2014
  target;
1800
- var portalNode = ((_b = portal) === null || _b === void 0 ? void 0 : _b.current) ||
2015
+ var portalNode = (portal === null || portal === void 0 ? void 0 : portal.current) ||
1801
2016
  portal;
1802
- var _d = targetNode.getBoundingClientRect(), top = _d.top, left = _d.left, width = _d.width, height = _d.height;
2017
+ var _b = targetNode.getBoundingClientRect(), top = _b.top, left = _b.left, width = _b.width, height = _b.height;
1803
2018
  if (portalNode && portalNode !== document.body) {
1804
2019
  // If the portal is not placed on document.body
1805
2020
  // position the FTPO relative to the portal
@@ -1807,48 +2022,48 @@ var Pointout = /** @class */ (function (_super) {
1807
2022
  top -= rect.top - portalNode.scrollTop;
1808
2023
  left -= rect.left - portalNode.scrollLeft;
1809
2024
  }
1810
- var _e = tslib.__read(arrowPosition.split('-'), 1), arrowBoxSide = _e[0];
2025
+ var _c = tslib.__read(arrowPosition.split('-'), 1), arrowBoxSide = _c[0];
1811
2026
  var style;
1812
2027
  switch (arrowBoxSide) {
1813
2028
  case 'right':
1814
2029
  style = {
1815
- left: left + "px",
1816
- top: (position === 'center'
2030
+ left: "".concat(left, "px"),
2031
+ top: "".concat(position === 'center'
1817
2032
  ? top + height / 2
1818
2033
  : position === 'start'
1819
2034
  ? top
1820
- : top + height) + "px"
2035
+ : top + height, "px")
1821
2036
  };
1822
2037
  break;
1823
2038
  case 'bottom':
1824
2039
  style = {
1825
- top: top + "px",
1826
- left: (position === 'center'
2040
+ top: "".concat(top, "px"),
2041
+ left: "".concat(position === 'center'
1827
2042
  ? left + width / 2
1828
2043
  : position === 'start'
1829
2044
  ? left
1830
- : left + width) + "px"
2045
+ : left + width, "px")
1831
2046
  };
1832
2047
  break;
1833
2048
  case 'left':
1834
2049
  style = {
1835
- left: left + width + "px",
1836
- top: (position === 'center'
2050
+ left: "".concat(left + width, "px"),
2051
+ top: "".concat(position === 'center'
1837
2052
  ? top + height / 2
1838
2053
  : position === 'start'
1839
2054
  ? top
1840
- : top + height) + "px"
2055
+ : top + height, "px")
1841
2056
  };
1842
2057
  break;
1843
2058
  case 'top':
1844
2059
  default:
1845
2060
  style = {
1846
- top: top + height + "px",
1847
- left: (position === 'center'
2061
+ top: "".concat(top + height, "px"),
2062
+ left: "".concat(position === 'center'
1848
2063
  ? left + width / 2
1849
2064
  : position === 'start'
1850
2065
  ? left
1851
- : left + width) + "px"
2066
+ : left + width, "px")
1852
2067
  };
1853
2068
  break;
1854
2069
  }
@@ -1860,7 +2075,7 @@ var Pointout = /** @class */ (function (_super) {
1860
2075
  }
1861
2076
  Pointout.prototype.getFocusableElements = function (root) {
1862
2077
  return root
1863
- ? Array.from(root.querySelectorAll(focusable + ", [data-focusable]"))
2078
+ ? Array.from(root.querySelectorAll("".concat(focusable, ", [data-focusable]")))
1864
2079
  : [];
1865
2080
  };
1866
2081
  Pointout.prototype.componentDidMount = function () {
@@ -1930,11 +2145,11 @@ var Pointout = /** @class */ (function (_super) {
1930
2145
  'Pointout--no-arrow': noArrow,
1931
2146
  'Pointout--auto': !!target
1932
2147
  },
1933
- _a["Pointout__arrow--" + arrowPosition] = !!arrowPosition && !noArrow,
1934
- _a["Pointout--" + position] = !!target,
2148
+ _a["Pointout__arrow--".concat(arrowPosition)] = !!arrowPosition && !noArrow,
2149
+ _a["Pointout--".concat(position)] = !!target,
1935
2150
  _a)), style: style, role: target ? undefined : 'region', "aria-labelledby": heading ? headingId : undefined, "aria-hidden": !!target && !disableOffscreenPointout, ref: function (el) { return (_this.visibleRef = el); } },
1936
2151
  noArrow ? null : (React__default.createElement("div", { className: classNames('Pointout__arrow', (_b = {},
1937
- _b["Pointout__arrow--" + arrowPosition] = !!arrowPosition && !noArrow,
2152
+ _b["Pointout__arrow--".concat(arrowPosition)] = !!arrowPosition && !noArrow,
1938
2153
  _b)) },
1939
2154
  React__default.createElement("div", { className: "Pointout__arrow-pointer" }))),
1940
2155
  React__default.createElement("div", { className: "Pointout__box" },
@@ -2115,7 +2330,7 @@ var Toast = /** @class */ (function (_super) {
2115
2330
  var scrim = type === 'action-needed' && show ? (React__default.createElement("div", { className: "Scrim--light Scrim--show Scrim--fade-in" })) : null;
2116
2331
  var defaultProps = {
2117
2332
  tabIndex: -1,
2118
- className: "Toast Toast--" + typeMap[type].className + " " + animationClass
2333
+ className: "Toast Toast--".concat(typeMap[type].className, " ").concat(animationClass)
2119
2334
  };
2120
2335
  if (!focus) {
2121
2336
  defaultProps.role = 'alert';
@@ -2301,9 +2516,10 @@ var Select = React__default.forwardRef(function (_a, ref) {
2301
2516
  'Field__select--disabled': disabled,
2302
2517
  'Field--has-error': !!error
2303
2518
  }) },
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
- })
2519
+ 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)
2520
+ ? options.map(function (option) {
2521
+ return (React__default.createElement("option", { className: "Field__option", key: option.key, value: option.value, disabled: option.disabled }, option.label || option.value));
2522
+ })
2307
2523
  : children),
2308
2524
  React__default.createElement("div", { className: "arrow-down" })),
2309
2525
  error && (React__default.createElement("div", { id: errorId, className: "Error" }, error))));
@@ -2352,7 +2568,7 @@ var RadioGroup = function (_a) {
2352
2568
  var _a;
2353
2569
  handleChange(radioValue);
2354
2570
  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)),
2571
+ }, disabled: disabled, checked: isChecked, "aria-describedby": labelDescription ? "".concat(id, "Desc") : undefined }, other)),
2356
2572
  React__default.createElement("label", { htmlFor: id, className: classNames('Field__label', {
2357
2573
  'Field__label--disabled': disabled
2358
2574
  }) }, label),
@@ -2360,7 +2576,7 @@ var RadioGroup = function (_a) {
2360
2576
  'Radio__overlay--focused': isFocused,
2361
2577
  'Radio__overlay--disabled': disabled
2362
2578
  }), 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', {
2579
+ labelDescription && (React__default.createElement("span", { id: "".concat(id, "Desc"), className: classNames('Field__labelDescription', {
2364
2580
  'Field__labelDescription--disabled': disabled
2365
2581
  }) }, labelDescription))));
2366
2582
  });
@@ -2380,7 +2596,7 @@ RadioGroup.propTypes = {
2380
2596
  })).isRequired,
2381
2597
  hasLabel: function (props, propName, componentName) {
2382
2598
  if (!props['aria-label'] && !props['aria-labelledby']) {
2383
- return new Error(componentName + " must have an \"aria-label\" or \"aria-labelledby\" prop");
2599
+ return new Error("".concat(componentName, " must have an \"aria-label\" or \"aria-labelledby\" prop"));
2384
2600
  }
2385
2601
  },
2386
2602
  className: PropTypes.string,
@@ -2389,6 +2605,125 @@ RadioGroup.propTypes = {
2389
2605
  };
2390
2606
  RadioGroup.displayName = 'RadioGroup';
2391
2607
 
2608
+ var Card = function (_a) {
2609
+ var className = _a.className, variant = _a.variant, other = tslib.__rest(_a, ["className", "variant"]);
2610
+ return (React__default.createElement("div", tslib.__assign({ className: classNames(className, {
2611
+ 'Card--simple': variant === 'simple',
2612
+ Card: !variant
2613
+ }) }, other)));
2614
+ };
2615
+ Card.displayName = 'Card';
2616
+ Card.propTypes = {
2617
+ className: PropTypes.string,
2618
+ variant: PropTypes.string
2619
+ };
2620
+
2621
+ var CardHeader = function (_a) {
2622
+ var className = _a.className, other = tslib.__rest(_a, ["className"]);
2623
+ return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__header', className) }, other)));
2624
+ };
2625
+ CardHeader.displayName = 'CardHeader';
2626
+ CardHeader.propTypes = {
2627
+ className: PropTypes.string
2628
+ };
2629
+
2630
+ var CardContent = function (_a) {
2631
+ var className = _a.className, other = tslib.__rest(_a, ["className"]);
2632
+ return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__content', className) }, other)));
2633
+ };
2634
+ CardContent.displayName = 'CardContent';
2635
+ CardContent.propTypes = {
2636
+ className: PropTypes.string
2637
+ };
2638
+
2639
+ var CardFooter = function (_a) {
2640
+ var className = _a.className, other = tslib.__rest(_a, ["className"]);
2641
+ return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__footer', className) }, other)));
2642
+ };
2643
+ CardFooter.displayName = 'CardFooter';
2644
+ CardFooter.propTypes = {
2645
+ className: PropTypes.string
2646
+ };
2647
+
2648
+ var RadioCardGroup = function (_a) {
2649
+ var name = _a.name, radios = _a.radios, defaultValue = _a.defaultValue, value = _a.value,
2650
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2651
+ _b = _a.onChange,
2652
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2653
+ onChange = _b === void 0 ? function () { } : _b, className = _a.className, other = tslib.__rest(_a, ["name", "radios", "defaultValue", "value", "onChange", "className"]);
2654
+ var _c = tslib.__read(React.useState(value !== null && value !== void 0 ? value : defaultValue), 2), currentValue = _c[0], setCurrentValue = _c[1];
2655
+ var _d = tslib.__read(React.useState(null), 2), focusIndex = _d[0], setFocusIndex = _d[1];
2656
+ var inputs = React.useRef([]);
2657
+ var handleChange = function (value) { return setCurrentValue(value); };
2658
+ var onRadioFocus = function (index) { return setFocusIndex(index); };
2659
+ var onRadioBlur = function () { return setFocusIndex(null); };
2660
+ var onRadioClick = function (index) {
2661
+ var _a;
2662
+ var radio = (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index];
2663
+ if (!radio) {
2664
+ return;
2665
+ }
2666
+ radio.click();
2667
+ radio.focus();
2668
+ };
2669
+ React.useEffect(function () {
2670
+ if (typeof value === 'undefined') {
2671
+ return;
2672
+ }
2673
+ setCurrentValue(value);
2674
+ }, [value]);
2675
+ var radioButtons = radios.map(function (radio, index) {
2676
+ 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"]);
2677
+ var isChecked = currentValue === radioValue;
2678
+ var isFocused = focusIndex === index;
2679
+ return (React__default.createElement("div", { className: classNames('RadioCard'), key: index },
2680
+ React__default.createElement(Card, { variant: "simple", className: classNames('RadioCardGroup__Card RadioCard__overlay', {
2681
+ 'RadioCard__overlay--focused': isFocused,
2682
+ 'RadioCard__overlay--checked': isChecked,
2683
+ 'RadioCard__overlay--disabled': disabled
2684
+ }), onClick: function () { return onRadioClick(index); } },
2685
+ React__default.createElement("input", tslib.__assign({ type: "radio", name: name, value: radioValue, id: id, ref: function (input) {
2686
+ if (!input) {
2687
+ return;
2688
+ }
2689
+ inputs.current.push(input);
2690
+ }, onFocus: function () { return onRadioFocus(index); }, onBlur: function () { return onRadioBlur(); }, onChange: function () {
2691
+ var _a;
2692
+ handleChange(radioValue);
2693
+ onChange(radio, (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index]);
2694
+ }, disabled: disabled, checked: isChecked }, other)),
2695
+ React__default.createElement(CardContent, null,
2696
+ React__default.createElement("div", { className: classNames('RadioCardGroup__Checked') }, isChecked && (React__default.createElement(Icon, { className: classNames('RadioCardGroup__Icon'), type: cardIcon }))),
2697
+ React__default.createElement("div", { className: classNames('RadioCardGroup__Base') },
2698
+ React__default.createElement("div", { className: classNames('RadioCardGroup__Image') }, cardImg),
2699
+ React__default.createElement("label", { htmlFor: id, className: classNames('RadioCardGroup__Label') }, label))))));
2700
+ });
2701
+ // reset the input refs array
2702
+ // refs get clobbered every re-render anyway and this supports "dynamic" radios
2703
+ // (changing the number of radio buttons for example)
2704
+ inputs.current = [];
2705
+ return (React__default.createElement("div", tslib.__assign({ className: classNames('RadioCardGroup'), role: "radiogroup" }, other), radioButtons));
2706
+ };
2707
+ RadioCardGroup.propTypes = {
2708
+ name: PropTypes.string,
2709
+ radios: PropTypes.arrayOf(PropTypes.shape({
2710
+ value: PropTypes.string.isRequired,
2711
+ id: PropTypes.string.isRequired,
2712
+ label: PropTypes.string.isRequired,
2713
+ cardImg: PropTypes.element.isRequired,
2714
+ cardIcon: PropTypes.string.isRequired
2715
+ })).isRequired,
2716
+ hasLabel: function (props, propName, componentName) {
2717
+ if (!props['aria-label'] && !props['aria-labelledby']) {
2718
+ return new Error("".concat(componentName, " must have an \"aria-label\" or \"aria-labelledby\" prop"));
2719
+ }
2720
+ },
2721
+ className: PropTypes.string,
2722
+ defaultValue: PropTypes.string,
2723
+ onChange: PropTypes.func
2724
+ };
2725
+ RadioCardGroup.displayName = 'RadioCardGroup';
2726
+
2392
2727
  var Checkbox = React.forwardRef(function (_a, ref) {
2393
2728
  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
2729
  var _d = tslib.__read(React.useState(checked), 2), isChecked = _d[0], setIsChecked = _d[1];
@@ -2458,46 +2793,6 @@ function TooltipTabstop(_a) {
2458
2793
  }
2459
2794
  TooltipTabstop.displayName = 'TooltipTabstop';
2460
2795
 
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
2796
  var TextField = /** @class */ (function (_super) {
2502
2797
  tslib.__extends(TextField, _super);
2503
2798
  function TextField(props) {
@@ -2591,152 +2886,6 @@ var TextField = /** @class */ (function (_super) {
2591
2886
  return TextField;
2592
2887
  }(React__default.Component));
2593
2888
 
2594
- function PanelTrigger(_a) {
2595
- var children = _a.children, className = _a.className, open = _a.open, fullWidth = _a.fullWidth, onClick = _a.onClick, _b = _a.iconExpanded, iconExpanded = _b === void 0 ? 'chevron-down' : _b, _c = _a.iconCollapsed, iconCollapsed = _c === void 0 ? 'chevron-right' : _c, other = tslib.__rest(_a, ["children", "className", "open", "fullWidth", "onClick", "iconExpanded", "iconCollapsed"]);
2596
- return (React__default.createElement("button", tslib.__assign({}, other, { className: classNames('ExpandCollapse__trigger', fullWidth ? 'fullWidth' : '', className), type: "button", "aria-expanded": open, onClick: onClick }),
2597
- React__default.createElement("div", { className: "ExpandCollapse__trigger-title" }, typeof children === 'function' ? children({ open: !!open }) : children),
2598
- React__default.createElement(Icon, { type: open ? iconExpanded : iconCollapsed })));
2599
- }
2600
- PanelTrigger.propTypes = {
2601
- children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
2602
- open: PropTypes.bool,
2603
- onClick: PropTypes.func,
2604
- className: PropTypes.string,
2605
- iconExpanded: PropTypes.string,
2606
- iconCollapsed: PropTypes.string
2607
- };
2608
- var PanelTrigger$1 = React__default.memo(PanelTrigger);
2609
-
2610
- var injectStyleTag = function () {
2611
- var style = document.createElement('style');
2612
- document.head.appendChild(style);
2613
- return style;
2614
- };
2615
- var setStyle = function (tag, cssString) {
2616
- tag.textContent = cssString;
2617
- };
2618
- var removeStyleTag = function (tag) {
2619
- document.head.removeChild(tag);
2620
- };
2621
-
2622
- var ExpandCollapsePanel = /** @class */ (function (_super) {
2623
- tslib.__extends(ExpandCollapsePanel, _super);
2624
- function ExpandCollapsePanel() {
2625
- var _this = _super !== null && _super.apply(this, arguments) || this;
2626
- _this.state = {
2627
- controlled: typeof _this.props.open !== 'undefined',
2628
- isOpen: typeof _this.props.open !== 'undefined' ? _this.props.open : false
2629
- };
2630
- _this.panel = React__default.createRef();
2631
- _this.handleToggle = function (e) {
2632
- var onToggle = _this.props.onToggle;
2633
- var _a = _this.state, isOpen = _a.isOpen, controlled = _a.controlled;
2634
- onToggle(e);
2635
- if (!controlled) {
2636
- _this.setState({ isOpen: !isOpen, isAnimating: true });
2637
- }
2638
- };
2639
- _this.animateOpen = function () {
2640
- var panel = _this.panel.current;
2641
- var animationTiming = _this.props.animationTiming;
2642
- if (!animationTiming) {
2643
- _this.setState({ isAnimating: false });
2644
- return;
2645
- }
2646
- var rect = panel === null || panel === void 0 ? void 0 : panel.getBoundingClientRect();
2647
- if (!rect) {
2648
- return;
2649
- }
2650
- if (!_this.styleTag) {
2651
- _this.styleTag = injectStyleTag();
2652
- }
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 ");
2654
- _this.setState({ animationClass: 'cauldron-expand-open' }, function () {
2655
- setTimeout(function () {
2656
- _this.setState({ animationClass: '', isAnimating: false });
2657
- setStyle(_this.styleTag, '');
2658
- }, animationTiming);
2659
- });
2660
- };
2661
- _this.animateClose = function () {
2662
- var panel = _this.panel.current;
2663
- var animationTiming = _this.props.animationTiming;
2664
- if (!animationTiming) {
2665
- _this.setState({ isAnimating: false });
2666
- return;
2667
- }
2668
- if (!_this.styleTag) {
2669
- _this.styleTag = injectStyleTag();
2670
- }
2671
- var rect = panel === null || panel === void 0 ? void 0 : panel.getBoundingClientRect();
2672
- if (!rect)
2673
- 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 ");
2675
- _this.setState({ animationClass: 'cauldron-collapse-close' }, function () {
2676
- setTimeout(function () {
2677
- _this.setState({ animationClass: '', isAnimating: false });
2678
- setStyle(_this.styleTag, '');
2679
- }, animationTiming);
2680
- });
2681
- };
2682
- return _this;
2683
- }
2684
- ExpandCollapsePanel.prototype.componentWillUnmount = function () {
2685
- var styleTag = this.styleTag;
2686
- if (styleTag) {
2687
- removeStyleTag(styleTag);
2688
- }
2689
- };
2690
- ExpandCollapsePanel.prototype.componentDidUpdate = function (prevProps, prevState) {
2691
- var _a = this.state, openState = _a.isOpen, controlled = _a.controlled;
2692
- var openProp = this.props.open;
2693
- if (controlled && openState !== openProp) {
2694
- this.setState({ isOpen: !!openProp, isAnimating: true });
2695
- }
2696
- if (typeof openProp !== typeof prevProps.open) {
2697
- this.setState({ controlled: typeof openProp !== 'undefined' });
2698
- }
2699
- if (prevState.isOpen !== openState && openState) {
2700
- this.animateOpen();
2701
- }
2702
- else if (prevState.isOpen !== openState && !openState) {
2703
- this.animateClose();
2704
- }
2705
- };
2706
- ExpandCollapsePanel.prototype.render = function () {
2707
- /* eslint-disable no-unused-vars */
2708
- var _a = this.props, children = _a.children, animationTiming = _a.animationTiming, className = _a.className, onToggle = _a.onToggle, open = _a.open, other = tslib.__rest(_a, ["children", "animationTiming", "className", "onToggle", "open"]);
2709
- /* eslint-enable no-unused-vars */
2710
- var _b = this.state, isOpen = _b.isOpen, isAnimating = _b.isAnimating, animationClass = _b.animationClass;
2711
- var trigger = React__default.Children.toArray(children).find(function (child) { return child.type === PanelTrigger$1; });
2712
- var panelElements = React__default.Children.toArray(children).filter(function (child) {
2713
- return typeof child === 'string' ||
2714
- child.type !== PanelTrigger$1;
2715
- });
2716
- return (React__default.createElement(React__default.Fragment, null,
2717
- trigger &&
2718
- React__default.cloneElement(trigger, {
2719
- open: isOpen,
2720
- onClick: this.handleToggle
2721
- }),
2722
- React__default.createElement("div", tslib.__assign({}, other, { className: classNames('ExpandCollapse__panel', animationClass, className, {
2723
- 'is--hidden': !isOpen && !isAnimating
2724
- }), ref: this.panel }), panelElements)));
2725
- };
2726
- ExpandCollapsePanel.defaultProps = {
2727
- animationTiming: 250,
2728
- onToggle: function () { }
2729
- };
2730
- ExpandCollapsePanel.propTypes = {
2731
- open: PropTypes.bool,
2732
- children: PropTypes.node.isRequired,
2733
- className: PropTypes.string,
2734
- animationTiming: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),
2735
- onToggle: PropTypes.func
2736
- };
2737
- return ExpandCollapsePanel;
2738
- }(React__default.Component));
2739
-
2740
2889
  function _objectWithoutPropertiesLoose(source, excluded) {
2741
2890
  if (source == null) return {};
2742
2891
  var target = {};
@@ -2839,27 +2988,6 @@ function _defineProperty(obj, key, value) {
2839
2988
 
2840
2989
  var defineProperty = _defineProperty;
2841
2990
 
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
2991
  function createCommonjsModule(fn, basedir, module) {
2864
2992
  return module = {
2865
2993
  path: basedir,
@@ -2896,6 +3024,9 @@ function _extends() {
2896
3024
  module.exports = _extends;
2897
3025
  });
2898
3026
 
3027
+ 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; }
3028
+
3029
+ 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
3030
  //
2900
3031
  // Super simple, non-algorithmic solution since the
2901
3032
  // number of class names will not be greater than 4
@@ -2941,7 +3072,7 @@ function createStyleObject(classNames) {
2941
3072
  });
2942
3073
  var classNamesCombinations = getClassNameCombinations(nonTokenClassNames);
2943
3074
  return classNamesCombinations.reduce(function (styleObject, className) {
2944
- return objectSpread({}, styleObject, stylesheet[className]);
3075
+ return _objectSpread(_objectSpread({}, styleObject), stylesheet[className]);
2945
3076
  }, elementStyle);
2946
3077
  }
2947
3078
  function createClassNameString(classNames) {
@@ -2980,7 +3111,7 @@ function createElement(_ref) {
2980
3111
  var props;
2981
3112
 
2982
3113
  if (!useInlineStyles) {
2983
- props = objectSpread({}, properties, {
3114
+ props = _objectSpread(_objectSpread({}, properties), {}, {
2984
3115
  className: createClassNameString(properties.className)
2985
3116
  });
2986
3117
  } else {
@@ -2995,14 +3126,14 @@ function createElement(_ref) {
2995
3126
  var className = properties.className && startingClassName.concat(properties.className.filter(function (className) {
2996
3127
  return !allStylesheetSelectors.includes(className);
2997
3128
  }));
2998
- props = objectSpread({}, properties, {
3129
+ props = _objectSpread(_objectSpread({}, properties), {}, {
2999
3130
  className: createClassNameString(className) || undefined,
3000
3131
  style: createStyleObject(properties.className, Object.assign({}, properties.style, style), stylesheet)
3001
3132
  });
3002
3133
  }
3003
3134
 
3004
3135
  var children = childrenCreator(node.children);
3005
- return React__default.createElement(TagName, _extends_1({
3136
+ return /*#__PURE__*/React__default.createElement(TagName, _extends_1({
3006
3137
  key: key
3007
3138
  }, props), children);
3008
3139
  }
@@ -3013,6 +3144,11 @@ var checkForListedLanguage = (function (astGenerator, language) {
3013
3144
  return langs.indexOf(language) !== -1;
3014
3145
  });
3015
3146
 
3147
+ var _excluded = ["language", "children", "style", "customStyle", "codeTagProps", "useInlineStyles", "showLineNumbers", "showInlineLineNumbers", "startingLineNumber", "lineNumberContainerStyle", "lineNumberStyle", "wrapLines", "wrapLongLines", "lineProps", "renderer", "PreTag", "CodeTag", "code", "astGenerator"];
3148
+
3149
+ 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; }
3150
+
3151
+ 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
3152
  var newLineRegex = /\n/g;
3017
3153
 
3018
3154
  function getNewLines(str) {
@@ -3025,7 +3161,7 @@ function getAllLineNumbers(_ref) {
3025
3161
  style = _ref.style;
3026
3162
  return lines.map(function (_, i) {
3027
3163
  var number = i + startingLineNumber;
3028
- return React__default.createElement("span", {
3164
+ return /*#__PURE__*/React__default.createElement("span", {
3029
3165
  key: "line-".concat(i),
3030
3166
  className: "react-syntax-highlighter-line-number",
3031
3167
  style: typeof style === 'function' ? style(number) : style
@@ -3038,13 +3174,13 @@ function AllLineNumbers(_ref2) {
3038
3174
  codeStyle = _ref2.codeStyle,
3039
3175
  _ref2$containerStyle = _ref2.containerStyle,
3040
3176
  containerStyle = _ref2$containerStyle === void 0 ? {
3041
- float: 'left',
3177
+ "float": 'left',
3042
3178
  paddingRight: '10px'
3043
3179
  } : _ref2$containerStyle,
3044
3180
  _ref2$numberStyle = _ref2.numberStyle,
3045
3181
  numberStyle = _ref2$numberStyle === void 0 ? {} : _ref2$numberStyle,
3046
3182
  startingLineNumber = _ref2.startingLineNumber;
3047
- return React__default.createElement("code", {
3183
+ return /*#__PURE__*/React__default.createElement("code", {
3048
3184
  style: Object.assign({}, codeStyle, containerStyle)
3049
3185
  }, getAllLineNumbers({
3050
3186
  lines: codeString.replace(/\n$/, '').split('\n'),
@@ -3085,7 +3221,7 @@ function assembleLineNumberStyles(lineNumberStyle, lineNumber, largestLineNumber
3085
3221
 
3086
3222
  var customLineNumberStyle = typeof lineNumberStyle === 'function' ? lineNumberStyle(lineNumber) : lineNumberStyle; // combine
3087
3223
 
3088
- var assembledStyle = objectSpread({}, defaultLineNumberStyle, customLineNumberStyle);
3224
+ var assembledStyle = _objectSpread$1(_objectSpread$1({}, defaultLineNumberStyle), customLineNumberStyle);
3089
3225
 
3090
3226
  return assembledStyle;
3091
3227
  }
@@ -3111,7 +3247,7 @@ function createLineElement(_ref3) {
3111
3247
  }
3112
3248
 
3113
3249
  if (wrapLongLines & showLineNumbers) {
3114
- properties.style = objectSpread({}, properties.style, {
3250
+ properties.style = _objectSpread$1(_objectSpread$1({}, properties.style), {}, {
3115
3251
  display: 'flex'
3116
3252
  });
3117
3253
  }
@@ -3138,7 +3274,9 @@ function flattenCodeTree(tree) {
3138
3274
  }));
3139
3275
  } else if (node.children) {
3140
3276
  var classNames = className.concat(node.properties.className);
3141
- newTree = newTree.concat(flattenCodeTree(node.children, classNames));
3277
+ flattenCodeTree(node.children, classNames).forEach(function (i) {
3278
+ return newTree.push(i);
3279
+ });
3142
3280
  }
3143
3281
  }
3144
3282
 
@@ -3207,19 +3345,19 @@ function processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlin
3207
3345
  newTree.push(_line); // if it's the last line
3208
3346
  } else if (i === splitValue.length - 1) {
3209
3347
  var stringChild = tree[index + 1] && tree[index + 1].children && tree[index + 1].children[0];
3348
+ var lastLineInPreviousSpan = {
3349
+ type: 'text',
3350
+ value: "".concat(text)
3351
+ };
3210
3352
 
3211
3353
  if (stringChild) {
3212
- var lastLineInPreviousSpan = {
3213
- type: 'text',
3214
- value: "".concat(text)
3215
- };
3216
3354
  var newElem = createLineElement({
3217
3355
  children: [lastLineInPreviousSpan],
3218
3356
  className: node.properties.className
3219
3357
  });
3220
3358
  tree.splice(index + 1, 0, newElem);
3221
3359
  } else {
3222
- var _children2 = [newChild];
3360
+ var _children2 = [lastLineInPreviousSpan];
3223
3361
 
3224
3362
  var _line2 = createLine(_children2, lineNumber, node.properties.className);
3225
3363
 
@@ -3325,7 +3463,7 @@ function highlight (defaultAstGenerator, defaultStyle) {
3325
3463
  _ref7$codeTagProps = _ref7.codeTagProps,
3326
3464
  codeTagProps = _ref7$codeTagProps === void 0 ? {
3327
3465
  className: language ? "language-".concat(language) : undefined,
3328
- style: objectSpread({}, style['code[class*="language-"]'], style["code[class*=\"language-".concat(language, "\"]")])
3466
+ style: _objectSpread$1(_objectSpread$1({}, style['code[class*="language-"]']), style["code[class*=\"language-".concat(language, "\"]")])
3329
3467
  } : _ref7$codeTagProps,
3330
3468
  _ref7$useInlineStyles = _ref7.useInlineStyles,
3331
3469
  useInlineStyles = _ref7$useInlineStyles === void 0 ? true : _ref7$useInlineStyles,
@@ -3349,12 +3487,12 @@ function highlight (defaultAstGenerator, defaultStyle) {
3349
3487
  _ref7$CodeTag = _ref7.CodeTag,
3350
3488
  CodeTag = _ref7$CodeTag === void 0 ? 'code' : _ref7$CodeTag,
3351
3489
  _ref7$code = _ref7.code,
3352
- code = _ref7$code === void 0 ? Array.isArray(children) ? children[0] : children : _ref7$code,
3490
+ code = _ref7$code === void 0 ? (Array.isArray(children) ? children[0] : children) || '' : _ref7$code,
3353
3491
  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"]);
3492
+ rest = objectWithoutProperties(_ref7, _excluded);
3355
3493
 
3356
3494
  astGenerator = astGenerator || defaultAstGenerator;
3357
- var allLineNumbers = showLineNumbers ? React__default.createElement(AllLineNumbers, {
3495
+ var allLineNumbers = showLineNumbers ? /*#__PURE__*/React__default.createElement(AllLineNumbers, {
3358
3496
  containerStyle: lineNumberContainerStyle,
3359
3497
  codeStyle: codeTagProps.style || {},
3360
3498
  numberStyle: lineNumberStyle,
@@ -3372,8 +3510,18 @@ function highlight (defaultAstGenerator, defaultStyle) {
3372
3510
  style: Object.assign({}, customStyle)
3373
3511
  });
3374
3512
 
3513
+ if (wrapLongLines) {
3514
+ codeTagProps.style = _objectSpread$1(_objectSpread$1({}, codeTagProps.style), {}, {
3515
+ whiteSpace: 'pre-wrap'
3516
+ });
3517
+ } else {
3518
+ codeTagProps.style = _objectSpread$1(_objectSpread$1({}, codeTagProps.style), {}, {
3519
+ whiteSpace: 'pre'
3520
+ });
3521
+ }
3522
+
3375
3523
  if (!astGenerator) {
3376
- return React__default.createElement(PreTag, preProps, allLineNumbers, React__default.createElement(CodeTag, codeTagProps, code));
3524
+ return /*#__PURE__*/React__default.createElement(PreTag, preProps, allLineNumbers, /*#__PURE__*/React__default.createElement(CodeTag, codeTagProps, code));
3377
3525
  }
3378
3526
  /*
3379
3527
  * Some custom renderers rely on individual row elements so we need to turn wrapLines on
@@ -3401,18 +3549,7 @@ function highlight (defaultAstGenerator, defaultStyle) {
3401
3549
 
3402
3550
  var largestLineNumber = codeTree.value.length + startingLineNumber;
3403
3551
  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({
3552
+ return /*#__PURE__*/React__default.createElement(PreTag, preProps, /*#__PURE__*/React__default.createElement(CodeTag, codeTagProps, !showInlineLineNumbers && allLineNumbers, renderer({
3416
3553
  rows: rows,
3417
3554
  stylesheet: style,
3418
3555
  useInlineStyles: useInlineStyles
@@ -7977,15 +8114,19 @@ SyntaxHighlighter.registerLanguage('javascript', javascript_1);
7977
8114
  SyntaxHighlighter.registerLanguage('css', css_1);
7978
8115
  SyntaxHighlighter.registerLanguage('html', xml_1);
7979
8116
  SyntaxHighlighter.registerLanguage('yaml', yaml_1);
8117
+ // HACK: This is a workaround for a bug in react-syntax-highlighter's types.
8118
+ var Highlighter = SyntaxHighlighter;
7980
8119
  var Code = function (_a) {
7981
8120
  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));
8121
+ return (React__default.createElement(React__default.Fragment, null,
8122
+ React__default.createElement(Highlighter, tslib.__assign({}, props, { useInlineStyles: false, className: classNames('Code', className), tabIndex: tabIndex }), children)));
7983
8123
  };
7984
8124
  Code.displayName = 'Code';
7985
8125
  Code.propTypes = {
7986
8126
  children: PropTypes.string.isRequired,
7987
8127
  language: PropTypes.oneOf(['javascript', 'css', 'html', 'yaml']),
7988
- className: PropTypes.string
8128
+ className: PropTypes.string,
8129
+ tabIndex: PropTypes.number
7989
8130
  };
7990
8131
 
7991
8132
  function AxeLoader() {
@@ -8064,6 +8205,7 @@ LoaderOverlay.propTypes = {
8064
8205
  variant: PropTypes.oneOf(['large', 'small']),
8065
8206
  label: PropTypes.string,
8066
8207
  focusOnInitialRender: PropTypes.bool,
8208
+ // @ts-expect-error
8067
8209
  children: PropTypes.node
8068
8210
  };
8069
8211
  LoaderOverlay.displayName = 'LoaderOverlay';
@@ -8183,6 +8325,7 @@ Tab.displayName = 'Tab';
8183
8325
  Tab.propTypes = {
8184
8326
  target: PropTypes.any.isRequired,
8185
8327
  id: PropTypes.string,
8328
+ // @ts-expect-error
8186
8329
  children: PropTypes.node
8187
8330
  };
8188
8331
 
@@ -8277,7 +8420,8 @@ var Tabs = function (_a) {
8277
8420
  React.useEffect(function () {
8278
8421
  var _a, _b;
8279
8422
  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');
8423
+ ? (_a = target.current) === null || _a === void 0 ? void 0 : _a.classList.remove('TabPanel--hidden')
8424
+ : (_b = target.current) === null || _b === void 0 ? void 0 : _b.classList.add('TabPanel--hidden');
8281
8425
  }, [activeIndex]);
8282
8426
  var config = tslib.__assign((_a = { id: id, className: classNames('Tab', {
8283
8427
  'Tab--active': selected
@@ -8317,6 +8461,7 @@ var TabPanel = React.forwardRef(function (_a, ref) {
8317
8461
  TabPanel.displayName = 'TabPanel';
8318
8462
  TabPanel.propTypes = {
8319
8463
  id: PropTypes.string,
8464
+ // @ts-expect-error
8320
8465
  children: PropTypes.node,
8321
8466
  className: PropTypes.string
8322
8467
  };
@@ -8363,12 +8508,12 @@ var Step = function (props) {
8363
8508
  var liProps;
8364
8509
  var isTooltip = isTooltipProps(other);
8365
8510
  if (isTooltip) {
8366
- (_a = other, (tooltip = _a.tooltip, tooltipText = _a.tooltipText, _a), liProps = tslib.__rest(_a, ["tooltip", "tooltipText"]));
8511
+ (_a = other, (tooltip = _a.tooltip, tooltipText = _a.tooltipText), liProps = tslib.__rest(_a, ["tooltip", "tooltipText"]));
8367
8512
  }
8368
8513
  else {
8369
8514
  liProps = other;
8370
8515
  }
8371
- return (React__default.createElement("li", tslib.__assign({ className: classNames('Stepper__step', "Stepper__step--" + status, className), "aria-current": status === 'current' ? 'step' : 'false' }, liProps),
8516
+ return (React__default.createElement("li", tslib.__assign({ className: classNames('Stepper__step', "Stepper__step--".concat(status), className), "aria-current": status === 'current' ? 'step' : 'false' }, liProps),
8372
8517
  React__default.createElement("div", { className: "Stepper__step-line" }),
8373
8518
  React__default.createElement("div", { className: "Stepper__step-content" }, isTooltip ? (React__default.createElement(TooltipTabstop, { placement: "bottom", tooltip: tooltip,
8374
8519
  // the pseudo content (ex: "1") is conveyed
@@ -8410,7 +8555,7 @@ var Panel = React.forwardRef(function (_a, ref) {
8410
8555
  if (!headingId) {
8411
8556
  return null;
8412
8557
  }
8413
- var HeadingComponent = "h" + (heading &&
8558
+ var HeadingComponent = "h".concat(heading &&
8414
8559
  typeof heading === 'object' &&
8415
8560
  'level' in heading &&
8416
8561
  !!heading.level
@@ -8428,7 +8573,9 @@ var Panel = React.forwardRef(function (_a, ref) {
8428
8573
  });
8429
8574
  Panel.displayName = 'Panel';
8430
8575
  Panel.propTypes = {
8576
+ // @ts-expect-error
8431
8577
  children: PropTypes.node.isRequired,
8578
+ // @ts-expect-error
8432
8579
  heading: PropTypes.oneOfType([PropTypes.object, PropTypes.node]),
8433
8580
  className: PropTypes.string
8434
8581
  };
@@ -8438,7 +8585,7 @@ var IssuePanel = function (_a) {
8438
8585
  return (React__default.createElement("div", { className: classNames('IssuePanel', className) },
8439
8586
  React__default.createElement("div", { className: "IssuePanel__Header" },
8440
8587
  title && React__default.createElement("div", { className: "IssuePanel__Header-title" }, title),
8441
- actions && React__default.createElement("div", { className: "IssuePanel__Header-actions" }, actions)),
8588
+ actions && (React__default.createElement("div", { className: "IssuePanel__Header-actions" }, actions))),
8442
8589
  React__default.createElement("div", { className: "IssuePanel__Content" }, children)));
8443
8590
  };
8444
8591
  IssuePanel.displayName = 'IssuePanel';
@@ -8451,7 +8598,7 @@ var ProgressBar = React.forwardRef(function (_a, ref) {
8451
8598
  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
8599
  var className = props.className, otherProps = tslib.__rest(props, ["className"]);
8453
8600
  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) + "%" } })));
8601
+ React__default.createElement("div", { className: "ProgressBar--fill", style: { width: "".concat(Math.min((progress / progressMax) * 100, 100), "%") } })));
8455
8602
  });
8456
8603
  ProgressBar.displayName = 'ProgressBar';
8457
8604
 
@@ -8532,12 +8679,41 @@ Pagination.propTypes = {
8532
8679
  className: PropTypes.string
8533
8680
  };
8534
8681
 
8682
+ var usePagination = function (_a) {
8683
+ var totalItems = _a.totalItems, _b = _a.initialPageSize, initialPageSize = _b === void 0 ? 10 : _b, _c = _a.initialPage, initialPage = _c === void 0 ? 1 : _c;
8684
+ var _d = tslib.__read(React.useState(initialPage), 2), currentPage = _d[0], setCurrentPage = _d[1];
8685
+ var pageStart = currentPage * initialPageSize - initialPageSize + 1;
8686
+ var pageEnd = Math.min(pageStart + initialPageSize - 1, totalItems);
8687
+ var onFirstPageClick = function () { return setCurrentPage(1); };
8688
+ var onPreviousPageClick = function () { return setCurrentPage(currentPage - 1); };
8689
+ var onNextPageClick = function () { return setCurrentPage(currentPage + 1); };
8690
+ var onLastPageClick = function () {
8691
+ return setCurrentPage(Math.ceil(totalItems / initialPageSize));
8692
+ };
8693
+ var pagination = {
8694
+ totalItems: totalItems,
8695
+ currentPage: currentPage,
8696
+ itemsPerPage: initialPageSize,
8697
+ onFirstPageClick: onFirstPageClick,
8698
+ onPreviousPageClick: onPreviousPageClick,
8699
+ onNextPageClick: onNextPageClick,
8700
+ onLastPageClick: onLastPageClick
8701
+ };
8702
+ var pageStatus = {
8703
+ currentPage: currentPage,
8704
+ pageStart: pageStart,
8705
+ pageEnd: pageEnd
8706
+ };
8707
+ return { pagination: pagination, pageStatus: pageStatus };
8708
+ };
8709
+
8535
8710
  var FieldWrap = React__default.forwardRef(function (_a, ref) {
8536
8711
  var children = _a.children, className = _a.className, _b = _a.as, Component = _b === void 0 ? 'div' : _b, props = tslib.__rest(_a, ["children", "className", "as"]);
8537
8712
  return (React__default.createElement(Component, tslib.__assign({ ref: ref, className: classNames('Panel', className) }, props), children));
8538
8713
  });
8539
8714
  FieldWrap.displayName = 'FieldWrap';
8540
8715
  FieldWrap.propTypes = {
8716
+ // @ts-expect-error
8541
8717
  children: PropTypes.node.isRequired,
8542
8718
  className: PropTypes.string,
8543
8719
  as: PropTypes.string
@@ -8558,7 +8734,7 @@ var Breadcrumb = React.forwardRef(function (_a, ref) {
8558
8734
  }
8559
8735
  });
8560
8736
  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)); }))));
8737
+ React__default.createElement("ol", null, childrenWithSeparators.map(function (child, index) { return (React__default.createElement("li", { className: "Breadcrumb__Item", key: "breadcrumb-".concat(index) }, child)); }))));
8562
8738
  });
8563
8739
  Breadcrumb.displayName = 'Breadcrumb';
8564
8740
 
@@ -8571,6 +8747,7 @@ var BreadcrumbLink = React.forwardRef(function (_a, ref) {
8571
8747
  var className = _a.className, _b = _a.as, ElementType = _b === void 0 ? 'a' : _b, children = _a.children, props = tslib.__rest(_a, ["className", "as", "children"]);
8572
8748
  return (React__default.createElement(ElementType, tslib.__assign({ className: classNames('Link', 'Breadcrumb__Link', className), ref: ref }, props), children));
8573
8749
  });
8750
+ BreadcrumbLink.displayName = 'BreadcrumbLink';
8574
8751
 
8575
8752
  var ColumnLeft = React.forwardRef(function (_a, ref) {
8576
8753
  var className = _a.className, children = _a.children, props = tslib.__rest(_a, ["className", "children"]);
@@ -8589,6 +8766,11 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8589
8766
  var _f = tslib.__read(React.useState(initialCollapsed), 2), isCollapsed = _f[0], setCollapsed = _f[1];
8590
8767
  var _g = tslib.__read(React.useState(false), 2), isFocusTrap = _g[0], setIsFocusTrap = _g[1];
8591
8768
  var _h = tslib.__read(React.useState(!initialCollapsed), 2), showPanel = _h[0], setShowPanel = _h[1];
8769
+ var toggleButtonRef = React.useRef(null);
8770
+ var closeButtonRef = React.useRef(null);
8771
+ var columnLeftRef = React.useRef(null);
8772
+ var columnRightRef = React.useRef(null);
8773
+ var columnLeft = React__default.Children.toArray(children).find(function (child) { return child.type === ColumnLeft; });
8592
8774
  var togglePanel = function () {
8593
8775
  if (isCollapsed) {
8594
8776
  setShowPanel(true);
@@ -8606,11 +8788,6 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8606
8788
  }
8607
8789
  });
8608
8790
  };
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
8791
  // The ColumnLeftComponent will end up being a focus trap when < 720px
8615
8792
  // This component also gets unmounted when not visible meaning that any
8616
8793
  // aria relationships cannot be set to items inside the component since
@@ -8625,11 +8802,11 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8625
8802
  React__default.createElement("button", { type: "button", onClick: togglePanel, ref: closeButtonRef, "aria-label": hideCollapsedPanelLabel },
8626
8803
  React__default.createElement(Icon, { type: "close" })),
8627
8804
  React__default.createElement(Tooltip, { target: closeButtonRef, association: "aria-labelledby", hideElementOnHidden: true }, hideCollapsedPanelLabel)));
8628
- var children_1 = tslib.__spread([
8805
+ var children_1 = tslib.__spreadArray([
8629
8806
  CloseButton
8630
- ], React__default.Children.toArray(columnLeft.props.children));
8807
+ ], tslib.__read(React__default.Children.toArray(columnLeft.props.children)), false);
8631
8808
  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 });
8809
+ return React.cloneElement(child, { key: "left-".concat(index) });
8633
8810
  }));
8634
8811
  }
8635
8812
  var columnRight = React__default.Children.toArray(children).find(function (child) { return child.type === ColumnRight; });
@@ -8640,11 +8817,11 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8640
8817
  React__default.createElement("button", { type: "button", onClick: togglePanel, ref: toggleButtonRef, "aria-label": !isCollapsed ? hideCollapsedPanelLabel : showCollapsedPanelLabel, "aria-expanded": !isCollapsed, "aria-controls": columnLeftId },
8641
8818
  React__default.createElement(Icon, { type: !isCollapsed ? 'chevron-double-left' : 'chevron-double-right' })),
8642
8819
  React__default.createElement(Tooltip, { target: toggleButtonRef, association: "aria-labelledby", hideElementOnHidden: true }, !isCollapsed ? hideCollapsedPanelLabel : showCollapsedPanelLabel)));
8643
- var children_2 = tslib.__spread([
8820
+ var children_2 = tslib.__spreadArray([
8644
8821
  ToggleButton
8645
- ], React__default.Children.toArray(columnRight.props.children));
8822
+ ], tslib.__read(React__default.Children.toArray(columnRight.props.children)), false);
8646
8823
  ColumnRightComponent = React.cloneElement(columnRight, { ref: ref_2, tabIndex: -1 }, children_2.map(function (child, index) {
8647
- return React.cloneElement(child, { key: "right-" + index });
8824
+ return React.cloneElement(child, { key: "right-".concat(index) });
8648
8825
  }));
8649
8826
  }
8650
8827
  React.useLayoutEffect(function () {
@@ -8709,15 +8886,16 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8709
8886
  'TwoColumnPanel--show': !isCollapsed,
8710
8887
  'TwoColumnPanel--hide': isCollapsed
8711
8888
  }) }, 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));
8889
+ React__default.createElement(React__default.Fragment, null,
8890
+ React__default.createElement(FocusTrap, { active: !isCollapsed && isFocusTrap, focusTrapOptions: {
8891
+ escapeDeactivates: true,
8892
+ allowOutsideClick: true,
8893
+ fallbackFocus: columnLeftRef.current
8894
+ }, containerElements: [columnLeftRef.current] }),
8895
+ React__default.createElement(ClickOutsideListener, { onClickOutside: handleClickOutside, target: columnLeftRef.current }),
8896
+ isCollapsed ? null : skipLink,
8897
+ showPanel ? ColumnLeftComponent : null,
8898
+ ColumnRightComponent)));
8721
8899
  });
8722
8900
  TwoColumnPanel.displayName = 'TwoColumnPanel';
8723
8901
 
@@ -8798,6 +8976,9 @@ ThemeProvider.propTypes = {
8798
8976
  initialTheme: PropTypes.string
8799
8977
  };
8800
8978
 
8979
+ exports.Accordion = Accordion;
8980
+ exports.AccordionContent = AccordionContent;
8981
+ exports.AccordionTrigger = AccordionTrigger;
8801
8982
  exports.Address = Address;
8802
8983
  exports.AddressCityStateZip = AddressCityStateZip;
8803
8984
  exports.AddressLine = AddressLine;
@@ -8857,6 +9038,7 @@ exports.Panel = Panel;
8857
9038
  exports.PanelTrigger = PanelTrigger$1;
8858
9039
  exports.Pointout = Pointout;
8859
9040
  exports.ProgressBar = ProgressBar;
9041
+ exports.RadioCardGroup = RadioCardGroup;
8860
9042
  exports.RadioGroup = RadioGroup;
8861
9043
  exports.Scrim = Scrim;
8862
9044
  exports.Select = Select;
@@ -8894,4 +9076,5 @@ exports.Workspace = Workspace;
8894
9076
  exports.focusableSelector = focusableSelector;
8895
9077
  exports.iconTypes = iconTypes;
8896
9078
  exports.useDidUpdate = useDidUpdate;
9079
+ exports.usePagination = usePagination;
8897
9080
  exports.useThemeContext = useThemeContext;