@deque/cauldron-react 4.5.0-canary.b2ef84aa → 4.5.0-canary.d5614ca7
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/components/Breadcrumb/Breadcrumb.d.ts +5 -9
- package/lib/components/Breadcrumb/BreadcrumbLink.d.ts +1 -1
- package/lib/components/Button/index.d.ts +1 -1
- package/lib/components/Code/index.d.ts +2 -2
- package/lib/components/Dialog/index.d.ts +1 -1
- package/lib/components/ExpandCollapsePanel/PanelTrigger.d.ts +1 -1
- package/lib/components/Icon/types.d.ts +1 -1
- package/lib/components/OptionsMenu/OptionsMenu.d.ts +1 -0
- package/lib/components/Pagination/Pagination.d.ts +20 -0
- package/lib/components/Pagination/index.d.ts +2 -19
- package/lib/components/Pagination/usePagination.d.ts +24 -0
- package/lib/components/ProgressBar/index.d.ts +6 -12
- package/lib/components/RadioCardGroup/index.d.ts +38 -0
- package/lib/components/Select/index.d.ts +1 -1
- package/lib/components/SideBar/SideBarItem.d.ts +1 -1
- package/lib/components/Toast/index.d.ts +1 -0
- package/lib/components/Tooltip/index.d.ts +1 -1
- package/lib/components/TopBar/TopBarTrigger.d.ts +1 -1
- package/lib/components/TwoColumnPanel/ColumnLeft.d.ts +3 -5
- package/lib/components/TwoColumnPanel/ColumnRight.d.ts +3 -5
- package/lib/filter-solid.js +24 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +291 -169
- package/lib/play.js +25 -0
- package/lib/recycle-square.js +24 -0
- package/lib/utils/remove-ids/index.d.ts +1 -1
- package/package.json +12 -11
package/lib/index.js
CHANGED
|
@@ -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/"
|
|
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 \""
|
|
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--"
|
|
294
|
-
_b["Icon__"
|
|
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),
|
|
@@ -364,7 +370,7 @@ var Scrim = /** @class */ (function (_super) {
|
|
|
364
370
|
if (destroy) {
|
|
365
371
|
return null;
|
|
366
372
|
}
|
|
367
|
-
return (React__default.createElement("div", { ref: function (el) { return (_this.el = el); }, className: "Scrim "
|
|
373
|
+
return (React__default.createElement("div", { ref: function (el) { return (_this.el = el); }, className: "Scrim ".concat(animationClass) }));
|
|
368
374
|
};
|
|
369
375
|
Scrim.propTypes = {
|
|
370
376
|
show: PropTypes.bool.isRequired
|
|
@@ -498,9 +504,9 @@ var TopBar = /** @class */ (function (_super) {
|
|
|
498
504
|
args[_i] = arguments[_i];
|
|
499
505
|
}
|
|
500
506
|
// @ts-ignore we're just spreading the original args
|
|
501
|
-
_this.onKeyDown.apply(_this, tslib.
|
|
507
|
+
_this.onKeyDown.apply(_this, tslib.__spreadArray([], tslib.__read(args), false));
|
|
502
508
|
if (child.props.onKeyDown) {
|
|
503
|
-
(_a = child.props).onKeyDown.apply(_a, tslib.
|
|
509
|
+
(_a = child.props).onKeyDown.apply(_a, tslib.__spreadArray([], tslib.__read(args), false));
|
|
504
510
|
}
|
|
505
511
|
},
|
|
506
512
|
tabIndex: 0,
|
|
@@ -536,7 +542,7 @@ var TopBar = /** @class */ (function (_super) {
|
|
|
536
542
|
};
|
|
537
543
|
TopBar.prototype.onKeyDown = function (e) {
|
|
538
544
|
var key = keyname(e.which);
|
|
539
|
-
var menuItems = tslib.
|
|
545
|
+
var menuItems = tslib.__spreadArray([], tslib.__read(this.menuItems), false);
|
|
540
546
|
// account for hidden side bar trigger (hamburger)
|
|
541
547
|
if (this.state.wide && this.props.hasTrigger) {
|
|
542
548
|
menuItems.shift();
|
|
@@ -592,6 +598,7 @@ var TopBarTrigger = function (_a) {
|
|
|
592
598
|
};
|
|
593
599
|
TopBarTrigger.displayName = 'TopBarTrigger';
|
|
594
600
|
TopBarTrigger.propTypes = {
|
|
601
|
+
// @ts-expect-error
|
|
595
602
|
children: PropTypes.node.isRequired,
|
|
596
603
|
className: PropTypes.string
|
|
597
604
|
};
|
|
@@ -787,7 +794,7 @@ var OptionsMenuList = /** @class */ (function (_super) {
|
|
|
787
794
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
788
795
|
var items = React__default.Children.toArray(children).map(function (child, i) {
|
|
789
796
|
var _a = child.props, className = _a.className, other = tslib.__rest(_a, ["className"]);
|
|
790
|
-
return React__default.cloneElement(child, tslib.__assign({ key: "list-item-"
|
|
797
|
+
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
798
|
});
|
|
792
799
|
// Key event is being handled in componentDidMount
|
|
793
800
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
@@ -1167,7 +1174,8 @@ var SideBar = /** @class */ (function (_super) {
|
|
|
1167
1174
|
setTimeout(function () {
|
|
1168
1175
|
var _a, _b;
|
|
1169
1176
|
_this.setState({ animateClass: second });
|
|
1170
|
-
var firstFocusable = show &&
|
|
1177
|
+
var firstFocusable = show &&
|
|
1178
|
+
((_b = (_a = _this.navList) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.querySelector(focusableSelector));
|
|
1171
1179
|
if (firstFocusable) {
|
|
1172
1180
|
firstFocusable.focus();
|
|
1173
1181
|
}
|
|
@@ -1216,6 +1224,7 @@ SideBarItem.defaultProps = {
|
|
|
1216
1224
|
autoClickLink: true
|
|
1217
1225
|
};
|
|
1218
1226
|
SideBarItem.propTypes = {
|
|
1227
|
+
// @ts-expect-error
|
|
1219
1228
|
children: PropTypes.node.isRequired,
|
|
1220
1229
|
autoClickLink: PropTypes.bool
|
|
1221
1230
|
};
|
|
@@ -1305,7 +1314,7 @@ var Dialog = /** @class */ (function (_super) {
|
|
|
1305
1314
|
var close = !forceAction ? (React__default.createElement("button", { className: "Dialog__close", type: "button", onClick: this.close },
|
|
1306
1315
|
React__default.createElement(Icon, { type: "close", "aria-hidden": "true" }),
|
|
1307
1316
|
React__default.createElement(Offscreen, null, closeButtonText))) : null;
|
|
1308
|
-
var Heading = "h"
|
|
1317
|
+
var Heading = "h".concat(typeof heading === 'object' && 'level' in heading && !!heading.level
|
|
1309
1318
|
? heading.level
|
|
1310
1319
|
: 2);
|
|
1311
1320
|
var Dialog = (React__default.createElement(FocusTrap, { focusTrapOptions: {
|
|
@@ -1464,7 +1473,7 @@ var SkipLink = /** @class */ (function (_super) {
|
|
|
1464
1473
|
target: function (props, propName, componentName) {
|
|
1465
1474
|
var value = props[propName];
|
|
1466
1475
|
if (!value || typeof value !== 'string' || value[0] !== '#') {
|
|
1467
|
-
return new Error("Invalid prop "
|
|
1476
|
+
return new Error("Invalid prop ".concat(propName, " supplied to ").concat(componentName, " (must be string starting with \"#\")"));
|
|
1468
1477
|
}
|
|
1469
1478
|
},
|
|
1470
1479
|
skipText: PropTypes.string,
|
|
@@ -1480,6 +1489,8 @@ var Button = React.forwardRef(function (_a, ref) {
|
|
|
1480
1489
|
'Button--secondary': variant === 'secondary',
|
|
1481
1490
|
'Button--error': variant === 'error',
|
|
1482
1491
|
Link: variant === 'link',
|
|
1492
|
+
Tag: variant === 'tag',
|
|
1493
|
+
'Button--tag': variant === 'tag',
|
|
1483
1494
|
'Button--thin': thin
|
|
1484
1495
|
}), ref: ref || buttonRef }, other), children));
|
|
1485
1496
|
});
|
|
@@ -1609,8 +1620,8 @@ function Tooltip(_a) {
|
|
|
1609
1620
|
targetElement === null || targetElement === void 0 ? void 0 : targetElement.setAttribute(association, [id, attrText].filter(Boolean).join(' '));
|
|
1610
1621
|
}
|
|
1611
1622
|
}, [targetElement, id]);
|
|
1612
|
-
return (showTooltip || hideElementOnHidden) && isBrowser()
|
|
1613
|
-
? reactDom.createPortal(React__default.createElement("div", tslib.__assign({ id: id, className: classNames('Tooltip', "Tooltip--"
|
|
1623
|
+
return (React__default.createElement(React__default.Fragment, null, (showTooltip || hideElementOnHidden) && isBrowser()
|
|
1624
|
+
? reactDom.createPortal(React__default.createElement("div", tslib.__assign({ id: id, className: classNames('Tooltip', "Tooltip--".concat(placement), className, {
|
|
1614
1625
|
TooltipInfo: variant === 'info',
|
|
1615
1626
|
'Tooltip--hidden': !showTooltip && hideElementOnHidden,
|
|
1616
1627
|
'Tooltip--big': variant === 'big'
|
|
@@ -1618,7 +1629,7 @@ function Tooltip(_a) {
|
|
|
1618
1629
|
variant !== 'big' && (React__default.createElement("div", { className: "TooltipArrow", ref: setArrowElement, style: styles.arrow })),
|
|
1619
1630
|
children), (portal && 'current' in portal ? portal.current : portal) ||
|
|
1620
1631
|
document.body)
|
|
1621
|
-
: null;
|
|
1632
|
+
: null));
|
|
1622
1633
|
}
|
|
1623
1634
|
Tooltip.displayName = 'Tooltip';
|
|
1624
1635
|
Tooltip.propTypes = {
|
|
@@ -1681,6 +1692,7 @@ IconButton.propTypes = {
|
|
|
1681
1692
|
as: PropTypes.elementType,
|
|
1682
1693
|
// @ts-expect-error
|
|
1683
1694
|
icon: PropTypes.string.isRequired,
|
|
1695
|
+
// @ts-expect-error
|
|
1684
1696
|
label: PropTypes.node.isRequired,
|
|
1685
1697
|
// @ts-expect-error
|
|
1686
1698
|
tooltipPlacement: PropTypes.string,
|
|
@@ -1695,7 +1707,7 @@ IconButton.displayName = 'IconButton';
|
|
|
1695
1707
|
var i = 0;
|
|
1696
1708
|
var randomId = function () {
|
|
1697
1709
|
var num = Math.floor(Math.random() * 10000) + 1;
|
|
1698
|
-
return "x_"
|
|
1710
|
+
return "x_".concat(i++, "_").concat(num);
|
|
1699
1711
|
};
|
|
1700
1712
|
|
|
1701
1713
|
/*
|
|
@@ -1790,16 +1802,15 @@ var Pointout = /** @class */ (function (_super) {
|
|
|
1790
1802
|
visibleFocusable[elementIndex].classList.remove('Pointout--focus-active');
|
|
1791
1803
|
};
|
|
1792
1804
|
_this.positionRelativeToTarget = function () {
|
|
1793
|
-
var _a,
|
|
1794
|
-
var _c = _this.props, target = _c.target, portal = _c.portal, arrowPosition = _c.arrowPosition, position = _c.position;
|
|
1805
|
+
var _a = _this.props, target = _a.target, portal = _a.portal, arrowPosition = _a.arrowPosition, position = _a.position;
|
|
1795
1806
|
if (!target) {
|
|
1796
1807
|
return;
|
|
1797
1808
|
}
|
|
1798
|
-
var targetNode = (
|
|
1809
|
+
var targetNode = (target === null || target === void 0 ? void 0 : target.current) ||
|
|
1799
1810
|
target;
|
|
1800
|
-
var portalNode = (
|
|
1811
|
+
var portalNode = (portal === null || portal === void 0 ? void 0 : portal.current) ||
|
|
1801
1812
|
portal;
|
|
1802
|
-
var
|
|
1813
|
+
var _b = targetNode.getBoundingClientRect(), top = _b.top, left = _b.left, width = _b.width, height = _b.height;
|
|
1803
1814
|
if (portalNode && portalNode !== document.body) {
|
|
1804
1815
|
// If the portal is not placed on document.body
|
|
1805
1816
|
// position the FTPO relative to the portal
|
|
@@ -1807,48 +1818,48 @@ var Pointout = /** @class */ (function (_super) {
|
|
|
1807
1818
|
top -= rect.top - portalNode.scrollTop;
|
|
1808
1819
|
left -= rect.left - portalNode.scrollLeft;
|
|
1809
1820
|
}
|
|
1810
|
-
var
|
|
1821
|
+
var _c = tslib.__read(arrowPosition.split('-'), 1), arrowBoxSide = _c[0];
|
|
1811
1822
|
var style;
|
|
1812
1823
|
switch (arrowBoxSide) {
|
|
1813
1824
|
case 'right':
|
|
1814
1825
|
style = {
|
|
1815
|
-
left: left
|
|
1816
|
-
top: (position === 'center'
|
|
1826
|
+
left: "".concat(left, "px"),
|
|
1827
|
+
top: "".concat(position === 'center'
|
|
1817
1828
|
? top + height / 2
|
|
1818
1829
|
: position === 'start'
|
|
1819
1830
|
? top
|
|
1820
|
-
: top + height
|
|
1831
|
+
: top + height, "px")
|
|
1821
1832
|
};
|
|
1822
1833
|
break;
|
|
1823
1834
|
case 'bottom':
|
|
1824
1835
|
style = {
|
|
1825
|
-
top: top
|
|
1826
|
-
left: (position === 'center'
|
|
1836
|
+
top: "".concat(top, "px"),
|
|
1837
|
+
left: "".concat(position === 'center'
|
|
1827
1838
|
? left + width / 2
|
|
1828
1839
|
: position === 'start'
|
|
1829
1840
|
? left
|
|
1830
|
-
: left + width
|
|
1841
|
+
: left + width, "px")
|
|
1831
1842
|
};
|
|
1832
1843
|
break;
|
|
1833
1844
|
case 'left':
|
|
1834
1845
|
style = {
|
|
1835
|
-
left: left + width
|
|
1836
|
-
top: (position === 'center'
|
|
1846
|
+
left: "".concat(left + width, "px"),
|
|
1847
|
+
top: "".concat(position === 'center'
|
|
1837
1848
|
? top + height / 2
|
|
1838
1849
|
: position === 'start'
|
|
1839
1850
|
? top
|
|
1840
|
-
: top + height
|
|
1851
|
+
: top + height, "px")
|
|
1841
1852
|
};
|
|
1842
1853
|
break;
|
|
1843
1854
|
case 'top':
|
|
1844
1855
|
default:
|
|
1845
1856
|
style = {
|
|
1846
|
-
top: top + height
|
|
1847
|
-
left: (position === 'center'
|
|
1857
|
+
top: "".concat(top + height, "px"),
|
|
1858
|
+
left: "".concat(position === 'center'
|
|
1848
1859
|
? left + width / 2
|
|
1849
1860
|
: position === 'start'
|
|
1850
1861
|
? left
|
|
1851
|
-
: left + width
|
|
1862
|
+
: left + width, "px")
|
|
1852
1863
|
};
|
|
1853
1864
|
break;
|
|
1854
1865
|
}
|
|
@@ -1860,7 +1871,7 @@ var Pointout = /** @class */ (function (_super) {
|
|
|
1860
1871
|
}
|
|
1861
1872
|
Pointout.prototype.getFocusableElements = function (root) {
|
|
1862
1873
|
return root
|
|
1863
|
-
? Array.from(root.querySelectorAll(focusable
|
|
1874
|
+
? Array.from(root.querySelectorAll("".concat(focusable, ", [data-focusable]")))
|
|
1864
1875
|
: [];
|
|
1865
1876
|
};
|
|
1866
1877
|
Pointout.prototype.componentDidMount = function () {
|
|
@@ -1930,11 +1941,11 @@ var Pointout = /** @class */ (function (_super) {
|
|
|
1930
1941
|
'Pointout--no-arrow': noArrow,
|
|
1931
1942
|
'Pointout--auto': !!target
|
|
1932
1943
|
},
|
|
1933
|
-
_a["Pointout__arrow--"
|
|
1934
|
-
_a["Pointout--"
|
|
1944
|
+
_a["Pointout__arrow--".concat(arrowPosition)] = !!arrowPosition && !noArrow,
|
|
1945
|
+
_a["Pointout--".concat(position)] = !!target,
|
|
1935
1946
|
_a)), style: style, role: target ? undefined : 'region', "aria-labelledby": heading ? headingId : undefined, "aria-hidden": !!target && !disableOffscreenPointout, ref: function (el) { return (_this.visibleRef = el); } },
|
|
1936
1947
|
noArrow ? null : (React__default.createElement("div", { className: classNames('Pointout__arrow', (_b = {},
|
|
1937
|
-
_b["Pointout__arrow--"
|
|
1948
|
+
_b["Pointout__arrow--".concat(arrowPosition)] = !!arrowPosition && !noArrow,
|
|
1938
1949
|
_b)) },
|
|
1939
1950
|
React__default.createElement("div", { className: "Pointout__arrow-pointer" }))),
|
|
1940
1951
|
React__default.createElement("div", { className: "Pointout__box" },
|
|
@@ -2115,7 +2126,7 @@ var Toast = /** @class */ (function (_super) {
|
|
|
2115
2126
|
var scrim = type === 'action-needed' && show ? (React__default.createElement("div", { className: "Scrim--light Scrim--show Scrim--fade-in" })) : null;
|
|
2116
2127
|
var defaultProps = {
|
|
2117
2128
|
tabIndex: -1,
|
|
2118
|
-
className: "Toast Toast--"
|
|
2129
|
+
className: "Toast Toast--".concat(typeMap[type].className, " ").concat(animationClass)
|
|
2119
2130
|
};
|
|
2120
2131
|
if (!focus) {
|
|
2121
2132
|
defaultProps.role = 'alert';
|
|
@@ -2301,9 +2312,10 @@ var Select = React__default.forwardRef(function (_a, ref) {
|
|
|
2301
2312
|
'Field__select--disabled': disabled,
|
|
2302
2313
|
'Field--has-error': !!error
|
|
2303
2314
|
}) },
|
|
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)
|
|
2305
|
-
|
|
2306
|
-
|
|
2315
|
+
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)
|
|
2316
|
+
? options.map(function (option) {
|
|
2317
|
+
return (React__default.createElement("option", { className: "Field__option", key: option.key, value: option.value, disabled: option.disabled }, option.label || option.value));
|
|
2318
|
+
})
|
|
2307
2319
|
: children),
|
|
2308
2320
|
React__default.createElement("div", { className: "arrow-down" })),
|
|
2309
2321
|
error && (React__default.createElement("div", { id: errorId, className: "Error" }, error))));
|
|
@@ -2352,7 +2364,7 @@ var RadioGroup = function (_a) {
|
|
|
2352
2364
|
var _a;
|
|
2353
2365
|
handleChange(radioValue);
|
|
2354
2366
|
onChange(radio, (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index]);
|
|
2355
|
-
}, disabled: disabled, checked: isChecked, "aria-describedby": labelDescription ? id
|
|
2367
|
+
}, disabled: disabled, checked: isChecked, "aria-describedby": labelDescription ? "".concat(id, "Desc") : undefined }, other)),
|
|
2356
2368
|
React__default.createElement("label", { htmlFor: id, className: classNames('Field__label', {
|
|
2357
2369
|
'Field__label--disabled': disabled
|
|
2358
2370
|
}) }, label),
|
|
@@ -2360,7 +2372,7 @@ var RadioGroup = function (_a) {
|
|
|
2360
2372
|
'Radio__overlay--focused': isFocused,
|
|
2361
2373
|
'Radio__overlay--disabled': disabled
|
|
2362
2374
|
}), type: isChecked ? 'radio-checked' : 'radio-unchecked', "aria-hidden": "true", onClick: function () { return onRadioClick(index); } }),
|
|
2363
|
-
labelDescription && (React__default.createElement("span", { id: id
|
|
2375
|
+
labelDescription && (React__default.createElement("span", { id: "".concat(id, "Desc"), className: classNames('Field__labelDescription', {
|
|
2364
2376
|
'Field__labelDescription--disabled': disabled
|
|
2365
2377
|
}) }, labelDescription))));
|
|
2366
2378
|
});
|
|
@@ -2380,7 +2392,7 @@ RadioGroup.propTypes = {
|
|
|
2380
2392
|
})).isRequired,
|
|
2381
2393
|
hasLabel: function (props, propName, componentName) {
|
|
2382
2394
|
if (!props['aria-label'] && !props['aria-labelledby']) {
|
|
2383
|
-
return new Error(componentName
|
|
2395
|
+
return new Error("".concat(componentName, " must have an \"aria-label\" or \"aria-labelledby\" prop"));
|
|
2384
2396
|
}
|
|
2385
2397
|
},
|
|
2386
2398
|
className: PropTypes.string,
|
|
@@ -2389,6 +2401,125 @@ RadioGroup.propTypes = {
|
|
|
2389
2401
|
};
|
|
2390
2402
|
RadioGroup.displayName = 'RadioGroup';
|
|
2391
2403
|
|
|
2404
|
+
var Card = function (_a) {
|
|
2405
|
+
var className = _a.className, variant = _a.variant, other = tslib.__rest(_a, ["className", "variant"]);
|
|
2406
|
+
return (React__default.createElement("div", tslib.__assign({ className: classNames(className, {
|
|
2407
|
+
'Card--simple': variant === 'simple',
|
|
2408
|
+
Card: !variant
|
|
2409
|
+
}) }, other)));
|
|
2410
|
+
};
|
|
2411
|
+
Card.displayName = 'Card';
|
|
2412
|
+
Card.propTypes = {
|
|
2413
|
+
className: PropTypes.string,
|
|
2414
|
+
variant: PropTypes.string
|
|
2415
|
+
};
|
|
2416
|
+
|
|
2417
|
+
var CardHeader = function (_a) {
|
|
2418
|
+
var className = _a.className, other = tslib.__rest(_a, ["className"]);
|
|
2419
|
+
return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__header', className) }, other)));
|
|
2420
|
+
};
|
|
2421
|
+
CardHeader.displayName = 'CardHeader';
|
|
2422
|
+
CardHeader.propTypes = {
|
|
2423
|
+
className: PropTypes.string
|
|
2424
|
+
};
|
|
2425
|
+
|
|
2426
|
+
var CardContent = function (_a) {
|
|
2427
|
+
var className = _a.className, other = tslib.__rest(_a, ["className"]);
|
|
2428
|
+
return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__content', className) }, other)));
|
|
2429
|
+
};
|
|
2430
|
+
CardContent.displayName = 'CardContent';
|
|
2431
|
+
CardContent.propTypes = {
|
|
2432
|
+
className: PropTypes.string
|
|
2433
|
+
};
|
|
2434
|
+
|
|
2435
|
+
var CardFooter = function (_a) {
|
|
2436
|
+
var className = _a.className, other = tslib.__rest(_a, ["className"]);
|
|
2437
|
+
return (React__default.createElement("div", tslib.__assign({ className: classNames('Card__footer', className) }, other)));
|
|
2438
|
+
};
|
|
2439
|
+
CardFooter.displayName = 'CardFooter';
|
|
2440
|
+
CardFooter.propTypes = {
|
|
2441
|
+
className: PropTypes.string
|
|
2442
|
+
};
|
|
2443
|
+
|
|
2444
|
+
var RadioCardGroup = function (_a) {
|
|
2445
|
+
var name = _a.name, radios = _a.radios, defaultValue = _a.defaultValue, value = _a.value,
|
|
2446
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2447
|
+
_b = _a.onChange,
|
|
2448
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2449
|
+
onChange = _b === void 0 ? function () { } : _b, className = _a.className, other = tslib.__rest(_a, ["name", "radios", "defaultValue", "value", "onChange", "className"]);
|
|
2450
|
+
var _c = tslib.__read(React.useState(value !== null && value !== void 0 ? value : defaultValue), 2), currentValue = _c[0], setCurrentValue = _c[1];
|
|
2451
|
+
var _d = tslib.__read(React.useState(null), 2), focusIndex = _d[0], setFocusIndex = _d[1];
|
|
2452
|
+
var inputs = React.useRef([]);
|
|
2453
|
+
var handleChange = function (value) { return setCurrentValue(value); };
|
|
2454
|
+
var onRadioFocus = function (index) { return setFocusIndex(index); };
|
|
2455
|
+
var onRadioBlur = function () { return setFocusIndex(null); };
|
|
2456
|
+
var onRadioClick = function (index) {
|
|
2457
|
+
var _a;
|
|
2458
|
+
var radio = (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index];
|
|
2459
|
+
if (!radio) {
|
|
2460
|
+
return;
|
|
2461
|
+
}
|
|
2462
|
+
radio.click();
|
|
2463
|
+
radio.focus();
|
|
2464
|
+
};
|
|
2465
|
+
React.useEffect(function () {
|
|
2466
|
+
if (typeof value === 'undefined') {
|
|
2467
|
+
return;
|
|
2468
|
+
}
|
|
2469
|
+
setCurrentValue(value);
|
|
2470
|
+
}, [value]);
|
|
2471
|
+
var radioButtons = radios.map(function (radio, index) {
|
|
2472
|
+
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"]);
|
|
2473
|
+
var isChecked = currentValue === radioValue;
|
|
2474
|
+
var isFocused = focusIndex === index;
|
|
2475
|
+
return (React__default.createElement("div", { className: classNames('RadioCard'), key: index },
|
|
2476
|
+
React__default.createElement(Card, { variant: "simple", className: classNames('RadioCardGroup__Card RadioCard__overlay', {
|
|
2477
|
+
'RadioCard__overlay--focused': isFocused,
|
|
2478
|
+
'RadioCard__overlay--checked': isChecked,
|
|
2479
|
+
'RadioCard__overlay--disabled': disabled
|
|
2480
|
+
}), onClick: function () { return onRadioClick(index); } },
|
|
2481
|
+
React__default.createElement("input", tslib.__assign({ type: "radio", name: name, value: radioValue, id: id, ref: function (input) {
|
|
2482
|
+
if (!input) {
|
|
2483
|
+
return;
|
|
2484
|
+
}
|
|
2485
|
+
inputs.current.push(input);
|
|
2486
|
+
}, onFocus: function () { return onRadioFocus(index); }, onBlur: function () { return onRadioBlur(); }, onChange: function () {
|
|
2487
|
+
var _a;
|
|
2488
|
+
handleChange(radioValue);
|
|
2489
|
+
onChange(radio, (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index]);
|
|
2490
|
+
}, disabled: disabled, checked: isChecked }, other)),
|
|
2491
|
+
React__default.createElement(CardContent, null,
|
|
2492
|
+
React__default.createElement("div", { className: classNames('RadioCardGroup__Checked') }, isChecked && (React__default.createElement(Icon, { className: classNames('RadioCardGroup__Icon'), type: cardIcon }))),
|
|
2493
|
+
React__default.createElement("div", { className: classNames('RadioCardGroup__Base') },
|
|
2494
|
+
React__default.createElement("div", { className: classNames('RadioCardGroup__Image') }, cardImg),
|
|
2495
|
+
React__default.createElement("label", { htmlFor: id, className: classNames('RadioCardGroup__Label') }, label))))));
|
|
2496
|
+
});
|
|
2497
|
+
// reset the input refs array
|
|
2498
|
+
// refs get clobbered every re-render anyway and this supports "dynamic" radios
|
|
2499
|
+
// (changing the number of radio buttons for example)
|
|
2500
|
+
inputs.current = [];
|
|
2501
|
+
return (React__default.createElement("div", tslib.__assign({ className: classNames('RadioCardGroup'), role: "radiogroup" }, other), radioButtons));
|
|
2502
|
+
};
|
|
2503
|
+
RadioCardGroup.propTypes = {
|
|
2504
|
+
name: PropTypes.string,
|
|
2505
|
+
radios: PropTypes.arrayOf(PropTypes.shape({
|
|
2506
|
+
value: PropTypes.string.isRequired,
|
|
2507
|
+
id: PropTypes.string.isRequired,
|
|
2508
|
+
label: PropTypes.string.isRequired,
|
|
2509
|
+
cardImg: PropTypes.element.isRequired,
|
|
2510
|
+
cardIcon: PropTypes.string.isRequired
|
|
2511
|
+
})).isRequired,
|
|
2512
|
+
hasLabel: function (props, propName, componentName) {
|
|
2513
|
+
if (!props['aria-label'] && !props['aria-labelledby']) {
|
|
2514
|
+
return new Error("".concat(componentName, " must have an \"aria-label\" or \"aria-labelledby\" prop"));
|
|
2515
|
+
}
|
|
2516
|
+
},
|
|
2517
|
+
className: PropTypes.string,
|
|
2518
|
+
defaultValue: PropTypes.string,
|
|
2519
|
+
onChange: PropTypes.func
|
|
2520
|
+
};
|
|
2521
|
+
RadioCardGroup.displayName = 'RadioCardGroup';
|
|
2522
|
+
|
|
2392
2523
|
var Checkbox = React.forwardRef(function (_a, ref) {
|
|
2393
2524
|
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
2525
|
var _d = tslib.__read(React.useState(checked), 2), isChecked = _d[0], setIsChecked = _d[1];
|
|
@@ -2458,46 +2589,6 @@ function TooltipTabstop(_a) {
|
|
|
2458
2589
|
}
|
|
2459
2590
|
TooltipTabstop.displayName = 'TooltipTabstop';
|
|
2460
2591
|
|
|
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
2592
|
var TextField = /** @class */ (function (_super) {
|
|
2502
2593
|
tslib.__extends(TextField, _super);
|
|
2503
2594
|
function TextField(props) {
|
|
@@ -2650,7 +2741,7 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
|
|
|
2650
2741
|
if (!_this.styleTag) {
|
|
2651
2742
|
_this.styleTag = injectStyleTag();
|
|
2652
2743
|
}
|
|
2653
|
-
setStyle(_this.styleTag, "\n @keyframes expandOpenAnimation {\n 0% { opacity: 0; height: 0; }\n 100% { opacity: 1; height: "
|
|
2744
|
+
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
2745
|
_this.setState({ animationClass: 'cauldron-expand-open' }, function () {
|
|
2655
2746
|
setTimeout(function () {
|
|
2656
2747
|
_this.setState({ animationClass: '', isAnimating: false });
|
|
@@ -2671,7 +2762,7 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
|
|
|
2671
2762
|
var rect = panel === null || panel === void 0 ? void 0 : panel.getBoundingClientRect();
|
|
2672
2763
|
if (!rect)
|
|
2673
2764
|
return;
|
|
2674
|
-
setStyle(_this.styleTag, "\n @keyframes collapseCloseAnimation {\n 0% { opacity: 1; height: "
|
|
2765
|
+
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
2766
|
_this.setState({ animationClass: 'cauldron-collapse-close' }, function () {
|
|
2676
2767
|
setTimeout(function () {
|
|
2677
2768
|
_this.setState({ animationClass: '', isAnimating: false });
|
|
@@ -2839,27 +2930,6 @@ function _defineProperty(obj, key, value) {
|
|
|
2839
2930
|
|
|
2840
2931
|
var defineProperty = _defineProperty;
|
|
2841
2932
|
|
|
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
2933
|
function createCommonjsModule(fn, basedir, module) {
|
|
2864
2934
|
return module = {
|
|
2865
2935
|
path: basedir,
|
|
@@ -2896,6 +2966,9 @@ function _extends() {
|
|
|
2896
2966
|
module.exports = _extends;
|
|
2897
2967
|
});
|
|
2898
2968
|
|
|
2969
|
+
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; }
|
|
2970
|
+
|
|
2971
|
+
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
2972
|
//
|
|
2900
2973
|
// Super simple, non-algorithmic solution since the
|
|
2901
2974
|
// number of class names will not be greater than 4
|
|
@@ -2941,7 +3014,7 @@ function createStyleObject(classNames) {
|
|
|
2941
3014
|
});
|
|
2942
3015
|
var classNamesCombinations = getClassNameCombinations(nonTokenClassNames);
|
|
2943
3016
|
return classNamesCombinations.reduce(function (styleObject, className) {
|
|
2944
|
-
return
|
|
3017
|
+
return _objectSpread(_objectSpread({}, styleObject), stylesheet[className]);
|
|
2945
3018
|
}, elementStyle);
|
|
2946
3019
|
}
|
|
2947
3020
|
function createClassNameString(classNames) {
|
|
@@ -2980,7 +3053,7 @@ function createElement(_ref) {
|
|
|
2980
3053
|
var props;
|
|
2981
3054
|
|
|
2982
3055
|
if (!useInlineStyles) {
|
|
2983
|
-
props =
|
|
3056
|
+
props = _objectSpread(_objectSpread({}, properties), {}, {
|
|
2984
3057
|
className: createClassNameString(properties.className)
|
|
2985
3058
|
});
|
|
2986
3059
|
} else {
|
|
@@ -2995,14 +3068,14 @@ function createElement(_ref) {
|
|
|
2995
3068
|
var className = properties.className && startingClassName.concat(properties.className.filter(function (className) {
|
|
2996
3069
|
return !allStylesheetSelectors.includes(className);
|
|
2997
3070
|
}));
|
|
2998
|
-
props =
|
|
3071
|
+
props = _objectSpread(_objectSpread({}, properties), {}, {
|
|
2999
3072
|
className: createClassNameString(className) || undefined,
|
|
3000
3073
|
style: createStyleObject(properties.className, Object.assign({}, properties.style, style), stylesheet)
|
|
3001
3074
|
});
|
|
3002
3075
|
}
|
|
3003
3076
|
|
|
3004
3077
|
var children = childrenCreator(node.children);
|
|
3005
|
-
return React__default.createElement(TagName, _extends_1({
|
|
3078
|
+
return /*#__PURE__*/React__default.createElement(TagName, _extends_1({
|
|
3006
3079
|
key: key
|
|
3007
3080
|
}, props), children);
|
|
3008
3081
|
}
|
|
@@ -3013,6 +3086,11 @@ var checkForListedLanguage = (function (astGenerator, language) {
|
|
|
3013
3086
|
return langs.indexOf(language) !== -1;
|
|
3014
3087
|
});
|
|
3015
3088
|
|
|
3089
|
+
var _excluded = ["language", "children", "style", "customStyle", "codeTagProps", "useInlineStyles", "showLineNumbers", "showInlineLineNumbers", "startingLineNumber", "lineNumberContainerStyle", "lineNumberStyle", "wrapLines", "wrapLongLines", "lineProps", "renderer", "PreTag", "CodeTag", "code", "astGenerator"];
|
|
3090
|
+
|
|
3091
|
+
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; }
|
|
3092
|
+
|
|
3093
|
+
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
3094
|
var newLineRegex = /\n/g;
|
|
3017
3095
|
|
|
3018
3096
|
function getNewLines(str) {
|
|
@@ -3025,7 +3103,7 @@ function getAllLineNumbers(_ref) {
|
|
|
3025
3103
|
style = _ref.style;
|
|
3026
3104
|
return lines.map(function (_, i) {
|
|
3027
3105
|
var number = i + startingLineNumber;
|
|
3028
|
-
return React__default.createElement("span", {
|
|
3106
|
+
return /*#__PURE__*/React__default.createElement("span", {
|
|
3029
3107
|
key: "line-".concat(i),
|
|
3030
3108
|
className: "react-syntax-highlighter-line-number",
|
|
3031
3109
|
style: typeof style === 'function' ? style(number) : style
|
|
@@ -3038,13 +3116,13 @@ function AllLineNumbers(_ref2) {
|
|
|
3038
3116
|
codeStyle = _ref2.codeStyle,
|
|
3039
3117
|
_ref2$containerStyle = _ref2.containerStyle,
|
|
3040
3118
|
containerStyle = _ref2$containerStyle === void 0 ? {
|
|
3041
|
-
float: 'left',
|
|
3119
|
+
"float": 'left',
|
|
3042
3120
|
paddingRight: '10px'
|
|
3043
3121
|
} : _ref2$containerStyle,
|
|
3044
3122
|
_ref2$numberStyle = _ref2.numberStyle,
|
|
3045
3123
|
numberStyle = _ref2$numberStyle === void 0 ? {} : _ref2$numberStyle,
|
|
3046
3124
|
startingLineNumber = _ref2.startingLineNumber;
|
|
3047
|
-
return React__default.createElement("code", {
|
|
3125
|
+
return /*#__PURE__*/React__default.createElement("code", {
|
|
3048
3126
|
style: Object.assign({}, codeStyle, containerStyle)
|
|
3049
3127
|
}, getAllLineNumbers({
|
|
3050
3128
|
lines: codeString.replace(/\n$/, '').split('\n'),
|
|
@@ -3085,7 +3163,7 @@ function assembleLineNumberStyles(lineNumberStyle, lineNumber, largestLineNumber
|
|
|
3085
3163
|
|
|
3086
3164
|
var customLineNumberStyle = typeof lineNumberStyle === 'function' ? lineNumberStyle(lineNumber) : lineNumberStyle; // combine
|
|
3087
3165
|
|
|
3088
|
-
var assembledStyle =
|
|
3166
|
+
var assembledStyle = _objectSpread$1(_objectSpread$1({}, defaultLineNumberStyle), customLineNumberStyle);
|
|
3089
3167
|
|
|
3090
3168
|
return assembledStyle;
|
|
3091
3169
|
}
|
|
@@ -3111,7 +3189,7 @@ function createLineElement(_ref3) {
|
|
|
3111
3189
|
}
|
|
3112
3190
|
|
|
3113
3191
|
if (wrapLongLines & showLineNumbers) {
|
|
3114
|
-
properties.style =
|
|
3192
|
+
properties.style = _objectSpread$1(_objectSpread$1({}, properties.style), {}, {
|
|
3115
3193
|
display: 'flex'
|
|
3116
3194
|
});
|
|
3117
3195
|
}
|
|
@@ -3138,7 +3216,9 @@ function flattenCodeTree(tree) {
|
|
|
3138
3216
|
}));
|
|
3139
3217
|
} else if (node.children) {
|
|
3140
3218
|
var classNames = className.concat(node.properties.className);
|
|
3141
|
-
|
|
3219
|
+
flattenCodeTree(node.children, classNames).forEach(function (i) {
|
|
3220
|
+
return newTree.push(i);
|
|
3221
|
+
});
|
|
3142
3222
|
}
|
|
3143
3223
|
}
|
|
3144
3224
|
|
|
@@ -3207,19 +3287,19 @@ function processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlin
|
|
|
3207
3287
|
newTree.push(_line); // if it's the last line
|
|
3208
3288
|
} else if (i === splitValue.length - 1) {
|
|
3209
3289
|
var stringChild = tree[index + 1] && tree[index + 1].children && tree[index + 1].children[0];
|
|
3290
|
+
var lastLineInPreviousSpan = {
|
|
3291
|
+
type: 'text',
|
|
3292
|
+
value: "".concat(text)
|
|
3293
|
+
};
|
|
3210
3294
|
|
|
3211
3295
|
if (stringChild) {
|
|
3212
|
-
var lastLineInPreviousSpan = {
|
|
3213
|
-
type: 'text',
|
|
3214
|
-
value: "".concat(text)
|
|
3215
|
-
};
|
|
3216
3296
|
var newElem = createLineElement({
|
|
3217
3297
|
children: [lastLineInPreviousSpan],
|
|
3218
3298
|
className: node.properties.className
|
|
3219
3299
|
});
|
|
3220
3300
|
tree.splice(index + 1, 0, newElem);
|
|
3221
3301
|
} else {
|
|
3222
|
-
var _children2 = [
|
|
3302
|
+
var _children2 = [lastLineInPreviousSpan];
|
|
3223
3303
|
|
|
3224
3304
|
var _line2 = createLine(_children2, lineNumber, node.properties.className);
|
|
3225
3305
|
|
|
@@ -3325,7 +3405,7 @@ function highlight (defaultAstGenerator, defaultStyle) {
|
|
|
3325
3405
|
_ref7$codeTagProps = _ref7.codeTagProps,
|
|
3326
3406
|
codeTagProps = _ref7$codeTagProps === void 0 ? {
|
|
3327
3407
|
className: language ? "language-".concat(language) : undefined,
|
|
3328
|
-
style:
|
|
3408
|
+
style: _objectSpread$1(_objectSpread$1({}, style['code[class*="language-"]']), style["code[class*=\"language-".concat(language, "\"]")])
|
|
3329
3409
|
} : _ref7$codeTagProps,
|
|
3330
3410
|
_ref7$useInlineStyles = _ref7.useInlineStyles,
|
|
3331
3411
|
useInlineStyles = _ref7$useInlineStyles === void 0 ? true : _ref7$useInlineStyles,
|
|
@@ -3349,12 +3429,12 @@ function highlight (defaultAstGenerator, defaultStyle) {
|
|
|
3349
3429
|
_ref7$CodeTag = _ref7.CodeTag,
|
|
3350
3430
|
CodeTag = _ref7$CodeTag === void 0 ? 'code' : _ref7$CodeTag,
|
|
3351
3431
|
_ref7$code = _ref7.code,
|
|
3352
|
-
code = _ref7$code === void 0 ? Array.isArray(children) ? children[0] : children : _ref7$code,
|
|
3432
|
+
code = _ref7$code === void 0 ? (Array.isArray(children) ? children[0] : children) || '' : _ref7$code,
|
|
3353
3433
|
astGenerator = _ref7.astGenerator,
|
|
3354
|
-
rest = objectWithoutProperties(_ref7,
|
|
3434
|
+
rest = objectWithoutProperties(_ref7, _excluded);
|
|
3355
3435
|
|
|
3356
3436
|
astGenerator = astGenerator || defaultAstGenerator;
|
|
3357
|
-
var allLineNumbers = showLineNumbers ? React__default.createElement(AllLineNumbers, {
|
|
3437
|
+
var allLineNumbers = showLineNumbers ? /*#__PURE__*/React__default.createElement(AllLineNumbers, {
|
|
3358
3438
|
containerStyle: lineNumberContainerStyle,
|
|
3359
3439
|
codeStyle: codeTagProps.style || {},
|
|
3360
3440
|
numberStyle: lineNumberStyle,
|
|
@@ -3372,8 +3452,18 @@ function highlight (defaultAstGenerator, defaultStyle) {
|
|
|
3372
3452
|
style: Object.assign({}, customStyle)
|
|
3373
3453
|
});
|
|
3374
3454
|
|
|
3455
|
+
if (wrapLongLines) {
|
|
3456
|
+
codeTagProps.style = _objectSpread$1(_objectSpread$1({}, codeTagProps.style), {}, {
|
|
3457
|
+
whiteSpace: 'pre-wrap'
|
|
3458
|
+
});
|
|
3459
|
+
} else {
|
|
3460
|
+
codeTagProps.style = _objectSpread$1(_objectSpread$1({}, codeTagProps.style), {}, {
|
|
3461
|
+
whiteSpace: 'pre'
|
|
3462
|
+
});
|
|
3463
|
+
}
|
|
3464
|
+
|
|
3375
3465
|
if (!astGenerator) {
|
|
3376
|
-
return React__default.createElement(PreTag, preProps, allLineNumbers, React__default.createElement(CodeTag, codeTagProps, code));
|
|
3466
|
+
return /*#__PURE__*/React__default.createElement(PreTag, preProps, allLineNumbers, /*#__PURE__*/React__default.createElement(CodeTag, codeTagProps, code));
|
|
3377
3467
|
}
|
|
3378
3468
|
/*
|
|
3379
3469
|
* Some custom renderers rely on individual row elements so we need to turn wrapLines on
|
|
@@ -3401,18 +3491,7 @@ function highlight (defaultAstGenerator, defaultStyle) {
|
|
|
3401
3491
|
|
|
3402
3492
|
var largestLineNumber = codeTree.value.length + startingLineNumber;
|
|
3403
3493
|
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({
|
|
3494
|
+
return /*#__PURE__*/React__default.createElement(PreTag, preProps, /*#__PURE__*/React__default.createElement(CodeTag, codeTagProps, !showInlineLineNumbers && allLineNumbers, renderer({
|
|
3416
3495
|
rows: rows,
|
|
3417
3496
|
stylesheet: style,
|
|
3418
3497
|
useInlineStyles: useInlineStyles
|
|
@@ -7977,15 +8056,19 @@ SyntaxHighlighter.registerLanguage('javascript', javascript_1);
|
|
|
7977
8056
|
SyntaxHighlighter.registerLanguage('css', css_1);
|
|
7978
8057
|
SyntaxHighlighter.registerLanguage('html', xml_1);
|
|
7979
8058
|
SyntaxHighlighter.registerLanguage('yaml', yaml_1);
|
|
8059
|
+
// HACK: This is a workaround for a bug in react-syntax-highlighter's types.
|
|
8060
|
+
var Highlighter = SyntaxHighlighter;
|
|
7980
8061
|
var Code = function (_a) {
|
|
7981
8062
|
var children = _a.children, className = _a.className, tabIndex = _a.tabIndex, props = tslib.__rest(_a, ["children", "className", "tabIndex"]);
|
|
7982
|
-
return (React__default.createElement(
|
|
8063
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
8064
|
+
React__default.createElement(Highlighter, tslib.__assign({}, props, { useInlineStyles: false, className: classNames('Code', className), tabIndex: tabIndex }), children)));
|
|
7983
8065
|
};
|
|
7984
8066
|
Code.displayName = 'Code';
|
|
7985
8067
|
Code.propTypes = {
|
|
7986
8068
|
children: PropTypes.string.isRequired,
|
|
7987
8069
|
language: PropTypes.oneOf(['javascript', 'css', 'html', 'yaml']),
|
|
7988
|
-
className: PropTypes.string
|
|
8070
|
+
className: PropTypes.string,
|
|
8071
|
+
tabIndex: PropTypes.number
|
|
7989
8072
|
};
|
|
7990
8073
|
|
|
7991
8074
|
function AxeLoader() {
|
|
@@ -8064,6 +8147,7 @@ LoaderOverlay.propTypes = {
|
|
|
8064
8147
|
variant: PropTypes.oneOf(['large', 'small']),
|
|
8065
8148
|
label: PropTypes.string,
|
|
8066
8149
|
focusOnInitialRender: PropTypes.bool,
|
|
8150
|
+
// @ts-expect-error
|
|
8067
8151
|
children: PropTypes.node
|
|
8068
8152
|
};
|
|
8069
8153
|
LoaderOverlay.displayName = 'LoaderOverlay';
|
|
@@ -8183,6 +8267,7 @@ Tab.displayName = 'Tab';
|
|
|
8183
8267
|
Tab.propTypes = {
|
|
8184
8268
|
target: PropTypes.any.isRequired,
|
|
8185
8269
|
id: PropTypes.string,
|
|
8270
|
+
// @ts-expect-error
|
|
8186
8271
|
children: PropTypes.node
|
|
8187
8272
|
};
|
|
8188
8273
|
|
|
@@ -8277,7 +8362,8 @@ var Tabs = function (_a) {
|
|
|
8277
8362
|
React.useEffect(function () {
|
|
8278
8363
|
var _a, _b;
|
|
8279
8364
|
index === activeIndex
|
|
8280
|
-
? (_a = target.current) === null || _a === void 0 ? void 0 : _a.classList.remove('TabPanel--hidden')
|
|
8365
|
+
? (_a = target.current) === null || _a === void 0 ? void 0 : _a.classList.remove('TabPanel--hidden')
|
|
8366
|
+
: (_b = target.current) === null || _b === void 0 ? void 0 : _b.classList.add('TabPanel--hidden');
|
|
8281
8367
|
}, [activeIndex]);
|
|
8282
8368
|
var config = tslib.__assign((_a = { id: id, className: classNames('Tab', {
|
|
8283
8369
|
'Tab--active': selected
|
|
@@ -8317,6 +8403,7 @@ var TabPanel = React.forwardRef(function (_a, ref) {
|
|
|
8317
8403
|
TabPanel.displayName = 'TabPanel';
|
|
8318
8404
|
TabPanel.propTypes = {
|
|
8319
8405
|
id: PropTypes.string,
|
|
8406
|
+
// @ts-expect-error
|
|
8320
8407
|
children: PropTypes.node,
|
|
8321
8408
|
className: PropTypes.string
|
|
8322
8409
|
};
|
|
@@ -8363,12 +8450,12 @@ var Step = function (props) {
|
|
|
8363
8450
|
var liProps;
|
|
8364
8451
|
var isTooltip = isTooltipProps(other);
|
|
8365
8452
|
if (isTooltip) {
|
|
8366
|
-
(_a = other, (tooltip = _a.tooltip, tooltipText = _a.tooltipText
|
|
8453
|
+
(_a = other, (tooltip = _a.tooltip, tooltipText = _a.tooltipText), liProps = tslib.__rest(_a, ["tooltip", "tooltipText"]));
|
|
8367
8454
|
}
|
|
8368
8455
|
else {
|
|
8369
8456
|
liProps = other;
|
|
8370
8457
|
}
|
|
8371
|
-
return (React__default.createElement("li", tslib.__assign({ className: classNames('Stepper__step', "Stepper__step--"
|
|
8458
|
+
return (React__default.createElement("li", tslib.__assign({ className: classNames('Stepper__step', "Stepper__step--".concat(status), className), "aria-current": status === 'current' ? 'step' : 'false' }, liProps),
|
|
8372
8459
|
React__default.createElement("div", { className: "Stepper__step-line" }),
|
|
8373
8460
|
React__default.createElement("div", { className: "Stepper__step-content" }, isTooltip ? (React__default.createElement(TooltipTabstop, { placement: "bottom", tooltip: tooltip,
|
|
8374
8461
|
// the pseudo content (ex: "1") is conveyed
|
|
@@ -8410,7 +8497,7 @@ var Panel = React.forwardRef(function (_a, ref) {
|
|
|
8410
8497
|
if (!headingId) {
|
|
8411
8498
|
return null;
|
|
8412
8499
|
}
|
|
8413
|
-
var HeadingComponent = "h"
|
|
8500
|
+
var HeadingComponent = "h".concat(heading &&
|
|
8414
8501
|
typeof heading === 'object' &&
|
|
8415
8502
|
'level' in heading &&
|
|
8416
8503
|
!!heading.level
|
|
@@ -8428,7 +8515,9 @@ var Panel = React.forwardRef(function (_a, ref) {
|
|
|
8428
8515
|
});
|
|
8429
8516
|
Panel.displayName = 'Panel';
|
|
8430
8517
|
Panel.propTypes = {
|
|
8518
|
+
// @ts-expect-error
|
|
8431
8519
|
children: PropTypes.node.isRequired,
|
|
8520
|
+
// @ts-expect-error
|
|
8432
8521
|
heading: PropTypes.oneOfType([PropTypes.object, PropTypes.node]),
|
|
8433
8522
|
className: PropTypes.string
|
|
8434
8523
|
};
|
|
@@ -8438,7 +8527,7 @@ var IssuePanel = function (_a) {
|
|
|
8438
8527
|
return (React__default.createElement("div", { className: classNames('IssuePanel', className) },
|
|
8439
8528
|
React__default.createElement("div", { className: "IssuePanel__Header" },
|
|
8440
8529
|
title && React__default.createElement("div", { className: "IssuePanel__Header-title" }, title),
|
|
8441
|
-
actions && React__default.createElement("div", { className: "IssuePanel__Header-actions" }, actions)),
|
|
8530
|
+
actions && (React__default.createElement("div", { className: "IssuePanel__Header-actions" }, actions))),
|
|
8442
8531
|
React__default.createElement("div", { className: "IssuePanel__Content" }, children)));
|
|
8443
8532
|
};
|
|
8444
8533
|
IssuePanel.displayName = 'IssuePanel';
|
|
@@ -8451,7 +8540,7 @@ var ProgressBar = React.forwardRef(function (_a, ref) {
|
|
|
8451
8540
|
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
8541
|
var className = props.className, otherProps = tslib.__rest(props, ["className"]);
|
|
8453
8542
|
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)
|
|
8543
|
+
React__default.createElement("div", { className: "ProgressBar--fill", style: { width: "".concat(Math.min((progress / progressMax) * 100, 100), "%") } })));
|
|
8455
8544
|
});
|
|
8456
8545
|
ProgressBar.displayName = 'ProgressBar';
|
|
8457
8546
|
|
|
@@ -8532,12 +8621,41 @@ Pagination.propTypes = {
|
|
|
8532
8621
|
className: PropTypes.string
|
|
8533
8622
|
};
|
|
8534
8623
|
|
|
8624
|
+
var usePagination = function (_a) {
|
|
8625
|
+
var totalItems = _a.totalItems, _b = _a.initialPageSize, initialPageSize = _b === void 0 ? 10 : _b, _c = _a.initialPage, initialPage = _c === void 0 ? 1 : _c;
|
|
8626
|
+
var _d = tslib.__read(React.useState(initialPage), 2), currentPage = _d[0], setCurrentPage = _d[1];
|
|
8627
|
+
var pageStart = currentPage * initialPageSize - initialPageSize + 1;
|
|
8628
|
+
var pageEnd = Math.min(pageStart + initialPageSize - 1, totalItems);
|
|
8629
|
+
var onFirstPageClick = function () { return setCurrentPage(1); };
|
|
8630
|
+
var onPreviousPageClick = function () { return setCurrentPage(currentPage - 1); };
|
|
8631
|
+
var onNextPageClick = function () { return setCurrentPage(currentPage + 1); };
|
|
8632
|
+
var onLastPageClick = function () {
|
|
8633
|
+
return setCurrentPage(Math.ceil(totalItems / initialPageSize));
|
|
8634
|
+
};
|
|
8635
|
+
var pagination = {
|
|
8636
|
+
totalItems: totalItems,
|
|
8637
|
+
currentPage: currentPage,
|
|
8638
|
+
itemsPerPage: initialPageSize,
|
|
8639
|
+
onFirstPageClick: onFirstPageClick,
|
|
8640
|
+
onPreviousPageClick: onPreviousPageClick,
|
|
8641
|
+
onNextPageClick: onNextPageClick,
|
|
8642
|
+
onLastPageClick: onLastPageClick
|
|
8643
|
+
};
|
|
8644
|
+
var pageStatus = {
|
|
8645
|
+
currentPage: currentPage,
|
|
8646
|
+
pageStart: pageStart,
|
|
8647
|
+
pageEnd: pageEnd
|
|
8648
|
+
};
|
|
8649
|
+
return { pagination: pagination, pageStatus: pageStatus };
|
|
8650
|
+
};
|
|
8651
|
+
|
|
8535
8652
|
var FieldWrap = React__default.forwardRef(function (_a, ref) {
|
|
8536
8653
|
var children = _a.children, className = _a.className, _b = _a.as, Component = _b === void 0 ? 'div' : _b, props = tslib.__rest(_a, ["children", "className", "as"]);
|
|
8537
8654
|
return (React__default.createElement(Component, tslib.__assign({ ref: ref, className: classNames('Panel', className) }, props), children));
|
|
8538
8655
|
});
|
|
8539
8656
|
FieldWrap.displayName = 'FieldWrap';
|
|
8540
8657
|
FieldWrap.propTypes = {
|
|
8658
|
+
// @ts-expect-error
|
|
8541
8659
|
children: PropTypes.node.isRequired,
|
|
8542
8660
|
className: PropTypes.string,
|
|
8543
8661
|
as: PropTypes.string
|
|
@@ -8558,7 +8676,7 @@ var Breadcrumb = React.forwardRef(function (_a, ref) {
|
|
|
8558
8676
|
}
|
|
8559
8677
|
});
|
|
8560
8678
|
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-"
|
|
8679
|
+
React__default.createElement("ol", null, childrenWithSeparators.map(function (child, index) { return (React__default.createElement("li", { className: "Breadcrumb__Item", key: "breadcrumb-".concat(index) }, child)); }))));
|
|
8562
8680
|
});
|
|
8563
8681
|
Breadcrumb.displayName = 'Breadcrumb';
|
|
8564
8682
|
|
|
@@ -8571,6 +8689,7 @@ var BreadcrumbLink = React.forwardRef(function (_a, ref) {
|
|
|
8571
8689
|
var className = _a.className, _b = _a.as, ElementType = _b === void 0 ? 'a' : _b, children = _a.children, props = tslib.__rest(_a, ["className", "as", "children"]);
|
|
8572
8690
|
return (React__default.createElement(ElementType, tslib.__assign({ className: classNames('Link', 'Breadcrumb__Link', className), ref: ref }, props), children));
|
|
8573
8691
|
});
|
|
8692
|
+
BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
8574
8693
|
|
|
8575
8694
|
var ColumnLeft = React.forwardRef(function (_a, ref) {
|
|
8576
8695
|
var className = _a.className, children = _a.children, props = tslib.__rest(_a, ["className", "children"]);
|
|
@@ -8589,6 +8708,11 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
|
|
|
8589
8708
|
var _f = tslib.__read(React.useState(initialCollapsed), 2), isCollapsed = _f[0], setCollapsed = _f[1];
|
|
8590
8709
|
var _g = tslib.__read(React.useState(false), 2), isFocusTrap = _g[0], setIsFocusTrap = _g[1];
|
|
8591
8710
|
var _h = tslib.__read(React.useState(!initialCollapsed), 2), showPanel = _h[0], setShowPanel = _h[1];
|
|
8711
|
+
var toggleButtonRef = React.useRef(null);
|
|
8712
|
+
var closeButtonRef = React.useRef(null);
|
|
8713
|
+
var columnLeftRef = React.useRef(null);
|
|
8714
|
+
var columnRightRef = React.useRef(null);
|
|
8715
|
+
var columnLeft = React__default.Children.toArray(children).find(function (child) { return child.type === ColumnLeft; });
|
|
8592
8716
|
var togglePanel = function () {
|
|
8593
8717
|
if (isCollapsed) {
|
|
8594
8718
|
setShowPanel(true);
|
|
@@ -8606,11 +8730,6 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
|
|
|
8606
8730
|
}
|
|
8607
8731
|
});
|
|
8608
8732
|
};
|
|
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
8733
|
// The ColumnLeftComponent will end up being a focus trap when < 720px
|
|
8615
8734
|
// This component also gets unmounted when not visible meaning that any
|
|
8616
8735
|
// aria relationships cannot be set to items inside the component since
|
|
@@ -8625,11 +8744,11 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
|
|
|
8625
8744
|
React__default.createElement("button", { type: "button", onClick: togglePanel, ref: closeButtonRef, "aria-label": hideCollapsedPanelLabel },
|
|
8626
8745
|
React__default.createElement(Icon, { type: "close" })),
|
|
8627
8746
|
React__default.createElement(Tooltip, { target: closeButtonRef, association: "aria-labelledby", hideElementOnHidden: true }, hideCollapsedPanelLabel)));
|
|
8628
|
-
var children_1 = tslib.
|
|
8747
|
+
var children_1 = tslib.__spreadArray([
|
|
8629
8748
|
CloseButton
|
|
8630
|
-
], React__default.Children.toArray(columnLeft.props.children));
|
|
8749
|
+
], tslib.__read(React__default.Children.toArray(columnLeft.props.children)), false);
|
|
8631
8750
|
ColumnLeftComponent = React.cloneElement(columnLeft, { id: id, ref: ref_1, tabIndex: -1 }, children_1.map(function (child, index) {
|
|
8632
|
-
return React.cloneElement(child, { key: "left-"
|
|
8751
|
+
return React.cloneElement(child, { key: "left-".concat(index) });
|
|
8633
8752
|
}));
|
|
8634
8753
|
}
|
|
8635
8754
|
var columnRight = React__default.Children.toArray(children).find(function (child) { return child.type === ColumnRight; });
|
|
@@ -8640,11 +8759,11 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
|
|
|
8640
8759
|
React__default.createElement("button", { type: "button", onClick: togglePanel, ref: toggleButtonRef, "aria-label": !isCollapsed ? hideCollapsedPanelLabel : showCollapsedPanelLabel, "aria-expanded": !isCollapsed, "aria-controls": columnLeftId },
|
|
8641
8760
|
React__default.createElement(Icon, { type: !isCollapsed ? 'chevron-double-left' : 'chevron-double-right' })),
|
|
8642
8761
|
React__default.createElement(Tooltip, { target: toggleButtonRef, association: "aria-labelledby", hideElementOnHidden: true }, !isCollapsed ? hideCollapsedPanelLabel : showCollapsedPanelLabel)));
|
|
8643
|
-
var children_2 = tslib.
|
|
8762
|
+
var children_2 = tslib.__spreadArray([
|
|
8644
8763
|
ToggleButton
|
|
8645
|
-
], React__default.Children.toArray(columnRight.props.children));
|
|
8764
|
+
], tslib.__read(React__default.Children.toArray(columnRight.props.children)), false);
|
|
8646
8765
|
ColumnRightComponent = React.cloneElement(columnRight, { ref: ref_2, tabIndex: -1 }, children_2.map(function (child, index) {
|
|
8647
|
-
return React.cloneElement(child, { key: "right-"
|
|
8766
|
+
return React.cloneElement(child, { key: "right-".concat(index) });
|
|
8648
8767
|
}));
|
|
8649
8768
|
}
|
|
8650
8769
|
React.useLayoutEffect(function () {
|
|
@@ -8709,15 +8828,16 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
|
|
|
8709
8828
|
'TwoColumnPanel--show': !isCollapsed,
|
|
8710
8829
|
'TwoColumnPanel--hide': isCollapsed
|
|
8711
8830
|
}) }, props, { ref: ref }),
|
|
8712
|
-
React__default.createElement(
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8831
|
+
React__default.createElement(React__default.Fragment, null,
|
|
8832
|
+
React__default.createElement(FocusTrap, { active: !isCollapsed && isFocusTrap, focusTrapOptions: {
|
|
8833
|
+
escapeDeactivates: true,
|
|
8834
|
+
allowOutsideClick: true,
|
|
8835
|
+
fallbackFocus: columnLeftRef.current
|
|
8836
|
+
}, containerElements: [columnLeftRef.current] }),
|
|
8837
|
+
React__default.createElement(ClickOutsideListener, { onClickOutside: handleClickOutside, target: columnLeftRef.current }),
|
|
8838
|
+
isCollapsed ? null : skipLink,
|
|
8839
|
+
showPanel ? ColumnLeftComponent : null,
|
|
8840
|
+
ColumnRightComponent)));
|
|
8721
8841
|
});
|
|
8722
8842
|
TwoColumnPanel.displayName = 'TwoColumnPanel';
|
|
8723
8843
|
|
|
@@ -8857,6 +8977,7 @@ exports.Panel = Panel;
|
|
|
8857
8977
|
exports.PanelTrigger = PanelTrigger$1;
|
|
8858
8978
|
exports.Pointout = Pointout;
|
|
8859
8979
|
exports.ProgressBar = ProgressBar;
|
|
8980
|
+
exports.RadioCardGroup = RadioCardGroup;
|
|
8860
8981
|
exports.RadioGroup = RadioGroup;
|
|
8861
8982
|
exports.Scrim = Scrim;
|
|
8862
8983
|
exports.Select = Select;
|
|
@@ -8894,4 +9015,5 @@ exports.Workspace = Workspace;
|
|
|
8894
9015
|
exports.focusableSelector = focusableSelector;
|
|
8895
9016
|
exports.iconTypes = iconTypes;
|
|
8896
9017
|
exports.useDidUpdate = useDidUpdate;
|
|
9018
|
+
exports.usePagination = usePagination;
|
|
8897
9019
|
exports.useThemeContext = useThemeContext;
|