@deque/cauldron-react 4.3.0-canary.2f072027 → 4.3.0-canary.4881208c
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>;
|
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
|
|