@deque/cauldron-react 6.0.0 → 6.1.0-canary.e8a7f45e

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.
Files changed (126) hide show
  1. package/lib/__tests__/setupTests.d.ts +2 -0
  2. package/lib/index.js +20 -10
  3. package/lib/src/axe.d.ts +3 -0
  4. package/lib/src/components/Button/index.test.d.ts +1 -0
  5. package/lib/src/components/Combobox/Combobox.test.d.ts +1 -0
  6. package/lib/{components → src/components}/IconButton/index.d.ts +1 -0
  7. package/package.json +12 -5
  8. /package/lib/{components → src/components}/Accordion/Accordion.d.ts +0 -0
  9. /package/lib/{components → src/components}/Accordion/index.d.ts +0 -0
  10. /package/lib/{components → src/components}/Address/index.d.ts +0 -0
  11. /package/lib/{components → src/components}/Alert/index.d.ts +0 -0
  12. /package/lib/{components → src/components}/Breadcrumb/Breadcrumb.d.ts +0 -0
  13. /package/lib/{components → src/components}/Breadcrumb/BreadcrumbItem.d.ts +0 -0
  14. /package/lib/{components → src/components}/Breadcrumb/BreadcrumbLink.d.ts +0 -0
  15. /package/lib/{components → src/components}/Breadcrumb/index.d.ts +0 -0
  16. /package/lib/{components → src/components}/Button/index.d.ts +0 -0
  17. /package/lib/{components → src/components}/Checkbox/index.d.ts +0 -0
  18. /package/lib/{components → src/components}/ClickOutsideListener/index.d.ts +0 -0
  19. /package/lib/{components → src/components}/Code/index.d.ts +0 -0
  20. /package/lib/{components → src/components}/Combobox/Combobox.d.ts +0 -0
  21. /package/lib/{components → src/components}/Combobox/ComboboxContext.d.ts +0 -0
  22. /package/lib/{components → src/components}/Combobox/ComboboxGroup.d.ts +0 -0
  23. /package/lib/{components → src/components}/Combobox/ComboboxOption.d.ts +0 -0
  24. /package/lib/{components → src/components}/Combobox/index.d.ts +0 -0
  25. /package/lib/{components → src/components}/DescriptionList/index.d.ts +0 -0
  26. /package/lib/{components → src/components}/Dialog/index.d.ts +0 -0
  27. /package/lib/{components → src/components}/ExpandCollapsePanel/ExpandCollapsePanel.d.ts +0 -0
  28. /package/lib/{components → src/components}/ExpandCollapsePanel/PanelTrigger.d.ts +0 -0
  29. /package/lib/{components → src/components}/ExpandCollapsePanel/index.d.ts +0 -0
  30. /package/lib/{components → src/components}/FieldWrap/index.d.ts +0 -0
  31. /package/lib/{components → src/components}/Icon/index.d.ts +0 -0
  32. /package/lib/{components → src/components}/Icon/types.d.ts +0 -0
  33. /package/lib/{components → src/components}/Layout/index.d.ts +0 -0
  34. /package/lib/{components → src/components}/Line/index.d.ts +0 -0
  35. /package/lib/{components → src/components}/Link/index.d.ts +0 -0
  36. /package/lib/{components → src/components}/Listbox/Listbox.d.ts +0 -0
  37. /package/lib/{components → src/components}/Listbox/ListboxContext.d.ts +0 -0
  38. /package/lib/{components → src/components}/Listbox/ListboxGroup.d.ts +0 -0
  39. /package/lib/{components → src/components}/Listbox/ListboxOption.d.ts +0 -0
  40. /package/lib/{components → src/components}/Listbox/index.d.ts +0 -0
  41. /package/lib/{components → src/components}/Loader/index.d.ts +0 -0
  42. /package/lib/{components → src/components}/LoaderOverlay/axe-loader.d.ts +0 -0
  43. /package/lib/{components → src/components}/LoaderOverlay/index.d.ts +0 -0
  44. /package/lib/{components → src/components}/Main/index.d.ts +0 -0
  45. /package/lib/{components → src/components}/MenuBar/index.d.ts +0 -0
  46. /package/lib/{components → src/components}/MenuItem/click-link.d.ts +0 -0
  47. /package/lib/{components → src/components}/MenuItem/index.d.ts +0 -0
  48. /package/lib/{components → src/components}/Modal/index.d.ts +0 -0
  49. /package/lib/{components → src/components}/NavBar/NavBar.d.ts +0 -0
  50. /package/lib/{components → src/components}/NavBar/NavItem.d.ts +0 -0
  51. /package/lib/{components → src/components}/NavBar/index.d.ts +0 -0
  52. /package/lib/{components → src/components}/Notice/index.d.ts +0 -0
  53. /package/lib/{components → src/components}/Offscreen/index.d.ts +0 -0
  54. /package/lib/{components → src/components}/OptionsMenu/OptionsMenu.d.ts +0 -0
  55. /package/lib/{components → src/components}/OptionsMenu/OptionsMenuItem.d.ts +0 -0
  56. /package/lib/{components → src/components}/OptionsMenu/OptionsMenuList.d.ts +0 -0
  57. /package/lib/{components → src/components}/OptionsMenu/OptionsMenuTrigger.d.ts +0 -0
  58. /package/lib/{components → src/components}/OptionsMenu/OptionsMenuWrapper.d.ts +0 -0
  59. /package/lib/{components → src/components}/OptionsMenu/index.d.ts +0 -0
  60. /package/lib/{components → src/components}/Pagination/Pagination.d.ts +0 -0
  61. /package/lib/{components → src/components}/Pagination/index.d.ts +0 -0
  62. /package/lib/{components → src/components}/Pagination/usePagination.d.ts +0 -0
  63. /package/lib/{components → src/components}/Panel/Panel.d.ts +0 -0
  64. /package/lib/{components → src/components}/Panel/PanelContent.d.ts +0 -0
  65. /package/lib/{components → src/components}/Panel/PanelHeader.d.ts +0 -0
  66. /package/lib/{components → src/components}/Panel/index.d.ts +0 -0
  67. /package/lib/{components → src/components}/Popover/index.d.ts +0 -0
  68. /package/lib/{components → src/components}/ProgressBar/index.d.ts +0 -0
  69. /package/lib/{components → src/components}/RadioCardGroup/index.d.ts +0 -0
  70. /package/lib/{components → src/components}/RadioGroup/index.d.ts +0 -0
  71. /package/lib/{components → src/components}/Scrim/index.d.ts +0 -0
  72. /package/lib/{components → src/components}/Select/index.d.ts +0 -0
  73. /package/lib/{components → src/components}/SideBar/SideBar.d.ts +0 -0
  74. /package/lib/{components → src/components}/SideBar/SideBarItem.d.ts +0 -0
  75. /package/lib/{components → src/components}/SideBar/index.d.ts +0 -0
  76. /package/lib/{components → src/components}/SkipLink/index.d.ts +0 -0
  77. /package/lib/{components → src/components}/Stepper/index.d.ts +0 -0
  78. /package/lib/{components → src/components}/Table/Table.d.ts +0 -0
  79. /package/lib/{components → src/components}/Table/TableBody.d.ts +0 -0
  80. /package/lib/{components → src/components}/Table/TableCell.d.ts +0 -0
  81. /package/lib/{components → src/components}/Table/TableFooter.d.ts +0 -0
  82. /package/lib/{components → src/components}/Table/TableHead.d.ts +0 -0
  83. /package/lib/{components → src/components}/Table/TableHeader.d.ts +0 -0
  84. /package/lib/{components → src/components}/Table/TableRow.d.ts +0 -0
  85. /package/lib/{components → src/components}/Table/index.d.ts +0 -0
  86. /package/lib/{components → src/components}/Tabs/Tab.d.ts +0 -0
  87. /package/lib/{components → src/components}/Tabs/TabPanel.d.ts +0 -0
  88. /package/lib/{components → src/components}/Tabs/Tabs.d.ts +0 -0
  89. /package/lib/{components → src/components}/Tabs/index.d.ts +0 -0
  90. /package/lib/{components → src/components}/Tag/index.d.ts +0 -0
  91. /package/lib/{components → src/components}/TagButton/index.d.ts +0 -0
  92. /package/lib/{components → src/components}/TextField/index.d.ts +0 -0
  93. /package/lib/{components → src/components}/Toast/index.d.ts +0 -0
  94. /package/lib/{components → src/components}/Toast/utils.d.ts +0 -0
  95. /package/lib/{components → src/components}/Tooltip/index.d.ts +0 -0
  96. /package/lib/{components → src/components}/TooltipTabstop/index.d.ts +0 -0
  97. /package/lib/{components → src/components}/TopBar/TopBar.d.ts +0 -0
  98. /package/lib/{components → src/components}/TopBar/TopBarMenu.d.ts +0 -0
  99. /package/lib/{components → src/components}/TopBar/TopBarTrigger.d.ts +0 -0
  100. /package/lib/{components → src/components}/TopBar/index.d.ts +0 -0
  101. /package/lib/{components → src/components}/TwoColumnPanel/ColumnGroupHeader.d.ts +0 -0
  102. /package/lib/{components → src/components}/TwoColumnPanel/ColumnHeader.d.ts +0 -0
  103. /package/lib/{components → src/components}/TwoColumnPanel/ColumnLeft.d.ts +0 -0
  104. /package/lib/{components → src/components}/TwoColumnPanel/ColumnList.d.ts +0 -0
  105. /package/lib/{components → src/components}/TwoColumnPanel/ColumnRight.d.ts +0 -0
  106. /package/lib/{components → src/components}/TwoColumnPanel/TwoColumnPanel.d.ts +0 -0
  107. /package/lib/{components → src/components}/TwoColumnPanel/index.d.ts +0 -0
  108. /package/lib/{components → src/components}/Workspace/index.d.ts +0 -0
  109. /package/lib/{constants.d.ts → src/constants.d.ts} +0 -0
  110. /package/lib/{contexts → src/contexts}/theme.d.ts +0 -0
  111. /package/lib/{index.d.ts → src/index.d.ts} +0 -0
  112. /package/lib/{types.d.ts → src/types.d.ts} +0 -0
  113. /package/lib/{utils → src/utils}/aria-isolate/index.d.ts +0 -0
  114. /package/lib/{utils → src/utils}/focusable-selector/index.d.ts +0 -0
  115. /package/lib/{utils → src/utils}/is-browser/index.d.ts +0 -0
  116. /package/lib/{utils → src/utils}/polymorphic-type/index.d.ts +0 -0
  117. /package/lib/{utils → src/utils}/query-all/index.d.ts +0 -0
  118. /package/lib/{utils → src/utils}/remove-ids/index.d.ts +0 -0
  119. /package/lib/{utils → src/utils}/rndid/index.d.ts +0 -0
  120. /package/lib/{utils → src/utils}/setRef.d.ts +0 -0
  121. /package/lib/{utils → src/utils}/stylesheets/index.d.ts +0 -0
  122. /package/lib/{utils → src/utils}/token-list/index.d.ts +0 -0
  123. /package/lib/{utils → src/utils}/use-did-update/index.d.ts +0 -0
  124. /package/lib/{utils → src/utils}/useIntersectionRef.d.ts +0 -0
  125. /package/lib/{utils → src/utils}/useSharedRef.d.ts +0 -0
  126. /package/lib/{utils → src/utils}/viewport/index.d.ts +0 -0
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ import 'jest-axe/extend-expect';
package/lib/index.js CHANGED
@@ -1756,7 +1756,7 @@ var TooltipContent = function (_a) {
1756
1756
  */
1757
1757
  // eslint-disable-next-line react/display-name
1758
1758
  var IconButton = React.forwardRef(function (_a, ref) {
1759
- var _b = _a.as, Component = _b === void 0 ? 'button' : _b, icon = _a.icon, label = _a.label, _c = _a.tooltipPlacement, tooltipPlacement = _c === void 0 ? 'auto' : _c, tooltipVariant = _a.tooltipVariant, tooltipPortal = _a.tooltipPortal, className = _a.className, _d = _a.variant, variant = _d === void 0 ? 'secondary' : _d, disabled = _a.disabled, _e = _a.tabIndex, tabIndex = _e === void 0 ? 0 : _e, other = tslib.__rest(_a, ["as", "icon", "label", "tooltipPlacement", "tooltipVariant", "tooltipPortal", "className", "variant", "disabled", "tabIndex"]);
1759
+ var _b = _a.as, Component = _b === void 0 ? 'button' : _b, icon = _a.icon, label = _a.label, _c = _a.tooltipPlacement, tooltipPlacement = _c === void 0 ? 'auto' : _c, tooltipVariant = _a.tooltipVariant, tooltipPortal = _a.tooltipPortal, className = _a.className, _d = _a.variant, variant = _d === void 0 ? 'secondary' : _d, disabled = _a.disabled, _e = _a.tabIndex, tabIndex = _e === void 0 ? 0 : _e, large = _a.large, other = tslib.__rest(_a, ["as", "icon", "label", "tooltipPlacement", "tooltipVariant", "tooltipPortal", "className", "variant", "disabled", "tabIndex", "large"]);
1760
1760
  var internalRef = React.useRef();
1761
1761
  React.useImperativeHandle(ref, function () { return internalRef.current; });
1762
1762
  // Configure additional properties based on the type of the Component
@@ -1779,7 +1779,8 @@ var IconButton = React.forwardRef(function (_a, ref) {
1779
1779
  IconButton: true,
1780
1780
  'IconButton--primary': variant === 'primary',
1781
1781
  'IconButton--secondary': variant === 'secondary',
1782
- 'IconButton--error': variant === 'error'
1782
+ 'IconButton--error': variant === 'error',
1783
+ 'IconButton--large': large
1783
1784
  }), ref: internalRef, disabled: disabled, tabIndex: disabled ? -1 : tabIndex }, accessibilityProps, other),
1784
1785
  React__default["default"].createElement(Icon, { type: icon }),
1785
1786
  disabled && React__default["default"].createElement(Offscreen, null, label)),
@@ -2751,7 +2752,7 @@ var Step = function (props) {
2751
2752
  liProps = other;
2752
2753
  }
2753
2754
  return (React__default["default"].createElement("li", tslib.__assign({ className: classNames__default["default"]('Stepper__step', "Stepper__step--".concat(status), className), "aria-current": status === 'current' ? 'step' : 'false' }, liProps),
2754
- React__default["default"].createElement("div", { className: "Stepper__step-line" }),
2755
+ React__default["default"].createElement("div", { className: classNames__default["default"]('Stepper__step-line', "Stepper__step--".concat(status, "-line")) }),
2755
2756
  React__default["default"].createElement("div", { className: "Stepper__step-content" }, isTooltip ? (React__default["default"].createElement(TooltipTabstop, { placement: "bottom", tooltip: tooltip,
2756
2757
  // the pseudo content (ex: "1") is conveyed
2757
2758
  // by the list item's position in the set of
@@ -2759,9 +2760,9 @@ var Step = function (props) {
2759
2760
  // it with the contents of the tooltip in the
2760
2761
  // tab stop's accessible name.
2761
2762
  association: "aria-labelledby", "aria-label": tooltipText },
2762
- React__default["default"].createElement("div", { className: "Stepper__step-indicator" }))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
2763
- React__default["default"].createElement("div", { className: "Stepper__step-indicator" }),
2764
- children ? (React__default["default"].createElement("div", { className: "Stepper__step-label" }, children)) : null)))));
2763
+ React__default["default"].createElement("div", { className: classNames__default["default"]('Stepper__step-indicator', "Stepper__step--".concat(status, "-indicator")) }, status === 'complete' && React__default["default"].createElement(Icon, { type: 'check' })))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
2764
+ React__default["default"].createElement("div", { className: classNames__default["default"]('Stepper__step-indicator', "Stepper__step--".concat(status, "-indicator")) }, status === 'complete' && React__default["default"].createElement(Icon, { type: 'check' })),
2765
+ children ? (React__default["default"].createElement("div", { className: classNames__default["default"]('Stepper__step-label', "Stepper__step--".concat(status, "-label")) }, children)) : null)))));
2765
2766
  };
2766
2767
  Step.displayName = 'Step';
2767
2768
  var Stepper = function (_a) {
@@ -3548,8 +3549,12 @@ var Combobox = React.forwardRef(function (_a, ref) {
3548
3549
  }
3549
3550
  }, [open]);
3550
3551
  React.useEffect(function () {
3552
+ var _a = tslib.__read(Array.from(matchingOptions.entries()).find(function (_a) {
3553
+ var _b = tslib.__read(_a, 2), selected = _b[1].selected;
3554
+ return selected;
3555
+ }) || [], 2), element = _a[0], option = _a[1];
3551
3556
  if (autocomplete === 'manual') {
3552
- setActiveDescendant(null);
3557
+ setActiveDescendant(!element ? null : tslib.__assign({ element: element }, option));
3553
3558
  }
3554
3559
  else if (autocomplete === 'automatic' &&
3555
3560
  matchingOptions.size &&
@@ -3588,7 +3593,9 @@ var Combobox = React.forwardRef(function (_a, ref) {
3588
3593
  var handleComboboxOptionClick = React.useCallback(function () {
3589
3594
  var _a;
3590
3595
  // maintain focus on the input
3591
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
3596
+ if (inputRef.current !== document.activeElement) {
3597
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
3598
+ }
3592
3599
  }, []);
3593
3600
  var handleBlur = React.useCallback(function (event) {
3594
3601
  var _a;
@@ -3606,8 +3613,11 @@ var Combobox = React.forwardRef(function (_a, ref) {
3606
3613
  var enterKeypress = event.key === Enter;
3607
3614
  var escKeypress = event.key === Escape;
3608
3615
  var arrowKeypress = ['ArrowDown', 'ArrowUp'].includes(event.key);
3609
- if ([Home, End].includes(event.key)) {
3610
- // prevent the page from scrolling and allow start/end option activation
3616
+ if (
3617
+ // prevent the page from scrolling and allow start/end option activation
3618
+ [Home, End].includes(event.key) ||
3619
+ // prevent combobox from submitting any forms when the listbox is expanded
3620
+ (enterKeypress && open)) {
3611
3621
  event.preventDefault();
3612
3622
  }
3613
3623
  if (escKeypress) {
@@ -0,0 +1,3 @@
1
+ import { JestAxe } from 'jest-axe';
2
+ declare const axe: JestAxe;
3
+ export default axe;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -15,6 +15,7 @@ export interface IconButtonOwnProps {
15
15
  tooltipVariant?: TooltipProps['variant'];
16
16
  tooltipPortal?: TooltipProps['portal'];
17
17
  variant?: 'primary' | 'secondary' | 'error';
18
+ large?: boolean;
18
19
  }
19
20
  type PolymorphicIconButton = Polymorphic.ForwardRefComponent<'button', IconButtonOwnProps>;
20
21
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "6.0.0",
3
+ "version": "6.1.0-canary.e8a7f45e",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Fully accessible react components library for Deque Cauldron",
6
6
  "homepage": "https://cauldron.dequelabs.com/",
@@ -43,11 +43,17 @@
43
43
  "@rollup/plugin-dynamic-import-vars": "^1.4.2",
44
44
  "@rollup/plugin-typescript": "^11.1.2",
45
45
  "@svgr/rollup": "^6.1.2",
46
+ "@testing-library/jest-dom": "^6.1.3",
47
+ "@testing-library/react": "11.1.2",
46
48
  "@types/classnames": "^2.2.10",
49
+ "@types/enzyme-adapter-react-16": "^1.0.9",
50
+ "@types/jest": "^24.7.1",
51
+ "@types/jest-axe": "^3.5.4",
47
52
  "@types/node": "^17.0.42",
48
53
  "@types/react": "^18.0.12",
49
54
  "@types/react-dom": "^18.0.5",
50
55
  "@types/react-syntax-highlighter": "^15.5.2",
56
+ "@types/sinon": "^10",
51
57
  "autoprefixer": "^9.7.6",
52
58
  "babel-plugin-module-resolver": "^4.0.0",
53
59
  "babel-plugin-transform-export-extensions": "^6.22.0",
@@ -85,21 +91,22 @@
85
91
  "functions": 85,
86
92
  "lines": 85,
87
93
  "exclude": [
88
- "dist",
94
+ "lib",
89
95
  "coverage",
90
96
  "test/**/*.js"
91
97
  ]
92
98
  },
93
99
  "jest": {
94
100
  "setupFilesAfterEnv": [
95
- "<rootDir>__tests__/setupTests.js"
101
+ "<rootDir>__tests__/setupTests.ts"
96
102
  ],
97
103
  "testMatch": [
98
104
  "**/__tests__/src/**/*.js",
99
- "**/__tests__/demo/**/*.js"
105
+ "**/__tests__/demo/**/*.js",
106
+ "**/src/components/**/*.test.tsx"
100
107
  ],
101
108
  "collectCoverageFrom": [
102
- "**/src/**/*.{ts,tsx}"
109
+ "src/**/*.{ts,tsx}"
103
110
  ],
104
111
  "moduleNameMapper": {
105
112
  "\\.(css|less)$": "<rootDir>/__tests__/styleMock.js",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes