@deque/cauldron-react 3.0.1-canary.44fffaab → 3.0.1-canary.4fc5b1ab
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 +11 -0
- package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +5 -0
- package/lib/components/Breadcrumb/BreadcrumbLink.d.ts +6 -0
- package/lib/components/Breadcrumb/index.d.ts +3 -0
- package/lib/components/FieldWrap/index.d.ts +7 -0
- package/lib/components/Loader/index.d.ts +2 -1
- package/lib/components/LoaderOverlay/axe-loader.d.ts +1 -0
- package/lib/components/LoaderOverlay/index.d.ts +5 -1
- package/lib/components/Panel/index.d.ts +2 -1
- package/lib/components/Tabs/Tabs.d.ts +3 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +164 -60
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const Breadcrumb: React.ForwardRefExoticComponent<({
|
|
3
|
+
separator?: string | undefined;
|
|
4
|
+
} & React.HTMLAttributes<HTMLElement> & {
|
|
5
|
+
'aria-label': string;
|
|
6
|
+
} & React.RefAttributes<HTMLElement>) | ({
|
|
7
|
+
separator?: string | undefined;
|
|
8
|
+
} & React.HTMLAttributes<HTMLElement> & {
|
|
9
|
+
'aria-labelledby': string;
|
|
10
|
+
} & React.RefAttributes<HTMLElement>)>;
|
|
11
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface BreadcrumbLinkProps extends React.HTMLAttributes<HTMLLinkElement> {
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
}
|
|
5
|
+
declare const BreadcrumbLink: React.ForwardRefExoticComponent<BreadcrumbLinkProps & React.RefAttributes<HTMLElement>>;
|
|
6
|
+
export default BreadcrumbLink;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
as?: React.ElementType | string;
|
|
5
|
+
}
|
|
6
|
+
declare const FieldWrap: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
|
|
7
|
+
export default FieldWrap;
|
|
@@ -2,8 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
export interface LoaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
label?: string;
|
|
5
|
+
variant?: 'large' | 'small';
|
|
5
6
|
}
|
|
6
|
-
declare function Loader({ className, label, ...
|
|
7
|
+
declare function Loader({ className, variant, label, ...props }: LoaderProps): JSX.Element;
|
|
7
8
|
declare namespace Loader {
|
|
8
9
|
var propTypes: {
|
|
9
10
|
className: PropTypes.Requireable<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AxeLoader(): JSX.Element;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
interface LoaderOverlayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
variant?: 'large' | 'small';
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const LoaderOverlay: React.ForwardRefExoticComponent<LoaderOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
3
7
|
export default LoaderOverlay;
|
|
@@ -7,10 +7,11 @@ interface PanelProps extends HTMLAttributes<HTMLElement> {
|
|
|
7
7
|
text: ReactElement<any>;
|
|
8
8
|
level: number | undefined;
|
|
9
9
|
};
|
|
10
|
+
collapsed?: boolean;
|
|
10
11
|
className?: string;
|
|
11
12
|
}
|
|
12
13
|
declare const Panel: {
|
|
13
|
-
({ children, className, heading, ...other }: PanelProps): JSX.Element;
|
|
14
|
+
({ children, collapsed, className, heading, ...other }: PanelProps): JSX.Element;
|
|
14
15
|
displayName: string;
|
|
15
16
|
propTypes: {
|
|
16
17
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
@@ -5,6 +5,7 @@ declare type TabsProps = {
|
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
initialActiveIndex?: number;
|
|
7
7
|
thin?: boolean;
|
|
8
|
+
orientation?: 'horizontal' | 'vertical';
|
|
8
9
|
className?: string;
|
|
9
10
|
onChange?: ({ activeTabIndex, target }: {
|
|
10
11
|
activeTabIndex: number;
|
|
@@ -12,7 +13,7 @@ declare type TabsProps = {
|
|
|
12
13
|
}) => void;
|
|
13
14
|
} & Cauldron.LabelProps;
|
|
14
15
|
declare const Tabs: {
|
|
15
|
-
({ children, thin, initialActiveIndex, className, onChange, ...labelProp }: TabsProps): JSX.Element;
|
|
16
|
+
({ children, thin, orientation, initialActiveIndex, className, onChange, ...labelProp }: TabsProps): JSX.Element;
|
|
16
17
|
displayName: string;
|
|
17
18
|
propTypes: {
|
|
18
19
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
@@ -20,6 +21,7 @@ declare const Tabs: {
|
|
|
20
21
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
21
22
|
initialActiveIndex: PropTypes.Requireable<number>;
|
|
22
23
|
thin: PropTypes.Requireable<boolean>;
|
|
24
|
+
orientation: PropTypes.Requireable<string>;
|
|
23
25
|
className: PropTypes.Requireable<string>;
|
|
24
26
|
};
|
|
25
27
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -46,6 +46,8 @@ export { default as IssuePanel } from './components/IssuePanel';
|
|
|
46
46
|
export { default as ProgressBar } from './components/ProgressBar';
|
|
47
47
|
export { Address, AddressLine, AddressCityStateZip } from './components/Address';
|
|
48
48
|
export { default as Pagination } from './components/Pagination';
|
|
49
|
+
export { default as FieldWrap } from './components/FieldWrap';
|
|
50
|
+
export { default as Breadcrumb, BreadcrumbItem, BreadcrumbLink } from './components/Breadcrumb';
|
|
49
51
|
/**
|
|
50
52
|
* Helpers / Utils
|
|
51
53
|
*/
|
package/lib/index.js
CHANGED
|
@@ -259,11 +259,11 @@ var Icon = React.forwardRef(function (_a, ref) {
|
|
|
259
259
|
var _b;
|
|
260
260
|
var label = _a.label, className = _a.className, type = _a.type, other = tslib.__rest(_a, ["label", "className", "type"]);
|
|
261
261
|
var isMounted = React.useRef(true);
|
|
262
|
-
var _c = type.match(/(.*)-(right|left|up|down)$/) || [
|
|
262
|
+
var _c = tslib.__read(type.match(/(.*)-(right|left|up|down)$/) || [
|
|
263
263
|
'',
|
|
264
264
|
type
|
|
265
|
-
], name = _c[1], direction = _c[2];
|
|
266
|
-
var _d = React.useState(null), IconSVG = _d[0], setIcon = _d[1];
|
|
265
|
+
], 3), name = _c[1], direction = _c[2];
|
|
266
|
+
var _d = tslib.__read(React.useState(null), 2), IconSVG = _d[0], setIcon = _d[1];
|
|
267
267
|
React.useEffect(function () {
|
|
268
268
|
isMounted.current = true;
|
|
269
269
|
// NOTE: we don't want to pollute test output with
|
|
@@ -479,9 +479,9 @@ var TopBar = /** @class */ (function (_super) {
|
|
|
479
479
|
args[_i] = arguments[_i];
|
|
480
480
|
}
|
|
481
481
|
// @ts-ignore we're just spreading the original args
|
|
482
|
-
_this.onKeyDown.apply(_this, args);
|
|
482
|
+
_this.onKeyDown.apply(_this, tslib.__spread(args));
|
|
483
483
|
if (child.props.onKeyDown) {
|
|
484
|
-
(_a = child.props).onKeyDown.apply(_a, args);
|
|
484
|
+
(_a = child.props).onKeyDown.apply(_a, tslib.__spread(args));
|
|
485
485
|
}
|
|
486
486
|
},
|
|
487
487
|
tabIndex: 0,
|
|
@@ -517,7 +517,7 @@ var TopBar = /** @class */ (function (_super) {
|
|
|
517
517
|
};
|
|
518
518
|
TopBar.prototype.onKeyDown = function (e) {
|
|
519
519
|
var key = keyname(e.which);
|
|
520
|
-
var menuItems = tslib.
|
|
520
|
+
var menuItems = tslib.__spread(this.menuItems);
|
|
521
521
|
// account for hidden side bar trigger (hamburger)
|
|
522
522
|
if (this.state.wide && this.props.hasTrigger) {
|
|
523
523
|
menuItems.shift();
|
|
@@ -669,7 +669,7 @@ var ClickOutsideListener = /** @class */ (function (_super) {
|
|
|
669
669
|
return ClickOutsideListener;
|
|
670
670
|
}(React__default.Component));
|
|
671
671
|
|
|
672
|
-
var _a = [38, 40, 9, 13, 32, 27], up = _a[0], down = _a[1], tab = _a[2], enter = _a[3], space = _a[4], esc = _a[5];
|
|
672
|
+
var _a = tslib.__read([38, 40, 9, 13, 32, 27], 6), up = _a[0], down = _a[1], tab = _a[2], enter = _a[3], space = _a[4], esc = _a[5];
|
|
673
673
|
var OptionsMenuList = /** @class */ (function (_super) {
|
|
674
674
|
tslib.__extends(OptionsMenuList, _super);
|
|
675
675
|
function OptionsMenuList(props) {
|
|
@@ -797,7 +797,7 @@ var OptionsMenuList = /** @class */ (function (_super) {
|
|
|
797
797
|
return OptionsMenuList;
|
|
798
798
|
}(React__default.Component));
|
|
799
799
|
|
|
800
|
-
var
|
|
800
|
+
var _a$1 = tslib.__read([40], 1), down$1 = _a$1[0];
|
|
801
801
|
var OptionsMenu = /** @class */ (function (_super) {
|
|
802
802
|
tslib.__extends(OptionsMenu, _super);
|
|
803
803
|
function OptionsMenu(props) {
|
|
@@ -999,8 +999,8 @@ var NavBar = function (_a) {
|
|
|
999
999
|
var children = _a.children, className = _a.className, _b = _a.collapsed, collapsed = _b === void 0 ? false : _b, _c = _a.navTriggerLabel, navTriggerLabel = _c === void 0 ? 'MAIN MENU' : _c, propId = _a.propId;
|
|
1000
1000
|
var navRef = React.useRef(null);
|
|
1001
1001
|
var triggerRef = React.useRef(null);
|
|
1002
|
-
var _d = React.useState(false), showDropdown = _d[0], setShowDropdown = _d[1];
|
|
1003
|
-
var
|
|
1002
|
+
var _d = tslib.__read(React.useState(false), 2), showDropdown = _d[0], setShowDropdown = _d[1];
|
|
1003
|
+
var _e = tslib.__read([propId] || nextId.useId(1, 'navbar'), 1), menuId = _e[0];
|
|
1004
1004
|
var showNavItems = !collapsed || (collapsed && showDropdown);
|
|
1005
1005
|
var handleOutSideEvent = function (e) {
|
|
1006
1006
|
var _a;
|
|
@@ -1136,9 +1136,9 @@ var SideBar = /** @class */ (function (_super) {
|
|
|
1136
1136
|
SideBar.prototype.animate = function () {
|
|
1137
1137
|
var _this = this;
|
|
1138
1138
|
var show = this.props.show;
|
|
1139
|
-
var _a = show
|
|
1139
|
+
var _a = tslib.__read(show
|
|
1140
1140
|
? ['SideBar--show', 'SideBar--show SideBar--active']
|
|
1141
|
-
: ['SideBar--show', ''], first = _a[0], second = _a[1];
|
|
1141
|
+
: ['SideBar--show', ''], 2), first = _a[0], second = _a[1];
|
|
1142
1142
|
this.setState({ animateClass: first });
|
|
1143
1143
|
// css3 animations require transition classes to be added on separate tics
|
|
1144
1144
|
setTimeout(function () {
|
|
@@ -1472,14 +1472,14 @@ var fireCustomEvent = function (show, button) {
|
|
|
1472
1472
|
function Tooltip(_a) {
|
|
1473
1473
|
var _this = this;
|
|
1474
1474
|
var propId = _a.id, _b = _a.placement, initialPlacement = _b === void 0 ? 'auto' : _b, children = _a.children, portal = _a.portal, target = _a.target, _c = _a.association, association = _c === void 0 ? 'aria-describedby' : _c, _d = _a.variant, variant = _d === void 0 ? 'text' : _d, _e = _a.show, showProp = _e === void 0 ? false : _e, _f = _a.hideElementOnHidden, hideElementOnHidden = _f === void 0 ? false : _f, className = _a.className, props = tslib.__rest(_a, ["id", "placement", "children", "portal", "target", "association", "variant", "show", "hideElementOnHidden", "className"]);
|
|
1475
|
-
var
|
|
1475
|
+
var _g = tslib.__read(propId ? [propId] : nextId.useId(1, 'tooltip'), 1), id = _g[0];
|
|
1476
1476
|
var hovering = React.useRef(false);
|
|
1477
|
-
var
|
|
1478
|
-
var
|
|
1479
|
-
var
|
|
1480
|
-
var
|
|
1481
|
-
var
|
|
1482
|
-
var
|
|
1477
|
+
var _h = tslib.__read(React.useState(initialPlacement), 2), placement = _h[0], setPlacement = _h[1];
|
|
1478
|
+
var _j = tslib.__read(React.useState(!!showProp), 2), showTooltip = _j[0], setShowTooltip = _j[1];
|
|
1479
|
+
var _k = tslib.__read(React.useState(null), 2), targetElement = _k[0], setTargetElement = _k[1];
|
|
1480
|
+
var _l = tslib.__read(React.useState(null), 2), tooltipElement = _l[0], setTooltipElement = _l[1];
|
|
1481
|
+
var _m = tslib.__read(React.useState(null), 2), arrowElement = _m[0], setArrowElement = _m[1];
|
|
1482
|
+
var _o = reactPopper.usePopper(targetElement, tooltipElement, {
|
|
1483
1483
|
placement: initialPlacement,
|
|
1484
1484
|
modifiers: [
|
|
1485
1485
|
{ name: 'preventOverflow', options: { padding: 8 } },
|
|
@@ -1487,7 +1487,7 @@ function Tooltip(_a) {
|
|
|
1487
1487
|
{ name: 'offset', options: { offset: [0, 8] } },
|
|
1488
1488
|
{ name: 'arrow', options: { padding: 5, element: arrowElement } }
|
|
1489
1489
|
]
|
|
1490
|
-
}), styles =
|
|
1490
|
+
}), styles = _o.styles, attributes = _o.attributes, update = _o.update;
|
|
1491
1491
|
var show = function () { return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
1492
1492
|
return tslib.__generator(this, function (_a) {
|
|
1493
1493
|
switch (_a.label) {
|
|
@@ -1560,9 +1560,9 @@ function Tooltip(_a) {
|
|
|
1560
1560
|
return function () {
|
|
1561
1561
|
targetElement.removeEventListener('keyup', handleEscape);
|
|
1562
1562
|
};
|
|
1563
|
-
}, [
|
|
1563
|
+
}, [showProp]);
|
|
1564
1564
|
React.useEffect(function () {
|
|
1565
|
-
if (typeof
|
|
1565
|
+
if (typeof showProp !== undefined) {
|
|
1566
1566
|
targetElement === null || targetElement === void 0 ? void 0 : targetElement.addEventListener('mouseenter', handleTriggerMouseEnter);
|
|
1567
1567
|
targetElement === null || targetElement === void 0 ? void 0 : targetElement.addEventListener('mouseleave', handleTriggerMouseLeave);
|
|
1568
1568
|
targetElement === null || targetElement === void 0 ? void 0 : targetElement.addEventListener('focusin', show);
|
|
@@ -1574,7 +1574,7 @@ function Tooltip(_a) {
|
|
|
1574
1574
|
targetElement === null || targetElement === void 0 ? void 0 : targetElement.removeEventListener('focusin', show);
|
|
1575
1575
|
targetElement === null || targetElement === void 0 ? void 0 : targetElement.removeEventListener('focusout', hide);
|
|
1576
1576
|
};
|
|
1577
|
-
}, [targetElement,
|
|
1577
|
+
}, [targetElement, showProp]);
|
|
1578
1578
|
React.useEffect(function () {
|
|
1579
1579
|
if (tooltipElement) {
|
|
1580
1580
|
tooltipElement === null || tooltipElement === void 0 ? void 0 : tooltipElement.addEventListener('mouseenter', handleTipMouseEnter);
|
|
@@ -1740,19 +1740,29 @@ var Pointout = /** @class */ (function (_super) {
|
|
|
1740
1740
|
}
|
|
1741
1741
|
};
|
|
1742
1742
|
_this.handleOffscreenFocusIn = function (_a) {
|
|
1743
|
+
var e_1, _b;
|
|
1743
1744
|
var target = _a.target;
|
|
1744
|
-
var
|
|
1745
|
+
var _c = _this, offscreenRef = _c.offscreenRef, visibleRef = _c.visibleRef, getFocusableElements = _c.getFocusableElements;
|
|
1745
1746
|
var offscreenFocusable = getFocusableElements(offscreenRef);
|
|
1746
1747
|
var visibleFocusable = getFocusableElements(visibleRef);
|
|
1747
1748
|
var elementIndex = offscreenFocusable.findIndex(function (element) { return element === target; });
|
|
1748
1749
|
if (elementIndex === -1 || !visibleFocusable[elementIndex]) {
|
|
1749
1750
|
return;
|
|
1750
1751
|
}
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
var
|
|
1754
|
-
|
|
1755
|
-
|
|
1752
|
+
try {
|
|
1753
|
+
// Tag focusable elements
|
|
1754
|
+
for (var visibleFocusable_1 = tslib.__values(visibleFocusable), visibleFocusable_1_1 = visibleFocusable_1.next(); !visibleFocusable_1_1.done; visibleFocusable_1_1 = visibleFocusable_1.next()) {
|
|
1755
|
+
var element = visibleFocusable_1_1.value;
|
|
1756
|
+
element.setAttribute('data-focusable', 'true');
|
|
1757
|
+
element.setAttribute('tabindex', '-1');
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1761
|
+
finally {
|
|
1762
|
+
try {
|
|
1763
|
+
if (visibleFocusable_1_1 && !visibleFocusable_1_1.done && (_b = visibleFocusable_1["return"])) _b.call(visibleFocusable_1);
|
|
1764
|
+
}
|
|
1765
|
+
finally { if (e_1) throw e_1.error; }
|
|
1756
1766
|
}
|
|
1757
1767
|
visibleFocusable[elementIndex].classList.add('Pointout--focus-active');
|
|
1758
1768
|
};
|
|
@@ -1785,7 +1795,7 @@ var Pointout = /** @class */ (function (_super) {
|
|
|
1785
1795
|
top -= rect.top - portalNode.scrollTop;
|
|
1786
1796
|
left -= rect.left - portalNode.scrollLeft;
|
|
1787
1797
|
}
|
|
1788
|
-
var
|
|
1798
|
+
var _e = tslib.__read(arrowPosition.split('-'), 1), arrowBoxSide = _e[0];
|
|
1789
1799
|
var style;
|
|
1790
1800
|
switch (arrowBoxSide) {
|
|
1791
1801
|
case 'right':
|
|
@@ -2197,8 +2207,7 @@ Link.propTypes = {
|
|
|
2197
2207
|
Link.displayName = 'Link';
|
|
2198
2208
|
|
|
2199
2209
|
function Loader(_a) {
|
|
2200
|
-
var className = _a.className, label = _a.label,
|
|
2201
|
-
var props = tslib.__assign(tslib.__assign({}, other), { className: classNames('Loader', className) });
|
|
2210
|
+
var className = _a.className, _b = _a.variant, variant = _b === void 0 ? 'small' : _b, label = _a.label, props = tslib.__rest(_a, ["className", "variant", "label"]);
|
|
2202
2211
|
if (label === null || label === void 0 ? void 0 : label.length) {
|
|
2203
2212
|
props['role'] = 'alert';
|
|
2204
2213
|
props.children = React__default.createElement(Offscreen, null, label);
|
|
@@ -2206,7 +2215,11 @@ function Loader(_a) {
|
|
|
2206
2215
|
else {
|
|
2207
2216
|
props['aria-hidden'] = true;
|
|
2208
2217
|
}
|
|
2209
|
-
return React__default.createElement("div", tslib.__assign({
|
|
2218
|
+
return (React__default.createElement("div", tslib.__assign({ className: classNames('Loader', className, variant === 'large'
|
|
2219
|
+
? 'Loader--large'
|
|
2220
|
+
: variant === 'small'
|
|
2221
|
+
? 'Loader--small'
|
|
2222
|
+
: '') }, props)));
|
|
2210
2223
|
}
|
|
2211
2224
|
Loader.propTypes = {
|
|
2212
2225
|
className: PropTypes.string
|
|
@@ -2234,7 +2247,7 @@ var Select = React__default.forwardRef(function (_a, ref) {
|
|
|
2234
2247
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2235
2248
|
var onChangeEvent = onChange !== null && onChange !== void 0 ? onChange : (function () { });
|
|
2236
2249
|
var isControlled = typeof value !== 'undefined';
|
|
2237
|
-
var _c = React.useState(value || defaultValue || ''), currentValue = _c[0], setCurrentValue = _c[1];
|
|
2250
|
+
var _c = tslib.__read(React.useState(value || defaultValue || ''), 2), currentValue = _c[0], setCurrentValue = _c[1];
|
|
2238
2251
|
var handleChange = function (e) {
|
|
2239
2252
|
onChangeEvent(e);
|
|
2240
2253
|
if (isControlled) {
|
|
@@ -2291,8 +2304,8 @@ var RadioGroup = function (_a) {
|
|
|
2291
2304
|
_b = _a.onChange,
|
|
2292
2305
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2293
2306
|
onChange = _b === void 0 ? function () { } : _b, className = _a.className, other = tslib.__rest(_a, ["name", "radios", "defaultValue", "value", "onChange", "className"]);
|
|
2294
|
-
var _c = React.useState(value || defaultValue || null), currentValue = _c[0], setCurrentValue = _c[1];
|
|
2295
|
-
var _d = React.useState(null), focusIndex = _d[0], setFocusIndex = _d[1];
|
|
2307
|
+
var _c = tslib.__read(React.useState(value || defaultValue || null), 2), currentValue = _c[0], setCurrentValue = _c[1];
|
|
2308
|
+
var _d = tslib.__read(React.useState(null), 2), focusIndex = _d[0], setFocusIndex = _d[1];
|
|
2296
2309
|
var inputs = React.useRef([]);
|
|
2297
2310
|
var handleChange = function (value) { return setCurrentValue(value); };
|
|
2298
2311
|
var onRadioFocus = function (index) { return setFocusIndex(index); };
|
|
@@ -2361,8 +2374,8 @@ RadioGroup.displayName = 'RadioGroup';
|
|
|
2361
2374
|
|
|
2362
2375
|
var Checkbox = React.forwardRef(function (_a, ref) {
|
|
2363
2376
|
var id = _a.id, label = _a.label, 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", "error", "checkboxRef", "className", "onChange", 'aria-describedby', "disabled", "checked"]);
|
|
2364
|
-
var _d = React.useState(checked), isChecked = _d[0], setIsChecked = _d[1];
|
|
2365
|
-
var _e = React.useState(false), focused = _e[0], setFocused = _e[1];
|
|
2377
|
+
var _d = tslib.__read(React.useState(checked), 2), isChecked = _d[0], setIsChecked = _d[1];
|
|
2378
|
+
var _e = tslib.__read(React.useState(false), 2), focused = _e[0], setFocused = _e[1];
|
|
2366
2379
|
var checkRef = React.useRef(null);
|
|
2367
2380
|
React.useEffect(function () {
|
|
2368
2381
|
setIsChecked(checked);
|
|
@@ -7946,12 +7959,29 @@ Code.propTypes = {
|
|
|
7946
7959
|
className: PropTypes.string
|
|
7947
7960
|
};
|
|
7948
7961
|
|
|
7962
|
+
function AxeLoader() {
|
|
7963
|
+
return (React__default.createElement("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", x: "0", y: "0", viewBox: "0 0 800 800" },
|
|
7964
|
+
React__default.createElement("path", { fill: "currentColor", d: "M641.4 555.6c-27.2-12.1-59.1.2-71.2 27.3-.5 1-.8 2.1-1.2 3.2H160l227.6-394.3 170.1 292.8 32.4-18.8L387.5 117 95 623.6h474c4.9 13.1 14.8 24.4 28.6 30.5 7.1 3.2 14.5 4.7 21.8 4.7 20.7 0 40.4-11.9 49.3-32 12.1-27.1-.1-59.1-27.3-71.2zm1.6 59.8c-5.8 13-21.1 18.9-34 13.1-13-5.8-18.9-21.1-13.1-34 4.3-9.6 13.7-15.3 23.6-15.3 3.5 0 7.1.7 10.4 2.2 13.1 5.7 18.9 21 13.1 34z" }),
|
|
7965
|
+
React__default.createElement("path", { fill: "currentColor", d: "M379 549.9h-27.6v-16.7c-7.4 13.5-22.8 20.2-39 20.2-37.1 0-58.9-28.9-58.9-61.6 0-36.5 26.4-61.4 58.9-61.4 21.1 0 34 11.2 39 20.5V434H379v115.9zm-97.8-57.4c0 14.3 10.3 35.2 35.2 35.2 15.4 0 25.5-8 30.8-18.6 2.7-5.1 4-10.5 4.4-16.2.2-5.5-.8-11.2-3.2-16.2-4.9-11-15.6-20.5-32.3-20.5-22.4 0-35 18.1-35 36.1v.2zM436.2 488.9l-39-54.8h33.3l22.6 35.6 22.6-35.6h32.9l-38.8 54.8 43.2 61h-34L453.1 510l-26.2 39.9h-33.5l42.8-61z" })));
|
|
7966
|
+
}
|
|
7967
|
+
|
|
7949
7968
|
var LoaderOverlay = React__default.forwardRef(function (_a, ref) {
|
|
7950
|
-
var className = _a.className, other = tslib.__rest(_a, ["className"]);
|
|
7951
|
-
return (React__default.createElement("div", tslib.__assign({ className: classNames('Loader__overlay', className
|
|
7969
|
+
var className = _a.className, variant = _a.variant, label = _a.label, other = tslib.__rest(_a, ["className", "variant", "label"]);
|
|
7970
|
+
return (React__default.createElement("div", tslib.__assign({ className: classNames('Loader__overlay', className, variant === 'large'
|
|
7971
|
+
? 'Loader__overlay--large'
|
|
7972
|
+
: variant === 'small'
|
|
7973
|
+
? 'Loader__overlay--small'
|
|
7974
|
+
: ''), ref: ref }, other),
|
|
7975
|
+
React__default.createElement("div", { className: "Loader__overlay__loader" },
|
|
7976
|
+
React__default.createElement(Loader, { variant: variant }),
|
|
7977
|
+
React__default.createElement(AxeLoader, null)),
|
|
7978
|
+
label ? React__default.createElement("span", { className: "Loader__overlay__label" }, label) : null,
|
|
7979
|
+
other.children));
|
|
7952
7980
|
});
|
|
7953
7981
|
LoaderOverlay.propTypes = {
|
|
7954
|
-
className: PropTypes.string
|
|
7982
|
+
className: PropTypes.string,
|
|
7983
|
+
variant: PropTypes.oneOf(['large', 'small']),
|
|
7984
|
+
label: PropTypes.string
|
|
7955
7985
|
};
|
|
7956
7986
|
LoaderOverlay.displayName = 'LoaderOverlay';
|
|
7957
7987
|
|
|
@@ -8074,8 +8104,8 @@ var useDidUpdate = function (effect, dependencies) {
|
|
|
8074
8104
|
};
|
|
8075
8105
|
|
|
8076
8106
|
var Tabs = function (_a) {
|
|
8077
|
-
var children = _a.children, thin = _a.thin, _b = _a.initialActiveIndex, initialActiveIndex =
|
|
8078
|
-
var
|
|
8107
|
+
var children = _a.children, thin = _a.thin, _b = _a.orientation, orientation = _b === void 0 ? 'horizontal' : _b, _c = _a.initialActiveIndex, initialActiveIndex = _c === void 0 ? 0 : _c, className = _a.className, onChange = _a.onChange, labelProp = tslib.__rest(_a, ["children", "thin", "orientation", "initialActiveIndex", "className", "onChange"]);
|
|
8108
|
+
var _d = tslib.__read(React.useState(initialActiveIndex), 2), activeIndex = _d[0], setActiveIndex = _d[1];
|
|
8079
8109
|
var tabsRef = React.useRef(null);
|
|
8080
8110
|
var focusedTabRef = React.useRef(null);
|
|
8081
8111
|
var tabs = React__default.Children.toArray(children).filter(function (child) { return child.type === Tab; });
|
|
@@ -8086,34 +8116,48 @@ var Tabs = function (_a) {
|
|
|
8086
8116
|
var handleKeyDown = function (event) {
|
|
8087
8117
|
var key = event.key;
|
|
8088
8118
|
var newIndex = activeIndex;
|
|
8119
|
+
var forward;
|
|
8120
|
+
var backward;
|
|
8121
|
+
if (orientation === 'horizontal') {
|
|
8122
|
+
forward = 'ArrowRight';
|
|
8123
|
+
backward = 'ArrowLeft';
|
|
8124
|
+
}
|
|
8125
|
+
else {
|
|
8126
|
+
forward = 'ArrowDown';
|
|
8127
|
+
backward = 'ArrowUp';
|
|
8128
|
+
}
|
|
8089
8129
|
switch (key) {
|
|
8090
|
-
case
|
|
8130
|
+
case backward: {
|
|
8091
8131
|
newIndex = activeIndex - 1;
|
|
8092
8132
|
// circularity
|
|
8093
8133
|
if (newIndex === -1) {
|
|
8094
8134
|
newIndex = tabCount - 1;
|
|
8095
8135
|
}
|
|
8096
8136
|
setActiveIndex(newIndex);
|
|
8137
|
+
event.preventDefault();
|
|
8097
8138
|
break;
|
|
8098
8139
|
}
|
|
8099
|
-
case
|
|
8140
|
+
case forward: {
|
|
8100
8141
|
newIndex = activeIndex + 1;
|
|
8101
8142
|
// circularity
|
|
8102
8143
|
if (newIndex === tabCount) {
|
|
8103
8144
|
newIndex = 0;
|
|
8104
8145
|
}
|
|
8105
8146
|
setActiveIndex(newIndex);
|
|
8147
|
+
event.preventDefault();
|
|
8106
8148
|
break;
|
|
8107
8149
|
}
|
|
8108
8150
|
case 'Home': {
|
|
8109
8151
|
newIndex = 0;
|
|
8110
8152
|
setActiveIndex(newIndex);
|
|
8153
|
+
event.preventDefault();
|
|
8111
8154
|
break;
|
|
8112
8155
|
}
|
|
8113
8156
|
case 'End': {
|
|
8114
8157
|
event.preventDefault();
|
|
8115
8158
|
newIndex = tabCount - 1;
|
|
8116
8159
|
setActiveIndex(newIndex);
|
|
8160
|
+
event.preventDefault();
|
|
8117
8161
|
break;
|
|
8118
8162
|
}
|
|
8119
8163
|
}
|
|
@@ -8123,7 +8167,7 @@ var Tabs = function (_a) {
|
|
|
8123
8167
|
var _b;
|
|
8124
8168
|
var _c = child.props, target = _c.target, propId = _c.id, other = tslib.__rest(_c, ["target", "id"]);
|
|
8125
8169
|
var selected = index === activeIndex;
|
|
8126
|
-
var
|
|
8170
|
+
var _d = tslib.__read(propId ? [propId] : nextId.useId(1, 'tab'), 1), id = _d[0];
|
|
8127
8171
|
React.useEffect(function () {
|
|
8128
8172
|
var _a;
|
|
8129
8173
|
(_a = target.current) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-labelledby', id);
|
|
@@ -8146,7 +8190,9 @@ var Tabs = function (_a) {
|
|
|
8146
8190
|
}
|
|
8147
8191
|
}, [activeIndex]);
|
|
8148
8192
|
return (React__default.createElement("div", { className: classNames('Tabs', className, {
|
|
8149
|
-
'Tabs--thin': thin
|
|
8193
|
+
'Tabs--thin': thin,
|
|
8194
|
+
'Tabs--vertical': orientation === 'vertical',
|
|
8195
|
+
'Tabs--horizontal': orientation === 'horizontal'
|
|
8150
8196
|
}), ref: tabsRef },
|
|
8151
8197
|
React__default.createElement("ul", tslib.__assign({ role: "tablist", className: "Tablist" }, labelProp, { onKeyDown: handleKeyDown }), tabComponents)));
|
|
8152
8198
|
};
|
|
@@ -8157,12 +8203,13 @@ Tabs.propTypes = {
|
|
|
8157
8203
|
'aria-labelledby': PropTypes.string,
|
|
8158
8204
|
initialActiveIndex: PropTypes.number,
|
|
8159
8205
|
thin: PropTypes.bool,
|
|
8206
|
+
orientation: PropTypes.string,
|
|
8160
8207
|
className: PropTypes.string
|
|
8161
8208
|
};
|
|
8162
8209
|
|
|
8163
8210
|
var TabPanel = React.forwardRef(function (_a, ref) {
|
|
8164
8211
|
var children = _a.children, propId = _a.id, className = _a.className, other = tslib.__rest(_a, ["children", "id", "className"]);
|
|
8165
|
-
var
|
|
8212
|
+
var _b = tslib.__read(propId ? [propId] : nextId.useId(1, 'tabpanel'), 1), id = _b[0];
|
|
8166
8213
|
return (React__default.createElement("div", tslib.__assign({ role: "tabpanel", className: classNames('TabPanel', className), id: id, ref: ref }, other), children));
|
|
8167
8214
|
});
|
|
8168
8215
|
TabPanel.displayName = 'TabPanel';
|
|
@@ -8239,12 +8286,15 @@ Stepper.propTypes = {
|
|
|
8239
8286
|
};
|
|
8240
8287
|
|
|
8241
8288
|
var Panel = function (_a) {
|
|
8242
|
-
var
|
|
8289
|
+
var _b;
|
|
8290
|
+
var children = _a.children, collapsed = _a.collapsed, className = _a.className, heading = _a.heading, other = tslib.__rest(_a, ["children", "collapsed", "className", "heading"]);
|
|
8243
8291
|
var Heading = "h" + (typeof heading === 'object' && 'level' in heading && !!heading.level
|
|
8244
8292
|
? heading.level
|
|
8245
8293
|
: 2);
|
|
8246
8294
|
var headingId = typeof heading === 'object' && 'id' in heading ? heading.id : randomId();
|
|
8247
|
-
return (React__default.createElement("section", tslib.__assign({ "aria-labelledby": headingId, className: classNames('Panel', className
|
|
8295
|
+
return (React__default.createElement("section", tslib.__assign({ "aria-labelledby": headingId, className: classNames('Panel', className, (_b = {},
|
|
8296
|
+
_b['Panel--collapsed'] = collapsed,
|
|
8297
|
+
_b)) }, other),
|
|
8248
8298
|
React__default.createElement(Heading, { id: headingId, className: "Panel__Heading" }, typeof heading === 'object' && 'text' in heading
|
|
8249
8299
|
? heading.text
|
|
8250
8300
|
: heading),
|
|
@@ -8319,9 +8369,9 @@ var Pagination = React__default.forwardRef(function (_a, ref) {
|
|
|
8319
8369
|
var isFirstPage = currentPage === 1;
|
|
8320
8370
|
return (React__default.createElement("div", tslib.__assign({ ref: ref, className: classNames('Pagination', className) }, other),
|
|
8321
8371
|
React__default.createElement("ul", null,
|
|
8322
|
-
React__default.createElement("li", null, isFirstPage ? (React__default.createElement(TooltipTabstop, { tooltip: firstPageLabel, placement: tooltipPlacement },
|
|
8372
|
+
React__default.createElement("li", null, isFirstPage ? (React__default.createElement(TooltipTabstop, { hideElementOnHidden: true, association: "aria-labelledby", tooltip: firstPageLabel, placement: tooltipPlacement },
|
|
8323
8373
|
React__default.createElement(Icon, { type: "chevron-double-left" }))) : (React__default.createElement(IconButton, { icon: "chevron-double-left", tooltipPlacement: tooltipPlacement, label: firstPageLabel, onClick: onFirstPageClick }))),
|
|
8324
|
-
React__default.createElement("li", null, isFirstPage ? (React__default.createElement(TooltipTabstop, { tooltip: previousPageLabel, placement: tooltipPlacement },
|
|
8374
|
+
React__default.createElement("li", null, isFirstPage ? (React__default.createElement(TooltipTabstop, { hideElementOnHidden: true, association: "aria-labelledby", tooltip: previousPageLabel, placement: tooltipPlacement },
|
|
8325
8375
|
React__default.createElement(Icon, { type: "chevron-left" }))) : (React__default.createElement(IconButton, { icon: "chevron-left", tooltipPlacement: tooltipPlacement, label: previousPageLabel, onClick: onPreviousPageClick }))),
|
|
8326
8376
|
React__default.createElement("li", null,
|
|
8327
8377
|
React__default.createElement("span", { role: "log", "aria-atomic": "true" }, statusLabel || (React__default.createElement("span", null,
|
|
@@ -8332,9 +8382,9 @@ var Pagination = React__default.forwardRef(function (_a, ref) {
|
|
|
8332
8382
|
React__default.createElement("strong", null, itemEnd),
|
|
8333
8383
|
" of ",
|
|
8334
8384
|
React__default.createElement("strong", null, totalItems))))),
|
|
8335
|
-
React__default.createElement("li", null, isLastPage ? (React__default.createElement(TooltipTabstop, { tooltip: nextPageLabel, placement: tooltipPlacement },
|
|
8385
|
+
React__default.createElement("li", null, isLastPage ? (React__default.createElement(TooltipTabstop, { hideElementOnHidden: true, association: "aria-labelledby", tooltip: nextPageLabel, placement: tooltipPlacement },
|
|
8336
8386
|
React__default.createElement(Icon, { type: "chevron-right" }))) : (React__default.createElement(IconButton, { icon: "chevron-right", tooltipPlacement: tooltipPlacement, label: nextPageLabel, onClick: onNextPageClick }))),
|
|
8337
|
-
React__default.createElement("li", null, isLastPage ? (React__default.createElement(TooltipTabstop, { tooltip: lastPageLabel, placement: tooltipPlacement },
|
|
8387
|
+
React__default.createElement("li", null, isLastPage ? (React__default.createElement(TooltipTabstop, { hideElementOnHidden: true, association: "aria-labelledby", tooltip: lastPageLabel, placement: tooltipPlacement },
|
|
8338
8388
|
React__default.createElement(Icon, { type: "chevron-double-right" }))) : (React__default.createElement(IconButton, { icon: "chevron-double-right", tooltipPlacement: tooltipPlacement, label: lastPageLabel, onClick: onLastPageClick }))))));
|
|
8339
8389
|
});
|
|
8340
8390
|
Pagination.displayName = 'Pagination';
|
|
@@ -8356,12 +8406,52 @@ Pagination.propTypes = {
|
|
|
8356
8406
|
className: PropTypes.string
|
|
8357
8407
|
};
|
|
8358
8408
|
|
|
8409
|
+
var FieldWrap = React__default.forwardRef(function (_a, ref) {
|
|
8410
|
+
var children = _a.children, className = _a.className, _b = _a.as, Component = _b === void 0 ? 'div' : _b, props = tslib.__rest(_a, ["children", "className", "as"]);
|
|
8411
|
+
return (React__default.createElement(Component, tslib.__assign({ ref: ref, className: classNames('Panel', className) }, props), children));
|
|
8412
|
+
});
|
|
8413
|
+
FieldWrap.displayName = 'FieldWrap';
|
|
8414
|
+
FieldWrap.propTypes = {
|
|
8415
|
+
children: PropTypes.node.isRequired,
|
|
8416
|
+
className: PropTypes.string,
|
|
8417
|
+
as: PropTypes.string
|
|
8418
|
+
};
|
|
8419
|
+
|
|
8420
|
+
var Breadcrumb = React.forwardRef(function (_a, ref) {
|
|
8421
|
+
var _b = _a.separator, separator = _b === void 0 ? '/' : _b, className = _a.className, children = _a.children, props = tslib.__rest(_a, ["separator", "className", "children"]);
|
|
8422
|
+
var items = React__default.Children.toArray(children);
|
|
8423
|
+
var childrenWithSeparators = [];
|
|
8424
|
+
items.forEach(function (child, index) {
|
|
8425
|
+
if (index !== items.length - 1) {
|
|
8426
|
+
childrenWithSeparators.push(React__default.createElement(React__default.Fragment, null,
|
|
8427
|
+
child,
|
|
8428
|
+
React__default.createElement("span", { className: "Breadcrumb__Separator", "aria-hidden": "true" }, separator)));
|
|
8429
|
+
}
|
|
8430
|
+
else {
|
|
8431
|
+
childrenWithSeparators.push(child);
|
|
8432
|
+
}
|
|
8433
|
+
});
|
|
8434
|
+
return (React__default.createElement("nav", tslib.__assign({ className: classNames('Breadcrumb', className), ref: ref }, props),
|
|
8435
|
+
React__default.createElement("ol", null, childrenWithSeparators.map(function (child, index) { return (React__default.createElement("li", { className: "Breadcrumb__Item", key: "breadcrumb-" + index }, child)); }))));
|
|
8436
|
+
});
|
|
8437
|
+
Breadcrumb.displayName = 'Breadcrumb';
|
|
8438
|
+
|
|
8439
|
+
var BreadcrumbItem = React.forwardRef(function (_a, ref) {
|
|
8440
|
+
var className = _a.className, children = _a.children, props = tslib.__rest(_a, ["className", "children"]);
|
|
8441
|
+
return (React__default.createElement("span", tslib.__assign({ className: classNames('Breadcrumb__Item', className), ref: ref, "aria-current": "location" }, props), children));
|
|
8442
|
+
});
|
|
8443
|
+
|
|
8444
|
+
var BreadcrumbLink = React.forwardRef(function (_a, ref) {
|
|
8445
|
+
var className = _a.className, _b = _a.as, ElementType = _b === void 0 ? 'a' : _b, children = _a.children, props = tslib.__rest(_a, ["className", "as", "children"]);
|
|
8446
|
+
return (React__default.createElement(ElementType, tslib.__assign({ className: classNames('Link', 'Breadcrumb__Link', className), ref: ref }, props), children));
|
|
8447
|
+
});
|
|
8448
|
+
|
|
8359
8449
|
var LIGHT_THEME_CLASS = 'cauldron--theme-light';
|
|
8360
8450
|
var DARK_THEME_CLASS = 'cauldron--theme-dark';
|
|
8361
8451
|
var ThemeContext = React.createContext({});
|
|
8362
8452
|
var ThemeProvider = function (_a) {
|
|
8363
8453
|
var children = _a.children, _b = _a.context, context = _b === void 0 ? document.body : _b, _c = _a.initialTheme, initialTheme = _c === void 0 ? 'light' : _c;
|
|
8364
|
-
var _d = React.useState(initialTheme), theme = _d[0], setTheme = _d[1];
|
|
8454
|
+
var _d = tslib.__read(React.useState(initialTheme), 2), theme = _d[0], setTheme = _d[1];
|
|
8365
8455
|
var getThemeFromContext = function () {
|
|
8366
8456
|
return context.classList.contains(DARK_THEME_CLASS) ? 'dark' : 'light';
|
|
8367
8457
|
};
|
|
@@ -8374,12 +8464,22 @@ var ThemeProvider = function (_a) {
|
|
|
8374
8464
|
}, [context, theme]);
|
|
8375
8465
|
// Use a MutationObserver to track changes to the classes outside of the context of React
|
|
8376
8466
|
var handleMutation = function (mutationList) {
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
mutation
|
|
8381
|
-
|
|
8467
|
+
var e_1, _a;
|
|
8468
|
+
try {
|
|
8469
|
+
for (var mutationList_1 = tslib.__values(mutationList), mutationList_1_1 = mutationList_1.next(); !mutationList_1_1.done; mutationList_1_1 = mutationList_1.next()) {
|
|
8470
|
+
var mutation = mutationList_1_1.value;
|
|
8471
|
+
if (mutation.type === 'attributes' &&
|
|
8472
|
+
mutation.attributeName === 'class') {
|
|
8473
|
+
setTheme(getThemeFromContext());
|
|
8474
|
+
}
|
|
8475
|
+
}
|
|
8476
|
+
}
|
|
8477
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
8478
|
+
finally {
|
|
8479
|
+
try {
|
|
8480
|
+
if (mutationList_1_1 && !mutationList_1_1.done && (_a = mutationList_1["return"])) _a.call(mutationList_1);
|
|
8382
8481
|
}
|
|
8482
|
+
finally { if (e_1) throw e_1.error; }
|
|
8383
8483
|
}
|
|
8384
8484
|
};
|
|
8385
8485
|
React.useEffect(function () {
|
|
@@ -8412,6 +8512,9 @@ exports.Alert = Alert;
|
|
|
8412
8512
|
exports.AlertActions = AlertActions;
|
|
8413
8513
|
exports.AlertContent = AlertContent;
|
|
8414
8514
|
exports.AriaIsolate = AriaIsolate;
|
|
8515
|
+
exports.Breadcrumb = Breadcrumb;
|
|
8516
|
+
exports.BreadcrumbItem = BreadcrumbItem;
|
|
8517
|
+
exports.BreadcrumbLink = BreadcrumbLink;
|
|
8415
8518
|
exports.Button = Button;
|
|
8416
8519
|
exports.Card = Card;
|
|
8417
8520
|
exports.CardContent = CardContent;
|
|
@@ -8428,6 +8531,7 @@ exports.Dialog = Dialog;
|
|
|
8428
8531
|
exports.DialogContent = DialogContent;
|
|
8429
8532
|
exports.DialogFooter = DialogFooter;
|
|
8430
8533
|
exports.ExpandCollapsePanel = ExpandCollapsePanel;
|
|
8534
|
+
exports.FieldWrap = FieldWrap;
|
|
8431
8535
|
exports.Icon = Icon;
|
|
8432
8536
|
exports.IconButton = IconButton;
|
|
8433
8537
|
exports.IssuePanel = IssuePanel;
|