@deque/cauldron-react 4.6.0-canary.8df85c5f → 4.7.0-canary.1a47074d

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;
@@ -16,6 +16,7 @@ interface PageStatus {
16
16
  currentPage: number;
17
17
  pageStart: number;
18
18
  pageEnd: number;
19
+ setCurrentPage: (page: number) => void;
19
20
  }
20
21
  export declare const usePagination: ({ totalItems, initialPageSize, initialPage }: Options) => {
21
22
  pagination: PaginationResults;
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
  };
@@ -8717,7 +8717,8 @@ var usePagination = function (_a) {
8717
8717
  var pageStatus = {
8718
8718
  currentPage: currentPage,
8719
8719
  pageStart: pageStart,
8720
- pageEnd: pageEnd
8720
+ pageEnd: pageEnd,
8721
+ setCurrentPage: setCurrentPage
8721
8722
  };
8722
8723
  return { pagination: pagination, pageStatus: pageStatus };
8723
8724
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "4.6.0-canary.8df85c5f",
3
+ "version": "4.7.0-canary.1a47074d",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -80,7 +80,7 @@
80
80
  "react-router-dom": "^5.1.2",
81
81
  "rollup": "^2.23.0",
82
82
  "sinon": "^10.0.0",
83
- "ts-node": "^10.8.1",
83
+ "ts-node": "^10.9.1",
84
84
  "typescript": "^4.7.3"
85
85
  },
86
86
  "repository": {