@deque/cauldron-react 6.4.1 → 6.4.2-canary.1fd11347

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.
package/lib/cauldron.css CHANGED
@@ -42,11 +42,10 @@
42
42
  a.Button--primary,
43
43
  a.Button--secondary {
44
44
  text-decoration: none;
45
- padding: 9px 18px;
46
45
  }
47
46
 
48
47
  a.Button--thin {
49
- padding: 0 16px;
48
+ padding: 0 var(--space-small);
50
49
  }
51
50
 
52
51
  .Icon {
@@ -1,7 +1,7 @@
1
1
  import React, { ButtonHTMLAttributes, Ref } from 'react';
2
2
  export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
3
  buttonRef?: Ref<HTMLButtonElement>;
4
- variant?: 'primary' | 'secondary' | 'error' | 'link' | 'tag';
4
+ variant?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'link' | 'tag';
5
5
  thin?: boolean;
6
6
  }
7
7
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -7,8 +7,8 @@ export interface DialogProps extends React.HTMLAttributes<HTMLDivElement> {
7
7
  dialogRef?: React.Ref<HTMLDivElement>;
8
8
  onClose?: () => void;
9
9
  forceAction?: boolean;
10
- heading: React.ReactElement<any> | {
11
- text: React.ReactElement<any>;
10
+ heading: string | React.ReactElement<any> | {
11
+ text: React.ReactElement<any> | string;
12
12
  level: number | undefined;
13
13
  };
14
14
  closeButtonText?: string;
@@ -19,7 +19,7 @@ export interface IconButtonProps extends PolymorphicProps<React.HTMLAttributes<H
19
19
  * @deprecated use `tooltipProps.portal` instead
20
20
  */
21
21
  tooltipPortal?: TooltipProps['portal'];
22
- variant?: 'primary' | 'secondary' | 'error';
22
+ variant?: 'primary' | 'secondary' | 'tertiary' | 'error';
23
23
  large?: boolean;
24
24
  }
25
25
  declare const IconButton: PolymorphicComponent<IconButtonProps>;
package/lib/index.js CHANGED
@@ -1437,6 +1437,7 @@ var Dialog = /** @class */ (function (_super) {
1437
1437
  ? heading.level
1438
1438
  : 2);
1439
1439
  var Dialog = (React__default["default"].createElement(FocusTrap__default["default"], { focusTrapOptions: {
1440
+ allowOutsideClick: true,
1440
1441
  onDeactivate: this.close,
1441
1442
  escapeDeactivates: !forceAction,
1442
1443
  fallbackFocus: '.Dialog__heading'
@@ -1593,6 +1594,7 @@ var Button = React.forwardRef(function (_a, ref) {
1593
1594
  'Button--primary': variant === 'primary',
1594
1595
  'Button--secondary': variant === 'secondary',
1595
1596
  'Button--error': variant === 'error',
1597
+ 'Button--tertiary': variant === 'tertiary',
1596
1598
  Link: variant === 'link',
1597
1599
  Tag: variant === 'tag',
1598
1600
  'Button--tag': variant === 'tag',
@@ -1728,13 +1730,17 @@ function Tooltip(_a) {
1728
1730
  };
1729
1731
  var targetElement = document.body;
1730
1732
  if (showTooltip) {
1731
- targetElement.addEventListener('keyup', handleEscape);
1733
+ targetElement.addEventListener('keyup', handleEscape, { capture: true });
1732
1734
  }
1733
1735
  else {
1734
- targetElement.removeEventListener('keyup', handleEscape);
1736
+ targetElement.removeEventListener('keyup', handleEscape, {
1737
+ capture: true
1738
+ });
1735
1739
  }
1736
1740
  return function () {
1737
- targetElement.removeEventListener('keyup', handleEscape);
1741
+ targetElement.removeEventListener('keyup', handleEscape, {
1742
+ capture: true
1743
+ });
1738
1744
  };
1739
1745
  }, [showTooltip]);
1740
1746
  // Handle hover and focus events for the targetElement
@@ -1834,6 +1840,7 @@ var IconButton = React.forwardRef(function (_a, ref) {
1834
1840
  IconButton: true,
1835
1841
  'IconButton--primary': variant === 'primary',
1836
1842
  'IconButton--secondary': variant === 'secondary',
1843
+ 'IconButton--tertiary': variant === 'tertiary',
1837
1844
  'IconButton--error': variant === 'error',
1838
1845
  'IconButton--large': large
1839
1846
  }), ref: internalRef, disabled: disabled, tabIndex: disabled ? -1 : tabIndex }, accessibilityProps, other),
package/lib/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReactElement, ReactFragment, ReactPortal } from 'react';
1
+ import type { ReactElement, ReactPortal } from 'react';
2
2
  export declare namespace Cauldron {
3
3
  type LabelProps = {
4
4
  'aria-label': string;
@@ -10,4 +10,4 @@ export declare namespace Cauldron {
10
10
  * This type is meant to ensure that a prop can actually be rendered as content.
11
11
  * Explicit equivalent of Exclude<ReactNode, boolean | null | undefined>
12
12
  */
13
- export type ContentNode = string | number | ReactFragment | ReactPortal | ReactElement;
13
+ export type ContentNode = string | number | ReactPortal | ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "6.4.1",
3
+ "version": "6.4.2-canary.1fd11347",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Fully accessible react components library for Deque Cauldron",
6
6
  "homepage": "https://cauldron.dequelabs.com/",
@@ -47,7 +47,6 @@
47
47
  "@testing-library/react": "^12",
48
48
  "@testing-library/user-event": "^14.5.2",
49
49
  "@types/classnames": "^2.2.10",
50
- "@types/enzyme-adapter-react-16": "^1.0.9",
51
50
  "@types/jest": "^29.5.11",
52
51
  "@types/jest-axe": "^3.5.4",
53
52
  "@types/node": "^17.0.42",
@@ -59,8 +58,6 @@
59
58
  "babel-plugin-module-resolver": "^4.0.0",
60
59
  "babel-plugin-transform-export-extensions": "^6.22.0",
61
60
  "concurrently": "^5.3.0",
62
- "enzyme": "^3.11.0",
63
- "enzyme-adapter-react-16": "^1.15.2",
64
61
  "jest": "^29.7.0",
65
62
  "jest-axe": "^8.0.0",
66
63
  "jest-environment-jsdom": "^29.7.0",