@deque/cauldron-react 4.6.0-canary.8df85c5f → 4.7.0
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.
|
@@ -33,7 +33,7 @@ interface AccordionProps extends ExpandCollapsePanelProps {
|
|
|
33
33
|
children: React.ReactNode;
|
|
34
34
|
}
|
|
35
35
|
declare const Accordion: {
|
|
36
|
-
({ children }: AccordionProps): JSX.Element | null;
|
|
36
|
+
({ children, open, onToggle, animationTiming, ...props }: AccordionProps): JSX.Element | null;
|
|
37
37
|
displayName: string;
|
|
38
38
|
propTypes: {
|
|
39
39
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -9,10 +9,10 @@ interface Props extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
9
9
|
previousPageLabel?: string;
|
|
10
10
|
nextPageLabel?: string;
|
|
11
11
|
lastPageLabel?: string;
|
|
12
|
-
onNextPageClick?: () => void;
|
|
13
|
-
onPreviousPageClick?: () => void;
|
|
14
|
-
onFirstPageClick?: () => void;
|
|
15
|
-
onLastPageClick?: () => void;
|
|
12
|
+
onNextPageClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
onPreviousPageClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
14
|
+
onFirstPageClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
15
|
+
onLastPageClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
16
16
|
tooltipPlacement?: Placement;
|
|
17
17
|
thin?: boolean;
|
|
18
18
|
className?: string;
|
package/lib/index.js
CHANGED
|
@@ -481,7 +481,7 @@ var AccordionContent = function (_a) {
|
|
|
481
481
|
return (React__default.createElement("div", tslib.__assign({ className: classNames('Accordion__panel', className) }, otherProps), children));
|
|
482
482
|
};
|
|
483
483
|
var Accordion = function (_a) {
|
|
484
|
-
var children = _a.children;
|
|
484
|
+
var children = _a.children, open = _a.open, onToggle = _a.onToggle, animationTiming = _a.animationTiming, props = tslib.__rest(_a, ["children", "open", "onToggle", "animationTiming"]);
|
|
485
485
|
var childrenArray = React__default.Children.toArray(children);
|
|
486
486
|
var trigger = childrenArray.find(function (child) {
|
|
487
487
|
return typeof child === 'string' ||
|
|
@@ -502,8 +502,8 @@ var Accordion = function (_a) {
|
|
|
502
502
|
}
|
|
503
503
|
var _b = trigger.props, triggerClassName = _b.className, triggerProps = tslib.__rest(_b, ["className"]);
|
|
504
504
|
var elementId = nextId.useId();
|
|
505
|
-
return (React__default.createElement("div", { className: "Accordion" },
|
|
506
|
-
React__default.createElement(ExpandCollapsePanel, tslib.__assign({ id: panelElement.props.id || "".concat(elementId, "-panel") }, panelElement.props),
|
|
505
|
+
return (React__default.createElement("div", tslib.__assign({ className: "Accordion" }, props),
|
|
506
|
+
React__default.createElement(ExpandCollapsePanel, tslib.__assign({ id: panelElement.props.id || "".concat(elementId, "-panel"), open: open, onToggle: onToggle, animationTiming: animationTiming }, panelElement.props),
|
|
507
507
|
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),
|
|
508
508
|
panelElement)));
|
|
509
509
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deque/cauldron-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "Fully accessible react components library for Deque Cauldron",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -125,4 +125,4 @@
|
|
|
125
125
|
"\\.svg$": "<rootDir>/__tests__/svgMock.js"
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
}
|
|
128
|
+
}
|