@deque/cauldron-react 5.11.0-canary.06dfa4e8 → 5.11.0-canary.e08b5178

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.
@@ -38,6 +38,7 @@ export default class Dialog extends React.Component<DialogProps, DialogState> {
38
38
  };
39
39
  private element;
40
40
  private heading;
41
+ private headingId;
41
42
  constructor(props: DialogProps);
42
43
  componentDidMount(): void;
43
44
  componentWillUnmount(): void;
package/lib/index.js CHANGED
@@ -1561,6 +1561,7 @@ var Dialog = /** @class */ (function (_super) {
1561
1561
  tslib.__extends(Dialog, _super);
1562
1562
  function Dialog(props) {
1563
1563
  var _this = _super.call(this, props) || this;
1564
+ _this.headingId = nextId__default["default"]('dialog-title-');
1564
1565
  _this.close = _this.close.bind(_this);
1565
1566
  _this.focusHeading = _this.focusHeading.bind(_this);
1566
1567
  _this.handleClickOutside = _this.handleClickOutside.bind(_this);
@@ -1617,10 +1618,10 @@ var Dialog = /** @class */ (function (_super) {
1617
1618
  return;
1618
1619
  }
1619
1620
  setRef(dialogRef, el);
1620
- } }, other),
1621
+ }, "aria-labelledby": this.headingId }, other),
1621
1622
  React__default["default"].createElement("div", { className: "Dialog__inner" },
1622
1623
  React__default["default"].createElement("div", { className: "Dialog__header" },
1623
- React__default["default"].createElement(Heading, { className: "Dialog__heading", ref: function (el) { return (_this.heading = el); }, tabIndex: -1 }, typeof heading === 'object' && 'text' in heading
1624
+ React__default["default"].createElement(Heading, { className: "Dialog__heading", ref: function (el) { return (_this.heading = el); }, tabIndex: -1, id: this.headingId }, typeof heading === 'object' && 'text' in heading
1624
1625
  ? heading.text
1625
1626
  : heading),
1626
1627
  close),
@@ -4632,7 +4633,9 @@ var Popover = React.forwardRef(function (_a, ref) {
4632
4633
  var placement = (attributes.popper &&
4633
4634
  attributes.popper['data-popper-placement']) ||
4634
4635
  initialPlacement;
4635
- var additionalProps = variant === 'prompt' ? { 'aria-labelledby': "".concat(id, "-label") } : {};
4636
+ var additionalProps = variant === 'prompt' && !props['aria-label']
4637
+ ? { 'aria-labelledby': "".concat(id, "-label") }
4638
+ : {};
4636
4639
  // Keep targetElement in sync with target prop
4637
4640
  React.useEffect(function () {
4638
4641
  var targetElement = target && 'current' in target ? target.current : target;
@@ -4724,7 +4727,7 @@ var Popover = React.forwardRef(function (_a, ref) {
4724
4727
  React__default["default"].createElement("div", tslib.__assign({ id: id, className: classNames__default["default"]('Popover', "Popover--".concat(placement), className, {
4725
4728
  'Popover--hidden': !show,
4726
4729
  'Popover--prompt': variant === 'prompt'
4727
- }), ref: popoverRef, role: "dialog", style: styles.popper }, attributes.popper, props, additionalProps),
4730
+ }), ref: popoverRef, role: "dialog", style: styles.popper }, attributes.popper, additionalProps, props),
4728
4731
  React__default["default"].createElement("div", { className: "Popover__popoverArrow", ref: setArrowElement, style: styles.arrow }),
4729
4732
  React__default["default"].createElement("div", { className: "Popover__borderLeft" }),
4730
4733
  variant === 'prompt' ? (React__default["default"].createElement(PromptPopoverContent, { applyButtonText: applyButtonText, onApply: onApply, closeButtonText: closeButtonText, infoText: infoText || '', onClose: handleClosePopover, infoTextId: "".concat(id, "-label") })) : (children)))), (portal && 'current' in portal ? portal.current : portal) || document.body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "5.11.0-canary.06dfa4e8",
3
+ "version": "5.11.0-canary.e08b5178",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Fully accessible react components library for Deque Cauldron",
6
6
  "homepage": "https://cauldron.dequelabs.com/",
@@ -57,7 +57,7 @@
57
57
  "enzyme": "^3.11.0",
58
58
  "enzyme-adapter-react-16": "^1.15.2",
59
59
  "jest": "^24.7.1",
60
- "jest-axe": "^3.4.0",
60
+ "jest-axe": "^8.0.0",
61
61
  "nyc": "^15.0.1",
62
62
  "postcss-cli": "^7.1.1",
63
63
  "postcss-import": "^12.0.1",