@carbon/react 1.78.2 → 1.79.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 +835 -835
- package/es/components/Accordion/AccordionItem.js +2 -2
- package/es/components/Button/Button.d.ts +2 -3
- package/es/components/Button/Button.js +29 -19
- package/es/components/Button/ButtonBase.js +3 -1
- package/es/components/ChatButton/ChatButton.d.ts +2 -3
- package/es/components/ChatButton/ChatButton.js +1 -2
- package/es/components/ComboBox/ComboBox.js +34 -24
- package/es/components/ComposedModal/ComposedModal.js +65 -51
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +2 -2
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +1 -1
- package/es/components/ContentSwitcher/ContentSwitcher.js +3 -3
- package/es/components/DataTable/TableBatchAction.d.ts +3 -3
- package/es/components/DataTable/TableBatchAction.js +1 -1
- package/es/components/DataTable/TableContainer.d.ts +1 -1
- package/es/components/DataTable/TableContainer.js +5 -4
- package/es/components/DataTable/TableExpandHeader.d.ts +6 -5
- package/es/components/DataTable/TableToolbarMenu.d.ts +2 -2
- package/es/components/DataTable/TableToolbarMenu.js +1 -1
- package/es/components/DatePicker/DatePicker.js +2 -2
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/es/components/Dialog/index.d.ts +42 -4
- package/es/components/Dialog/index.js +177 -0
- package/es/components/ExpandableSearch/ExpandableSearch.js +2 -2
- package/es/components/FeatureFlags/index.d.ts +3 -1
- package/es/components/FeatureFlags/index.js +3 -0
- package/es/components/FileUploader/FileUploader.d.ts +1 -1
- package/es/components/FileUploader/FileUploader.js +2 -2
- package/es/components/FileUploader/FileUploaderButton.js +2 -2
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +6 -4
- package/es/components/FileUploader/FileUploaderItem.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +2 -2
- package/es/components/Grid/CSSGrid.js +18 -14
- package/es/components/Grid/Column.d.ts +2 -2
- package/es/components/Grid/Column.js +7 -8
- package/es/components/Grid/FlexGrid.js +7 -6
- package/es/components/Grid/GridTypes.d.ts +5 -3
- package/es/components/IconButton/index.d.ts +2 -2
- package/es/components/IconButton/index.js +4 -4
- package/es/components/Layer/index.d.ts +4 -6
- package/es/components/Layer/index.js +5 -6
- package/es/components/Link/Link.d.ts +2 -3
- package/es/components/Link/Link.js +1 -2
- package/es/components/ListBox/ListBoxMenuItem.d.ts +3 -3
- package/es/components/ListBox/ListBoxMenuItem.js +37 -15
- package/es/components/Menu/Menu.js +2 -2
- package/es/components/Menu/MenuItem.d.ts +2 -2
- package/es/components/Menu/MenuItem.js +3 -3
- package/es/components/Modal/Modal.js +121 -49
- package/es/components/ModalWrapper/ModalWrapper.js +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/MultiSelect/index.d.ts +1 -1
- package/es/components/MultiSelect/index.js +1 -8
- package/es/components/Notification/Notification.d.ts +5 -13
- package/es/components/Notification/Notification.js +3 -4
- package/es/components/OverflowMenu/OverflowMenu.d.ts +22 -201
- package/es/components/OverflowMenu/OverflowMenu.js +269 -338
- package/es/components/OverflowMenu/index.d.ts +5 -5
- package/es/components/OverflowMenu/index.js +2 -2
- package/es/components/OverflowMenu/next/index.d.ts +4 -4
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/es/components/ProgressIndicator/ProgressIndicator.js +2 -2
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Search/Search.d.ts +2 -3
- package/es/components/Search/Search.js +4 -6
- package/es/components/Slider/Slider.d.ts +39 -44
- package/es/components/Slider/Slider.js +57 -59
- package/es/components/Tabs/Tabs.d.ts +3 -6
- package/es/components/Tabs/Tabs.js +16 -18
- package/es/components/Tag/DismissibleTag.d.ts +3 -5
- package/es/components/Tag/DismissibleTag.js +1 -2
- package/es/components/Tag/OperationalTag.d.ts +2 -3
- package/es/components/Tag/OperationalTag.js +1 -2
- package/es/components/Tag/SelectableTag.d.ts +3 -5
- package/es/components/Tag/SelectableTag.js +1 -2
- package/es/components/Tag/Tag.d.ts +2 -3
- package/es/components/Tag/Tag.js +1 -2
- package/es/components/Tile/Tile.d.ts +3 -5
- package/es/components/Tile/Tile.js +16 -10
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/Tooltip/DefinitionTooltip.js +2 -2
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/Tooltip/Tooltip.js +2 -2
- package/es/components/TreeView/TreeNode.d.ts +3 -5
- package/es/components/TreeView/TreeNode.js +3 -4
- package/es/components/TreeView/TreeView.js +2 -2
- package/es/components/UIShell/HeaderContainer.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +2 -2
- package/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/components/UIShell/SideNav.d.ts +1 -1
- package/es/components/UIShell/SideNav.js +2 -2
- package/es/components/UIShell/SideNavHeader.d.ts +2 -3
- package/es/components/UIShell/SideNavHeader.js +1 -2
- package/es/components/UIShell/SideNavLink.d.ts +2 -2
- package/es/components/UIShell/SideNavLink.js +1 -1
- package/es/components/UIShell/SideNavMenu.d.ts +2 -2
- package/es/components/UIShell/SideNavMenu.js +3 -3
- package/es/components/UIShell/SwitcherItem.js +2 -2
- package/es/index.js +1 -1
- package/es/internal/FloatingMenu.d.ts +2 -2
- package/es/internal/FloatingMenu.js +8 -5
- package/es/internal/OptimizedResize.d.ts +18 -0
- package/es/internal/OptimizedResize.js +21 -24
- package/es/internal/createClassWrapper.d.ts +3 -3
- package/es/internal/createClassWrapper.js +4 -4
- package/es/internal/keyboard/index.d.ts +9 -0
- package/es/internal/keyboard/keys.d.ts +23 -0
- package/es/internal/keyboard/keys.js +2 -2
- package/es/internal/keyboard/match.d.ts +26 -0
- package/es/internal/keyboard/match.js +17 -41
- package/es/internal/keyboard/navigation.d.ts +37 -0
- package/es/internal/keyboard/navigation.js +15 -27
- package/es/internal/useMatchMedia.d.ts +8 -0
- package/es/internal/useMatchMedia.js +10 -20
- package/es/internal/useMergedRefs.js +3 -0
- package/es/internal/useNormalizedInputProps.d.ts +52 -0
- package/es/internal/useNormalizedInputProps.js +9 -36
- package/lib/components/Accordion/AccordionItem.js +2 -2
- package/lib/components/Button/Button.d.ts +2 -3
- package/lib/components/Button/Button.js +29 -19
- package/lib/components/Button/ButtonBase.js +3 -1
- package/lib/components/ChatButton/ChatButton.d.ts +2 -3
- package/lib/components/ChatButton/ChatButton.js +1 -2
- package/lib/components/ComboBox/ComboBox.js +34 -24
- package/lib/components/ComposedModal/ComposedModal.js +64 -50
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +2 -2
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +1 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.js +3 -3
- package/lib/components/DataTable/TableBatchAction.d.ts +3 -3
- package/lib/components/DataTable/TableBatchAction.js +1 -1
- package/lib/components/DataTable/TableContainer.d.ts +1 -1
- package/lib/components/DataTable/TableContainer.js +5 -4
- package/lib/components/DataTable/TableExpandHeader.d.ts +6 -5
- package/lib/components/DataTable/TableToolbarMenu.d.ts +2 -2
- package/lib/components/DataTable/TableToolbarMenu.js +1 -1
- package/lib/components/DatePicker/DatePicker.js +2 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/lib/components/Dialog/index.d.ts +42 -4
- package/lib/components/Dialog/index.js +190 -0
- package/lib/components/ExpandableSearch/ExpandableSearch.js +2 -2
- package/lib/components/FeatureFlags/index.d.ts +3 -1
- package/lib/components/FeatureFlags/index.js +3 -0
- package/lib/components/FileUploader/FileUploader.d.ts +1 -1
- package/lib/components/FileUploader/FileUploader.js +2 -2
- package/lib/components/FileUploader/FileUploaderButton.js +2 -2
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +6 -4
- package/lib/components/FileUploader/FileUploaderItem.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +2 -2
- package/lib/components/Grid/CSSGrid.js +18 -14
- package/lib/components/Grid/Column.d.ts +2 -2
- package/lib/components/Grid/Column.js +7 -8
- package/lib/components/Grid/FlexGrid.js +7 -6
- package/lib/components/Grid/GridTypes.d.ts +5 -3
- package/lib/components/IconButton/index.d.ts +2 -2
- package/lib/components/IconButton/index.js +4 -4
- package/lib/components/Layer/index.d.ts +4 -6
- package/lib/components/Layer/index.js +5 -6
- package/lib/components/Link/Link.d.ts +2 -3
- package/lib/components/Link/Link.js +1 -2
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +3 -3
- package/lib/components/ListBox/ListBoxMenuItem.js +36 -14
- package/lib/components/Menu/Menu.js +2 -2
- package/lib/components/Menu/MenuItem.d.ts +2 -2
- package/lib/components/Menu/MenuItem.js +3 -3
- package/lib/components/Modal/Modal.js +123 -51
- package/lib/components/ModalWrapper/ModalWrapper.js +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/lib/components/MultiSelect/MultiSelect.js +2 -2
- package/lib/components/MultiSelect/index.d.ts +1 -1
- package/lib/components/MultiSelect/index.js +1 -8
- package/lib/components/Notification/Notification.d.ts +5 -13
- package/lib/components/Notification/Notification.js +3 -4
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +22 -201
- package/lib/components/OverflowMenu/OverflowMenu.js +268 -336
- package/lib/components/OverflowMenu/index.d.ts +5 -5
- package/lib/components/OverflowMenu/index.js +2 -2
- package/lib/components/OverflowMenu/next/index.d.ts +4 -4
- package/lib/components/OverflowMenu/next/index.js +1 -1
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -2
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Search/Search.d.ts +2 -3
- package/lib/components/Search/Search.js +4 -6
- package/lib/components/Slider/Slider.d.ts +39 -44
- package/lib/components/Slider/Slider.js +57 -59
- package/lib/components/Tabs/Tabs.d.ts +3 -6
- package/lib/components/Tabs/Tabs.js +16 -18
- package/lib/components/Tag/DismissibleTag.d.ts +3 -5
- package/lib/components/Tag/DismissibleTag.js +1 -2
- package/lib/components/Tag/OperationalTag.d.ts +2 -3
- package/lib/components/Tag/OperationalTag.js +1 -2
- package/lib/components/Tag/SelectableTag.d.ts +3 -5
- package/lib/components/Tag/SelectableTag.js +1 -2
- package/lib/components/Tag/Tag.d.ts +2 -3
- package/lib/components/Tag/Tag.js +1 -2
- package/lib/components/Tile/Tile.d.ts +3 -5
- package/lib/components/Tile/Tile.js +16 -10
- package/lib/components/Toggletip/index.js +2 -2
- package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.js +2 -2
- package/lib/components/TreeView/TreeNode.d.ts +3 -5
- package/lib/components/TreeView/TreeNode.js +3 -4
- package/lib/components/TreeView/TreeView.js +2 -2
- package/lib/components/UIShell/HeaderContainer.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +2 -2
- package/lib/components/UIShell/HeaderPanel.js +2 -2
- package/lib/components/UIShell/SideNav.d.ts +1 -1
- package/lib/components/UIShell/SideNav.js +2 -2
- package/lib/components/UIShell/SideNavHeader.d.ts +2 -3
- package/lib/components/UIShell/SideNavHeader.js +1 -2
- package/lib/components/UIShell/SideNavLink.d.ts +2 -2
- package/lib/components/UIShell/SideNavLink.js +1 -1
- package/lib/components/UIShell/SideNavMenu.d.ts +2 -2
- package/lib/components/UIShell/SideNavMenu.js +3 -3
- package/lib/components/UIShell/SwitcherItem.js +2 -2
- package/lib/index.js +2 -2
- package/lib/internal/FloatingMenu.d.ts +2 -2
- package/lib/internal/FloatingMenu.js +9 -6
- package/lib/internal/OptimizedResize.d.ts +18 -0
- package/lib/internal/OptimizedResize.js +21 -24
- package/lib/internal/createClassWrapper.d.ts +3 -3
- package/lib/internal/createClassWrapper.js +4 -4
- package/lib/internal/keyboard/index.d.ts +9 -0
- package/lib/internal/keyboard/keys.d.ts +23 -0
- package/lib/internal/keyboard/keys.js +2 -2
- package/lib/internal/keyboard/match.d.ts +26 -0
- package/lib/internal/keyboard/match.js +17 -41
- package/lib/internal/keyboard/navigation.d.ts +37 -0
- package/lib/internal/keyboard/navigation.js +15 -27
- package/lib/internal/useMatchMedia.d.ts +8 -0
- package/lib/internal/useMatchMedia.js +10 -20
- package/lib/internal/useMergedRefs.js +3 -0
- package/lib/internal/useNormalizedInputProps.d.ts +52 -0
- package/lib/internal/useNormalizedInputProps.js +9 -36
- package/package.json +6 -6
- package/scss/components/dialog/_dialog.scss +9 -0
- package/scss/components/dialog/_index.scss +9 -0
- package/telemetry.yml +1 -0
- package/es/components/Modal/next/index.d.ts +0 -171
- package/es/internal/focus/index.js +0 -15
- package/es/internal/useEffectOnce.js +0 -30
- package/lib/components/Modal/next/index.d.ts +0 -171
- package/lib/internal/focus/index.js +0 -19
- package/lib/internal/useEffectOnce.js +0 -34
|
@@ -1,13 +1,13 @@
|
|
|
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.
|
|
6
6
|
*/
|
|
7
7
|
import { type OverflowMenuProps } from './OverflowMenu';
|
|
8
|
-
declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
8
|
+
declare const OverflowMenu: {
|
|
9
|
+
(props: OverflowMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
12
|
export default OverflowMenu;
|
|
13
13
|
export { OverflowMenu, type OverflowMenuProps };
|
|
@@ -20,10 +20,10 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
20
20
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
21
|
|
|
22
22
|
const OverflowMenuV11 = createClassWrapper.createClassWrapper(OverflowMenu$1.OverflowMenu);
|
|
23
|
-
|
|
23
|
+
const OverflowMenu = props => {
|
|
24
24
|
const enableV12OverflowMenu = index.useFeatureFlag('enable-v12-overflowmenu');
|
|
25
25
|
return enableV12OverflowMenu ? /*#__PURE__*/React__default["default"].createElement(index$1.OverflowMenu, props) : /*#__PURE__*/React__default["default"].createElement(OverflowMenuV11, props);
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
OverflowMenu.displayName = 'OverflowMenu';
|
|
28
28
|
|
|
29
29
|
exports.OverflowMenu = OverflowMenu;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2020,
|
|
2
|
+
* Copyright IBM Corp. 2020, 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
|
-
import React, { type
|
|
7
|
+
import React, { type ElementType } from 'react';
|
|
8
8
|
interface OverflowMenuProps {
|
|
9
9
|
/**
|
|
10
10
|
* **Experimental**: Will attempt to automatically align the floating element to avoid collisions with the viewport and being clipped by ancestor elements.
|
|
@@ -27,9 +27,9 @@ interface OverflowMenuProps {
|
|
|
27
27
|
*/
|
|
28
28
|
menuAlignment?: 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* A component used to render an icon.
|
|
31
31
|
*/
|
|
32
|
-
renderIcon?:
|
|
32
|
+
renderIcon?: ElementType;
|
|
33
33
|
/**
|
|
34
34
|
* Specify the size of the menu, from a list of available sizes.
|
|
35
35
|
*/
|
|
@@ -175,7 +175,7 @@ OverflowMenu.propTypes = {
|
|
|
175
175
|
*/
|
|
176
176
|
menuAlignment: PropTypes__default["default"].oneOf(['top-start', 'top-end', 'bottom-start', 'bottom-end']),
|
|
177
177
|
/**
|
|
178
|
-
*
|
|
178
|
+
* A component used to render an icon.
|
|
179
179
|
*/
|
|
180
180
|
// @ts-expect-error: PropTypes are not expressive enough to cover this case
|
|
181
181
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
@@ -13,12 +13,12 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var cx = require('classnames');
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var React = require('react');
|
|
16
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
17
|
+
var match = require('../../internal/keyboard/match.js');
|
|
16
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
19
|
var warning = require('../../internal/warning.js');
|
|
18
20
|
require('../Text/index.js');
|
|
19
|
-
var match = require('../../internal/keyboard/match.js');
|
|
20
21
|
var Text = require('../Text/Text.js');
|
|
21
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
22
22
|
|
|
23
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
24
|
|
|
@@ -13,12 +13,12 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var cx = require('classnames');
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var React = require('react');
|
|
16
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
17
|
+
var match = require('../../internal/keyboard/match.js');
|
|
16
18
|
var iconsReact = require('@carbon/icons-react');
|
|
17
19
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
20
|
require('../Text/index.js');
|
|
19
|
-
var match = require('../../internal/keyboard/match.js');
|
|
20
21
|
var Text = require('../Text/Text.js');
|
|
21
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
22
22
|
|
|
23
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
24
|
|
|
@@ -14,15 +14,15 @@ var iconsReact = require('@carbon/icons-react');
|
|
|
14
14
|
var cx = require('classnames');
|
|
15
15
|
var PropTypes = require('prop-types');
|
|
16
16
|
var React = require('react');
|
|
17
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
18
|
+
var match = require('../../internal/keyboard/match.js');
|
|
17
19
|
var useId = require('../../internal/useId.js');
|
|
18
20
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
21
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
20
22
|
var noopFn = require('../../internal/noopFn.js');
|
|
21
23
|
require('../Text/index.js');
|
|
22
24
|
var index = require('../FeatureFlags/index.js');
|
|
23
|
-
var match = require('../../internal/keyboard/match.js');
|
|
24
25
|
var Text = require('../Text/Text.js');
|
|
25
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
26
26
|
|
|
27
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
28
|
|
|
@@ -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.
|
|
@@ -62,8 +62,7 @@ export interface SearchProps extends InputPropsBase {
|
|
|
62
62
|
*/
|
|
63
63
|
placeholder?: string;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
66
|
-
* Can be a React component class
|
|
65
|
+
* A component used to render an icon.
|
|
67
66
|
*/
|
|
68
67
|
renderIcon?: ComponentType | FunctionComponent;
|
|
69
68
|
/**
|
|
@@ -14,7 +14,8 @@ var iconsReact = require('@carbon/icons-react');
|
|
|
14
14
|
var cx = require('classnames');
|
|
15
15
|
var PropTypes = require('prop-types');
|
|
16
16
|
var React = require('react');
|
|
17
|
-
var
|
|
17
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
18
|
+
var match = require('../../internal/keyboard/match.js');
|
|
18
19
|
var useId = require('../../internal/useId.js');
|
|
19
20
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
21
|
var events = require('../../tools/events.js');
|
|
@@ -22,8 +23,6 @@ var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
|
22
23
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
23
24
|
require('../FluidForm/FluidForm.js');
|
|
24
25
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
25
|
-
var match = require('../../internal/keyboard/match.js');
|
|
26
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
27
26
|
|
|
28
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
29
28
|
|
|
@@ -100,7 +99,7 @@ const Search = /*#__PURE__*/React__default["default"].forwardRef(function Search
|
|
|
100
99
|
onChange(clearedEvt);
|
|
101
100
|
onClear();
|
|
102
101
|
setHasContent(false);
|
|
103
|
-
|
|
102
|
+
inputRef.current?.focus();
|
|
104
103
|
}
|
|
105
104
|
function handleChange(event) {
|
|
106
105
|
setHasContent(event.target.value !== '');
|
|
@@ -231,8 +230,7 @@ Search.propTypes = {
|
|
|
231
230
|
*/
|
|
232
231
|
placeholder: PropTypes__default["default"].string,
|
|
233
232
|
/**
|
|
234
|
-
*
|
|
235
|
-
* Can be a React component class
|
|
233
|
+
* A component used to render an icon.
|
|
236
234
|
*/
|
|
237
235
|
// @ts-expect-error: PropTypes are not expressive enough to cover this case
|
|
238
236
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
@@ -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.
|
|
@@ -164,11 +164,6 @@ export interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputEle
|
|
|
164
164
|
*/
|
|
165
165
|
warnText?: React.ReactNode;
|
|
166
166
|
}
|
|
167
|
-
interface CalcValueProps {
|
|
168
|
-
clientX?: number;
|
|
169
|
-
value?: number;
|
|
170
|
-
useRawValue?: boolean;
|
|
171
|
-
}
|
|
172
167
|
interface CalcLeftPercentProps {
|
|
173
168
|
clientX?: number;
|
|
174
169
|
value?: number;
|
|
@@ -355,11 +350,13 @@ declare class Slider extends PureComponent<SliderProps> {
|
|
|
355
350
|
*/
|
|
356
351
|
clamp(val: any, min: any, max: any): number;
|
|
357
352
|
/**
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
353
|
+
* Rounds a given value to the nearest step defined by the slider's `step`
|
|
354
|
+
* prop.
|
|
355
|
+
*
|
|
356
|
+
* @param value - The value to adjust to the nearest step. Defaults to `0`.
|
|
357
|
+
* @returns The value rounded to the precision determined by the step.
|
|
361
358
|
*/
|
|
362
|
-
nearestStepValue(value
|
|
359
|
+
nearestStepValue(value?: number): number;
|
|
363
360
|
/**
|
|
364
361
|
* Sets up "drag" event handlers and calls `this.onDrag` in case dragging
|
|
365
362
|
* started on somewhere other than the thumb without a corresponding "move"
|
|
@@ -413,46 +410,44 @@ declare class Slider extends PureComponent<SliderProps> {
|
|
|
413
410
|
onInputKeyDown: (evt: any) => void;
|
|
414
411
|
processNewInputValue: (input: HTMLInputElement) => void;
|
|
415
412
|
calcLeftPercent: ({ clientX, value, range }: CalcLeftPercentProps) => number;
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
calcValue: ({ clientX, value, useRawValue }: CalcValueProps) => {
|
|
413
|
+
/**
|
|
414
|
+
* Calculates the discrete value (snapped to the nearest step) along
|
|
415
|
+
* with the corresponding handle position percentage.
|
|
416
|
+
*/
|
|
417
|
+
calcDiscreteValueAndPercent: ({ leftPercent, }: {
|
|
418
|
+
/** The percentage representing the position on the track. */
|
|
419
|
+
leftPercent: number;
|
|
420
|
+
}) => {
|
|
421
|
+
discreteValue: number;
|
|
422
|
+
discretePercent: number;
|
|
423
|
+
};
|
|
424
|
+
/**
|
|
425
|
+
* Calculates the slider's value and handle position based on either a
|
|
426
|
+
* mouse/touch event or an explicit value.
|
|
427
|
+
*/
|
|
428
|
+
calcValue: ({ clientX, value, useRawValue, }: {
|
|
429
|
+
/** The x-coordinate from a mouse/touch event. */
|
|
430
|
+
clientX?: number;
|
|
431
|
+
/** Value to base the calculations on (if no `clientX`). */
|
|
432
|
+
value?: number;
|
|
433
|
+
/** Whether to bypass the stepping logic and use the raw value. */
|
|
434
|
+
useRawValue?: boolean;
|
|
435
|
+
}) => {
|
|
440
436
|
value: number | undefined;
|
|
441
437
|
left: number;
|
|
442
438
|
};
|
|
443
439
|
calcDistanceToHandle: (handle: HandlePosition, clientX: any) => number;
|
|
444
440
|
/**
|
|
445
|
-
*
|
|
441
|
+
* Calculates a new slider value based on the current value, a change delta,
|
|
442
|
+
* and a step.
|
|
446
443
|
*
|
|
447
|
-
* @param
|
|
448
|
-
*
|
|
449
|
-
* @param
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
*/
|
|
455
|
-
calcValueForDelta: (currentValue: any, delta: any, step?: number) => any;
|
|
444
|
+
* @param currentValue - The starting value from which the slider is moving.
|
|
445
|
+
* @param delta - The amount to adjust the current value by.
|
|
446
|
+
* @param step - The step. Defaults to `1`.
|
|
447
|
+
* @returns The new slider value, rounded to the same number of decimal places
|
|
448
|
+
* as the step.
|
|
449
|
+
*/
|
|
450
|
+
calcValueForDelta: (currentValue: number, delta: number, step?: number) => number;
|
|
456
451
|
/**
|
|
457
452
|
* Sets state relevant to the given handle position.
|
|
458
453
|
*
|
|
@@ -14,6 +14,7 @@ var React = require('react');
|
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var keys = require('../../internal/keyboard/keys.js');
|
|
17
|
+
var match = require('../../internal/keyboard/match.js');
|
|
17
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
19
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
19
20
|
var index = require('../FeatureFlags/index.js');
|
|
@@ -23,7 +24,6 @@ require('../Tooltip/DefinitionTooltip.js');
|
|
|
23
24
|
var Tooltip = require('../Tooltip/Tooltip.js');
|
|
24
25
|
var SliderHandles = require('./SliderHandles.js');
|
|
25
26
|
var throttle = require('../../node_modules/es-toolkit/dist/compat/function/throttle.mjs.js');
|
|
26
|
-
var match = require('../../internal/keyboard/match.js');
|
|
27
27
|
var Text = require('../Text/Text.js');
|
|
28
28
|
|
|
29
29
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -326,7 +326,7 @@ class Slider extends React.PureComponent {
|
|
|
326
326
|
value,
|
|
327
327
|
left
|
|
328
328
|
} = this.calcValue({
|
|
329
|
-
value: this.calcValueForDelta(currentValue, delta, this.props.step)
|
|
329
|
+
value: this.calcValueForDelta(currentValue ?? this.props.min, delta, this.props.step)
|
|
330
330
|
});
|
|
331
331
|
this.setValueLeftForHandle(this.state.activeHandle, {
|
|
332
332
|
value: this.nearestStepValue(value),
|
|
@@ -533,67 +533,65 @@ class Slider extends React.PureComponent {
|
|
|
533
533
|
// re-assure Typescript, return 0.
|
|
534
534
|
return 0;
|
|
535
535
|
});
|
|
536
|
-
|
|
536
|
+
/**
|
|
537
|
+
* Calculates the discrete value (snapped to the nearest step) along
|
|
538
|
+
* with the corresponding handle position percentage.
|
|
539
|
+
*/
|
|
540
|
+
_rollupPluginBabelHelpers.defineProperty(this, "calcDiscreteValueAndPercent", _ref3 => {
|
|
537
541
|
let {
|
|
538
|
-
leftPercent
|
|
539
|
-
range
|
|
542
|
+
leftPercent
|
|
540
543
|
} = _ref3;
|
|
541
544
|
const {
|
|
542
|
-
step = 1
|
|
545
|
+
step = 1,
|
|
546
|
+
min,
|
|
547
|
+
max
|
|
543
548
|
} = this.props;
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
|
|
549
|
+
const numSteps = Math.floor((max - min) / step) + ((max - min) % step === 0 ? 1 : 2);
|
|
550
|
+
/** Index of the step that corresponds to `leftPercent`. */
|
|
551
|
+
const stepIndex = Math.round(leftPercent * (numSteps - 1));
|
|
552
|
+
const discreteValue = stepIndex === numSteps - 1 ? max : min + step * stepIndex;
|
|
553
|
+
/** Percentage corresponding to the step index. */
|
|
554
|
+
const discretePercent = stepIndex / (numSteps - 1);
|
|
555
|
+
return {
|
|
556
|
+
discreteValue,
|
|
557
|
+
discretePercent
|
|
558
|
+
};
|
|
549
559
|
});
|
|
550
560
|
/**
|
|
551
|
-
* Calculates
|
|
552
|
-
*
|
|
553
|
-
* - If `clientX` is specified, it will be used in
|
|
554
|
-
* conjunction with the Slider's bounding rectangle to calculate the new
|
|
555
|
-
* values.
|
|
556
|
-
* - If `clientX` is not specified and `value` is, it will be used to
|
|
557
|
-
* calculate new values as though it were the current value of the Slider.
|
|
558
|
-
* - If neither `clientX` nor `value` are specified, `this.props.value` will
|
|
559
|
-
* be used to calculate the new values as though it were the current value
|
|
560
|
-
* of the Slider.
|
|
561
|
-
*
|
|
562
|
-
* @param {object} params
|
|
563
|
-
* @param {number} [params.clientX] Optional clientX value expected to be from
|
|
564
|
-
* an event fired by one of the Slider's `DRAG_EVENT_TYPES` events.
|
|
565
|
-
* @param {number} [params.value] Optional value use during calculations if
|
|
566
|
-
* clientX is not provided.
|
|
567
|
-
* @param {boolean} [params.useRawValue=false] `true` to use the given value as-is.
|
|
561
|
+
* Calculates the slider's value and handle position based on either a
|
|
562
|
+
* mouse/touch event or an explicit value.
|
|
568
563
|
*/
|
|
569
564
|
_rollupPluginBabelHelpers.defineProperty(this, "calcValue", _ref4 => {
|
|
570
565
|
let {
|
|
571
566
|
clientX,
|
|
572
567
|
value,
|
|
573
|
-
useRawValue
|
|
568
|
+
useRawValue
|
|
574
569
|
} = _ref4;
|
|
575
570
|
const range = this.props.max - this.props.min;
|
|
576
|
-
|
|
577
|
-
// @todo solve for rtl.
|
|
578
|
-
const leftPercent = this.calcLeftPercent({
|
|
571
|
+
const leftPercentRaw = this.calcLeftPercent({
|
|
579
572
|
clientX,
|
|
580
573
|
value,
|
|
581
574
|
range
|
|
582
575
|
});
|
|
576
|
+
/** `leftPercentRaw` clamped between 0 and 1. */
|
|
577
|
+
const leftPercent = Math.min(1, Math.max(0, leftPercentRaw));
|
|
583
578
|
if (useRawValue) {
|
|
584
|
-
// Adjusts only for min/max of thumb position
|
|
585
579
|
return {
|
|
586
580
|
value,
|
|
587
|
-
left:
|
|
581
|
+
left: leftPercent * 100
|
|
588
582
|
};
|
|
589
583
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
584
|
+
|
|
585
|
+
// Use the discrete value and percentage for snapping.
|
|
586
|
+
const {
|
|
587
|
+
discreteValue,
|
|
588
|
+
discretePercent
|
|
589
|
+
} = this.calcDiscreteValueAndPercent({
|
|
590
|
+
leftPercent
|
|
593
591
|
});
|
|
594
592
|
return {
|
|
595
|
-
value:
|
|
596
|
-
left:
|
|
593
|
+
value: discreteValue,
|
|
594
|
+
left: discretePercent * 100
|
|
597
595
|
};
|
|
598
596
|
});
|
|
599
597
|
_rollupPluginBabelHelpers.defineProperty(this, "calcDistanceToHandle", (handle, clientX) => {
|
|
@@ -603,19 +601,21 @@ class Slider extends React.PureComponent {
|
|
|
603
601
|
return Math.abs(handleX - clientX);
|
|
604
602
|
});
|
|
605
603
|
/**
|
|
606
|
-
*
|
|
604
|
+
* Calculates a new slider value based on the current value, a change delta,
|
|
605
|
+
* and a step.
|
|
607
606
|
*
|
|
608
|
-
* @param
|
|
609
|
-
*
|
|
610
|
-
* @param
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
* A value determining how much the value should increase/decrease by moving
|
|
614
|
-
* the thumb by mouse.
|
|
607
|
+
* @param currentValue - The starting value from which the slider is moving.
|
|
608
|
+
* @param delta - The amount to adjust the current value by.
|
|
609
|
+
* @param step - The step. Defaults to `1`.
|
|
610
|
+
* @returns The new slider value, rounded to the same number of decimal places
|
|
611
|
+
* as the step.
|
|
615
612
|
*/
|
|
616
613
|
_rollupPluginBabelHelpers.defineProperty(this, "calcValueForDelta", function (currentValue, delta) {
|
|
617
614
|
let step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
618
|
-
|
|
615
|
+
const base = delta > 0 ? Math.floor(currentValue / step) * step : currentValue;
|
|
616
|
+
const newValue = base + delta;
|
|
617
|
+
const decimals = (step.toString().split('.')[1] || '').length;
|
|
618
|
+
return Number(newValue.toFixed(decimals));
|
|
619
619
|
});
|
|
620
620
|
/**
|
|
621
621
|
* Sets state relevant to the given handle position.
|
|
@@ -879,18 +879,16 @@ class Slider extends React.PureComponent {
|
|
|
879
879
|
}
|
|
880
880
|
|
|
881
881
|
/**
|
|
882
|
-
*
|
|
883
|
-
*
|
|
884
|
-
*
|
|
882
|
+
* Rounds a given value to the nearest step defined by the slider's `step`
|
|
883
|
+
* prop.
|
|
884
|
+
*
|
|
885
|
+
* @param value - The value to adjust to the nearest step. Defaults to `0`.
|
|
886
|
+
* @returns The value rounded to the precision determined by the step.
|
|
885
887
|
*/
|
|
886
|
-
nearestStepValue(
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
tempInput.max = `${this.props.max}`;
|
|
891
|
-
tempInput.step = `${this.props.step}`;
|
|
892
|
-
tempInput.value = `${value}`;
|
|
893
|
-
return parseFloat(tempInput.value);
|
|
888
|
+
nearestStepValue() {
|
|
889
|
+
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
890
|
+
const decimals = (this.props.step?.toString().split('.')[1] || '').length;
|
|
891
|
+
return Number(value.toFixed(decimals));
|
|
894
892
|
}
|
|
895
893
|
getClientXFromEvent(event) {
|
|
896
894
|
let clientX;
|
|
@@ -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.
|
|
@@ -340,12 +340,9 @@ export interface TabProps extends HTMLAttributes<HTMLElement> {
|
|
|
340
340
|
*/
|
|
341
341
|
renderButton?(): ReactNode;
|
|
342
342
|
/**
|
|
343
|
-
*
|
|
344
|
-
* Can be a React component class
|
|
343
|
+
* A component used to render an icon.
|
|
345
344
|
*/
|
|
346
|
-
renderIcon?:
|
|
347
|
-
size: number;
|
|
348
|
-
}>;
|
|
345
|
+
renderIcon?: React.ElementType;
|
|
349
346
|
/**
|
|
350
347
|
* An optional label to render under the primary tab label.
|
|
351
348
|
* Only useful for contained tabs.
|
|
@@ -25,12 +25,13 @@ var reactIs = require('react-is');
|
|
|
25
25
|
require('../Tooltip/DefinitionTooltip.js');
|
|
26
26
|
var Tooltip = require('../Tooltip/Tooltip.js');
|
|
27
27
|
var useControllableState = require('../../internal/useControllableState.js');
|
|
28
|
-
var useEffectOnce = require('../../internal/useEffectOnce.js');
|
|
29
28
|
var useId = require('../../internal/useId.js');
|
|
30
29
|
var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
31
30
|
var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
32
31
|
var useNoInteractiveChildren = require('../../internal/useNoInteractiveChildren.js');
|
|
33
32
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
33
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
34
|
+
var match = require('../../internal/keyboard/match.js');
|
|
34
35
|
var usePressable = require('./usePressable.js');
|
|
35
36
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
36
37
|
var useEvent = require('../../internal/useEvent.js');
|
|
@@ -38,9 +39,7 @@ var useMatchMedia = require('../../internal/useMatchMedia.js');
|
|
|
38
39
|
require('../Text/index.js');
|
|
39
40
|
var index = require('../BadgeIndicator/index.js');
|
|
40
41
|
var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js');
|
|
41
|
-
var match = require('../../internal/keyboard/match.js');
|
|
42
42
|
var Text = require('../Text/Text.js');
|
|
43
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
44
43
|
|
|
45
44
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
46
45
|
|
|
@@ -392,7 +391,7 @@ function TabList(_ref4) {
|
|
|
392
391
|
}
|
|
393
392
|
}
|
|
394
393
|
}
|
|
395
|
-
|
|
394
|
+
React.useEffect(() => {
|
|
396
395
|
const tab = tabs.current[selectedIndex];
|
|
397
396
|
if (scrollIntoView && tab) {
|
|
398
397
|
tab.scrollIntoView({
|
|
@@ -400,7 +399,7 @@ function TabList(_ref4) {
|
|
|
400
399
|
inline: 'nearest'
|
|
401
400
|
});
|
|
402
401
|
}
|
|
403
|
-
});
|
|
402
|
+
}, []);
|
|
404
403
|
React.useEffect(() => {
|
|
405
404
|
//adding 1 in calculation for firefox support
|
|
406
405
|
setIsNextButtonVisible(ref.current ? scrollLeft + buttonWidth + ref.current.clientWidth + 1 < ref.current.scrollWidth : false);
|
|
@@ -410,7 +409,7 @@ function TabList(_ref4) {
|
|
|
410
409
|
}
|
|
411
410
|
}
|
|
412
411
|
}, [scrollLeft, children, dismissable, isScrollable]);
|
|
413
|
-
|
|
412
|
+
React.useEffect(() => {
|
|
414
413
|
if (tabs.current[selectedIndex]?.disabled) {
|
|
415
414
|
const activeTabs = tabs.current.filter(tab => {
|
|
416
415
|
return !tab.disabled;
|
|
@@ -420,7 +419,7 @@ function TabList(_ref4) {
|
|
|
420
419
|
setSelectedIndex(tabs.current.indexOf(tab));
|
|
421
420
|
}
|
|
422
421
|
}
|
|
423
|
-
});
|
|
422
|
+
}, []);
|
|
424
423
|
useIsomorphicEffect["default"](() => {
|
|
425
424
|
if (ref.current) {
|
|
426
425
|
// adding 1 in calculation for firefox support
|
|
@@ -634,7 +633,7 @@ function TabListVertical(_ref8) {
|
|
|
634
633
|
setActiveIndex(selectedIndex);
|
|
635
634
|
}
|
|
636
635
|
}
|
|
637
|
-
|
|
636
|
+
React.useEffect(() => {
|
|
638
637
|
if (tabs.current[selectedIndex]?.disabled) {
|
|
639
638
|
const activeTabs = tabs.current.filter(tab => {
|
|
640
639
|
return !tab.disabled;
|
|
@@ -644,7 +643,7 @@ function TabListVertical(_ref8) {
|
|
|
644
643
|
setSelectedIndex(tabs.current.indexOf(tab));
|
|
645
644
|
}
|
|
646
645
|
}
|
|
647
|
-
});
|
|
646
|
+
}, []);
|
|
648
647
|
React.useEffect(() => {
|
|
649
648
|
function handler() {
|
|
650
649
|
const containerHeight = ref.current?.offsetHeight;
|
|
@@ -1017,22 +1016,21 @@ Tab.propTypes = {
|
|
|
1017
1016
|
* Provide a handler that is invoked on the key down event for the control
|
|
1018
1017
|
*/
|
|
1019
1018
|
onKeyDown: PropTypes__default["default"].func,
|
|
1020
|
-
|
|
1019
|
+
/**
|
|
1021
1020
|
* An optional parameter to allow overriding the anchor rendering.
|
|
1022
1021
|
* Useful for using Tab along with react-router or other client
|
|
1023
1022
|
* side router libraries.
|
|
1024
|
-
|
|
1023
|
+
*/
|
|
1025
1024
|
renderButton: PropTypes__default["default"].func,
|
|
1026
1025
|
/**
|
|
1027
|
-
*
|
|
1028
|
-
* Can be a React component class
|
|
1026
|
+
* A component used to render an icon.
|
|
1029
1027
|
*/
|
|
1030
1028
|
// @ts-expect-error: Invalid prop type derivation
|
|
1031
1029
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
1032
|
-
|
|
1030
|
+
/**
|
|
1033
1031
|
* An optional label to render under the primary tab label.
|
|
1034
|
-
|
|
1035
|
-
|
|
1032
|
+
* Only useful for contained tabs.
|
|
1033
|
+
*/
|
|
1036
1034
|
secondaryLabel: PropTypes__default["default"].string
|
|
1037
1035
|
};
|
|
1038
1036
|
|
|
@@ -1134,7 +1132,7 @@ const TabPanel = /*#__PURE__*/React__default["default"].forwardRef(function TabP
|
|
|
1134
1132
|
const className = cx__default["default"](`${prefix}--tab-content`, customClassName, {
|
|
1135
1133
|
[`${prefix}--tab-content--interactive`]: interactiveContent
|
|
1136
1134
|
});
|
|
1137
|
-
|
|
1135
|
+
React.useEffect(() => {
|
|
1138
1136
|
if (!panel.current) {
|
|
1139
1137
|
return;
|
|
1140
1138
|
}
|
|
@@ -1143,7 +1141,7 @@ const TabPanel = /*#__PURE__*/React__default["default"].forwardRef(function TabP
|
|
|
1143
1141
|
setInteractiveContent(true);
|
|
1144
1142
|
setTabIndex(-1);
|
|
1145
1143
|
}
|
|
1146
|
-
});
|
|
1144
|
+
}, []);
|
|
1147
1145
|
|
|
1148
1146
|
// tabindex should only be 0 if no interactive content in children
|
|
1149
1147
|
React.useEffect(() => {
|