@deque/cauldron-react 6.4.0-canary.fc280bd3 → 6.4.1-canary.2f7e190a
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/components/IconButton/index.d.ts +2 -2
- package/lib/index.js +7 -4
- package/lib/types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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))));
|
|
@@ -3604,7 +3602,7 @@ var Combobox = React.forwardRef(function (_a, ref) {
|
|
|
3604
3602
|
var isAutoComplete = autocomplete !== 'none';
|
|
3605
3603
|
var hasError = !!error;
|
|
3606
3604
|
var comboboxOptions = children ||
|
|
3607
|
-
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)); });
|
|
3608
3606
|
var triggerListboxKeyDown = React__default["default"].useCallback(function (key) {
|
|
3609
3607
|
var _a;
|
|
3610
3608
|
(_a = listboxRef.current) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new KeyboardEvent('keydown', {
|
|
@@ -3686,6 +3684,11 @@ var Combobox = React.forwardRef(function (_a, ref) {
|
|
|
3686
3684
|
/* istanbul ignore next: default value */ '';
|
|
3687
3685
|
setValue(stringValue);
|
|
3688
3686
|
setSelectedValue(stringValue);
|
|
3687
|
+
onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange({
|
|
3688
|
+
target: activeDescendant.element,
|
|
3689
|
+
value: stringValue,
|
|
3690
|
+
previousValue: value
|
|
3691
|
+
});
|
|
3689
3692
|
}
|
|
3690
3693
|
}, [autocomplete, activeDescendant, onBlur]);
|
|
3691
3694
|
var handleKeyDown = React.useCallback(function (event) {
|
package/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement,
|
|
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 |
|
|
13
|
+
export type ContentNode = string | number | ReactPortal | ReactElement;
|
package/package.json
CHANGED