@deque/cauldron-react 4.3.0-canary.bb49adf8 → 4.3.0-canary.e2302853
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { IconType } from '../Icon';
|
|
3
4
|
export interface PanelTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
5
|
children?: ((props: {
|
|
5
6
|
open: boolean;
|
|
@@ -7,14 +8,18 @@ export interface PanelTriggerProps extends React.ButtonHTMLAttributes<HTMLButton
|
|
|
7
8
|
open?: boolean;
|
|
8
9
|
fullWidth?: string;
|
|
9
10
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
+
iconExpanded?: IconType;
|
|
12
|
+
iconCollapsed?: IconType;
|
|
10
13
|
}
|
|
11
|
-
declare function PanelTrigger({ children, className, open, fullWidth, onClick, ...other }: PanelTriggerProps): JSX.Element;
|
|
14
|
+
declare function PanelTrigger({ children, className, open, fullWidth, onClick, iconExpanded, iconCollapsed, ...other }: PanelTriggerProps): JSX.Element;
|
|
12
15
|
declare namespace PanelTrigger {
|
|
13
16
|
var propTypes: {
|
|
14
17
|
children: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
15
18
|
open: PropTypes.Requireable<boolean>;
|
|
16
19
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
20
|
className: PropTypes.Requireable<string>;
|
|
21
|
+
iconExpanded: PropTypes.Requireable<string>;
|
|
22
|
+
iconCollapsed: PropTypes.Requireable<string>;
|
|
18
23
|
};
|
|
19
24
|
}
|
|
20
25
|
declare const _default: React.MemoExoticComponent<typeof PanelTrigger>;
|
|
@@ -7,16 +7,18 @@ interface TableHeaderProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
|
7
7
|
onSort?: () => void;
|
|
8
8
|
className?: string;
|
|
9
9
|
sortAscendingAnnouncement?: string;
|
|
10
|
-
|
|
10
|
+
sortDescendingAnnouncement?: string;
|
|
11
11
|
}
|
|
12
12
|
declare const TableHeader: {
|
|
13
|
-
({ children, sortDirection, onSort, className, sortAscendingAnnouncement,
|
|
13
|
+
({ children, sortDirection, onSort, className, sortAscendingAnnouncement, sortDescendingAnnouncement, ...other }: TableHeaderProps): JSX.Element;
|
|
14
14
|
displayName: string;
|
|
15
15
|
propTypes: {
|
|
16
16
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
17
17
|
sortDirection: PropTypes.Requireable<string>;
|
|
18
18
|
onSort: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
19
|
className: PropTypes.Requireable<string>;
|
|
20
|
+
sortAscendingAnnouncement: PropTypes.Requireable<string>;
|
|
21
|
+
sortDescendingAnnouncement: PropTypes.Requireable<string>;
|
|
20
22
|
};
|
|
21
23
|
};
|
|
22
24
|
export default TableHeader;
|
package/lib/index.js
CHANGED
|
@@ -2600,16 +2600,18 @@ var TextField = /** @class */ (function (_super) {
|
|
|
2600
2600
|
}(React__default.Component));
|
|
2601
2601
|
|
|
2602
2602
|
function PanelTrigger(_a) {
|
|
2603
|
-
var children = _a.children, className = _a.className, open = _a.open, fullWidth = _a.fullWidth, onClick = _a.onClick, other = tslib.__rest(_a, ["children", "className", "open", "fullWidth", "onClick"]);
|
|
2603
|
+
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"]);
|
|
2604
2604
|
return (React__default.createElement("button", tslib.__assign({}, other, { className: classNames('ExpandCollapse__trigger', fullWidth ? 'fullWidth' : '', className), type: "button", "aria-expanded": open, onClick: onClick }),
|
|
2605
2605
|
React__default.createElement("div", { className: "ExpandCollapse__trigger-title" }, typeof children === 'function' ? children({ open: !!open }) : children),
|
|
2606
|
-
React__default.createElement(Icon, { type: open ?
|
|
2606
|
+
React__default.createElement(Icon, { type: open ? iconExpanded : iconCollapsed })));
|
|
2607
2607
|
}
|
|
2608
2608
|
PanelTrigger.propTypes = {
|
|
2609
2609
|
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
2610
2610
|
open: PropTypes.bool,
|
|
2611
2611
|
onClick: PropTypes.func,
|
|
2612
|
-
className: PropTypes.string
|
|
2612
|
+
className: PropTypes.string,
|
|
2613
|
+
iconExpanded: PropTypes.string,
|
|
2614
|
+
iconCollapsed: PropTypes.string
|
|
2613
2615
|
};
|
|
2614
2616
|
var PanelTrigger$1 = React__default.memo(PanelTrigger);
|
|
2615
2617
|
|
|
@@ -7984,8 +7986,8 @@ SyntaxHighlighter.registerLanguage('css', css_1);
|
|
|
7984
7986
|
SyntaxHighlighter.registerLanguage('html', xml_1);
|
|
7985
7987
|
SyntaxHighlighter.registerLanguage('yaml', yaml_1);
|
|
7986
7988
|
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));
|
|
7989
|
+
var children = _a.children, className = _a.className, tabIndex = _a.tabIndex, props = tslib.__rest(_a, ["children", "className", "tabIndex"]);
|
|
7990
|
+
return (React__default.createElement(SyntaxHighlighter, tslib.__assign({}, props, { useInlineStyles: false, className: classNames('Code', className), tabIndex: tabIndex }), children));
|
|
7989
7991
|
};
|
|
7990
7992
|
Code.displayName = 'Code';
|
|
7991
7993
|
Code.propTypes = {
|
|
@@ -8123,18 +8125,15 @@ TableHead.propTypes = {
|
|
|
8123
8125
|
};
|
|
8124
8126
|
|
|
8125
8127
|
var TableHeader = function (_a) {
|
|
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.
|
|
8128
|
+
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.sortDescendingAnnouncement, sortDescendingAnnouncement = _c === void 0 ? 'sorted descending' : _c, other = tslib.__rest(_a, ["children", "sortDirection", "onSort", "className", "sortAscendingAnnouncement", "sortDescendingAnnouncement"]);
|
|
8127
8129
|
// When the sort direction changes, we want to announce the change in a live region
|
|
8128
8130
|
// because changes to the sort value is not widely supported yet
|
|
8129
8131
|
// see: https://a11ysupport.io/tech/aria/aria-sort_attribute
|
|
8130
|
-
var
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
: sortDescendingAnnouncemen);
|
|
8136
|
-
}
|
|
8137
|
-
}, [sortDirection]);
|
|
8132
|
+
var announcement = sortDirection === 'ascending'
|
|
8133
|
+
? sortAscendingAnnouncement
|
|
8134
|
+
: sortDirection === 'descending'
|
|
8135
|
+
? sortDescendingAnnouncement
|
|
8136
|
+
: '';
|
|
8138
8137
|
return (React__default.createElement("th", tslib.__assign({ "aria-sort": sortDirection, className: classNames('TableHeader', className, {
|
|
8139
8138
|
'TableHeader--sort-ascending': sortDirection === 'ascending',
|
|
8140
8139
|
'TableHeader--sort-descending': sortDirection === 'descending'
|
|
@@ -8149,7 +8148,9 @@ TableHeader.propTypes = {
|
|
|
8149
8148
|
children: PropTypes.node.isRequired,
|
|
8150
8149
|
sortDirection: PropTypes.string,
|
|
8151
8150
|
onSort: PropTypes.func,
|
|
8152
|
-
className: PropTypes.string
|
|
8151
|
+
className: PropTypes.string,
|
|
8152
|
+
sortAscendingAnnouncement: PropTypes.string,
|
|
8153
|
+
sortDescendingAnnouncement: PropTypes.string
|
|
8153
8154
|
};
|
|
8154
8155
|
|
|
8155
8156
|
var TableRow = function (_a) {
|