@carbon/react 1.48.1 → 1.49.0-rc.0
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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1009 -1009
- package/es/components/Accordion/Accordion.Skeleton.d.ts +1 -2
- package/es/components/Accordion/Accordion.d.ts +1 -1
- package/es/components/Accordion/AccordionItem.d.ts +1 -1
- package/es/components/Accordion/AccordionItem.js +5 -0
- package/es/components/Accordion/AccordionProvider.d.ts +1 -1
- package/es/components/AspectRatio/AspectRatio.d.ts +1 -1
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.d.ts +1 -1
- package/es/components/Checkbox/Checkbox.Skeleton.d.ts +1 -1
- package/es/components/ClassPrefix/index.d.ts +1 -1
- package/es/components/ComboButton/index.js +1 -0
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/es/components/DataTable/Table.d.ts +1 -1
- package/es/components/DataTable/TableBatchAction.d.ts +1 -1
- package/es/components/DataTable/TableBody.d.ts +1 -1
- package/es/components/DataTable/TableContainer.d.ts +1 -1
- package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableExpandedRow.d.ts +1 -1
- package/es/components/DataTable/TableRow.d.ts +1 -1
- package/es/components/DataTable/TableSelectAll.d.ts +1 -1
- package/es/components/DataTable/TableSelectRow.d.ts +1 -1
- package/es/components/DataTable/TableSlugRow.d.ts +1 -1
- package/es/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/es/components/DataTable/TableToolbarSearch.d.ts +1 -1
- package/es/components/DatePicker/DatePicker.Skeleton.d.ts +1 -1
- package/es/components/DatePicker/DatePicker.d.ts +1 -3
- package/es/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
- package/es/components/FileUploader/FileUploader.Skeleton.d.ts +1 -2
- package/es/components/FileUploader/FileUploader.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderItem.d.ts +1 -1
- package/es/components/FileUploader/Filename.d.ts +1 -1
- package/es/components/Form/Form.d.ts +1 -1
- package/es/components/FormGroup/FormGroup.d.ts +1 -1
- package/es/components/FormItem/FormItem.d.ts +1 -1
- package/es/components/FormLabel/FormLabel.d.ts +1 -1
- package/es/components/Heading/index.d.ts +5 -5
- package/es/components/Icon/Icon.Skeleton.d.ts +1 -1
- package/es/components/InlineLoading/InlineLoading.d.ts +1 -1
- package/es/components/ListBox/ListBoxMenu.d.ts +1 -0
- package/es/components/ListItem/ListItem.d.ts +1 -1
- package/es/components/Loading/Loading.d.ts +1 -2
- package/es/components/Loading/Loading.js +2 -2
- package/es/components/Menu/Menu.d.ts +59 -0
- package/es/components/Menu/Menu.js +33 -10
- package/es/components/Menu/MenuContext.d.ts +32 -0
- package/es/components/Menu/MenuItem.d.ts +119 -0
- package/es/components/Menu/MenuItem.js +17 -12
- package/es/components/Menu/index.d.ts +9 -0
- package/es/components/MenuButton/index.js +1 -0
- package/es/components/ModalWrapper/ModalWrapper.d.ts +1 -1
- package/es/components/Notification/Notification.d.ts +8 -6
- package/es/components/Notification/Notification.js +2 -1
- package/es/components/NumberInput/NumberInput.Skeleton.d.ts +1 -1
- package/es/components/OrderedList/OrderedList.d.ts +1 -1
- package/es/components/OverflowMenu/next/index.js +1 -0
- package/es/components/PrimaryButton/PrimaryButton.d.ts +1 -1
- package/es/components/ProgressBar/ProgressBar.d.ts +1 -2
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts +1 -2
- package/es/components/ProgressIndicator/ProgressIndicator.d.ts +2 -2
- package/es/components/RadioButton/RadioButton.Skeleton.d.ts +1 -1
- package/es/components/Search/Search.Skeleton.d.ts +1 -1
- package/es/components/SecondaryButton/SecondaryButton.d.ts +1 -1
- package/es/components/Select/Select.Skeleton.d.ts +1 -1
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/SelectItem/SelectItem.d.ts +1 -1
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +1 -1
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +1 -1
- package/es/components/SkeletonText/SkeletonText.d.ts +1 -1
- package/es/components/Slider/Slider.Skeleton.d.ts +1 -1
- package/es/components/Slider/Slider.d.ts +1 -1
- package/es/components/Slider/SliderHandles.d.ts +4 -4
- package/es/components/Stack/index.d.ts +4 -3
- package/es/components/StructuredList/StructuredList.Skeleton.d.ts +1 -2
- package/es/components/StructuredList/StructuredList.d.ts +6 -6
- package/es/components/TabContent/TabContent.d.ts +1 -1
- package/es/components/Tabs/Tabs.Skeleton.d.ts +1 -1
- package/es/components/Tabs/Tabs.d.ts +3 -3
- package/es/components/Tag/Tag.Skeleton.d.ts +1 -1
- package/es/components/Tag/Tag.d.ts +1 -1
- package/es/components/Text/Text.d.ts +1 -1
- package/es/components/Text/TextDirection.d.ts +1 -1
- package/es/components/Text/createTextComponent.d.ts +1 -1
- package/es/components/Text/index.d.ts +2 -2
- package/es/components/TextArea/TextArea.Skeleton.d.ts +1 -1
- package/es/components/TextInput/TextInput.Skeleton.d.ts +1 -1
- package/es/components/Theme/index.d.ts +4 -2
- package/es/components/TileGroup/TileGroup.d.ts +1 -1
- package/es/components/Toggle/Toggle.d.ts +1 -1
- package/es/components/Toggletip/index.d.ts +5 -5
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/UIShell/Content.d.ts +61 -49
- package/es/components/UIShell/HeaderContainer.d.ts +1 -1
- package/es/components/UIShell/HeaderMenuButton.d.ts +1 -1
- package/es/components/UIShell/HeaderName.d.ts +1 -1
- package/es/components/UIShell/HeaderNavigation.d.ts +1 -1
- package/es/components/UIShell/HeaderSideNavItems.d.ts +1 -1
- package/es/components/UIShell/SideNav.d.ts +1 -1
- package/es/components/UIShell/SideNavDetails.d.ts +1 -1
- package/es/components/UIShell/SideNavFooter.d.ts +1 -1
- package/es/components/UIShell/SideNavLinkText.d.ts +1 -1
- package/es/components/UIShell/SkipToContent.d.ts +1 -1
- package/es/components/UnorderedList/UnorderedList.d.ts +1 -1
- package/es/index.js +2 -2
- package/lib/components/Accordion/Accordion.Skeleton.d.ts +1 -2
- package/lib/components/Accordion/Accordion.d.ts +1 -1
- package/lib/components/Accordion/AccordionItem.d.ts +1 -1
- package/lib/components/Accordion/AccordionItem.js +5 -0
- package/lib/components/Accordion/AccordionProvider.d.ts +1 -1
- package/lib/components/AspectRatio/AspectRatio.d.ts +1 -1
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.d.ts +1 -1
- package/lib/components/Checkbox/Checkbox.Skeleton.d.ts +1 -1
- package/lib/components/ClassPrefix/index.d.ts +1 -1
- package/lib/components/ComboButton/index.js +1 -0
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/lib/components/DataTable/Table.d.ts +1 -1
- package/lib/components/DataTable/TableBatchAction.d.ts +1 -1
- package/lib/components/DataTable/TableBody.d.ts +1 -1
- package/lib/components/DataTable/TableContainer.d.ts +1 -1
- package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableExpandedRow.d.ts +1 -1
- package/lib/components/DataTable/TableRow.d.ts +1 -1
- package/lib/components/DataTable/TableSelectAll.d.ts +1 -1
- package/lib/components/DataTable/TableSelectRow.d.ts +1 -1
- package/lib/components/DataTable/TableSlugRow.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarSearch.d.ts +1 -1
- package/lib/components/DatePicker/DatePicker.Skeleton.d.ts +1 -1
- package/lib/components/DatePicker/DatePicker.d.ts +1 -3
- package/lib/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
- package/lib/components/FileUploader/FileUploader.Skeleton.d.ts +1 -2
- package/lib/components/FileUploader/FileUploader.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderItem.d.ts +1 -1
- package/lib/components/FileUploader/Filename.d.ts +1 -1
- package/lib/components/Form/Form.d.ts +1 -1
- package/lib/components/FormGroup/FormGroup.d.ts +1 -1
- package/lib/components/FormItem/FormItem.d.ts +1 -1
- package/lib/components/FormLabel/FormLabel.d.ts +1 -1
- package/lib/components/Heading/index.d.ts +5 -5
- package/lib/components/Icon/Icon.Skeleton.d.ts +1 -1
- package/lib/components/InlineLoading/InlineLoading.d.ts +1 -1
- package/lib/components/ListBox/ListBoxMenu.d.ts +1 -0
- package/lib/components/ListItem/ListItem.d.ts +1 -1
- package/lib/components/Loading/Loading.d.ts +1 -2
- package/lib/components/Loading/Loading.js +2 -2
- package/lib/components/Menu/Menu.d.ts +59 -0
- package/lib/components/Menu/Menu.js +33 -10
- package/lib/components/Menu/MenuContext.d.ts +32 -0
- package/lib/components/Menu/MenuItem.d.ts +119 -0
- package/lib/components/Menu/MenuItem.js +17 -12
- package/lib/components/Menu/index.d.ts +9 -0
- package/lib/components/MenuButton/index.js +1 -0
- package/lib/components/ModalWrapper/ModalWrapper.d.ts +1 -1
- package/lib/components/Notification/Notification.d.ts +8 -6
- package/lib/components/Notification/Notification.js +2 -1
- package/lib/components/NumberInput/NumberInput.Skeleton.d.ts +1 -1
- package/lib/components/OrderedList/OrderedList.d.ts +1 -1
- package/lib/components/OverflowMenu/next/index.js +1 -0
- package/lib/components/PrimaryButton/PrimaryButton.d.ts +1 -1
- package/lib/components/ProgressBar/ProgressBar.d.ts +1 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts +1 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.d.ts +2 -2
- package/lib/components/RadioButton/RadioButton.Skeleton.d.ts +1 -1
- package/lib/components/Search/Search.Skeleton.d.ts +1 -1
- package/lib/components/SecondaryButton/SecondaryButton.d.ts +1 -1
- package/lib/components/Select/Select.Skeleton.d.ts +1 -1
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/SelectItem/SelectItem.d.ts +1 -1
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +1 -1
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +1 -1
- package/lib/components/SkeletonText/SkeletonText.d.ts +1 -1
- package/lib/components/Slider/Slider.Skeleton.d.ts +1 -1
- package/lib/components/Slider/Slider.d.ts +1 -1
- package/lib/components/Slider/SliderHandles.d.ts +4 -4
- package/lib/components/Stack/index.d.ts +4 -3
- package/lib/components/StructuredList/StructuredList.Skeleton.d.ts +1 -2
- package/lib/components/StructuredList/StructuredList.d.ts +6 -6
- package/lib/components/TabContent/TabContent.d.ts +1 -1
- package/lib/components/Tabs/Tabs.Skeleton.d.ts +1 -1
- package/lib/components/Tabs/Tabs.d.ts +3 -3
- package/lib/components/Tag/Tag.Skeleton.d.ts +1 -1
- package/lib/components/Tag/Tag.d.ts +1 -1
- package/lib/components/Text/Text.d.ts +1 -1
- package/lib/components/Text/TextDirection.d.ts +1 -1
- package/lib/components/Text/createTextComponent.d.ts +1 -1
- package/lib/components/Text/index.d.ts +2 -2
- package/lib/components/TextArea/TextArea.Skeleton.d.ts +1 -1
- package/lib/components/TextInput/TextInput.Skeleton.d.ts +1 -1
- package/lib/components/Theme/index.d.ts +4 -2
- package/lib/components/TileGroup/TileGroup.d.ts +1 -1
- package/lib/components/Toggle/Toggle.d.ts +1 -1
- package/lib/components/Toggletip/index.d.ts +5 -5
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/UIShell/Content.d.ts +61 -49
- package/lib/components/UIShell/HeaderContainer.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenuButton.d.ts +1 -1
- package/lib/components/UIShell/HeaderName.d.ts +1 -1
- package/lib/components/UIShell/HeaderNavigation.d.ts +1 -1
- package/lib/components/UIShell/HeaderSideNavItems.d.ts +1 -1
- package/lib/components/UIShell/SideNav.d.ts +1 -1
- package/lib/components/UIShell/SideNavDetails.d.ts +1 -1
- package/lib/components/UIShell/SideNavFooter.d.ts +1 -1
- package/lib/components/UIShell/SideNavLinkText.d.ts +1 -1
- package/lib/components/UIShell/SkipToContent.d.ts +1 -1
- package/lib/components/UnorderedList/UnorderedList.d.ts +1 -1
- package/lib/index.js +8 -8
- package/package.json +6 -6
|
@@ -12,7 +12,7 @@ export interface BreadcrumbSkeletonProps extends React.HTMLAttributes<HTMLDivEle
|
|
|
12
12
|
*/
|
|
13
13
|
className?: string;
|
|
14
14
|
}
|
|
15
|
-
declare function BreadcrumbSkeleton({ className, ...rest }: BreadcrumbSkeletonProps): JSX.Element;
|
|
15
|
+
declare function BreadcrumbSkeleton({ className, ...rest }: BreadcrumbSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
declare namespace BreadcrumbSkeleton {
|
|
17
17
|
var propTypes: {
|
|
18
18
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { HTMLAttributes } from 'react';
|
|
9
9
|
declare const CheckboxSkeleton: {
|
|
10
|
-
({ className, ...rest }: HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
10
|
+
({ className, ...rest }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
propTypes: {
|
|
12
12
|
/**
|
|
13
13
|
* Specify an optional className to add.
|
|
@@ -13,7 +13,7 @@ interface ClassPrefixProps {
|
|
|
13
13
|
*/
|
|
14
14
|
prefix: string;
|
|
15
15
|
}
|
|
16
|
-
declare function ClassPrefix({ children, prefix, }: PropsWithChildren<ClassPrefixProps>): JSX.Element;
|
|
16
|
+
declare function ClassPrefix({ children, prefix, }: PropsWithChildren<ClassPrefixProps>): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
declare namespace ClassPrefix {
|
|
18
18
|
var propTypes: {
|
|
19
19
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -18,6 +18,7 @@ var index = require('../IconButton/index.js');
|
|
|
18
18
|
var Button = require('../Button/Button.js');
|
|
19
19
|
require('../Button/Button.Skeleton.js');
|
|
20
20
|
var Menu = require('../Menu/Menu.js');
|
|
21
|
+
require('../Menu/MenuItem.js');
|
|
21
22
|
var useAttachedMenu = require('../../internal/useAttachedMenu.js');
|
|
22
23
|
var useId = require('../../internal/useId.js');
|
|
23
24
|
var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
@@ -99,6 +99,6 @@ export default class ContentSwitcher extends React.Component<ContentSwitcherProp
|
|
|
99
99
|
} | null;
|
|
100
100
|
handleItemRef: (index: any) => (ref: any) => void;
|
|
101
101
|
handleChildChange: (data: any) => void;
|
|
102
|
-
render(): JSX.Element;
|
|
102
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
103
103
|
}
|
|
104
104
|
export {};
|
|
@@ -35,7 +35,7 @@ interface TableProps {
|
|
|
35
35
|
useZebraStyles?: boolean;
|
|
36
36
|
}
|
|
37
37
|
export declare const Table: {
|
|
38
|
-
({ className, children, useZebraStyles, size, isSortable, useStaticWidth, stickyHeader, overflowMenuOnHover, experimentalAutoAlign, ...other }: PropsWithChildren<TableProps>): JSX.Element;
|
|
38
|
+
({ className, children, useZebraStyles, size, isSortable, useStaticWidth, stickyHeader, overflowMenuOnHover, experimentalAutoAlign, ...other }: PropsWithChildren<TableProps>): import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
propTypes: {
|
|
40
40
|
/**
|
|
41
41
|
* Pass in the children that will be rendered within the Table
|
|
@@ -26,7 +26,7 @@ declare const TableBatchAction: {
|
|
|
26
26
|
[x: string]: any;
|
|
27
27
|
renderIcon?: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType | undefined;
|
|
28
28
|
iconDescription?: string | undefined;
|
|
29
|
-
}): JSX.Element;
|
|
29
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
propTypes: {
|
|
31
31
|
/**
|
|
32
32
|
* Specify if the button is an icon-only button
|
|
@@ -13,7 +13,7 @@ export interface TableBodyProps extends ReactAttr<HTMLTableSectionElement> {
|
|
|
13
13
|
'aria-live'?: 'polite' | 'assertive' | 'off';
|
|
14
14
|
}
|
|
15
15
|
declare const TableBody: {
|
|
16
|
-
({ children, className, ...rest }: TableBodyProps): JSX.Element;
|
|
16
|
+
({ children, className, ...rest }: TableBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
propTypes: {
|
|
18
18
|
/**
|
|
19
19
|
* `polite` Adjust the notification behavior of screen readers
|
|
@@ -26,7 +26,7 @@ export interface TableContainerProps extends Omit<ReactAttr<HTMLDivElement>, 'ti
|
|
|
26
26
|
title?: React.ReactNode;
|
|
27
27
|
}
|
|
28
28
|
declare const TableContainer: {
|
|
29
|
-
({ className, children, title, description, stickyHeader, useStaticWidth, ...rest }: TableContainerProps): JSX.Element;
|
|
29
|
+
({ className, children, title, description, stickyHeader, useStaticWidth, ...rest }: TableContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
propTypes: {
|
|
31
31
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
32
32
|
className: PropTypes.Requireable<string>;
|
|
@@ -59,7 +59,7 @@ type TableExpandHeaderPropsWithExpando = Omit<TableExpandHeaderPropsBase, 'ariaL
|
|
|
59
59
|
};
|
|
60
60
|
export type TableExpandHeaderProps = TableExpandHeaderPropsWithToggle | TableExpandHeaderPropsWithExpando | TableExpandHeaderPropsBase;
|
|
61
61
|
declare const TableExpandHeader: {
|
|
62
|
-
({ ["aria-controls"]: ariaControls, ["aria-label"]: ariaLabel, ariaLabel: deprecatedAriaLabel, className: headerClassName, enableExpando, enableToggle, id, isExpanded, onExpand, expandIconDescription, children, ...rest }: TableExpandHeaderProps): JSX.Element;
|
|
62
|
+
({ ["aria-controls"]: ariaControls, ["aria-label"]: ariaLabel, ariaLabel: deprecatedAriaLabel, className: headerClassName, enableExpando, enableToggle, id, isExpanded, onExpand, expandIconDescription, children, ...rest }: TableExpandHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
63
63
|
propTypes: {
|
|
64
64
|
/**
|
|
65
65
|
* Space separated list of one or more ID values referencing the TableExpandedRow(s) being controlled by the TableExpandHeader
|
|
@@ -13,7 +13,7 @@ interface TableExpandedRowProps extends ReactAttr<HTMLTableRowElement> {
|
|
|
13
13
|
colSpan: number;
|
|
14
14
|
}
|
|
15
15
|
declare const TableExpandedRow: {
|
|
16
|
-
({ className: customClassName, children, colSpan, ...rest }: TableExpandedRowProps): JSX.Element;
|
|
16
|
+
({ className: customClassName, children, colSpan, ...rest }: TableExpandedRowProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
propTypes: {
|
|
18
18
|
/**
|
|
19
19
|
* Pass in the contents for your TableExpandedRow
|
|
@@ -17,7 +17,7 @@ export interface TableRowProps extends ReactAttr<HTMLTableRowElement> {
|
|
|
17
17
|
isSelected?: boolean;
|
|
18
18
|
}
|
|
19
19
|
declare const TableRow: {
|
|
20
|
-
(props: TableRowProps): JSX.Element;
|
|
20
|
+
(props: TableRowProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
propTypes: {
|
|
22
22
|
/**
|
|
23
23
|
* Specify an optional className to be applied to the container node
|
|
@@ -41,7 +41,7 @@ interface TableSelectAllProps {
|
|
|
41
41
|
onSelect: React.MouseEventHandler<HTMLInputElement>;
|
|
42
42
|
}
|
|
43
43
|
declare const TableSelectAll: {
|
|
44
|
-
({ ariaLabel, checked, id, indeterminate, name, onSelect, disabled, className, }: TableSelectAllProps): JSX.Element;
|
|
44
|
+
({ ariaLabel, checked, id, indeterminate, name, onSelect, disabled, className, }: TableSelectAllProps): import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
propTypes: {
|
|
46
46
|
/**
|
|
47
47
|
* Specify the aria label for the underlying input control
|
|
@@ -45,7 +45,7 @@ export interface TableSelectRowProps {
|
|
|
45
45
|
radio?: boolean;
|
|
46
46
|
}
|
|
47
47
|
declare const TableSelectRow: {
|
|
48
|
-
({ ariaLabel, checked, id, name, onSelect, onChange, disabled, radio, className, }: TableSelectRowProps): JSX.Element;
|
|
48
|
+
({ ariaLabel, checked, id, name, onSelect, onChange, disabled, radio, className, }: TableSelectRowProps): import("react/jsx-runtime").JSX.Element;
|
|
49
49
|
propTypes: {
|
|
50
50
|
/**
|
|
51
51
|
* Specify the aria label for the underlying input control
|
|
@@ -16,7 +16,7 @@ export interface TableSlugRowProps {
|
|
|
16
16
|
slug?: ReactNodeLike;
|
|
17
17
|
}
|
|
18
18
|
declare const TableSlugRow: {
|
|
19
|
-
({ className, slug }: TableSlugRowProps): JSX.Element;
|
|
19
|
+
({ className, slug }: TableSlugRowProps): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
propTypes: {
|
|
21
21
|
/**
|
|
22
22
|
* The CSS class names of the cell that wraps the underlying input control
|
|
@@ -18,7 +18,7 @@ export interface TableToolbarMenuProps extends React.HTMLAttributes<HTMLDivEleme
|
|
|
18
18
|
/**
|
|
19
19
|
* Optional prop to allow overriding the default menu icon
|
|
20
20
|
*/
|
|
21
|
-
renderIcon?:
|
|
21
|
+
renderIcon?: any;
|
|
22
22
|
}
|
|
23
23
|
declare const TableToolbarMenu: React.FC<TableToolbarMenuProps>;
|
|
24
24
|
export default TableToolbarMenu;
|
|
@@ -86,7 +86,7 @@ export interface TableToolbarSearchProps {
|
|
|
86
86
|
translateWithId?: (id: string) => string;
|
|
87
87
|
}
|
|
88
88
|
declare const TableToolbarSearch: {
|
|
89
|
-
({ className, searchContainerClass, onChange: onChangeProp, onClear, translateWithId: t, placeholder, labelText, expanded: expandedProp, defaultExpanded, defaultValue, disabled, onExpand, persistent, id, onBlur, onFocus, size, tabIndex, ...rest }: TableToolbarSearchProps): JSX.Element;
|
|
89
|
+
({ className, searchContainerClass, onChange: onChangeProp, onClear, translateWithId: t, placeholder, labelText, expanded: expandedProp, defaultExpanded, defaultValue, disabled, onExpand, persistent, id, onBlur, onFocus, size, tabIndex, ...rest }: TableToolbarSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
90
90
|
propTypes: {
|
|
91
91
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
92
92
|
/**
|
|
@@ -14,7 +14,7 @@ export interface DatePickerSkeletonProps extends HTMLAttributes<HTMLDivElement>
|
|
|
14
14
|
hideLabel?: boolean;
|
|
15
15
|
}
|
|
16
16
|
declare const DatePickerSkeleton: {
|
|
17
|
-
({ range, id, hideLabel, className, ...rest }: DatePickerSkeletonProps): JSX.Element;
|
|
17
|
+
({ range, id, hideLabel, className, ...rest }: DatePickerSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
propTypes: {
|
|
19
19
|
/**
|
|
20
20
|
* Specify an optional className to add.
|
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
import { ReactNodeLike } from 'prop-types';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import flatpickr from 'flatpickr';
|
|
10
|
-
import { ReactAttr } from '../../types/common';
|
|
11
|
-
type ExcludedAttributes = 'value' | 'onChange' | 'locale';
|
|
12
10
|
export type DatePickerTypes = 'simple' | 'single' | 'range';
|
|
13
11
|
export type CalRef = {
|
|
14
12
|
inline: boolean;
|
|
@@ -22,7 +20,7 @@ export type CalRef = {
|
|
|
22
20
|
plugins: [];
|
|
23
21
|
clickOpens: any;
|
|
24
22
|
};
|
|
25
|
-
interface DatePickerProps
|
|
23
|
+
interface DatePickerProps {
|
|
26
24
|
/**
|
|
27
25
|
* Flatpickr prop passthrough enables direct date input, and when set to false,
|
|
28
26
|
* we must clear dates manually by resetting the value prop to empty string making it a controlled input.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { type SearchProps } from '../Search';
|
|
9
|
-
declare function ExpandableSearch({ onBlur, onChange, onExpand, onKeyDown, defaultValue, isExpanded, ...props }: SearchProps): JSX.Element;
|
|
9
|
+
declare function ExpandableSearch({ onBlur, onChange, onExpand, onKeyDown, defaultValue, isExpanded, ...props }: SearchProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
declare namespace ExpandableSearch {
|
|
11
11
|
var propTypes: React.WeakValidationMap<SearchProps & React.RefAttributes<HTMLInputElement>> | undefined;
|
|
12
12
|
var displayName: string;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference types="react" />
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import { ReactAttr } from '../../types/common';
|
|
10
9
|
export interface FileUploaderSkeletonProps extends ReactAttr<HTMLDivElement> {
|
|
@@ -13,7 +12,7 @@ export interface FileUploaderSkeletonProps extends ReactAttr<HTMLDivElement> {
|
|
|
13
12
|
*/
|
|
14
13
|
className?: string;
|
|
15
14
|
}
|
|
16
|
-
declare function FileUploaderSkeleton({ className, ...rest }: FileUploaderSkeletonProps): JSX.Element;
|
|
15
|
+
declare function FileUploaderSkeleton({ className, ...rest }: FileUploaderSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
16
|
declare namespace FileUploaderSkeleton {
|
|
18
17
|
var propTypes: {
|
|
19
18
|
/**
|
|
@@ -71,7 +71,7 @@ export interface FileUploaderButtonProps extends Omit<ReactAttr<HTMLButtonElemen
|
|
|
71
71
|
tabIndex?: number | string;
|
|
72
72
|
innerRef?: React.RefObject<HTMLLabelElement>;
|
|
73
73
|
}
|
|
74
|
-
declare function FileUploaderButton({ accept, buttonKind, className, disabled, disableLabelChanges, id, labelText: ownerLabelText, multiple, onChange, name, size, innerRef, ...other }: FileUploaderButtonProps): JSX.Element;
|
|
74
|
+
declare function FileUploaderButton({ accept, buttonKind, className, disabled, disableLabelChanges, id, labelText: ownerLabelText, multiple, onChange, name, size, innerRef, ...other }: FileUploaderButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
75
75
|
declare namespace FileUploaderButton {
|
|
76
76
|
var propTypes: {
|
|
77
77
|
/**
|
|
@@ -65,7 +65,7 @@ export interface FileUploaderDropContainerProps extends Omit<ReactAttr<HTMLButto
|
|
|
65
65
|
*/
|
|
66
66
|
tabIndex?: number | string;
|
|
67
67
|
}
|
|
68
|
-
declare function FileUploaderDropContainer({ accept, className, id, disabled, labelText, multiple, name, onAddFiles, onClick, pattern, innerRef, ...rest }: FileUploaderDropContainerProps): JSX.Element;
|
|
68
|
+
declare function FileUploaderDropContainer({ accept, className, id, disabled, labelText, multiple, name, onAddFiles, onClick, pattern, innerRef, ...rest }: FileUploaderDropContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
69
69
|
declare namespace FileUploaderDropContainer {
|
|
70
70
|
var propTypes: {
|
|
71
71
|
/**
|
|
@@ -53,7 +53,7 @@ export interface FileUploaderItemProps extends ReactAttr<HTMLSpanElement> {
|
|
|
53
53
|
*/
|
|
54
54
|
uuid?: string;
|
|
55
55
|
}
|
|
56
|
-
declare function FileUploaderItem({ uuid, name, status, iconDescription, onDelete, invalid, errorSubject, errorBody, size, ...other }: FileUploaderItemProps): JSX.Element;
|
|
56
|
+
declare function FileUploaderItem({ uuid, name, status, iconDescription, onDelete, invalid, errorSubject, errorBody, size, ...other }: FileUploaderItemProps): import("react/jsx-runtime").JSX.Element;
|
|
57
57
|
declare namespace FileUploaderItem {
|
|
58
58
|
var propTypes: {
|
|
59
59
|
/**
|
|
@@ -35,7 +35,7 @@ export interface FilenameProps extends Omit<ReactAttr & SVGAttr, 'tabIndex' | 't
|
|
|
35
35
|
*/
|
|
36
36
|
tabIndex?: number;
|
|
37
37
|
}
|
|
38
|
-
declare function Filename({ iconDescription, status, invalid, name, tabIndex, ['aria-describedby']: ariaDescribedBy, ...rest }: FilenameProps): JSX.Element | null;
|
|
38
|
+
declare function Filename({ iconDescription, status, invalid, name, tabIndex, ['aria-describedby']: ariaDescribedBy, ...rest }: FilenameProps): import("react/jsx-runtime").JSX.Element | null;
|
|
39
39
|
declare namespace Filename {
|
|
40
40
|
var propTypes: {
|
|
41
41
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { type ComponentProps } from 'react';
|
|
9
9
|
type FormProps = ComponentProps<'form'>;
|
|
10
|
-
declare function Form({ className, children, ...other }: FormProps): JSX.Element;
|
|
10
|
+
declare function Form({ className, children, ...other }: FormProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare namespace Form {
|
|
12
12
|
var propTypes: {
|
|
13
13
|
/**
|
|
@@ -39,7 +39,7 @@ export interface FormGroupProps extends ReactAttr<HTMLFieldSetElement> {
|
|
|
39
39
|
messageText?: string;
|
|
40
40
|
}
|
|
41
41
|
declare const FormGroup: {
|
|
42
|
-
({ legendId, legendText, invalid, children, className, message, messageText, ...rest }: FormGroupProps): JSX.Element;
|
|
42
|
+
({ legendId, legendText, invalid, children, className, message, messageText, ...rest }: FormGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
43
43
|
propTypes: {
|
|
44
44
|
/**
|
|
45
45
|
* Provide the children form elements to be rendered inside of the <fieldset>
|
|
@@ -16,7 +16,7 @@ type FormItemProps = {
|
|
|
16
16
|
*/
|
|
17
17
|
className?: string;
|
|
18
18
|
};
|
|
19
|
-
declare function FormItem({ className, children, ...rest }: FormItemProps): JSX.Element;
|
|
19
|
+
declare function FormItem({ className, children, ...rest }: FormItemProps): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
declare namespace FormItem {
|
|
21
21
|
var propTypes: {
|
|
22
22
|
/**
|
|
@@ -20,7 +20,7 @@ export interface FormLabelProps extends Omit<React.LabelHTMLAttributes<HTMLLabel
|
|
|
20
20
|
*/
|
|
21
21
|
id?: string;
|
|
22
22
|
}
|
|
23
|
-
declare function FormLabel({ className: customClassName, children, id, ...rest }: FormLabelProps): JSX.Element;
|
|
23
|
+
declare function FormLabel({ className: customClassName, children, id, ...rest }: FormLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
declare namespace FormLabel {
|
|
25
25
|
var propTypes: {
|
|
26
26
|
/**
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { type ElementType } from 'react';
|
|
8
|
+
import type { PolymorphicProps } from '../../types/common';
|
|
8
9
|
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
9
10
|
type SectionBaseProps = {
|
|
10
11
|
level?: HeadingLevel;
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare const Heading: React.ForwardRefExoticComponent<Pick<React.ClassAttributes<HTMLHeadingElement> & React.HTMLAttributes<HTMLHeadingElement>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement>> & React.RefAttributes<HTMLHeadingElement>>;
|
|
13
|
+
type SectionProps<E extends ElementType> = PolymorphicProps<E, SectionBaseProps>;
|
|
14
|
+
export declare const Section: React.ForwardRefExoticComponent<Omit<SectionProps<React.ElementType<any>>, "ref"> & React.RefAttributes<unknown>>;
|
|
15
|
+
export declare const Heading: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
16
16
|
export {};
|
|
@@ -13,7 +13,7 @@ export interface IconSkeletonProps extends ComponentProps<'div'> {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
}
|
|
15
15
|
declare const IconSkeleton: {
|
|
16
|
-
({ className, ...rest }: IconSkeletonProps): JSX.Element;
|
|
16
|
+
({ className, ...rest }: IconSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
propTypes: {
|
|
18
18
|
/**
|
|
19
19
|
* Specify an optional className to add.
|
|
@@ -36,7 +36,7 @@ export interface InlineLoadingProps extends Omit<React.DetailedHTMLProps<React.H
|
|
|
36
36
|
successDelay?: number;
|
|
37
37
|
}
|
|
38
38
|
declare const InlineLoading: {
|
|
39
|
-
({ className, status, iconDescription, description, onSuccess, successDelay, ...rest }: InlineLoadingProps): JSX.Element;
|
|
39
|
+
({ className, status, iconDescription, description, onSuccess, successDelay, ...rest }: InlineLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
40
40
|
propTypes: {
|
|
41
41
|
/**
|
|
42
42
|
* Specify a custom className to be applied to the container node
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { type ComponentProps } from 'react';
|
|
9
9
|
type ListItemProps = ComponentProps<'li'>;
|
|
10
|
-
declare function ListItem({ className, children, ...other }: ListItemProps): JSX.Element;
|
|
10
|
+
declare function ListItem({ className, children, ...other }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare namespace ListItem {
|
|
12
12
|
var propTypes: {
|
|
13
13
|
/**
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/// <reference types="react" />
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import { ReactAttr } from '../../types/common';
|
|
10
9
|
export interface LoadingProps extends ReactAttr<HTMLDivElement> {
|
|
@@ -33,7 +32,7 @@ export interface LoadingProps extends ReactAttr<HTMLDivElement> {
|
|
|
33
32
|
*/
|
|
34
33
|
withOverlay: boolean;
|
|
35
34
|
}
|
|
36
|
-
declare function Loading({ active, className: customClassName, withOverlay, small, description, ...rest }: LoadingProps): JSX.Element;
|
|
35
|
+
declare function Loading({ active, className: customClassName, withOverlay, small, description, ...rest }: LoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
37
36
|
declare namespace Loading {
|
|
38
37
|
var propTypes: {
|
|
39
38
|
/**
|
|
@@ -52,12 +52,12 @@ function Loading(_ref) {
|
|
|
52
52
|
className: `${prefix}--loading__background`,
|
|
53
53
|
cx: "50%",
|
|
54
54
|
cy: "50%",
|
|
55
|
-
r: "
|
|
55
|
+
r: "42"
|
|
56
56
|
}) : null, /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
57
57
|
className: `${prefix}--loading__stroke`,
|
|
58
58
|
cx: "50%",
|
|
59
59
|
cy: "50%",
|
|
60
|
-
r:
|
|
60
|
+
r: small ? '42' : '44'
|
|
61
61
|
})));
|
|
62
62
|
return withOverlay ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
63
63
|
className: overlayClassName
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
interface MenuProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
9
|
+
/**
|
|
10
|
+
* A collection of MenuItems to be rendered within this Menu.
|
|
11
|
+
*/
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class names.
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* A label describing the Menu.
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The mode of this menu. Defaults to full.
|
|
23
|
+
* `full` supports nesting and selectable menu items, but no icons.
|
|
24
|
+
* `basic` supports icons but no nesting or selectable menu items.
|
|
25
|
+
*
|
|
26
|
+
* **This prop is not intended for use and will be set by the respective implementation (like useContextMenu, MenuButton, and ComboButton).**
|
|
27
|
+
*/
|
|
28
|
+
mode?: 'full' | 'basic';
|
|
29
|
+
/**
|
|
30
|
+
* Provide an optional function to be called when the Menu should be closed.
|
|
31
|
+
*/
|
|
32
|
+
onClose?: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Provide an optional function to be called when the Menu is opened.
|
|
35
|
+
*/
|
|
36
|
+
onOpen?: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the Menu is open or not.
|
|
39
|
+
*/
|
|
40
|
+
open?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Specify the size of the Menu.
|
|
43
|
+
*/
|
|
44
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
45
|
+
/**
|
|
46
|
+
* Specify a DOM node where the Menu should be rendered in. Defaults to document.body.
|
|
47
|
+
*/
|
|
48
|
+
target?: any;
|
|
49
|
+
/**
|
|
50
|
+
* Specify the x position of the Menu. Either pass a single number or an array with two numbers describing your activator's boundaries ([x1, x2])
|
|
51
|
+
*/
|
|
52
|
+
x?: number | (number | null | undefined)[];
|
|
53
|
+
/**
|
|
54
|
+
* Specify the y position of the Menu. Either pass a single number or an array with two numbers describing your activator's boundaries ([y1, y2])
|
|
55
|
+
*/
|
|
56
|
+
y?: number | (number | null | undefined)[];
|
|
57
|
+
}
|
|
58
|
+
declare const Menu: React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
59
|
+
export { Menu };
|
|
@@ -66,7 +66,7 @@ const Menu = /*#__PURE__*/React__default["default"].forwardRef(function Menu(_re
|
|
|
66
66
|
dispatch: childDispatch
|
|
67
67
|
};
|
|
68
68
|
}, [childState, childDispatch]);
|
|
69
|
-
const menu = React.useRef();
|
|
69
|
+
const menu = React.useRef(null);
|
|
70
70
|
const ref = useMergedRefs.useMergedRefs([forwardRef, menu]);
|
|
71
71
|
const [position, setPosition] = React.useState([-1, -1]);
|
|
72
72
|
const focusableItems = childContext.state.items.filter(item => !item.disabled && item.ref.current);
|
|
@@ -154,11 +154,14 @@ const Menu = /*#__PURE__*/React__default["default"].forwardRef(function Menu(_re
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
function handleBlur(e) {
|
|
157
|
-
if (open && onClose && isRoot && !menu.current
|
|
157
|
+
if (open && onClose && isRoot && !menu.current?.contains(e.relatedTarget)) {
|
|
158
158
|
handleClose(e);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
function fitValue(range, axis) {
|
|
162
|
+
if (!menu.current) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
162
165
|
const {
|
|
163
166
|
width,
|
|
164
167
|
height
|
|
@@ -197,18 +200,38 @@ const Menu = /*#__PURE__*/React__default["default"].forwardRef(function Menu(_re
|
|
|
197
200
|
reversedAnchor - size >= 0 ? reversedAnchor - size + offset : false,
|
|
198
201
|
// align at max (second fallback)
|
|
199
202
|
max - spacing - size];
|
|
203
|
+
|
|
204
|
+
// Previous array `options`, has at least one item that is a number (the last one - second fallback).
|
|
205
|
+
// That guarantees that the return of `find()` will always be a number
|
|
206
|
+
// and we can safely add the numeric casting `as number`.
|
|
200
207
|
const bestOption = options.find(option => option !== false);
|
|
201
208
|
return bestOption >= spacing ? bestOption : spacing;
|
|
202
209
|
}
|
|
210
|
+
function notEmpty(value) {
|
|
211
|
+
return value !== null && value !== undefined;
|
|
212
|
+
}
|
|
213
|
+
function getPosition(x) {
|
|
214
|
+
if (Array.isArray(x)) {
|
|
215
|
+
// has to be of length 2
|
|
216
|
+
const filtered = x.filter(notEmpty);
|
|
217
|
+
if (filtered.length === 2) {
|
|
218
|
+
return filtered;
|
|
219
|
+
} else {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
} else {
|
|
223
|
+
return [x, x];
|
|
224
|
+
}
|
|
225
|
+
}
|
|
203
226
|
function calculatePosition() {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
return [
|
|
227
|
+
const ranges = {
|
|
228
|
+
x: getPosition(x),
|
|
229
|
+
y: getPosition(y)
|
|
230
|
+
};
|
|
231
|
+
if (!ranges.x || !ranges.y) {
|
|
232
|
+
return [-1, -1];
|
|
210
233
|
}
|
|
211
|
-
return [-1, -1];
|
|
234
|
+
return [fitValue(ranges.x, 'x') ?? -1, fitValue(ranges.y, 'y') ?? -1];
|
|
212
235
|
}
|
|
213
236
|
React.useEffect(() => {
|
|
214
237
|
if (open && focusableItems.length > 0) {
|
|
@@ -222,7 +245,7 @@ const Menu = /*#__PURE__*/React__default["default"].forwardRef(function Menu(_re
|
|
|
222
245
|
} else {
|
|
223
246
|
// reset position when menu is closed in order for the --shown
|
|
224
247
|
// modifier to be applied correctly
|
|
225
|
-
setPosition(-1, -1);
|
|
248
|
+
setPosition([-1, -1]);
|
|
226
249
|
}
|
|
227
250
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
228
251
|
}, [open]);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
type ActionType = {
|
|
9
|
+
type: 'enableIcons' | 'registerItem';
|
|
10
|
+
payload: any;
|
|
11
|
+
};
|
|
12
|
+
type StateType = {
|
|
13
|
+
isRoot: boolean;
|
|
14
|
+
mode: 'full' | 'basic';
|
|
15
|
+
hasIcons: boolean;
|
|
16
|
+
size: 'xs' | 'sm' | 'md' | 'lg' | null;
|
|
17
|
+
items: any[];
|
|
18
|
+
requestCloseRoot: (e: Pick<React.KeyboardEvent<HTMLUListElement>, 'type'>) => void;
|
|
19
|
+
};
|
|
20
|
+
declare function menuReducer(state: StateType, action: ActionType): {
|
|
21
|
+
hasIcons: boolean;
|
|
22
|
+
isRoot: boolean;
|
|
23
|
+
mode: "full" | "basic";
|
|
24
|
+
size: "sm" | "md" | "lg" | "xs" | null;
|
|
25
|
+
items: any[];
|
|
26
|
+
requestCloseRoot: (e: Pick<React.KeyboardEvent<HTMLUListElement>, "type">) => void;
|
|
27
|
+
};
|
|
28
|
+
declare const MenuContext: React.Context<{
|
|
29
|
+
state: StateType;
|
|
30
|
+
dispatch: React.Dispatch<any>;
|
|
31
|
+
}>;
|
|
32
|
+
export { MenuContext, menuReducer };
|