@deque/cauldron-react 5.4.1 → 5.5.0-canary.720bc9bd

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.
@@ -7,10 +7,18 @@ declare const Alert: ({ children, className, variant, heading, ...other }: Alert
7
7
  declare const AlertContent: {
8
8
  ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
9
9
  displayName: string;
10
+ propTypes: {
11
+ className: import("prop-types").Requireable<string>;
12
+ children: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
13
+ };
10
14
  };
11
15
  declare const AlertActions: {
12
16
  ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
13
17
  displayName: string;
18
+ propTypes: {
19
+ className: import("prop-types").Requireable<string>;
20
+ children: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
21
+ };
14
22
  };
15
23
  export default Alert;
16
24
  export { Alert, AlertContent, AlertActions };
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- interface BreadcrumbItemProps extends React.HTMLAttributes<HTMLSpanElement> {
3
- }
2
+ declare type BreadcrumbItemProps = React.HTMLAttributes<HTMLSpanElement>;
4
3
  declare const BreadcrumbItem: React.ForwardRefExoticComponent<BreadcrumbItemProps & React.RefAttributes<HTMLElement>>;
5
4
  export default BreadcrumbItem;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- export interface CardContentProps extends React.HTMLAttributes<HTMLDivElement> {
4
- }
3
+ export declare type CardContentProps = React.HTMLAttributes<HTMLDivElement>;
5
4
  declare const CardContent: {
6
5
  ({ className, ...other }: CardContentProps): JSX.Element;
7
6
  displayName: string;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- export interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement> {
4
- }
3
+ export declare type CardFooterProps = React.HTMLAttributes<HTMLDivElement>;
5
4
  declare const CardFooter: {
6
5
  ({ className, ...other }: CardFooterProps): JSX.Element;
7
6
  displayName: string;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- export interface CardHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
4
- }
3
+ export declare type CardHeaderProps = React.HTMLAttributes<HTMLDivElement>;
5
4
  declare const CardHeader: {
6
5
  ({ className, ...other }: CardHeaderProps): JSX.Element;
7
6
  displayName: string;
@@ -51,9 +51,17 @@ export default class Dialog extends React.Component<DialogProps, DialogState> {
51
51
  declare const DialogContent: {
52
52
  ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
53
53
  displayName: string;
54
+ propTypes: {
55
+ className: PropTypes.Requireable<string>;
56
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
57
+ };
54
58
  };
55
59
  declare const DialogFooter: {
56
60
  ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
57
61
  displayName: string;
62
+ propTypes: {
63
+ className: PropTypes.Requireable<string>;
64
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
65
+ };
58
66
  };
59
67
  export { Dialog, DialogContent, DialogFooter };
@@ -7,10 +7,18 @@ declare const Modal: ({ children, className, variant, ...other }: ModalProps) =>
7
7
  declare const ModalContent: {
8
8
  ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
9
9
  displayName: string;
10
+ propTypes: {
11
+ className: import("prop-types").Requireable<string>;
12
+ children: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
13
+ };
10
14
  };
11
15
  declare const ModalFooter: {
12
16
  ({ children, className, ...other }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
13
17
  displayName: string;
18
+ propTypes: {
19
+ className: import("prop-types").Requireable<string>;
20
+ children: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
21
+ };
14
22
  };
15
23
  export default Modal;
16
24
  export { Modal, ModalContent, ModalFooter };
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- export interface OffscreenProps extends React.HTMLAttributes<HTMLSpanElement> {
3
- }
2
+ export declare type OffscreenProps = React.HTMLAttributes<HTMLSpanElement>;
4
3
  declare const Offscreen: (props: OffscreenProps) => JSX.Element;
5
4
  export default Offscreen;
@@ -25,5 +25,15 @@ declare namespace Tooltip {
25
25
  };
26
26
  }
27
27
  export default Tooltip;
28
- export declare const TooltipHead: ({ className, ...other }: React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
29
- export declare const TooltipContent: ({ className, ...other }: React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
28
+ export declare const TooltipHead: {
29
+ ({ className, ...other }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
30
+ propTypes: {
31
+ className: PropTypes.Requireable<string>;
32
+ };
33
+ };
34
+ export declare const TooltipContent: {
35
+ ({ className, ...other }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
36
+ propTypes: {
37
+ className: PropTypes.Requireable<string>;
38
+ };
39
+ };
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- interface ColumnGroupHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
3
- }
2
+ declare type ColumnGroupHeaderProps = React.HTMLAttributes<HTMLDivElement>;
4
3
  declare const ColumnGroupHeader: React.ForwardRefExoticComponent<ColumnGroupHeaderProps & React.RefAttributes<HTMLDivElement>>;
5
4
  export default ColumnGroupHeader;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- interface ColumnHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
3
- }
2
+ declare type ColumnHeaderProps = React.HTMLAttributes<HTMLDivElement>;
4
3
  declare const ColumnHeader: React.ForwardRefExoticComponent<ColumnHeaderProps & React.RefAttributes<HTMLDivElement>>;
5
4
  export default ColumnHeader;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- interface ColumnListProps extends React.HTMLAttributes<HTMLDivElement> {
3
- }
2
+ declare type ColumnListProps = React.HTMLAttributes<HTMLDivElement>;
4
3
  declare const ColumnList: React.ForwardRefExoticComponent<ColumnListProps & React.RefAttributes<HTMLDivElement>>;
5
4
  export default ColumnList;
package/lib/index.js CHANGED
@@ -28,6 +28,7 @@ var Main = /** @class */ (function (_super) {
28
28
  return (React__default.createElement("main", tslib.__assign({ className: "Main", ref: mainRef }, other), children));
29
29
  };
30
30
  Main.defaultProps = {
31
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
31
32
  mainRef: function () { }
32
33
  };
33
34
  Main.propTypes = {
@@ -50,6 +51,7 @@ var Layout = /** @class */ (function (_super) {
50
51
  return (React__default.createElement("div", tslib.__assign({ className: "Layout", ref: layoutRef }, other), children));
51
52
  };
52
53
  Layout.defaultProps = {
54
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
53
55
  layoutRef: function () { }
54
56
  };
55
57
  Layout.propTypes = {
@@ -88,7 +90,9 @@ var Workspace = /** @class */ (function (_super) {
88
90
  React__default.createElement(Main, tslib.__assign({ mainRef: workspaceRef }, other), children)));
89
91
  };
90
92
  Workspace.defaultProps = {
93
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
91
94
  workspaceRef: function () { },
95
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
92
96
  layoutRef: function () { },
93
97
  noSideBar: false
94
98
  };
@@ -384,6 +388,7 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
384
388
  };
385
389
  _this.panel = React__default.createRef();
386
390
  _this.handleToggle = function (e) {
391
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
387
392
  var _a = _this.props.onToggle, onToggle = _a === void 0 ? function () { } : _a;
388
393
  var _b = _this.state, isOpen = _b.isOpen, controlled = _b.controlled;
389
394
  onToggle(e);
@@ -394,7 +399,9 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
394
399
  _this.animateOpen = function () {
395
400
  var panel = _this.panel.current;
396
401
  var animationTiming = _this.props.animationTiming;
397
- if (!animationTiming) {
402
+ var prefersReducedMotion = matchMedia('(prefers-reduced-motion: reduce)')
403
+ .matches;
404
+ if (!animationTiming || prefersReducedMotion) {
398
405
  _this.setState({ isAnimating: false });
399
406
  return;
400
407
  }
@@ -416,7 +423,9 @@ var ExpandCollapsePanel = /** @class */ (function (_super) {
416
423
  _this.animateClose = function () {
417
424
  var panel = _this.panel.current;
418
425
  var animationTiming = _this.props.animationTiming;
419
- if (!animationTiming) {
426
+ var prefersReducedMotion = matchMedia('(prefers-reduced-motion: reduce)')
427
+ .matches;
428
+ if (!animationTiming || prefersReducedMotion) {
420
429
  _this.setState({ isAnimating: false });
421
430
  return;
422
431
  }
@@ -668,8 +677,11 @@ var MenuItem = /** @class */ (function (_super) {
668
677
  }, onClick: this.onClick, onKeyDown: this.onKeyDown }), children));
669
678
  };
670
679
  MenuItem.defaultProps = {
680
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
671
681
  menuItemRef: function () { },
682
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
672
683
  onClick: function () { },
684
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
673
685
  onKeyDown: function () { },
674
686
  autoClickLink: true
675
687
  };
@@ -1035,6 +1047,7 @@ var OptionsMenuList = /** @class */ (function (_super) {
1035
1047
  var clickOutsideEventActive = !show ? false : undefined;
1036
1048
  // Key event is being handled in componentDidMount
1037
1049
  /* eslint-disable jsx-a11y/click-events-have-key-events */
1050
+ /* eslint-disable jsx-a11y/role-supports-aria-props */
1038
1051
  return (React__default.createElement(ClickOutsideListener, { onClickOutside: this.handleClickOutside, mouseEvent: clickOutsideEventActive, touchEvent: clickOutsideEventActive },
1039
1052
  React__default.createElement("ul", tslib.__assign({}, other, { className: classNames('OptionsMenu__list', className), "aria-expanded": show, role: "menu", onClick: handleClick, ref: function (el) {
1040
1053
  _this.menuRef = el;
@@ -1046,7 +1059,9 @@ var OptionsMenuList = /** @class */ (function (_super) {
1046
1059
  };
1047
1060
  OptionsMenuList.defaultProps = {
1048
1061
  closeOnSelect: true,
1062
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1049
1063
  onSelect: function () { },
1064
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1050
1065
  onClose: function () { }
1051
1066
  };
1052
1067
  OptionsMenuList.propTypes = {
@@ -1114,7 +1129,9 @@ var OptionsMenu = /** @class */ (function (_super) {
1114
1129
  }, onClose: this.handleClose }, other), children)));
1115
1130
  };
1116
1131
  OptionsMenu.defaultProps = {
1132
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1117
1133
  onClose: function () { },
1134
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1118
1135
  onSelect: function () { },
1119
1136
  align: 'right'
1120
1137
  };
@@ -1155,6 +1172,7 @@ var OptionsMenuItemComponent = /** @class */ (function (_super) {
1155
1172
  React__default.createElement("li", tslib.__assign({ role: "menuitem", ref: menuItemRef, "aria-disabled": disabled, onClick: handleClick }, other)));
1156
1173
  };
1157
1174
  OptionsMenuItemComponent.defaultProps = {
1175
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1158
1176
  onSelect: function () { }
1159
1177
  };
1160
1178
  OptionsMenuItemComponent.propTypes = {
@@ -1251,7 +1269,9 @@ var TopBarMenu = /** @class */ (function (_super) {
1251
1269
  })));
1252
1270
  };
1253
1271
  TopBarMenu.defaultProps = {
1272
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1254
1273
  onKeyDown: function () { },
1274
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1255
1275
  menuItemRef: function () { }
1256
1276
  };
1257
1277
  TopBarMenu.propTypes = {
@@ -1514,7 +1534,9 @@ var AriaIsolate = /** @class */ (function () {
1514
1534
  return AriaIsolate;
1515
1535
  }());
1516
1536
 
1517
- var noop = function () { };
1537
+ var noop = function () {
1538
+ //not empty
1539
+ };
1518
1540
  var Dialog = /** @class */ (function (_super) {
1519
1541
  tslib.__extends(Dialog, _super);
1520
1542
  function Dialog(props) {
@@ -1630,11 +1652,19 @@ var DialogContent = function (_a) {
1630
1652
  return (React__default.createElement("div", tslib.__assign({ className: classNames('Dialog__content', className) }, other), children));
1631
1653
  };
1632
1654
  DialogContent.displayName = 'DialogContent';
1655
+ DialogContent.propTypes = {
1656
+ className: PropTypes.string,
1657
+ children: PropTypes.node
1658
+ };
1633
1659
  var DialogFooter = function (_a) {
1634
1660
  var children = _a.children, className = _a.className, other = tslib.__rest(_a, ["children", "className"]);
1635
1661
  return (React__default.createElement("div", tslib.__assign({ className: classNames('Dialog__footer', className) }, other), children));
1636
1662
  };
1637
1663
  DialogFooter.displayName = 'DialogFooter';
1664
+ DialogFooter.propTypes = {
1665
+ className: PropTypes.string,
1666
+ children: PropTypes.node
1667
+ };
1638
1668
 
1639
1669
  var Alert = function (_a) {
1640
1670
  var children = _a.children, className = _a.className, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, heading = _a.heading, other = tslib.__rest(_a, ["children", "className", "variant", "heading"]);
@@ -1891,10 +1921,16 @@ var TooltipHead = function (_a) {
1891
1921
  var className = _a.className, other = tslib.__rest(_a, ["className"]);
1892
1922
  return (React__default.createElement("div", tslib.__assign({ className: classNames('TooltipHead', className) }, other)));
1893
1923
  };
1924
+ TooltipHead.propTypes = {
1925
+ className: PropTypes.string
1926
+ };
1894
1927
  var TooltipContent = function (_a) {
1895
1928
  var className = _a.className, other = tslib.__rest(_a, ["className"]);
1896
1929
  return (React__default.createElement("div", tslib.__assign({ className: classNames('TooltipContent', className) }, other)));
1897
1930
  };
1931
+ TooltipContent.propTypes = {
1932
+ className: PropTypes.string
1933
+ };
1898
1934
 
1899
1935
  /**
1900
1936
  * Unfortunately, eslint does not recognize that this Polymorphic component has a displayName set
@@ -2056,6 +2092,7 @@ var Pointout = /** @class */ (function (_super) {
2056
2092
  target;
2057
2093
  var portalNode = (portal === null || portal === void 0 ? void 0 : portal.current) ||
2058
2094
  portal;
2095
+ // eslint-disable-next-line prefer-const
2059
2096
  var _b = targetNode.getBoundingClientRect(), top = _b.top, left = _b.left, width = _b.width, height = _b.height;
2060
2097
  if (portalNode && portalNode !== document.body) {
2061
2098
  // If the portal is not placed on document.body
@@ -2232,8 +2269,10 @@ var Pointout = /** @class */ (function (_super) {
2232
2269
  (_a = this.props) === null || _a === void 0 ? void 0 : _a.onClose();
2233
2270
  };
2234
2271
  Pointout.defaultProps = {
2272
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2235
2273
  ftpoRef: function () { },
2236
2274
  noArrow: false,
2275
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2237
2276
  onClose: function () { },
2238
2277
  dismissText: 'dismiss',
2239
2278
  previousText: 'previous',
@@ -8213,7 +8252,8 @@ Code.propTypes = {
8213
8252
  children: PropTypes.string.isRequired,
8214
8253
  language: PropTypes.oneOf(['javascript', 'css', 'html', 'yaml']),
8215
8254
  className: PropTypes.string,
8216
- tabIndex: PropTypes.number
8255
+ tabIndex: PropTypes.number,
8256
+ scrollable: PropTypes.bool
8217
8257
  };
8218
8258
 
8219
8259
  function AxeLoader() {
@@ -8879,10 +8919,14 @@ var Breadcrumb = React.forwardRef(function (_a, ref) {
8879
8919
  });
8880
8920
  Breadcrumb.displayName = 'Breadcrumb';
8881
8921
 
8882
- var BreadcrumbItem = React.forwardRef(function (_a, ref) {
8922
+ var BreadcrumbItem = React.forwardRef(// eslint-disable-line react/display-name
8923
+ function (_a, ref) {
8883
8924
  var className = _a.className, children = _a.children, props = tslib.__rest(_a, ["className", "children"]);
8884
8925
  return (React__default.createElement("span", tslib.__assign({ className: classNames('Breadcrumb__Item', className), ref: ref, "aria-current": "location" }, props), children));
8885
8926
  });
8927
+ BreadcrumbItem.propTypes = {
8928
+ className: PropTypes.string
8929
+ };
8886
8930
 
8887
8931
  var BreadcrumbLink = React.forwardRef(function (_a, ref) {
8888
8932
  var className = _a.className, _b = _a.as, ElementType = _b === void 0 ? 'a' : _b, children = _a.children, props = tslib.__rest(_a, ["className", "as", "children"]);
@@ -8947,7 +8991,11 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8947
8991
  CloseButton
8948
8992
  ], tslib.__read(React__default.Children.toArray(columnLeft.props.children)), false);
8949
8993
  ColumnLeftComponent = React.cloneElement(columnLeft, { id: id, ref: ref_1, tabIndex: -1 }, children_1.map(function (child, index) {
8950
- return React.cloneElement(child, { key: "left-".concat(index) });
8994
+ return React.cloneElement(child, {
8995
+ key: child.key
8996
+ ? child.key
8997
+ : "left-".concat(index)
8998
+ });
8951
8999
  }));
8952
9000
  }
8953
9001
  var columnRight = React__default.Children.toArray(children).find(function (child) { return child.type === ColumnRight; });
@@ -8962,7 +9010,11 @@ var TwoColumnPanel = React.forwardRef(function (_a, ref) {
8962
9010
  ToggleButton
8963
9011
  ], tslib.__read(React__default.Children.toArray(columnRight.props.children)), false);
8964
9012
  ColumnRightComponent = React.cloneElement(columnRight, { ref: ref_2, tabIndex: -1 }, children_2.map(function (child, index) {
8965
- return React.cloneElement(child, { key: "right-".concat(index) });
9013
+ return React.cloneElement(child, {
9014
+ key: child.key
9015
+ ? child.key
9016
+ : "right-".concat(index)
9017
+ });
8966
9018
  }));
8967
9019
  }
8968
9020
  React.useLayoutEffect(function () {
@@ -9045,18 +9097,27 @@ var ColumnHeader = React.forwardRef(function (_a, ref) {
9045
9097
  return (React__default.createElement("div", tslib.__assign({ className: classNames('TwoColumnPanel__Header', className) }, props, { ref: ref }), children));
9046
9098
  });
9047
9099
  ColumnHeader.displayName = 'ColumnHeader';
9100
+ ColumnHeader.propTypes = {
9101
+ className: PropTypes.string
9102
+ };
9048
9103
 
9049
9104
  var ColumnGroupHeader = React.forwardRef(function (_a, ref) {
9050
9105
  var className = _a.className, children = _a.children, props = tslib.__rest(_a, ["className", "children"]);
9051
9106
  return (React__default.createElement("div", tslib.__assign({ className: classNames('TwoColumnPanel__GroupHeader', className) }, props, { ref: ref }), children));
9052
9107
  });
9053
9108
  ColumnGroupHeader.displayName = 'ColumnGroupHeader';
9109
+ ColumnGroupHeader.propTypes = {
9110
+ className: PropTypes.string
9111
+ };
9054
9112
 
9055
9113
  var ColumnList = React.forwardRef(function (_a, ref) {
9056
9114
  var className = _a.className, children = _a.children, props = tslib.__rest(_a, ["className", "children"]);
9057
9115
  return (React__default.createElement("div", tslib.__assign({ className: classNames('TwoColumnPanel__List', className) }, props, { ref: ref }), children));
9058
9116
  });
9059
9117
  ColumnList.displayName = 'ColumnList';
9118
+ ColumnList.propTypes = {
9119
+ className: PropTypes.string
9120
+ };
9060
9121
 
9061
9122
  var LIGHT_THEME_CLASS = 'cauldron--theme-light';
9062
9123
  var DARK_THEME_CLASS = 'cauldron--theme-dark';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "5.4.1",
3
+ "version": "5.5.0-canary.720bc9bd",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "homepage": "https://cauldron.dequelabs.com/",
6
6
  "publishConfig": {
@@ -60,10 +60,6 @@
60
60
  "concurrently": "^5.3.0",
61
61
  "enzyme": "^3.11.0",
62
62
  "enzyme-adapter-react-16": "^1.15.2",
63
- "eslint": "^6.8.0",
64
- "eslint-config-prettier": "^6.11.0",
65
- "eslint-plugin-jsx-a11y": "^6.2.3",
66
- "eslint-plugin-react": "^7.19.0",
67
63
  "jest": "^24.7.1",
68
64
  "jest-axe": "^3.4.0",
69
65
  "jsdom": "^16.2.2",
@@ -126,4 +122,4 @@
126
122
  "\\.svg$": "<rootDir>/__tests__/svgMock.js"
127
123
  }
128
124
  }
129
- }
125
+ }