@deque/cauldron-react 6.4.0 → 6.4.1-canary.d15db46f

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.
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { IconType } from '../Icon';
3
3
  import { TooltipProps } from '../Tooltip';
4
4
  import { PolymorphicProps, PolymorphicComponent } from '../../utils/polymorphicComponent';
5
- export interface IconButtonProps extends PolymorphicProps<React.HTMLAttributes<HTMLButtonElement | HTMLAnchorElement>, 'button' | 'a'> {
5
+ export interface IconButtonProps extends PolymorphicProps<React.HTMLAttributes<HTMLButtonElement | HTMLAnchorElement>> {
6
6
  icon: IconType;
7
7
  label: React.ReactNode;
8
8
  tooltipProps?: Omit<TooltipProps, 'children' | 'target'>;
@@ -22,5 +22,5 @@ export interface IconButtonProps extends PolymorphicProps<React.HTMLAttributes<H
22
22
  variant?: 'primary' | 'secondary' | 'error';
23
23
  large?: boolean;
24
24
  }
25
- declare const IconButton: PolymorphicComponent<IconButtonProps, "button" | "a">;
25
+ declare const IconButton: PolymorphicComponent<IconButtonProps>;
26
26
  export default IconButton;
package/lib/index.js CHANGED
@@ -1836,9 +1836,7 @@ var IconButton = React.forwardRef(function (_a, ref) {
1836
1836
  'IconButton--secondary': variant === 'secondary',
1837
1837
  'IconButton--error': variant === 'error',
1838
1838
  'IconButton--large': large
1839
- }),
1840
- // @ts-expect-error the concrete type is unknown, so HTMLElement is expected
1841
- ref: internalRef, disabled: disabled, tabIndex: disabled ? -1 : tabIndex }, accessibilityProps, other),
1839
+ }), ref: internalRef, disabled: disabled, tabIndex: disabled ? -1 : tabIndex }, accessibilityProps, other),
1842
1840
  React__default["default"].createElement(Icon, { type: icon }),
1843
1841
  disabled && React__default["default"].createElement(Offscreen, null, label)),
1844
1842
  !disabled && (React__default["default"].createElement(Tooltip, tslib.__assign({ target: internalRef }, tooltipProps), label))));
@@ -2558,13 +2556,9 @@ var LoaderOverlay = React.forwardRef(function (_a, ref) {
2558
2556
  }, [focusTrap, overlayRef.current]);
2559
2557
  React.useEffect(function () {
2560
2558
  if (!!focusOnInitialRender && overlayRef.current) {
2561
- setTimeout(function () {
2562
- var _a;
2563
- return (_a = overlayRef.current) === null || _a === void 0 ? void 0 : _a.focus();
2564
- });
2559
+ overlayRef.current.focus();
2565
2560
  }
2566
- return;
2567
- }, [overlayRef.current]);
2561
+ }, []);
2568
2562
  var Wrapper = focusTrap ? FocusTrap__default["default"] : React__default["default"].Fragment;
2569
2563
  var wrapperProps = focusTrap
2570
2564
  ? {
@@ -3608,7 +3602,7 @@ var Combobox = React.forwardRef(function (_a, ref) {
3608
3602
  var isAutoComplete = autocomplete !== 'none';
3609
3603
  var hasError = !!error;
3610
3604
  var comboboxOptions = children ||
3611
- options.map(function (option, index) { return (React__default["default"].createElement(ComboboxOption, { key: option.key || index, id: "".concat(id, "-option-").concat(index + 1), description: option.description }, option.label)); });
3605
+ options.map(function (option, index) { return (React__default["default"].createElement(ComboboxOption, { key: option.key || index, id: "".concat(id, "-option-").concat(index + 1), description: option.description, value: option.value }, option.label)); });
3612
3606
  var triggerListboxKeyDown = React__default["default"].useCallback(function (key) {
3613
3607
  var _a;
3614
3608
  (_a = listboxRef.current) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new KeyboardEvent('keydown', {
@@ -3690,6 +3684,11 @@ var Combobox = React.forwardRef(function (_a, ref) {
3690
3684
  /* istanbul ignore next: default value */ '';
3691
3685
  setValue(stringValue);
3692
3686
  setSelectedValue(stringValue);
3687
+ onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange({
3688
+ target: activeDescendant.element,
3689
+ value: stringValue,
3690
+ previousValue: value
3691
+ });
3693
3692
  }
3694
3693
  }, [autocomplete, activeDescendant, onBlur]);
3695
3694
  var handleKeyDown = React.useCallback(function (event) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "6.4.0",
3
+ "version": "6.4.1-canary.d15db46f",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Fully accessible react components library for Deque Cauldron",
6
6
  "homepage": "https://cauldron.dequelabs.com/",