@deque/cauldron-react 6.4.0-canary.fc280bd3 → 6.4.1-canary.0418308f
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.
|
@@ -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;
|
|
@@ -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
|
@@ -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'
|
|
@@ -1836,9 +1837,7 @@ var IconButton = React.forwardRef(function (_a, ref) {
|
|
|
1836
1837
|
'IconButton--secondary': variant === 'secondary',
|
|
1837
1838
|
'IconButton--error': variant === 'error',
|
|
1838
1839
|
'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),
|
|
1840
|
+
}), ref: internalRef, disabled: disabled, tabIndex: disabled ? -1 : tabIndex }, accessibilityProps, other),
|
|
1842
1841
|
React__default["default"].createElement(Icon, { type: icon }),
|
|
1843
1842
|
disabled && React__default["default"].createElement(Offscreen, null, label)),
|
|
1844
1843
|
!disabled && (React__default["default"].createElement(Tooltip, tslib.__assign({ target: internalRef }, tooltipProps), label))));
|
|
@@ -3604,7 +3603,7 @@ var Combobox = React.forwardRef(function (_a, ref) {
|
|
|
3604
3603
|
var isAutoComplete = autocomplete !== 'none';
|
|
3605
3604
|
var hasError = !!error;
|
|
3606
3605
|
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)); });
|
|
3606
|
+
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
3607
|
var triggerListboxKeyDown = React__default["default"].useCallback(function (key) {
|
|
3609
3608
|
var _a;
|
|
3610
3609
|
(_a = listboxRef.current) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new KeyboardEvent('keydown', {
|
|
@@ -3686,6 +3685,11 @@ var Combobox = React.forwardRef(function (_a, ref) {
|
|
|
3686
3685
|
/* istanbul ignore next: default value */ '';
|
|
3687
3686
|
setValue(stringValue);
|
|
3688
3687
|
setSelectedValue(stringValue);
|
|
3688
|
+
onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange({
|
|
3689
|
+
target: activeDescendant.element,
|
|
3690
|
+
value: stringValue,
|
|
3691
|
+
previousValue: value
|
|
3692
|
+
});
|
|
3689
3693
|
}
|
|
3690
3694
|
}, [autocomplete, activeDescendant, onBlur]);
|
|
3691
3695
|
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