@carbon/react 1.81.0 → 1.82.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 +892 -892
- package/es/components/AILabel/index.d.ts +1 -1
- package/es/components/AILabel/index.js +2 -9
- package/es/components/Breadcrumb/Breadcrumb.d.ts +2 -3
- package/es/components/Breadcrumb/Breadcrumb.js +4 -4
- package/es/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
- package/es/components/Breadcrumb/BreadcrumbItem.js +5 -4
- package/es/components/Button/Button.js +2 -10
- package/es/components/ButtonSet/ButtonSet.d.ts +2 -3
- package/es/components/ButtonSet/ButtonSet.js +4 -4
- package/es/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/es/components/CodeSnippet/CodeSnippet.js +3 -19
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComboBox/ComboBox.js +2 -2
- package/es/components/ComboButton/index.d.ts +1 -1
- package/es/components/ComboButton/index.js +2 -18
- package/es/components/ComposedModal/ComposedModal.js +5 -3
- package/es/components/Copy/Copy.d.ts +1 -1
- package/es/components/Copy/Copy.js +2 -18
- package/es/components/CopyButton/CopyButton.d.ts +1 -1
- package/es/components/CopyButton/CopyButton.js +2 -18
- package/es/components/DataTable/DataTable.d.ts +7 -12
- package/es/components/DataTable/DataTable.js +0 -5
- package/es/components/DataTable/TableToolbarAction.d.ts +2 -4
- package/es/components/DataTable/TableToolbarAction.js +5 -4
- package/es/components/DataTable/tools/sorting.d.ts +42 -0
- package/es/components/DataTable/tools/sorting.js +24 -53
- package/es/components/DatePicker/DatePicker.d.ts +1 -1
- package/es/components/DatePicker/DatePicker.js +18 -18
- package/es/components/Dialog/index.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
- package/es/components/Dropdown/Dropdown.Skeleton.js +2 -2
- package/es/components/Dropdown/Dropdown.d.ts +7 -6
- package/es/components/Dropdown/Dropdown.js +7 -3
- package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +1 -1
- package/es/components/FluidDropdown/FluidDropdown.d.ts +1 -1
- package/es/components/FluidSearch/FluidSearch.d.ts +3 -6
- package/es/components/IconButton/index.d.ts +1 -1
- package/es/components/IconButton/index.js +2 -18
- package/es/components/ListBox/ListBox.d.ts +4 -5
- package/es/components/ListBox/ListBox.js +8 -7
- package/es/components/ListBox/ListBoxMenu.d.ts +4 -4
- package/es/components/ListBox/ListBoxMenu.js +4 -2
- package/es/components/ListBox/ListBoxMenuItem.d.ts +9 -8
- package/es/components/ListBox/ListBoxPropTypes.d.ts +3 -3
- package/es/components/ListBox/ListBoxPropTypes.js +3 -3
- package/es/components/ListBox/index.d.ts +7 -5
- package/es/components/ListBox/index.js +1 -1
- package/es/components/Menu/Menu.js +5 -0
- package/es/components/Modal/Modal.js +9 -9
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -2
- package/es/components/MultiSelect/MultiSelect.d.ts +8 -2
- package/es/components/MultiSelect/MultiSelect.js +3 -3
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/OverflowMenu/OverflowMenu.js +2 -21
- package/es/components/OverflowMenu/next/index.js +2 -18
- package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +5 -4
- package/es/components/PageHeader/PageHeader.d.ts +153 -8
- package/es/components/PageHeader/PageHeader.js +143 -21
- package/es/components/PageHeader/index.d.ts +2 -2
- package/es/components/PageHeader/index.js +1 -1
- package/es/components/Popover/index.js +4 -21
- package/es/components/Search/Search.d.ts +2 -5
- package/es/components/Search/Search.js +24 -8
- package/es/components/Stack/HStack.d.ts +2 -3
- package/es/components/Stack/HStack.js +4 -7
- package/es/components/Stack/Stack.d.ts +3 -4
- package/es/components/Stack/Stack.js +3 -6
- package/es/components/Stack/VStack.d.ts +2 -3
- package/es/components/Stack/VStack.js +3 -2
- package/es/components/Stack/index.d.ts +4 -4
- package/es/components/TextArea/TextArea.js +3 -5
- package/es/components/TimePicker/TimePicker.d.ts +3 -4
- package/es/components/TimePicker/TimePicker.js +5 -4
- package/es/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
- package/es/components/TimePickerSelect/TimePickerSelect.js +5 -4
- package/es/components/TreeView/TreeNode.js +13 -1
- package/es/components/TreeView/TreeView.js +1 -1
- package/es/index.js +1 -1
- package/es/internal/FloatingMenu.js +9 -5
- package/es/internal/environment.js +7 -0
- package/es/internal/keyboard/navigation.d.ts +0 -10
- package/es/internal/keyboard/navigation.js +1 -13
- package/es/internal/useId.js +1 -1
- package/es/internal/useNoInteractiveChildren.js +7 -0
- package/es/internal/useOutsideClick.js +3 -0
- package/es/internal/wrapFocus.d.ts +49 -0
- package/es/internal/wrapFocus.js +64 -51
- package/es/tools/events.d.ts +17 -0
- package/es/tools/events.js +10 -13
- package/es/tools/mapPopoverAlign.d.ts +15 -0
- package/es/tools/mapPopoverAlign.js +28 -0
- package/es/tools/uniqueId.d.ts +7 -0
- package/es/tools/uniqueId.js +3 -3
- package/es/types/common.d.ts +0 -2
- package/lib/components/AILabel/index.d.ts +1 -1
- package/lib/components/AILabel/index.js +2 -9
- package/lib/components/Breadcrumb/Breadcrumb.d.ts +2 -3
- package/lib/components/Breadcrumb/Breadcrumb.js +3 -3
- package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
- package/lib/components/Breadcrumb/BreadcrumbItem.js +4 -3
- package/lib/components/Button/Button.js +1 -9
- package/lib/components/ButtonSet/ButtonSet.d.ts +2 -3
- package/lib/components/ButtonSet/ButtonSet.js +3 -3
- package/lib/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/lib/components/CodeSnippet/CodeSnippet.js +3 -19
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.js +1 -1
- package/lib/components/ComboButton/index.d.ts +1 -1
- package/lib/components/ComboButton/index.js +2 -18
- package/lib/components/ComposedModal/ComposedModal.js +5 -3
- package/lib/components/Copy/Copy.d.ts +1 -1
- package/lib/components/Copy/Copy.js +2 -18
- package/lib/components/CopyButton/CopyButton.d.ts +1 -1
- package/lib/components/CopyButton/CopyButton.js +2 -18
- package/lib/components/DataTable/DataTable.d.ts +7 -12
- package/lib/components/DataTable/DataTable.js +0 -5
- package/lib/components/DataTable/TableToolbarAction.d.ts +2 -4
- package/lib/components/DataTable/TableToolbarAction.js +4 -3
- package/lib/components/DataTable/tools/sorting.d.ts +42 -0
- package/lib/components/DataTable/tools/sorting.js +23 -53
- package/lib/components/DatePicker/DatePicker.d.ts +1 -1
- package/lib/components/DatePicker/DatePicker.js +18 -18
- package/lib/components/Dialog/index.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
- package/lib/components/Dropdown/Dropdown.Skeleton.js +1 -1
- package/lib/components/Dropdown/Dropdown.d.ts +7 -6
- package/lib/components/Dropdown/Dropdown.js +6 -2
- package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +1 -1
- package/lib/components/FluidDropdown/FluidDropdown.d.ts +1 -1
- package/lib/components/FluidSearch/FluidSearch.d.ts +3 -6
- package/lib/components/IconButton/index.d.ts +1 -1
- package/lib/components/IconButton/index.js +2 -18
- package/lib/components/ListBox/ListBox.d.ts +4 -5
- package/lib/components/ListBox/ListBox.js +7 -6
- package/lib/components/ListBox/ListBoxMenu.d.ts +4 -4
- package/lib/components/ListBox/ListBoxMenu.js +3 -1
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +9 -8
- package/lib/components/ListBox/ListBoxPropTypes.d.ts +3 -3
- package/lib/components/ListBox/ListBoxPropTypes.js +4 -4
- package/lib/components/ListBox/index.d.ts +7 -5
- package/lib/components/ListBox/index.js +2 -2
- package/lib/components/Menu/Menu.js +5 -0
- package/lib/components/Modal/Modal.js +9 -9
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +2 -1
- package/lib/components/MultiSelect/MultiSelect.d.ts +8 -2
- package/lib/components/MultiSelect/MultiSelect.js +2 -2
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +2 -21
- package/lib/components/OverflowMenu/next/index.js +2 -18
- package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -3
- package/lib/components/PageHeader/PageHeader.d.ts +153 -8
- package/lib/components/PageHeader/PageHeader.js +145 -19
- package/lib/components/PageHeader/index.d.ts +2 -2
- package/lib/components/PageHeader/index.js +4 -0
- package/lib/components/Popover/index.js +4 -21
- package/lib/components/Search/Search.d.ts +2 -5
- package/lib/components/Search/Search.js +24 -8
- package/lib/components/Stack/HStack.d.ts +2 -3
- package/lib/components/Stack/HStack.js +3 -6
- package/lib/components/Stack/Stack.d.ts +3 -4
- package/lib/components/Stack/Stack.js +2 -5
- package/lib/components/Stack/VStack.d.ts +2 -3
- package/lib/components/Stack/VStack.js +2 -1
- package/lib/components/Stack/index.d.ts +4 -4
- package/lib/components/TextArea/TextArea.js +2 -4
- package/lib/components/TimePicker/TimePicker.d.ts +3 -4
- package/lib/components/TimePicker/TimePicker.js +4 -3
- package/lib/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
- package/lib/components/TimePickerSelect/TimePickerSelect.js +4 -3
- package/lib/components/TreeView/TreeNode.js +13 -1
- package/lib/components/TreeView/TreeView.js +1 -1
- package/lib/index.js +2 -2
- package/lib/internal/FloatingMenu.js +9 -5
- package/lib/internal/environment.js +7 -0
- package/lib/internal/keyboard/navigation.d.ts +0 -10
- package/lib/internal/keyboard/navigation.js +0 -14
- package/lib/internal/useNoInteractiveChildren.js +7 -0
- package/lib/internal/useOutsideClick.js +3 -0
- package/lib/internal/wrapFocus.d.ts +49 -0
- package/lib/internal/wrapFocus.js +66 -53
- package/lib/tools/events.d.ts +17 -0
- package/lib/tools/events.js +10 -13
- package/lib/tools/mapPopoverAlign.d.ts +15 -0
- package/lib/tools/mapPopoverAlign.js +32 -0
- package/lib/tools/uniqueId.d.ts +7 -0
- package/lib/tools/uniqueId.js +3 -3
- package/lib/types/common.d.ts +0 -2
- package/package.json +7 -7
- package/telemetry.yml +3 -1
- package/es/tools/createPropAdapter.js +0 -40
- package/lib/tools/createPropAdapter.js +0 -44
|
@@ -9,18 +9,19 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import { ChevronDown } from '@carbon/icons-react';
|
|
10
10
|
import cx from 'classnames';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
|
-
import React__default from 'react';
|
|
12
|
+
import React__default, { forwardRef } from 'react';
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const frFn = forwardRef;
|
|
16
|
+
const TimePickerSelect = frFn((props, ref) => {
|
|
17
|
+
const {
|
|
17
18
|
['aria-label']: ariaLabel = 'open list of options',
|
|
18
19
|
children,
|
|
19
20
|
id,
|
|
20
21
|
disabled = false,
|
|
21
22
|
className,
|
|
22
23
|
...rest
|
|
23
|
-
} =
|
|
24
|
+
} = props;
|
|
24
25
|
const prefix = usePrefix();
|
|
25
26
|
const selectClasses = cx({
|
|
26
27
|
[`${prefix}--select`]: true,
|
|
@@ -14,7 +14,7 @@ import { ArrowLeft, ArrowRight, Enter, Space } from '../../internal/keyboard/key
|
|
|
14
14
|
import { matches, match } from '../../internal/keyboard/match.js';
|
|
15
15
|
import { useControllableState } from '../../internal/useControllableState.js';
|
|
16
16
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
17
|
-
import uniqueId from '../../tools/uniqueId.js';
|
|
17
|
+
import { uniqueId } from '../../tools/uniqueId.js';
|
|
18
18
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
19
19
|
|
|
20
20
|
const TreeNode = /*#__PURE__*/React__default.forwardRef((_ref, forwardedRef) => {
|
|
@@ -201,6 +201,18 @@ const TreeNode = /*#__PURE__*/React__default.forwardRef((_ref, forwardedRef) =>
|
|
|
201
201
|
}
|
|
202
202
|
if (matches(event, [Enter, Space])) {
|
|
203
203
|
event.preventDefault();
|
|
204
|
+
if (match(event, Enter) && children) {
|
|
205
|
+
// Toggle expansion state for parent nodes
|
|
206
|
+
if (!enableTreeviewControllable) {
|
|
207
|
+
onToggle?.(event, {
|
|
208
|
+
id,
|
|
209
|
+
isExpanded: !expanded,
|
|
210
|
+
label,
|
|
211
|
+
value
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
setExpanded(!expanded);
|
|
215
|
+
}
|
|
204
216
|
if (href) {
|
|
205
217
|
currentNode.current?.click();
|
|
206
218
|
}
|
|
@@ -13,7 +13,7 @@ import { ArrowUp, ArrowDown, Home, End } from '../../internal/keyboard/keys.js';
|
|
|
13
13
|
import { matches, match } from '../../internal/keyboard/match.js';
|
|
14
14
|
import { useControllableState } from '../../internal/useControllableState.js';
|
|
15
15
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
|
-
import uniqueId from '../../tools/uniqueId.js';
|
|
16
|
+
import { uniqueId } from '../../tools/uniqueId.js';
|
|
17
17
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
18
18
|
import TreeNode from './TreeNode.js';
|
|
19
19
|
|
package/es/index.js
CHANGED
|
@@ -107,8 +107,8 @@ export { default as SkeletonPlaceholder } from './components/SkeletonPlaceholder
|
|
|
107
107
|
export { default as SkeletonText } from './components/SkeletonText/SkeletonText.js';
|
|
108
108
|
export { default as Slider } from './components/Slider/index.js';
|
|
109
109
|
export { HStack } from './components/Stack/HStack.js';
|
|
110
|
-
export { VStack } from './components/Stack/VStack.js';
|
|
111
110
|
export { Stack } from './components/Stack/Stack.js';
|
|
111
|
+
export { VStack } from './components/Stack/VStack.js';
|
|
112
112
|
export { StructuredListBody, StructuredListCell, StructuredListHead, StructuredListInput, StructuredListRow, StructuredListWrapper } from './components/StructuredList/StructuredList.js';
|
|
113
113
|
export { default as StructuredListSkeleton } from './components/StructuredList/StructuredList.Skeleton.js';
|
|
114
114
|
export { default as Switch } from './components/Switch/Switch.js';
|
|
@@ -15,7 +15,7 @@ import { selectorTabbable, selectorFocusable } from './keyboard/navigation.js';
|
|
|
15
15
|
import { OptimizedResize } from './OptimizedResize.js';
|
|
16
16
|
import { PrefixContext } from './usePrefix.js';
|
|
17
17
|
import { warning } from './warning.js';
|
|
18
|
-
import wrapFocus,
|
|
18
|
+
import { wrapFocus, wrapFocusWithoutSentinels } from './wrapFocus.js';
|
|
19
19
|
|
|
20
20
|
const DIRECTION_LEFT = 'left';
|
|
21
21
|
const DIRECTION_TOP = 'top';
|
|
@@ -246,13 +246,17 @@ const FloatingMenu = _ref2 => {
|
|
|
246
246
|
* Blur handler used when focus trapping is enabled.
|
|
247
247
|
*/
|
|
248
248
|
const handleBlur = event => {
|
|
249
|
-
|
|
249
|
+
const {
|
|
250
|
+
target,
|
|
251
|
+
relatedTarget
|
|
252
|
+
} = event;
|
|
253
|
+
if (menuBodyRef.current && startSentinelRef.current && endSentinelRef.current && target instanceof HTMLElement && relatedTarget instanceof HTMLElement) {
|
|
250
254
|
wrapFocus({
|
|
251
255
|
bodyNode: menuBodyRef.current,
|
|
252
256
|
startTrapNode: startSentinelRef.current,
|
|
253
257
|
endTrapNode: endSentinelRef.current,
|
|
254
|
-
currentActiveNode:
|
|
255
|
-
oldActiveNode:
|
|
258
|
+
currentActiveNode: relatedTarget,
|
|
259
|
+
oldActiveNode: target
|
|
256
260
|
});
|
|
257
261
|
}
|
|
258
262
|
};
|
|
@@ -261,7 +265,7 @@ const FloatingMenu = _ref2 => {
|
|
|
261
265
|
* Keydown handler for focus wrapping when experimental focus trap is enabled.
|
|
262
266
|
*/
|
|
263
267
|
const handleKeyDown = event => {
|
|
264
|
-
if (match(event, Tab) && menuBodyRef.current) {
|
|
268
|
+
if (match(event, Tab) && menuBodyRef.current && event.target instanceof HTMLElement) {
|
|
265
269
|
wrapFocusWithoutSentinels({
|
|
266
270
|
containerNode: menuBodyRef.current,
|
|
267
271
|
currentActiveNode: event.target,
|
|
@@ -11,9 +11,16 @@
|
|
|
11
11
|
* @see https://github.com/facebook/fbjs/blob/4d1751311d3f67af2dcce2e40df8512a23c7b9c6/packages/fbjs/src/core/ExecutionEnvironment.js#L12
|
|
12
12
|
*/
|
|
13
13
|
const canUseDOM = !!(typeof window !== 'undefined' &&
|
|
14
|
+
// TODO: `ssr-friendly` doesn't support ESLint v9.
|
|
15
|
+
// https://github.com/kopiro/eslint-plugin-ssr-friendly/issues/30
|
|
16
|
+
// https://github.com/carbon-design-system/carbon/issues/18991
|
|
17
|
+
/*
|
|
14
18
|
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
|
19
|
+
*/
|
|
15
20
|
window.document &&
|
|
21
|
+
/*
|
|
16
22
|
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
|
23
|
+
*/
|
|
17
24
|
window.document.createElement);
|
|
18
25
|
|
|
19
26
|
export { canUseDOM };
|
|
@@ -17,16 +17,6 @@ import { KeyboardEvent } from 'react';
|
|
|
17
17
|
* getNextIndex(keyCodes.RIGHT, 0, 4)
|
|
18
18
|
*/
|
|
19
19
|
export declare const getNextIndex: (key: KeyboardEvent | number | string, index: number, arrayLength: number) => number | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* A flag `node.compareDocumentPosition(target)` returns that indicates
|
|
22
|
-
* `target` is located earlier than `node` in the document or `target` contains `node`.
|
|
23
|
-
*/
|
|
24
|
-
export declare const DOCUMENT_POSITION_BROAD_PRECEDING: number;
|
|
25
|
-
/**
|
|
26
|
-
* A flag `node.compareDocumentPosition(target)` returns that indicates
|
|
27
|
-
* `target` is located later than `node` in the document or `node` contains `target`.
|
|
28
|
-
*/
|
|
29
|
-
export declare const DOCUMENT_POSITION_BROAD_FOLLOWING: number;
|
|
30
20
|
/**
|
|
31
21
|
* CSS selector that selects major nodes that are sequentially focusable.
|
|
32
22
|
*/
|
|
@@ -29,18 +29,6 @@ const getNextIndex = (key, index, arrayLength) => {
|
|
|
29
29
|
return;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
* A flag `node.compareDocumentPosition(target)` returns that indicates
|
|
34
|
-
* `target` is located earlier than `node` in the document or `target` contains `node`.
|
|
35
|
-
*/
|
|
36
|
-
const DOCUMENT_POSITION_BROAD_PRECEDING = typeof Node !== 'undefined' ? Node.DOCUMENT_POSITION_PRECEDING | Node.DOCUMENT_POSITION_CONTAINS : 0;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* A flag `node.compareDocumentPosition(target)` returns that indicates
|
|
40
|
-
* `target` is located later than `node` in the document or `node` contains `target`.
|
|
41
|
-
*/
|
|
42
|
-
const DOCUMENT_POSITION_BROAD_FOLLOWING = typeof Node !== 'undefined' ? Node.DOCUMENT_POSITION_FOLLOWING | Node.DOCUMENT_POSITION_CONTAINED_BY : 0;
|
|
43
|
-
|
|
44
32
|
/**
|
|
45
33
|
* CSS selector that selects major nodes that are sequentially focusable.
|
|
46
34
|
*/
|
|
@@ -61,4 +49,4 @@ const selectorFocusable = `
|
|
|
61
49
|
iframe, object, embed, *[tabindex]:not([disabled]), *[contenteditable=true]
|
|
62
50
|
`;
|
|
63
51
|
|
|
64
|
-
export {
|
|
52
|
+
export { getNextIndex, selectorFocusable, selectorTabbable };
|
package/es/internal/useId.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React__default, {
|
|
8
|
+
import React__default, { useLayoutEffect, useEffect, useState } from 'react';
|
|
9
9
|
import { setupGetInstanceId } from '../tools/setupGetInstanceId.js';
|
|
10
10
|
import { canUseDOM } from './environment.js';
|
|
11
11
|
import { useIdPrefix } from './useIdPrefix.js';
|
|
@@ -10,11 +10,15 @@ import { useEffect } from 'react';
|
|
|
10
10
|
function useNoInteractiveChildren(ref) {
|
|
11
11
|
let message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'component should have no interactive child nodes';
|
|
12
12
|
if (process.env.NODE_ENV !== 'production') {
|
|
13
|
+
// TODO: https://github.com/carbon-design-system/carbon/issues/19005
|
|
14
|
+
/*
|
|
13
15
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
16
|
+
*/
|
|
14
17
|
useEffect(() => {
|
|
15
18
|
const node = ref.current ? getInteractiveContent(ref.current) : false;
|
|
16
19
|
if (node) {
|
|
17
20
|
const errorMessage = `Error: ${message}.\n\nInstead found: ${node.outerHTML}`;
|
|
21
|
+
// eslint-disable-next-line no-console
|
|
18
22
|
console.error(errorMessage);
|
|
19
23
|
throw new Error(errorMessage);
|
|
20
24
|
}
|
|
@@ -24,7 +28,10 @@ function useNoInteractiveChildren(ref) {
|
|
|
24
28
|
function useInteractiveChildrenNeedDescription(ref) {
|
|
25
29
|
let message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : `interactive child node(s) should have an \`aria-describedby\` property`;
|
|
26
30
|
if (process.env.NODE_ENV !== 'production') {
|
|
31
|
+
// TODO: https://github.com/carbon-design-system/carbon/issues/19005
|
|
32
|
+
/*
|
|
27
33
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
34
|
+
*/
|
|
28
35
|
useEffect(() => {
|
|
29
36
|
const node = ref.current ? getInteractiveContent(ref.current) : false;
|
|
30
37
|
if (node && !node.hasAttribute('aria-describedby')) {
|
|
@@ -19,7 +19,10 @@ const useOutsideClick = (ref, callback) => {
|
|
|
19
19
|
// treated as a constant as it will be false when executed in a Node.js
|
|
20
20
|
// environment and true when executed in the browser
|
|
21
21
|
if (canUseDOM) {
|
|
22
|
+
// TODO: https://github.com/carbon-design-system/carbon/issues/19005
|
|
23
|
+
/*
|
|
22
24
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
25
|
+
*/
|
|
23
26
|
useWindowEvent('click', event => {
|
|
24
27
|
const {
|
|
25
28
|
target
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2020, 2025
|
|
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
|
+
* Checks whether the given node or one of its ancestors matches any of the
|
|
9
|
+
* specified floating menu selectors.
|
|
10
|
+
*
|
|
11
|
+
* @param {Node} node - A DOM node.
|
|
12
|
+
* @param {string[]} selectorsFloatingMenus - Additional CSS selectors that
|
|
13
|
+
* match floating menus.
|
|
14
|
+
* @returns {boolean} Whether the node or one of its ancestors is in a floating
|
|
15
|
+
* menu.
|
|
16
|
+
*/
|
|
17
|
+
export declare const elementOrParentIsFloatingMenu: (node: Node, selectorsFloatingMenus?: string[]) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Ensures the focus is kept within the given container by implementing
|
|
20
|
+
* "focus-wrap" behavior.
|
|
21
|
+
*/
|
|
22
|
+
export declare const wrapFocus: ({ bodyNode, startTrapNode, endTrapNode, currentActiveNode, oldActiveNode, selectorsFloatingMenus, }: {
|
|
23
|
+
/** The DOM node of the container. */
|
|
24
|
+
bodyNode: HTMLElement | null;
|
|
25
|
+
/** The start sentinel node for focus trapping. */
|
|
26
|
+
startTrapNode: HTMLElement | null;
|
|
27
|
+
/** The end sentinel node for focus trapping. */
|
|
28
|
+
endTrapNode: HTMLElement | null;
|
|
29
|
+
/** The current active node (i.e., the one with focus). */
|
|
30
|
+
currentActiveNode: HTMLElement;
|
|
31
|
+
/** The previous active node (i.e., the one that had focus before). */
|
|
32
|
+
oldActiveNode: HTMLElement;
|
|
33
|
+
/** CSS selectors for floating menus. */
|
|
34
|
+
selectorsFloatingMenus?: string[];
|
|
35
|
+
}) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Ensures the focus is kept in the given container, implementing "focus-wrap"
|
|
38
|
+
* behavior.
|
|
39
|
+
*
|
|
40
|
+
* Note: This must be called *before* focus moves using `onKeyDown` or similar.
|
|
41
|
+
*/
|
|
42
|
+
export declare const wrapFocusWithoutSentinels: ({ containerNode, currentActiveNode, event, }: {
|
|
43
|
+
/** The container node within which to keep focus. */
|
|
44
|
+
containerNode: HTMLElement;
|
|
45
|
+
/** The current active node (i.e., the one with focus). */
|
|
46
|
+
currentActiveNode: HTMLElement;
|
|
47
|
+
/** The event that triggered this function. */
|
|
48
|
+
event: React.KeyboardEvent | KeyboardEvent;
|
|
49
|
+
}) => void;
|
package/es/internal/wrapFocus.js
CHANGED
|
@@ -6,33 +6,45 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { useEffect } from 'react';
|
|
9
|
-
import { DOCUMENT_POSITION_BROAD_PRECEDING, selectorTabbable, DOCUMENT_POSITION_BROAD_FOLLOWING } from './keyboard/navigation.js';
|
|
10
9
|
import { tabbable } from 'tabbable';
|
|
10
|
+
import { selectorTabbable } from './keyboard/navigation.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @returns {boolean} `true` of the given `node` is in a floating menu.
|
|
13
|
+
* A flag `node.compareDocumentPosition(target)` returns that indicates
|
|
14
|
+
* `target` is located earlier than `node` in the document or `target` contains `node`.
|
|
16
15
|
*/
|
|
17
|
-
|
|
16
|
+
const DOCUMENT_POSITION_BROAD_PRECEDING = typeof Node !== 'undefined' ? Node.DOCUMENT_POSITION_PRECEDING | Node.DOCUMENT_POSITION_CONTAINS : 0;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A flag `node.compareDocumentPosition(target)` returns that indicates
|
|
20
|
+
* `target` is located later than `node` in the document or `node` contains `target`.
|
|
21
|
+
*/
|
|
22
|
+
const DOCUMENT_POSITION_BROAD_FOLLOWING = typeof Node !== 'undefined' ? Node.DOCUMENT_POSITION_FOLLOWING | Node.DOCUMENT_POSITION_CONTAINED_BY : 0;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Checks whether the given node or one of its ancestors matches any of the
|
|
26
|
+
* specified floating menu selectors.
|
|
27
|
+
*
|
|
28
|
+
* @param {Node} node - A DOM node.
|
|
29
|
+
* @param {string[]} selectorsFloatingMenus - Additional CSS selectors that
|
|
30
|
+
* match floating menus.
|
|
31
|
+
* @returns {boolean} Whether the node or one of its ancestors is in a floating
|
|
32
|
+
* menu.
|
|
33
|
+
*/
|
|
34
|
+
const elementOrParentIsFloatingMenu = function (node) {
|
|
18
35
|
let selectorsFloatingMenus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
19
|
-
if (node && typeof node.closest === 'function') {
|
|
20
|
-
const allSelectorsFloatingMenus = [
|
|
21
|
-
return allSelectorsFloatingMenus.some(selector => node.closest(selector));
|
|
36
|
+
if (node instanceof Element && typeof node.closest === 'function') {
|
|
37
|
+
const allSelectorsFloatingMenus = ['.cds--overflow-menu-options', '.cds--tooltip', '.flatpickr-calendar', ...selectorsFloatingMenus];
|
|
38
|
+
return allSelectorsFloatingMenus.some(selector => !!node.closest(selector));
|
|
22
39
|
}
|
|
23
|
-
|
|
40
|
+
return false;
|
|
41
|
+
};
|
|
24
42
|
|
|
25
43
|
/**
|
|
26
|
-
* Ensures the focus is kept
|
|
27
|
-
*
|
|
28
|
-
* @param {Node|null} options.bodyNode
|
|
29
|
-
* @param {Node|null} options.startTrapNode The DOM node of the focus sentinel the is placed earlier next to `modalNode`.
|
|
30
|
-
* @param {Node|null} options.endTrapNode The DOM node of the focus sentinel the is placed next to `modalNode`.
|
|
31
|
-
* @param {Node} options.currentActiveNode The DOM node that has focus.
|
|
32
|
-
* @param {Node} options.oldActiveNode The DOM node that previously had focus.
|
|
33
|
-
* @param {string[]} [options.selectorsFloatingMenus] The CSS selectors that matches floating menus.
|
|
44
|
+
* Ensures the focus is kept within the given container by implementing
|
|
45
|
+
* "focus-wrap" behavior.
|
|
34
46
|
*/
|
|
35
|
-
|
|
47
|
+
const wrapFocus = _ref => {
|
|
36
48
|
let {
|
|
37
49
|
bodyNode,
|
|
38
50
|
startTrapNode,
|
|
@@ -44,59 +56,60 @@ function wrapFocus(_ref) {
|
|
|
44
56
|
if (bodyNode && currentActiveNode && oldActiveNode && !bodyNode.contains(currentActiveNode) && !elementOrParentIsFloatingMenu(currentActiveNode, selectorsFloatingMenus)) {
|
|
45
57
|
const comparisonResult = oldActiveNode.compareDocumentPosition(currentActiveNode);
|
|
46
58
|
if (currentActiveNode === startTrapNode || comparisonResult & DOCUMENT_POSITION_BROAD_PRECEDING) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
const tabbableElement = Array.from(bodyNode.querySelectorAll(selectorTabbable)).reverse().find(_ref2 => {
|
|
60
|
+
let {
|
|
61
|
+
offsetParent
|
|
62
|
+
} = _ref2;
|
|
63
|
+
return Boolean(offsetParent);
|
|
64
|
+
});
|
|
65
|
+
if (tabbableElement) {
|
|
66
|
+
tabbableElement.focus();
|
|
50
67
|
} else if (bodyNode !== oldActiveNode) {
|
|
51
68
|
bodyNode.focus();
|
|
52
69
|
}
|
|
53
70
|
} else if (currentActiveNode === endTrapNode || comparisonResult & DOCUMENT_POSITION_BROAD_FOLLOWING) {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
71
|
+
const tabbableElement = Array.from(bodyNode.querySelectorAll(selectorTabbable)).find(_ref3 => {
|
|
72
|
+
let {
|
|
73
|
+
offsetParent
|
|
74
|
+
} = _ref3;
|
|
75
|
+
return Boolean(offsetParent);
|
|
76
|
+
});
|
|
77
|
+
if (tabbableElement) {
|
|
78
|
+
tabbableElement.focus();
|
|
57
79
|
} else if (bodyNode !== oldActiveNode) {
|
|
58
80
|
bodyNode.focus();
|
|
59
81
|
}
|
|
60
82
|
}
|
|
61
83
|
}
|
|
62
|
-
}
|
|
84
|
+
};
|
|
63
85
|
|
|
64
86
|
/**
|
|
65
|
-
* Ensures the focus is kept in the given
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* @param {EventTarget} options.currentActiveNode The DOM node that has focus.
|
|
70
|
-
* @param {React.KeyboardEvent} options.event The DOM event
|
|
87
|
+
* Ensures the focus is kept in the given container, implementing "focus-wrap"
|
|
88
|
+
* behavior.
|
|
89
|
+
*
|
|
90
|
+
* Note: This must be called *before* focus moves using `onKeyDown` or similar.
|
|
71
91
|
*/
|
|
72
|
-
|
|
92
|
+
const wrapFocusWithoutSentinels = _ref4 => {
|
|
73
93
|
let {
|
|
74
94
|
containerNode,
|
|
75
95
|
currentActiveNode,
|
|
76
96
|
event
|
|
77
|
-
} =
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
|
|
97
|
+
} = _ref4;
|
|
98
|
+
if (!containerNode) return;
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (['blur', 'focusout', 'focusin', 'focus'].includes(event.type) && process.env.NODE_ENV !== 'production') {
|
|
81
101
|
throw new Error(`Error: wrapFocusWithoutSentinels(...) called in unsupported ${event.type} event.\n\nCall wrapFocusWithoutSentinels(...) from onKeyDown instead.`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
102
|
+
}
|
|
103
|
+
}, []);
|
|
84
104
|
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
//
|
|
105
|
+
// Use `tabbable` to get the focusable elements in tab order.
|
|
106
|
+
// `selectorTabbable` returns elements in DOM order which is why it's not
|
|
107
|
+
// used.
|
|
88
108
|
const tabbables = tabbable(containerNode);
|
|
89
109
|
const firstTabbable = tabbables[0];
|
|
90
110
|
const lastTabbable = tabbables[tabbables.length - 1];
|
|
91
111
|
|
|
92
|
-
//
|
|
93
|
-
// console.log(containerNode);
|
|
94
|
-
// console.log(tabbables);
|
|
95
|
-
// console.log(firstTabbable);
|
|
96
|
-
// console.log(lastTabbable);
|
|
97
|
-
// console.log(currentActiveNode);
|
|
98
|
-
|
|
99
|
-
// The shift key is used to determine if focus is moving forwards or backwards
|
|
112
|
+
// The shift key indicates if focus is moving forwards or backwards.
|
|
100
113
|
if (currentActiveNode === lastTabbable && !event.shiftKey) {
|
|
101
114
|
// Cancel the current movement of focus because we're going to place it ourselves
|
|
102
115
|
event.preventDefault();
|
|
@@ -107,6 +120,6 @@ function wrapFocusWithoutSentinels(_ref2) {
|
|
|
107
120
|
event.preventDefault();
|
|
108
121
|
lastTabbable.focus();
|
|
109
122
|
}
|
|
110
|
-
}
|
|
123
|
+
};
|
|
111
124
|
|
|
112
|
-
export {
|
|
125
|
+
export { elementOrParentIsFloatingMenu, wrapFocus, wrapFocusWithoutSentinels };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
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 type { SyntheticEvent } from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* Composes multiple event handler functions into a single event handler. The
|
|
10
|
+
* composed handler calls each provided function sequentially with the event and
|
|
11
|
+
* any additional arguments. If any handler calls `event.preventDefault()`,
|
|
12
|
+
* further handlers are skipped.
|
|
13
|
+
*
|
|
14
|
+
* @param handlers - An array of event handler functions.
|
|
15
|
+
* @returns A composite event handler.
|
|
16
|
+
*/
|
|
17
|
+
export declare const composeEventHandlers: <E extends SyntheticEvent = SyntheticEvent<Element, Event>>(handlers: (((event: E, ...args: any[]) => void) | undefined)[]) => (event: E, ...args: any[]) => void;
|
package/es/tools/events.js
CHANGED
|
@@ -5,28 +5,25 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
// @ts-check
|
|
9
|
-
|
|
10
8
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
* Composes multiple event handler functions into a single event handler. The
|
|
10
|
+
* composed handler calls each provided function sequentially with the event and
|
|
11
|
+
* any additional arguments. If any handler calls `event.preventDefault()`,
|
|
12
|
+
* further handlers are skipped.
|
|
15
13
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @returns
|
|
14
|
+
* @param handlers - An array of event handler functions.
|
|
15
|
+
* @returns A composite event handler.
|
|
18
16
|
*/
|
|
19
|
-
const composeEventHandlers =
|
|
17
|
+
const composeEventHandlers = handlers => function (event) {
|
|
20
18
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
21
19
|
args[_key - 1] = arguments[_key];
|
|
22
20
|
}
|
|
23
|
-
for (
|
|
21
|
+
for (const handler of handlers) {
|
|
24
22
|
if (event.defaultPrevented) {
|
|
25
23
|
break;
|
|
26
24
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
fn(event, ...args);
|
|
25
|
+
if (typeof handler === 'function') {
|
|
26
|
+
handler(event, ...args);
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
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 type { Placement } from '@floating-ui/react';
|
|
8
|
+
/**
|
|
9
|
+
* Maps popover alignment values to their corresponding replacement values.
|
|
10
|
+
*
|
|
11
|
+
* @param align - The original align value.
|
|
12
|
+
* @returns The new align value based on mapping or the original align if no
|
|
13
|
+
* mapping exists.
|
|
14
|
+
*/
|
|
15
|
+
export declare const mapPopoverAlign: (align: string) => Placement;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
const popoverAlignMapping = {
|
|
9
|
+
'top-left': 'top-start',
|
|
10
|
+
'top-right': 'top-end',
|
|
11
|
+
'bottom-left': 'bottom-start',
|
|
12
|
+
'bottom-right': 'bottom-end',
|
|
13
|
+
'left-bottom': 'left-end',
|
|
14
|
+
'left-top': 'left-start',
|
|
15
|
+
'right-bottom': 'right-end',
|
|
16
|
+
'right-top': 'right-start'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Maps popover alignment values to their corresponding replacement values.
|
|
21
|
+
*
|
|
22
|
+
* @param align - The original align value.
|
|
23
|
+
* @returns The new align value based on mapping or the original align if no
|
|
24
|
+
* mapping exists.
|
|
25
|
+
*/
|
|
26
|
+
const mapPopoverAlign = align => popoverAlignMapping[align] ?? align;
|
|
27
|
+
|
|
28
|
+
export { mapPopoverAlign };
|
package/es/tools/uniqueId.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
let lastId = 0;
|
|
9
|
-
function
|
|
9
|
+
const uniqueId = function () {
|
|
10
10
|
let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'id';
|
|
11
11
|
lastId++;
|
|
12
12
|
return `${prefix}${lastId}`;
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
14
|
|
|
15
|
-
export { uniqueId
|
|
15
|
+
export { uniqueId };
|
package/es/types/common.d.ts
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
export type ReactAttr<T = HTMLElement> = React.HTMLAttributes<T>;
|
|
9
|
-
export type ForwardRefProps<T, P = unknown> = React.PropsWithoutRef<React.PropsWithChildren<P>> & React.RefAttributes<T>;
|
|
10
|
-
export type ForwardRefReturn<T, P = unknown> = React.ForwardRefExoticComponent<ForwardRefProps<T, P>>;
|
|
11
9
|
/**
|
|
12
10
|
* For "as" props. Creates an "as" property that supports native html tags such as 'span', 'a', 'button' as well as custom functional components
|
|
13
11
|
* All native props for the supplied html tag/component are inferred as part of the base component props, allowing us to use props like `href` on an 'a' element etc
|
|
@@ -17,7 +17,7 @@ var React = require('react');
|
|
|
17
17
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
18
|
var index = require('../Toggletip/index.js');
|
|
19
19
|
var index$1 = require('../IconButton/index.js');
|
|
20
|
-
var
|
|
20
|
+
var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
|
|
21
21
|
var iconsReact = require('@carbon/icons-react');
|
|
22
22
|
var useId = require('../../internal/useId.js');
|
|
23
23
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
@@ -90,9 +90,6 @@ AILabelActions.propTypes = {
|
|
|
90
90
|
* @deprecated Use NewPopoverAlignment instead.
|
|
91
91
|
*/
|
|
92
92
|
|
|
93
|
-
const propMappingFunction = deprecatedValue => {
|
|
94
|
-
return createPropAdapter.mapPopoverAlignProp(deprecatedValue);
|
|
95
|
-
};
|
|
96
93
|
const AILabel = /*#__PURE__*/React__default["default"].forwardRef(function AILabel(_ref3, ref) {
|
|
97
94
|
let {
|
|
98
95
|
aiText = 'AI',
|
|
@@ -191,11 +188,7 @@ AILabel.propTypes = {
|
|
|
191
188
|
// deprecated use right-start instead
|
|
192
189
|
|
|
193
190
|
// new values to match floating-ui
|
|
194
|
-
'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
|
|
195
|
-
//allowed prop values
|
|
196
|
-
['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
|
|
197
|
-
//optional mapper function
|
|
198
|
-
propMappingFunction),
|
|
191
|
+
'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']), ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'], mapPopoverAlign.mapPopoverAlign),
|
|
199
192
|
/**
|
|
200
193
|
* Specify the text that will be provided to the aria-label of the `AILabel` button
|
|
201
194
|
*/
|
|
@@ -1,11 +1,10 @@
|
|
|
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 React from 'react';
|
|
8
|
-
import { ForwardRefReturn } from '../../types/common';
|
|
9
8
|
export interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
|
|
10
9
|
/**
|
|
11
10
|
* Specify the label for the breadcrumb container
|
|
@@ -25,5 +24,5 @@ export interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
25
24
|
*/
|
|
26
25
|
size?: 'sm' | 'md';
|
|
27
26
|
}
|
|
28
|
-
declare const Breadcrumb:
|
|
27
|
+
declare const Breadcrumb: React.ForwardRefExoticComponent<BreadcrumbProps & React.RefAttributes<HTMLElement>>;
|
|
29
28
|
export default Breadcrumb;
|