@carbon/react 1.80.1 → 1.81.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 +785 -785
- package/es/components/Accordion/AccordionItem.d.ts +2 -2
- package/es/components/AspectRatio/AspectRatio.d.ts +2 -2
- package/es/components/Button/Button.js +3 -0
- package/es/components/Button/ButtonBase.d.ts +2 -2
- package/es/components/ChatButton/ChatButton.js +5 -3
- package/es/components/CodeSnippet/CodeSnippet.js +2 -0
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComboBox/ComboBox.js +52 -30
- package/es/components/ComposedModal/ComposedModal.d.ts +1 -1
- package/es/components/ComposedModal/ComposedModal.js +1 -2
- package/es/components/ComposedModal/ModalFooter.js +0 -1
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -1
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/es/components/ContextMenu/useContextMenu.d.ts +1 -1
- package/es/components/DataTable/DataTable.d.ts +5 -5
- package/es/components/DataTable/DataTable.js +1 -1
- package/es/components/DataTable/TableActionList.d.ts +1 -1
- package/es/components/DataTable/TableCell.js +28 -4
- package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableHead.d.ts +1 -1
- package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/es/components/DataTable/TableToolbarSearch.d.ts +1 -1
- package/es/components/DataTable/tools/cells.d.ts +13 -0
- package/es/components/DataTable/tools/cells.js +3 -6
- package/es/components/DataTable/tools/filter.d.ts +26 -0
- package/es/components/DataTable/tools/filter.js +8 -17
- package/es/components/DatePicker/DatePicker.js +1 -1
- package/es/components/DatePickerInput/DatePickerInput.d.ts +2 -2
- package/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.js +6 -6
- package/es/components/FeatureFlags/index.d.ts +1 -1
- package/es/components/FileUploader/FileUploader.d.ts +6 -1
- package/es/components/FileUploader/FileUploader.js +3 -1
- package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.d.ts +1 -1
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +5 -6
- package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -3
- package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +2 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +6 -4
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +40 -0
- package/es/components/FluidNumberInput/FluidNumberInput.js +123 -0
- package/es/components/FluidTextInput/FluidTextInput.js +2 -2
- package/es/components/Grid/Column.js +1 -1
- package/es/components/Grid/GridTypes.d.ts +6 -1
- package/es/components/Layer/LayerLevel.d.ts +3 -3
- package/es/components/Layer/LayerLevel.js +4 -3
- package/es/components/Layer/index.d.ts +4 -2
- package/es/components/Layer/index.js +3 -2
- package/es/components/Link/Link.js +3 -1
- package/es/components/Menu/Menu.d.ts +1 -1
- package/es/components/Menu/Menu.js +4 -14
- package/es/components/Menu/MenuContext.d.ts +1 -1
- package/es/components/Menu/MenuItem.js +15 -4
- package/es/components/Modal/Modal.js +5 -2
- package/es/components/ModalWrapper/ModalWrapper.d.ts +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -3
- package/es/components/MultiSelect/FilterableMultiSelect.js +4 -3
- package/es/components/MultiSelect/MultiSelect.d.ts +2 -6
- package/es/components/MultiSelect/MultiSelect.js +22 -4
- package/es/components/MultiSelect/index.d.ts +2 -4
- package/es/components/NumberInput/NumberInput.js +2 -1
- package/es/components/OverflowMenu/OverflowMenu.d.ts +7 -1
- package/es/components/OverflowMenu/OverflowMenu.js +69 -17
- package/es/components/OverflowMenu/index.d.ts +2 -4
- package/es/components/OverflowMenu/index.js +10 -6
- package/es/components/OverflowMenu/next/index.js +0 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +4 -0
- package/es/components/PageHeader/PageHeader.d.ts +9 -2
- package/es/components/PageHeader/PageHeader.js +16 -4
- package/es/components/PageHeader/index.d.ts +2 -2
- package/es/components/PageHeader/index.js +1 -1
- package/es/components/PaginationNav/PaginationNav.d.ts +1 -1
- package/es/components/PaginationNav/PaginationNav.js +2 -1
- package/es/components/Popover/index.d.ts +3 -2
- package/es/components/Popover/index.js +10 -5
- package/es/components/Portal/index.d.ts +1 -1
- package/es/components/Search/Search.js +0 -1
- package/es/components/SkeletonText/SkeletonText.js +3 -1
- package/es/components/Slider/Slider.d.ts +3 -13
- package/es/components/Slider/Slider.js +2 -14
- package/es/components/Tabs/Tabs.d.ts +2 -2
- package/es/components/Tabs/Tabs.js +8 -6
- package/es/components/Tabs/usePressable.js +1 -1
- package/es/components/Tag/Tag.js +9 -2
- package/es/components/Text/Text.js +3 -2
- package/es/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/es/components/TextInput/ControlledPasswordInput.js +0 -6
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +0 -4
- package/es/components/TextInput/index.d.ts +6 -0
- package/es/components/TextInput/index.js +0 -8
- package/es/components/Tile/Tile.js +0 -1
- package/es/components/Toggle/Toggle.d.ts +1 -1
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +9 -14
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +37 -41
- package/es/components/Toggletip/index.js +11 -8
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/TreeView/TreeView.d.ts +1 -1
- package/es/components/UIShell/Content.d.ts +14 -1
- package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.d.ts +2 -99
- package/es/components/UIShell/HeaderMenu.js +10 -3
- package/es/components/UIShell/HeaderMenuButton.d.ts +1 -98
- package/es/components/UIShell/HeaderMenuItem.d.ts +3 -4
- package/es/components/UIShell/HeaderMenuItem.js +3 -3
- package/es/components/UIShell/HeaderName.js +1 -1
- package/es/components/UIShell/HeaderNavigation.d.ts +0 -97
- package/es/components/UIShell/Link.d.ts +8 -8
- package/es/components/UIShell/Link.js +8 -5
- package/es/components/UIShell/SideNav.d.ts +3 -3
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/SideNavHeader.js +0 -1
- package/es/components/UIShell/SideNavLink.d.ts +3 -4
- package/es/components/UIShell/SideNavLink.js +8 -3
- package/es/components/UIShell/SideNavMenu.js +0 -1
- package/es/components/UIShell/SideNavMenuItem.d.ts +1 -49
- package/es/components/UIShell/SideNavMenuItem.js +1 -1
- package/es/components/UIShell/SideNavSwitcher.js +0 -1
- package/es/components/UIShell/SwitcherItem.d.ts +2 -2
- package/es/components/UIShell/SwitcherItem.js +1 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +7 -7
- package/es/internal/FloatingMenu.js +2 -1
- package/es/internal/clamp.d.ts +10 -0
- package/es/internal/clamp.js +13 -0
- package/es/internal/useEvent.d.ts +9 -0
- package/es/internal/useEvent.js +8 -49
- package/es/internal/useId.js +1 -1
- package/es/internal/useMatchMedia.d.ts +7 -2
- package/es/internal/useMatchMedia.js +9 -10
- package/es/internal/useNoInteractiveChildren.js +4 -2
- package/es/internal/useOutsideClick.d.ts +1 -1
- package/es/prop-types/AriaPropTypes.js +1 -1
- package/es/prop-types/isRequiredOneOf.d.ts +16 -0
- package/es/prop-types/isRequiredOneOf.js +11 -9
- package/es/tools/setupGetInstanceId.d.ts +12 -0
- package/es/tools/setupGetInstanceId.js +7 -8
- package/es/tools/toggleClass.d.ts +14 -0
- package/es/tools/toggleClass.js +9 -10
- package/es/tools/wrapComponent.d.ts +1 -1
- package/es/types/common.d.ts +1 -6
- package/lib/components/Accordion/AccordionItem.d.ts +2 -2
- package/lib/components/AspectRatio/AspectRatio.d.ts +2 -2
- package/lib/components/Button/Button.js +3 -0
- package/lib/components/Button/ButtonBase.d.ts +2 -2
- package/lib/components/ChatButton/ChatButton.js +5 -3
- package/lib/components/CodeSnippet/CodeSnippet.js +2 -0
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.js +52 -30
- package/lib/components/ComposedModal/ComposedModal.d.ts +1 -1
- package/lib/components/ComposedModal/ComposedModal.js +2 -3
- package/lib/components/ComposedModal/ModalFooter.js +0 -1
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/lib/components/ContextMenu/useContextMenu.d.ts +1 -1
- package/lib/components/DataTable/DataTable.d.ts +5 -5
- package/lib/components/DataTable/DataTable.js +1 -1
- package/lib/components/DataTable/TableActionList.d.ts +1 -1
- package/lib/components/DataTable/TableCell.js +28 -3
- package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHead.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarSearch.d.ts +1 -1
- package/lib/components/DataTable/tools/cells.d.ts +13 -0
- package/lib/components/DataTable/tools/cells.js +3 -6
- package/lib/components/DataTable/tools/filter.d.ts +26 -0
- package/lib/components/DataTable/tools/filter.js +8 -17
- package/lib/components/DatePicker/DatePicker.js +1 -1
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +2 -2
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.js +6 -6
- package/lib/components/FeatureFlags/index.d.ts +1 -1
- package/lib/components/FileUploader/FileUploader.d.ts +6 -1
- package/lib/components/FileUploader/FileUploader.js +3 -1
- package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.d.ts +1 -1
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -5
- package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -3
- package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +2 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +7 -5
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +50 -0
- package/lib/components/FluidNumberInput/FluidNumberInput.js +133 -0
- package/lib/components/FluidTextInput/FluidTextInput.js +2 -2
- package/lib/components/Grid/Column.js +1 -1
- package/lib/components/Grid/GridTypes.d.ts +6 -1
- package/lib/components/Layer/LayerLevel.d.ts +3 -3
- package/lib/components/Layer/LayerLevel.js +4 -2
- package/lib/components/Layer/index.d.ts +4 -2
- package/lib/components/Layer/index.js +2 -1
- package/lib/components/Link/Link.js +3 -1
- package/lib/components/Menu/Menu.d.ts +1 -1
- package/lib/components/Menu/Menu.js +4 -14
- package/lib/components/Menu/MenuContext.d.ts +1 -1
- package/lib/components/Menu/MenuItem.js +15 -4
- package/lib/components/Modal/Modal.js +6 -3
- package/lib/components/ModalWrapper/ModalWrapper.d.ts +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -3
- package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -2
- package/lib/components/MultiSelect/MultiSelect.d.ts +2 -6
- package/lib/components/MultiSelect/MultiSelect.js +21 -3
- package/lib/components/MultiSelect/index.d.ts +2 -4
- package/lib/components/NumberInput/NumberInput.js +2 -1
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +7 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +69 -17
- package/lib/components/OverflowMenu/index.d.ts +2 -4
- package/lib/components/OverflowMenu/index.js +9 -5
- package/lib/components/OverflowMenu/next/index.js +0 -1
- package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +4 -0
- package/lib/components/PageHeader/PageHeader.d.ts +9 -2
- package/lib/components/PageHeader/PageHeader.js +17 -3
- package/lib/components/PageHeader/index.d.ts +2 -2
- package/lib/components/PageHeader/index.js +2 -0
- package/lib/components/PaginationNav/PaginationNav.d.ts +1 -1
- package/lib/components/PaginationNav/PaginationNav.js +2 -1
- package/lib/components/Popover/index.d.ts +3 -2
- package/lib/components/Popover/index.js +10 -5
- package/lib/components/Portal/index.d.ts +1 -1
- package/lib/components/Search/Search.js +0 -1
- package/lib/components/SkeletonText/SkeletonText.js +3 -1
- package/lib/components/Slider/Slider.d.ts +3 -13
- package/lib/components/Slider/Slider.js +2 -14
- package/lib/components/Tabs/Tabs.d.ts +2 -2
- package/lib/components/Tabs/Tabs.js +7 -5
- package/lib/components/Tabs/usePressable.js +1 -1
- package/lib/components/Tag/Tag.js +9 -2
- package/lib/components/Text/Text.js +2 -1
- package/lib/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/lib/components/TextInput/ControlledPasswordInput.js +0 -6
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +0 -4
- package/lib/components/TextInput/index.d.ts +6 -0
- package/lib/components/TextInput/index.js +1 -7
- package/lib/components/Tile/Tile.js +0 -1
- package/lib/components/Toggle/Toggle.d.ts +1 -1
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +9 -14
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +34 -39
- package/lib/components/Toggletip/index.js +11 -8
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/TreeView/TreeView.d.ts +1 -1
- package/lib/components/UIShell/Content.d.ts +14 -1
- package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenu.d.ts +2 -99
- package/lib/components/UIShell/HeaderMenu.js +10 -3
- package/lib/components/UIShell/HeaderMenuButton.d.ts +1 -98
- package/lib/components/UIShell/HeaderMenuItem.d.ts +3 -4
- package/lib/components/UIShell/HeaderMenuItem.js +3 -3
- package/lib/components/UIShell/HeaderName.js +1 -1
- package/lib/components/UIShell/HeaderNavigation.d.ts +0 -97
- package/lib/components/UIShell/Link.d.ts +8 -8
- package/lib/components/UIShell/Link.js +7 -5
- package/lib/components/UIShell/SideNav.d.ts +3 -3
- package/lib/components/UIShell/SideNav.js +1 -1
- package/lib/components/UIShell/SideNavHeader.js +0 -1
- package/lib/components/UIShell/SideNavLink.d.ts +3 -4
- package/lib/components/UIShell/SideNavLink.js +8 -3
- package/lib/components/UIShell/SideNavMenu.js +0 -1
- package/lib/components/UIShell/SideNavMenuItem.d.ts +1 -49
- package/lib/components/UIShell/SideNavMenuItem.js +1 -1
- package/lib/components/UIShell/SideNavSwitcher.js +0 -1
- package/lib/components/UIShell/SwitcherItem.d.ts +2 -2
- package/lib/components/UIShell/SwitcherItem.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +13 -11
- package/lib/internal/FloatingMenu.js +2 -1
- package/lib/internal/clamp.d.ts +10 -0
- package/lib/internal/clamp.js +17 -0
- package/lib/internal/useEvent.d.ts +9 -0
- package/lib/internal/useEvent.js +8 -49
- package/lib/internal/useId.js +1 -1
- package/lib/internal/useMatchMedia.d.ts +7 -2
- package/lib/internal/useMatchMedia.js +9 -10
- package/lib/internal/useNoInteractiveChildren.js +4 -2
- package/lib/internal/useOutsideClick.d.ts +1 -1
- package/lib/prop-types/AriaPropTypes.js +1 -1
- package/lib/prop-types/isRequiredOneOf.d.ts +16 -0
- package/lib/prop-types/isRequiredOneOf.js +11 -9
- package/lib/tools/setupGetInstanceId.d.ts +12 -0
- package/lib/tools/setupGetInstanceId.js +7 -8
- package/lib/tools/toggleClass.d.ts +14 -0
- package/lib/tools/toggleClass.js +9 -10
- package/lib/tools/wrapComponent.d.ts +1 -1
- package/lib/types/common.d.ts +1 -6
- package/package.json +15 -15
- package/telemetry.yml +11 -12
- package/es/components/MultiSelect/index.js +0 -13
- package/es/internal/ClickListener.d.ts +0 -13
- package/es/internal/ClickListener.js +0 -47
- package/lib/components/MultiSelect/index.js +0 -19
- package/lib/internal/ClickListener.d.ts +0 -13
- package/lib/internal/ClickListener.js +0 -51
|
@@ -117,7 +117,9 @@ const FileUploader = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
117
117
|
}, state.fileNames.length === 0 ? null : state.fileNames.map((name, index) => /*#__PURE__*/React__default.createElement("span", _extends({
|
|
118
118
|
key: index,
|
|
119
119
|
className: selectedFileClasses,
|
|
120
|
-
ref: node =>
|
|
120
|
+
ref: node => {
|
|
121
|
+
nodes[index] = node;
|
|
122
|
+
} // eslint-disable-line
|
|
121
123
|
}, other), /*#__PURE__*/React__default.createElement(Text, {
|
|
122
124
|
as: "p",
|
|
123
125
|
className: `${prefix}--file-filename`,
|
|
@@ -69,7 +69,7 @@ export interface FileUploaderButtonProps extends Omit<ReactAttr<HTMLButtonElemen
|
|
|
69
69
|
* @deprecated The `tabIndex` prop for `FileUploaderButton` has been deprecated since it now renders a button element by default.
|
|
70
70
|
*/
|
|
71
71
|
tabIndex?: number | string;
|
|
72
|
-
innerRef?: React.RefObject<HTMLLabelElement>;
|
|
72
|
+
innerRef?: React.RefObject<HTMLLabelElement | null>;
|
|
73
73
|
}
|
|
74
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 {
|
|
@@ -55,7 +55,7 @@ export interface FileUploaderDropContainerProps extends Omit<ReactAttr<HTMLButto
|
|
|
55
55
|
/**
|
|
56
56
|
* Ref to pass to the inner button element
|
|
57
57
|
*/
|
|
58
|
-
innerRef?: React.
|
|
58
|
+
innerRef?: React.Ref<HTMLButtonElement>;
|
|
59
59
|
/**
|
|
60
60
|
* @deprecated The `role` prop for `FileUploaderButton` has been deprecated since it now renders a button element by default, and has an implicit role of button.
|
|
61
61
|
*/
|
|
@@ -6,21 +6,20 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import React__default from 'react';
|
|
9
|
+
import React__default, { forwardRef } from 'react';
|
|
10
10
|
import DatePickerInput from '../DatePickerInput/DatePickerInput.js';
|
|
11
11
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
...other
|
|
16
|
-
} = _ref;
|
|
13
|
+
const frFn = forwardRef;
|
|
14
|
+
const FluidDatePickerInput = frFn((props, ref) => {
|
|
17
15
|
return /*#__PURE__*/React__default.createElement(FormContext.Provider, {
|
|
18
16
|
value: {
|
|
19
17
|
isFluid: true
|
|
20
18
|
}
|
|
21
19
|
}, /*#__PURE__*/React__default.createElement(DatePickerInput, _extends({
|
|
22
20
|
ref: ref
|
|
23
|
-
},
|
|
21
|
+
}, props)));
|
|
24
22
|
});
|
|
23
|
+
FluidDatePickerInput.propTypes = DatePickerInput.propTypes;
|
|
25
24
|
|
|
26
25
|
export { FluidDatePickerInput as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2022
|
|
2
|
+
* Copyright IBM Corp. 2022, 2025
|
|
3
3
|
*
|
|
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
7
|
import React, { FunctionComponent } from 'react';
|
|
8
|
-
import { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
|
|
9
|
-
import { FilterableMultiSelectProps } from '../MultiSelect
|
|
8
|
+
import type { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
|
|
9
|
+
import { type FilterableMultiSelectProps } from '../MultiSelect';
|
|
10
10
|
interface OnChangeData<ItemType> {
|
|
11
11
|
selectedItems: ItemType[] | null;
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2022
|
|
2
|
+
* Copyright IBM Corp. 2022, 2025
|
|
3
3
|
*
|
|
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
7
|
import React from 'react';
|
|
8
|
+
import { type MultiSelectProps } from '../MultiSelect';
|
|
8
9
|
import { UseSelectProps } from 'downshift';
|
|
9
|
-
import { MultiSelectProps } from '../MultiSelect/MultiSelect';
|
|
10
10
|
interface OnChangeData<ItemType> {
|
|
11
11
|
selectedItems: ItemType[] | null;
|
|
12
12
|
}
|
|
@@ -9,11 +9,10 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import '../MultiSelect/
|
|
12
|
+
import { FilterableMultiSelect } from '../MultiSelect/FilterableMultiSelect.js';
|
|
13
|
+
import { MultiSelect } from '../MultiSelect/MultiSelect.js';
|
|
13
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
15
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
15
|
-
import FilterableMultiSelect from '../MultiSelect/FilterableMultiSelect.js';
|
|
16
|
-
import MultiSelect from '../MultiSelect/MultiSelect.js';
|
|
17
16
|
|
|
18
17
|
const FluidMultiSelect = /*#__PURE__*/React__default.forwardRef(function FluidMultiSelect(_ref, ref) {
|
|
19
18
|
let {
|
|
@@ -36,7 +35,10 @@ const FluidMultiSelect = /*#__PURE__*/React__default.forwardRef(function FluidMu
|
|
|
36
35
|
React__default.createElement(FilterableMultiSelect, _extends({
|
|
37
36
|
ref: ref,
|
|
38
37
|
className: classNames
|
|
39
|
-
}, other)) :
|
|
38
|
+
}, other)) :
|
|
39
|
+
/*#__PURE__*/
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
React__default.createElement(MultiSelect, _extends({
|
|
40
42
|
ref: ref,
|
|
41
43
|
className: classNames
|
|
42
44
|
}, other)));
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 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
|
+
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import React__default from 'react';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import { FormContext } from '../FluidForm/FormContext.js';
|
|
14
|
+
|
|
15
|
+
const FluidNumberInputSkeleton = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
className,
|
|
18
|
+
...other
|
|
19
|
+
} = _ref;
|
|
20
|
+
const prefix = usePrefix();
|
|
21
|
+
return /*#__PURE__*/React__default.createElement(FormContext.Provider, {
|
|
22
|
+
value: {
|
|
23
|
+
isFluid: true
|
|
24
|
+
}
|
|
25
|
+
}, /*#__PURE__*/React__default.createElement("div", _extends({
|
|
26
|
+
className: cx(`${prefix}--form-item ${prefix}--text-input--fluid__skeleton`, className)
|
|
27
|
+
}, other), /*#__PURE__*/React__default.createElement("span", {
|
|
28
|
+
className: `${prefix}--label ${prefix}--skeleton`
|
|
29
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
30
|
+
className: `${prefix}--skeleton ${prefix}--text-input`
|
|
31
|
+
})));
|
|
32
|
+
};
|
|
33
|
+
FluidNumberInputSkeleton.propTypes = {
|
|
34
|
+
/**
|
|
35
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
36
|
+
*/
|
|
37
|
+
className: PropTypes.string
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export { FluidNumberInputSkeleton as default };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 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
|
+
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import React__default from 'react';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import '../NumberInput/NumberInput.Skeleton.js';
|
|
13
|
+
import { NumberInput } from '../NumberInput/NumberInput.js';
|
|
14
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
|
+
import { FormContext } from '../FluidForm/FormContext.js';
|
|
16
|
+
|
|
17
|
+
const FluidNumberInput = /*#__PURE__*/React__default.forwardRef(function FluidNumberInput(_ref, ref) {
|
|
18
|
+
let {
|
|
19
|
+
className,
|
|
20
|
+
...other
|
|
21
|
+
} = _ref;
|
|
22
|
+
const prefix = usePrefix();
|
|
23
|
+
const classNames = cx(`${prefix}--number-input--fluid`, className);
|
|
24
|
+
return /*#__PURE__*/React__default.createElement(FormContext.Provider, {
|
|
25
|
+
value: {
|
|
26
|
+
isFluid: true
|
|
27
|
+
}
|
|
28
|
+
}, /*#__PURE__*/React__default.createElement(NumberInput, _extends({
|
|
29
|
+
ref: ref,
|
|
30
|
+
className: classNames
|
|
31
|
+
}, other)));
|
|
32
|
+
});
|
|
33
|
+
FluidNumberInput.propTypes = {
|
|
34
|
+
/**
|
|
35
|
+
* `true` to allow empty string.
|
|
36
|
+
*/
|
|
37
|
+
allowEmpty: PropTypes.bool,
|
|
38
|
+
/**
|
|
39
|
+
* Specify an optional className to be applied to the wrapper node
|
|
40
|
+
*/
|
|
41
|
+
className: PropTypes.string,
|
|
42
|
+
/**
|
|
43
|
+
* Optional starting value for uncontrolled state
|
|
44
|
+
*/
|
|
45
|
+
defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
46
|
+
/**
|
|
47
|
+
* Specify if the wheel functionality for the input should be disabled, or not
|
|
48
|
+
*/
|
|
49
|
+
disableWheel: PropTypes.bool,
|
|
50
|
+
/**
|
|
51
|
+
* Specify if the control should be disabled, or not
|
|
52
|
+
*/
|
|
53
|
+
disabled: PropTypes.bool,
|
|
54
|
+
/**
|
|
55
|
+
* Provide a description for up/down icons that can be read by screen readers
|
|
56
|
+
*/
|
|
57
|
+
iconDescription: PropTypes.string,
|
|
58
|
+
/**
|
|
59
|
+
* Specify a custom `id` for the input
|
|
60
|
+
*/
|
|
61
|
+
id: PropTypes.string.isRequired,
|
|
62
|
+
/**
|
|
63
|
+
* Specify if the currently value is invalid.
|
|
64
|
+
*/
|
|
65
|
+
invalid: PropTypes.bool,
|
|
66
|
+
/**
|
|
67
|
+
* Message which is displayed if the value is invalid.
|
|
68
|
+
*/
|
|
69
|
+
invalidText: PropTypes.node,
|
|
70
|
+
/**
|
|
71
|
+
* Generic `label` that will be used as the textual representation of what
|
|
72
|
+
* this field is for
|
|
73
|
+
*/
|
|
74
|
+
label: PropTypes.node,
|
|
75
|
+
/**
|
|
76
|
+
* The maximum value.
|
|
77
|
+
*/
|
|
78
|
+
max: PropTypes.number,
|
|
79
|
+
/**
|
|
80
|
+
* The minimum value.
|
|
81
|
+
*/
|
|
82
|
+
min: PropTypes.number,
|
|
83
|
+
/**
|
|
84
|
+
* Provide an optional handler that is called when the internal state of
|
|
85
|
+
* NumberInput changes. This handler is called with event and state info.
|
|
86
|
+
* `(event, { value, direction }) => void`
|
|
87
|
+
*/
|
|
88
|
+
onChange: PropTypes.func,
|
|
89
|
+
/**
|
|
90
|
+
* Provide an optional function to be called when the up/down button is clicked
|
|
91
|
+
*/
|
|
92
|
+
onClick: PropTypes.func,
|
|
93
|
+
/**
|
|
94
|
+
* Provide an optional function to be called when a key is pressed in the number input
|
|
95
|
+
*/
|
|
96
|
+
onKeyUp: PropTypes.func,
|
|
97
|
+
/**
|
|
98
|
+
* Specify how much the values should increase/decrease upon clicking on up/down button
|
|
99
|
+
*/
|
|
100
|
+
step: PropTypes.number,
|
|
101
|
+
/**
|
|
102
|
+
* Provide custom text for the component for each translation id
|
|
103
|
+
*/
|
|
104
|
+
translateWithId: PropTypes.func,
|
|
105
|
+
/**
|
|
106
|
+
* Specify the value of the input
|
|
107
|
+
*/
|
|
108
|
+
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
109
|
+
/**
|
|
110
|
+
* Specify whether the control is currently in warning state
|
|
111
|
+
*/
|
|
112
|
+
warn: PropTypes.bool,
|
|
113
|
+
/**
|
|
114
|
+
* Provide the text that is displayed when the control is in warning state
|
|
115
|
+
*/
|
|
116
|
+
warnText: PropTypes.node,
|
|
117
|
+
/**
|
|
118
|
+
* Whether or not the component is readonly
|
|
119
|
+
*/
|
|
120
|
+
readOnly: PropTypes.bool
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export { FluidNumberInput as default };
|
|
@@ -9,12 +9,12 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import '../TextInput/
|
|
12
|
+
import TextInput from '../TextInput/TextInput.js';
|
|
13
|
+
import '../TextInput/TextInput.Skeleton.js';
|
|
13
14
|
import '../TextInput/ControlledPasswordInput.js';
|
|
14
15
|
import PasswordInput from '../TextInput/PasswordInput.js';
|
|
15
16
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
17
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
17
|
-
import TextInput from '../TextInput/TextInput.js';
|
|
18
18
|
|
|
19
19
|
const FluidTextInput = /*#__PURE__*/React__default.forwardRef(function FluidTextInput(_ref, ref) {
|
|
20
20
|
let {
|
|
@@ -13,7 +13,7 @@ import React__default from 'react';
|
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
import { useGridSettings } from './GridContext.js';
|
|
15
15
|
|
|
16
|
-
const Column = /*#__PURE__*/React__default.forwardRef(
|
|
16
|
+
const Column = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
17
17
|
let {
|
|
18
18
|
as,
|
|
19
19
|
children,
|
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { PolymorphicComponentPropWithRef } from '../../internal/PolymorphicProps';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
8
9
|
export interface GridBaseProps {
|
|
10
|
+
/**
|
|
11
|
+
* Specify grid alignment. Default is center
|
|
12
|
+
*/
|
|
13
|
+
align?: 'start' | 'center' | 'end';
|
|
9
14
|
/**
|
|
10
15
|
* Pass in content that will be rendered within the `Grid`
|
|
11
16
|
*/
|
|
@@ -33,5 +38,5 @@ export type GridProps<T extends React.ElementType> = PolymorphicComponentPropWit
|
|
|
33
38
|
export interface GridComponent {
|
|
34
39
|
<T extends React.ElementType = 'div'>(props: GridProps<T>): React.ReactElement | null;
|
|
35
40
|
displayName?: string;
|
|
36
|
-
propTypes?:
|
|
41
|
+
propTypes?: PropTypes.WeakValidationMap<GridProps<any>>;
|
|
37
42
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2023
|
|
2
|
+
* Copyright IBM Corp. 2023, 2025
|
|
3
3
|
*
|
|
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
7
|
export declare const levels: readonly ["one", "two", "three"];
|
|
8
|
-
export declare const MIN_LEVEL = 0;
|
|
9
|
-
export declare const MAX_LEVEL: number;
|
|
10
8
|
export declare const LayerLevels: readonly [0, 1, 2];
|
|
9
|
+
export declare const MIN_LEVEL: 0;
|
|
10
|
+
export declare const MAX_LEVEL: 0 | 1 | 2;
|
|
11
11
|
export type LayerLevel = (typeof LayerLevels)[number];
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const levels = ['one', 'two', 'three'];
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const LayerLevels = [0, 1, 2];
|
|
10
|
+
const MIN_LEVEL = LayerLevels[0];
|
|
11
|
+
const MAX_LEVEL = LayerLevels[LayerLevels.length - 1];
|
|
11
12
|
|
|
12
|
-
export { MAX_LEVEL, MIN_LEVEL, levels };
|
|
13
|
+
export { LayerLevels, MAX_LEVEL, MIN_LEVEL, levels };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
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.
|
|
@@ -31,5 +31,7 @@ export interface LayerBaseProps {
|
|
|
31
31
|
level?: LayerLevel;
|
|
32
32
|
}
|
|
33
33
|
export type LayerProps<T extends React.ElementType> = PolymorphicComponentPropWithRef<T, LayerBaseProps>;
|
|
34
|
-
declare const Layer: React.ForwardRefExoticComponent<
|
|
34
|
+
declare const Layer: React.ForwardRefExoticComponent<LayerBaseProps & {
|
|
35
|
+
as?: React.ElementType;
|
|
36
|
+
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<any>>;
|
|
35
37
|
export { Layer };
|
|
@@ -11,7 +11,8 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import { LayerContext } from './LayerContext.js';
|
|
14
|
-
import { levels,
|
|
14
|
+
import { levels, MAX_LEVEL, MIN_LEVEL } from './LayerLevel.js';
|
|
15
|
+
import { clamp } from '../../internal/clamp.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* A custom hook that will return information about the current layer. A common
|
|
@@ -37,7 +38,7 @@ const Layer = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
37
38
|
const prefix = usePrefix();
|
|
38
39
|
const className = cx(`${prefix}--layer-${levels[level]}`, customClassName);
|
|
39
40
|
// The level should be between MIN_LEVEL and MAX_LEVEL
|
|
40
|
-
const value =
|
|
41
|
+
const value = clamp(level + 1, MIN_LEVEL, MAX_LEVEL);
|
|
41
42
|
const BaseComponent = as || 'div';
|
|
42
43
|
return /*#__PURE__*/React__default.createElement(LayerContext.Provider, {
|
|
43
44
|
value: value
|
|
@@ -11,7 +11,8 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import React__default from 'react';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
// First create the component with basic types
|
|
15
|
+
const LinkBase = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
15
16
|
let {
|
|
16
17
|
as: BaseComponent,
|
|
17
18
|
children,
|
|
@@ -54,6 +55,7 @@ const Link = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
54
55
|
className: `${prefix}--link__icon`
|
|
55
56
|
}, /*#__PURE__*/React__default.createElement(Icon, null)));
|
|
56
57
|
});
|
|
58
|
+
const Link = LinkBase;
|
|
57
59
|
Link.displayName = 'Link';
|
|
58
60
|
Link.propTypes = {
|
|
59
61
|
/**
|
|
@@ -9,7 +9,7 @@ export interface MenuProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
|
9
9
|
/**
|
|
10
10
|
* The ref of the containing element, used for positioning and alignment of the menu
|
|
11
11
|
*/
|
|
12
|
-
containerRef?: RefObject<HTMLDivElement>;
|
|
12
|
+
containerRef?: RefObject<HTMLDivElement | null>;
|
|
13
13
|
/**
|
|
14
14
|
* A collection of MenuItems to be rendered within this Menu.
|
|
15
15
|
*/
|
|
@@ -101,18 +101,8 @@ const Menu = /*#__PURE__*/forwardRef(function Menu(_ref, forwardRef) {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
function handleClose(
|
|
105
|
-
|
|
106
|
-
window.addEventListener('keyup', returnFocus, {
|
|
107
|
-
once: true
|
|
108
|
-
});
|
|
109
|
-
} else if (e.type === 'click' && menu.current) {
|
|
110
|
-
menu.current.addEventListener('focusout', returnFocus, {
|
|
111
|
-
once: true
|
|
112
|
-
});
|
|
113
|
-
} else {
|
|
114
|
-
returnFocus();
|
|
115
|
-
}
|
|
104
|
+
function handleClose() {
|
|
105
|
+
returnFocus();
|
|
116
106
|
if (onClose) {
|
|
117
107
|
onClose();
|
|
118
108
|
}
|
|
@@ -123,7 +113,7 @@ const Menu = /*#__PURE__*/forwardRef(function Menu(_ref, forwardRef) {
|
|
|
123
113
|
// if the user presses escape or this is a submenu
|
|
124
114
|
// and the user presses ArrowLeft, close it
|
|
125
115
|
if ((match(e, Escape) || !isRoot && match(e, ArrowLeft)) && onClose) {
|
|
126
|
-
handleClose(
|
|
116
|
+
handleClose();
|
|
127
117
|
} else {
|
|
128
118
|
focusItem(e);
|
|
129
119
|
}
|
|
@@ -158,7 +148,7 @@ const Menu = /*#__PURE__*/forwardRef(function Menu(_ref, forwardRef) {
|
|
|
158
148
|
}
|
|
159
149
|
function handleBlur(e) {
|
|
160
150
|
if (open && onClose && isRoot && !menu.current?.contains(e.relatedTarget)) {
|
|
161
|
-
handleClose(
|
|
151
|
+
handleClose();
|
|
162
152
|
}
|
|
163
153
|
}
|
|
164
154
|
function fitValue(range, axis) {
|
|
@@ -98,18 +98,28 @@ const MenuItem = /*#__PURE__*/forwardRef(function MenuItem(_ref, forwardRef) {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
+
|
|
102
|
+
// Avoid stray keyup event from MenuButton affecting MenuItem, and vice versa.
|
|
103
|
+
// Keyboard click is handled differently for <button> vs. <li> and for Enter vs. Space. See
|
|
104
|
+
// https://www.stefanjudis.com/today-i-learned/keyboard-button-clicks-with-space-and-enter-behave-differently/.
|
|
105
|
+
const pendingKeyboardClick = useRef(false);
|
|
106
|
+
const keyboardClickEvent = e => match(e, Enter) || match(e, Space);
|
|
101
107
|
function handleKeyDown(e) {
|
|
102
108
|
if (hasChildren && match(e, ArrowRight)) {
|
|
103
109
|
openSubmenu();
|
|
104
110
|
e.stopPropagation();
|
|
105
111
|
}
|
|
106
|
-
|
|
107
|
-
handleClick(e);
|
|
108
|
-
}
|
|
112
|
+
pendingKeyboardClick.current = keyboardClickEvent(e);
|
|
109
113
|
if (rest.onKeyDown) {
|
|
110
114
|
rest.onKeyDown(e);
|
|
111
115
|
}
|
|
112
116
|
}
|
|
117
|
+
function handleKeyUp(e) {
|
|
118
|
+
if (pendingKeyboardClick.current && keyboardClickEvent(e)) {
|
|
119
|
+
handleClick(e);
|
|
120
|
+
}
|
|
121
|
+
pendingKeyboardClick.current = false;
|
|
122
|
+
}
|
|
113
123
|
const classNames = cx(className, `${prefix}--menu-item`, {
|
|
114
124
|
[`${prefix}--menu-item--disabled`]: isDisabled,
|
|
115
125
|
[`${prefix}--menu-item--danger`]: isDanger
|
|
@@ -162,7 +172,8 @@ const MenuItem = /*#__PURE__*/forwardRef(function MenuItem(_ref, forwardRef) {
|
|
|
162
172
|
"aria-haspopup": hasChildren ?? undefined,
|
|
163
173
|
"aria-expanded": hasChildren ? submenuOpen : undefined,
|
|
164
174
|
onClick: handleClick,
|
|
165
|
-
onKeyDown: handleKeyDown
|
|
175
|
+
onKeyDown: handleKeyDown,
|
|
176
|
+
onKeyUp: handleKeyUp
|
|
166
177
|
}, getReferenceProps()), /*#__PURE__*/React__default.createElement("div", {
|
|
167
178
|
className: `${prefix}--menu-item__selection-icon`
|
|
168
179
|
}, rest['aria-checked'] && (_Checkmark || (_Checkmark = /*#__PURE__*/React__default.createElement(Checkmark, null)))), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -10,7 +10,7 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { Close } from '@carbon/icons-react';
|
|
13
|
-
import toggleClass from '../../tools/toggleClass.js';
|
|
13
|
+
import { toggleClass } from '../../tools/toggleClass.js';
|
|
14
14
|
import Button from '../Button/Button.js';
|
|
15
15
|
import '../Button/Button.Skeleton.js';
|
|
16
16
|
import ButtonSet from '../ButtonSet/ButtonSet.js';
|
|
@@ -95,12 +95,15 @@ const Modal = /*#__PURE__*/React__default.forwardRef(function Modal(_ref, ref) {
|
|
|
95
95
|
return !onSecondarySubmit && element === secondaryButton.current || element.classList.contains(modalCloseButtonClass);
|
|
96
96
|
}
|
|
97
97
|
function handleKeyDown(evt) {
|
|
98
|
+
const {
|
|
99
|
+
target
|
|
100
|
+
} = evt;
|
|
98
101
|
evt.stopPropagation();
|
|
99
102
|
if (open) {
|
|
100
103
|
if (match(evt, Escape)) {
|
|
101
104
|
onRequestClose(evt);
|
|
102
105
|
}
|
|
103
|
-
if (match(evt, Enter) && shouldSubmitOnEnter && !isCloseButton(
|
|
106
|
+
if (match(evt, Enter) && shouldSubmitOnEnter && target instanceof Element && !isCloseButton(target) && document.activeElement !== button.current) {
|
|
104
107
|
onRequestSubmit(evt);
|
|
105
108
|
}
|
|
106
109
|
if (focusTrapWithoutSentinels && !enableDialogElement && match(evt, Tab) && innerModal.current) {
|
|
@@ -62,8 +62,8 @@ export default class ModalWrapper extends React.Component<ModalWrapperProps, Mod
|
|
|
62
62
|
triggerButtonKind: PropTypes.Requireable<"primary" | "secondary" | "danger" | "ghost" | "danger--primary" | "danger--ghost" | "danger--tertiary" | "tertiary">;
|
|
63
63
|
withHeader: PropTypes.Requireable<boolean>;
|
|
64
64
|
};
|
|
65
|
-
triggerButton: React.RefObject<HTMLButtonElement>;
|
|
66
|
-
modal: React.RefObject<HTMLDivElement>;
|
|
65
|
+
triggerButton: React.RefObject<HTMLButtonElement | null>;
|
|
66
|
+
modal: React.RefObject<HTMLDivElement | null>;
|
|
67
67
|
state: {
|
|
68
68
|
isOpen: boolean;
|
|
69
69
|
};
|
|
@@ -191,11 +191,11 @@ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSorting
|
|
|
191
191
|
*/
|
|
192
192
|
warnText?: ReactNode;
|
|
193
193
|
}
|
|
194
|
-
declare const FilterableMultiSelect: {
|
|
195
|
-
<ItemType>(props: FilterableMultiSelectProps<ItemType>): ReactElement
|
|
194
|
+
export declare const FilterableMultiSelect: {
|
|
195
|
+
<ItemType>(props: FilterableMultiSelectProps<ItemType>): ReactElement<any>;
|
|
196
196
|
propTypes?: any;
|
|
197
197
|
contextTypes?: any;
|
|
198
198
|
defaultProps?: any;
|
|
199
199
|
displayName?: any;
|
|
200
200
|
};
|
|
201
|
-
export
|
|
201
|
+
export {};
|
|
@@ -11,7 +11,7 @@ import cx from 'classnames';
|
|
|
11
11
|
import Downshift, { useCombobox, useMultipleSelection } from 'downshift';
|
|
12
12
|
import isEqual from 'react-fast-compare';
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
|
-
import React__default, { useContext, useRef, useState, useLayoutEffect, useMemo, useEffect } from 'react';
|
|
14
|
+
import React__default, { forwardRef, useContext, useRef, useState, useLayoutEffect, useMemo, useEffect } from 'react';
|
|
15
15
|
import { defaultFilterItems } from '../ComboBox/tools/filter.js';
|
|
16
16
|
import { sortingPropTypes } from './MultiSelectPropTypes.js';
|
|
17
17
|
import ListBox from '../ListBox/index.js';
|
|
@@ -61,7 +61,7 @@ const {
|
|
|
61
61
|
* ends up just being defined as "string".)
|
|
62
62
|
*/
|
|
63
63
|
|
|
64
|
-
const FilterableMultiSelect = /*#__PURE__*/
|
|
64
|
+
const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSelect(_ref, ref) {
|
|
65
65
|
let {
|
|
66
66
|
autoAlign = false,
|
|
67
67
|
className: containerClassName,
|
|
@@ -647,6 +647,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default.forwardRef(function Fi
|
|
|
647
647
|
}, item)) : itemText)));
|
|
648
648
|
}) : null)), !inline && !invalid && !warn ? helper : null);
|
|
649
649
|
});
|
|
650
|
+
FilterableMultiSelect.displayName = 'FilterableMultiSelect';
|
|
650
651
|
FilterableMultiSelect.propTypes = {
|
|
651
652
|
/**
|
|
652
653
|
* Deprecated, aria-label is no longer needed
|
|
@@ -800,4 +801,4 @@ FilterableMultiSelect.propTypes = {
|
|
|
800
801
|
warnText: PropTypes.node
|
|
801
802
|
};
|
|
802
803
|
|
|
803
|
-
export { FilterableMultiSelect
|
|
804
|
+
export { FilterableMultiSelect };
|
|
@@ -173,9 +173,5 @@ export interface MultiSelectProps<ItemType> extends MultiSelectSortingProps<Item
|
|
|
173
173
|
*/
|
|
174
174
|
warnText?: ReactNode;
|
|
175
175
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
<ItemType>(props: MultiSelectComponentProps<ItemType>): React.ReactElement | null;
|
|
179
|
-
}
|
|
180
|
-
declare const _default: MultiSelectComponent;
|
|
181
|
-
export default _default;
|
|
176
|
+
export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps<unknown> & React.RefAttributes<HTMLButtonElement>>;
|
|
177
|
+
export {};
|