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