@deque/cauldron-react 4.2.1-canary.d1539456 → 4.3.0-canary.2f072027
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.
|
@@ -6,9 +6,11 @@ interface TableHeaderProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
|
6
6
|
sortDirection?: SortDirection;
|
|
7
7
|
onSort?: () => void;
|
|
8
8
|
className?: string;
|
|
9
|
+
sortAscendingAnnouncement?: string;
|
|
10
|
+
sortDescendingAnnouncemen?: string;
|
|
9
11
|
}
|
|
10
12
|
declare const TableHeader: {
|
|
11
|
-
({ children, sortDirection, onSort, className, ...other }: TableHeaderProps): JSX.Element;
|
|
13
|
+
({ children, sortDirection, onSort, className, sortAscendingAnnouncement, sortDescendingAnnouncemen, ...other }: TableHeaderProps): JSX.Element;
|
|
12
14
|
displayName: string;
|
|
13
15
|
propTypes: {
|
|
14
16
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import SkipLink from '../SkipLink';
|
|
2
3
|
interface TwoColumnPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
initialCollapsed?: boolean;
|
|
4
5
|
showCollapsedPanelLabel?: string;
|
|
5
6
|
hideCollapsedPanelLabel?: string;
|
|
7
|
+
skipLink?: SkipLink;
|
|
6
8
|
}
|
|
7
9
|
declare const TwoColumnPanel: React.ForwardRefExoticComponent<TwoColumnPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
10
|
export default TwoColumnPanel;
|
package/lib/index.js
CHANGED
|
@@ -7984,8 +7984,8 @@ SyntaxHighlighter.registerLanguage('css', css_1);
|
|
|
7984
7984
|
SyntaxHighlighter.registerLanguage('html', xml_1);
|
|
7985
7985
|
SyntaxHighlighter.registerLanguage('yaml', yaml_1);
|
|
7986
7986
|
var Code = function (_a) {
|
|
7987
|
-
var children = _a.children, className = _a.className, props = tslib.__rest(_a, ["children", "className"]);
|
|
7988
|
-
return (React__default.createElement(SyntaxHighlighter, tslib.__assign({}, props, { useInlineStyles: false, className: classNames('Code', className) }), children));
|
|
7987
|
+
var children = _a.children, className = _a.className, tabIndex = _a.tabIndex, props = tslib.__rest(_a, ["children", "className", "tabIndex"]);
|
|
7988
|
+
return (React__default.createElement(SyntaxHighlighter, tslib.__assign({}, props, { useInlineStyles: false, className: classNames('Code', className), tabIndex: tabIndex }), children));
|
|
7989
7989
|
};
|
|
7990
7990
|
Code.displayName = 'Code';
|
|
7991
7991
|
Code.propTypes = {
|
|
@@ -8123,13 +8123,26 @@ TableHead.propTypes = {
|
|
|
8123
8123
|
};
|
|
8124
8124
|
|
|
8125
8125
|
var TableHeader = function (_a) {
|
|
8126
|
-
var children = _a.children, sortDirection = _a.sortDirection, onSort = _a.onSort, className = _a.className, other = tslib.__rest(_a, ["children", "sortDirection", "onSort", "className"]);
|
|
8126
|
+
var children = _a.children, sortDirection = _a.sortDirection, onSort = _a.onSort, className = _a.className, _b = _a.sortAscendingAnnouncement, sortAscendingAnnouncement = _b === void 0 ? 'sorted ascending' : _b, _c = _a.sortDescendingAnnouncemen, sortDescendingAnnouncemen = _c === void 0 ? 'sorted descending' : _c, other = tslib.__rest(_a, ["children", "sortDirection", "onSort", "className", "sortAscendingAnnouncement", "sortDescendingAnnouncemen"]);
|
|
8127
|
+
// When the sort direction changes, we want to announce the change in a live region
|
|
8128
|
+
// because changes to the sort value is not widely supported yet
|
|
8129
|
+
// see: https://a11ysupport.io/tech/aria/aria-sort_attribute
|
|
8130
|
+
var _d = tslib.__read(React.useState(''), 2), announcement = _d[0], setAnnouncement = _d[1];
|
|
8131
|
+
React.useEffect(function () {
|
|
8132
|
+
if (sortDirection !== 'none') {
|
|
8133
|
+
setAnnouncement(sortDirection === 'ascending'
|
|
8134
|
+
? sortAscendingAnnouncement
|
|
8135
|
+
: sortDescendingAnnouncemen);
|
|
8136
|
+
}
|
|
8137
|
+
}, [sortDirection]);
|
|
8127
8138
|
return (React__default.createElement("th", tslib.__assign({ "aria-sort": sortDirection, className: classNames('TableHeader', className, {
|
|
8128
8139
|
'TableHeader--sort-ascending': sortDirection === 'ascending',
|
|
8129
8140
|
'TableHeader--sort-descending': sortDirection === 'descending'
|
|
8130
8141
|
}) }, other), !!onSort && !!sortDirection ? (React__default.createElement("button", { onClick: onSort, className: "TableHeader__sort-button", type: "button" },
|
|
8131
8142
|
children,
|
|
8132
|
-
React__default.createElement("span", { "aria-hidden": "true" }, sortDirection === 'none' ? (React__default.createElement(Icon, { type: "sort-triangle" })) : sortDirection === 'ascending' ? (React__default.createElement(Icon, { type: "triangle-up" })) : (React__default.createElement(Icon, { type: "triangle-down" })))
|
|
8143
|
+
React__default.createElement("span", { "aria-hidden": "true" }, sortDirection === 'none' ? (React__default.createElement(Icon, { type: "sort-triangle" })) : sortDirection === 'ascending' ? (React__default.createElement(Icon, { type: "triangle-up" })) : (React__default.createElement(Icon, { type: "triangle-down" }))),
|
|
8144
|
+
React__default.createElement(Offscreen, null,
|
|
8145
|
+
React__default.createElement("span", { role: "status", "aria-live": "polite" }, announcement)))) : (children)));
|
|
8133
8146
|
};
|
|
8134
8147
|
TableHeader.displayName = 'TableHeader';
|
|
8135
8148
|
TableHeader.propTypes = {
|
|
@@ -8543,11 +8556,23 @@ var BreadcrumbLink = React.forwardRef(function (_a, ref) {
|
|
|
8543
8556
|
return (React__default.createElement(ElementType, tslib.__assign({ className: classNames('Link', 'Breadcrumb__Link', className), ref: ref }, props), children));
|
|
8544
8557
|
});
|
|
8545
8558
|
|
|
8559
|
+
var ColumnLeft = React.forwardRef(function (_a, ref) {
|
|
8560
|
+
var className = _a.className, children = _a.children, props = tslib.__rest(_a, ["className", "children"]);
|
|
8561
|
+
return (React__default.createElement("section", tslib.__assign({ className: classNames('TwoColumnPanel__Left', className) }, props, { ref: ref }), children));
|
|
8562
|
+
});
|
|
8563
|
+
ColumnLeft.displayName = 'ColumnLeft';
|
|
8564
|
+
|
|
8565
|
+
var ColumnRight = React.forwardRef(function (_a, ref) {
|
|
8566
|
+
var className = _a.className, children = _a.children, props = tslib.__rest(_a, ["className", "children"]);
|
|
8567
|
+
return (React__default.createElement("section", tslib.__assign({ className: classNames('TwoColumnPanel__Right', className) }, props, { ref: ref }), children));
|
|
8568
|
+
});
|
|
8569
|
+
ColumnRight.displayName = 'ColumnRight';
|
|
8570
|
+
|
|
8546
8571
|
var TwoColumnPanel = React.forwardRef(function (_a, ref) {
|
|
8547
|
-
var className = _a.className, children = _a.children, _b = _a.initialCollapsed, initialCollapsed = _b === void 0 ? false : _b, _c = _a.showCollapsedPanelLabel, showCollapsedPanelLabel = _c === void 0 ? 'Show Panel' : _c, _d = _a.hideCollapsedPanelLabel, hideCollapsedPanelLabel = _d === void 0 ? 'Hide Panel' : _d, props = tslib.__rest(_a, ["className", "children", "initialCollapsed", "showCollapsedPanelLabel", "hideCollapsedPanelLabel"]);
|
|
8548
|
-
var
|
|
8549
|
-
var
|
|
8550
|
-
var
|
|
8572
|
+
var className = _a.className, children = _a.children, _b = _a.initialCollapsed, initialCollapsed = _b === void 0 ? false : _b, _c = _a.showCollapsedPanelLabel, showCollapsedPanelLabel = _c === void 0 ? 'Show Panel' : _c, _d = _a.hideCollapsedPanelLabel, hideCollapsedPanelLabel = _d === void 0 ? 'Hide Panel' : _d, _e = _a.skipLink, skipLink = _e === void 0 ? null : _e, props = tslib.__rest(_a, ["className", "children", "initialCollapsed", "showCollapsedPanelLabel", "hideCollapsedPanelLabel", "skipLink"]);
|
|
8573
|
+
var _f = tslib.__read(React.useState(initialCollapsed), 2), isCollapsed = _f[0], setCollapsed = _f[1];
|
|
8574
|
+
var _g = tslib.__read(React.useState(false), 2), isFocusTrap = _g[0], setIsFocusTrap = _g[1];
|
|
8575
|
+
var _h = tslib.__read(React.useState(!initialCollapsed), 2), showPanel = _h[0], setShowPanel = _h[1];
|
|
8551
8576
|
var togglePanel = function () {
|
|
8552
8577
|
if (isCollapsed) {
|
|
8553
8578
|
setShowPanel(true);
|
|
@@ -8674,6 +8699,7 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
|
|
|
8674
8699
|
fallbackFocus: columnLeftRef.current
|
|
8675
8700
|
}, containerElements: [columnLeftRef.current] }),
|
|
8676
8701
|
React__default.createElement(ClickOutsideListener, { onClickOutside: handleClickOutside, target: columnLeftRef.current }),
|
|
8702
|
+
isCollapsed ? null : skipLink,
|
|
8677
8703
|
showPanel ? ColumnLeftComponent : null,
|
|
8678
8704
|
ColumnRightComponent));
|
|
8679
8705
|
});
|
|
@@ -8691,18 +8717,6 @@ var ColumnGroupHeader = React.forwardRef(function (_a, ref) {
|
|
|
8691
8717
|
});
|
|
8692
8718
|
ColumnGroupHeader.displayName = 'ColumnGroupHeader';
|
|
8693
8719
|
|
|
8694
|
-
var ColumnLeft = React.forwardRef(function (_a, ref) {
|
|
8695
|
-
var className = _a.className, children = _a.children, props = tslib.__rest(_a, ["className", "children"]);
|
|
8696
|
-
return (React__default.createElement("section", tslib.__assign({ className: classNames('TwoColumnPanel__Left', className) }, props, { ref: ref }), children));
|
|
8697
|
-
});
|
|
8698
|
-
ColumnLeft.displayName = 'ColumnLeft';
|
|
8699
|
-
|
|
8700
|
-
var ColumnRight = React.forwardRef(function (_a, ref) {
|
|
8701
|
-
var className = _a.className, children = _a.children, props = tslib.__rest(_a, ["className", "children"]);
|
|
8702
|
-
return (React__default.createElement("section", tslib.__assign({ className: classNames('TwoColumnPanel__Right', className) }, props, { ref: ref }), children));
|
|
8703
|
-
});
|
|
8704
|
-
ColumnRight.displayName = 'ColumnRight';
|
|
8705
|
-
|
|
8706
8720
|
var ColumnList = React.forwardRef(function (_a, ref) {
|
|
8707
8721
|
var className = _a.className, children = _a.children, props = tslib.__rest(_a, ["className", "children"]);
|
|
8708
8722
|
return (React__default.createElement("div", tslib.__assign({ className: classNames('TwoColumnPanel__List', className) }, props, { ref: ref }), children));
|