@carbon/react 1.101.0 → 1.102.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 +998 -963
- package/es/components/Accordion/AccordionItem.js +8 -6
- package/es/components/ComboBox/ComboBox.js +3 -3
- package/es/components/ComposedModal/ComposedModal.js +0 -1
- package/es/components/ContainedList/ContainedList.d.ts +1 -1
- package/es/components/ContainedList/ContainedList.js +9 -34
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +3 -3
- package/es/components/ContentSwitcher/ContentSwitcher.js +1 -2
- package/es/components/DataTable/DataTable.d.ts +6 -2
- package/es/components/DataTable/DataTable.js +3 -1
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/TableToolbarSearch.d.ts +11 -2
- package/es/components/DataTable/TableToolbarSearch.js +10 -3
- package/es/components/DataTable/stories/examples/TableToolbarFilter.d.ts +3 -0
- package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +2 -12
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +1 -8
- package/es/components/DatePicker/DatePicker.js +4 -1
- package/es/components/DatePickerInput/DatePickerInput.d.ts +2 -5
- package/es/components/DatePickerInput/DatePickerInput.js +2 -13
- package/es/components/Dropdown/Dropdown.js +1 -0
- package/es/components/ExpandableSearch/ExpandableSearch.js +2 -1
- package/es/components/ExpandableSearch/index.js +12 -0
- package/es/components/FluidSelect/FluidSelect.d.ts +3 -3
- package/es/components/FluidTextArea/FluidTextArea.d.ts +2 -4
- package/es/components/FluidTextArea/FluidTextArea.js +1 -2
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.d.ts +3 -3
- package/es/components/Grid/Column.d.ts +1 -1
- package/es/components/Grid/Column.js +2 -2
- package/es/components/Loading/Loading.d.ts +1 -1
- package/es/components/Loading/Loading.js +3 -1
- package/es/components/Menu/Menu.d.ts +1 -1
- package/es/components/Menu/Menu.js +6 -2
- package/es/components/Menu/MenuItem.js +2 -2
- package/es/components/Modal/Modal.js +0 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +4 -3
- package/es/components/MultiSelect/MultiSelect.js +5 -8
- package/es/components/MultiSelect/MultiSelectPropTypes.d.ts +6 -8
- package/es/components/MultiSelect/tools/sorting.d.ts +16 -9
- package/es/components/MultiSelect/tools/sorting.js +10 -14
- package/es/components/OverflowMenu/OverflowMenu.js +1 -0
- package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +5 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +12 -2
- package/es/components/Popover/index.js +3 -3
- package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +8 -11
- package/es/components/Search/Search.js +3 -2
- package/es/components/Search/utils.d.ts +7 -0
- package/es/components/Search/utils.js +10 -0
- package/es/components/Select/Select.d.ts +2 -2
- package/es/components/Select/Select.js +1 -1
- package/es/components/SelectItem/SelectItem.d.ts +3 -3
- package/es/components/StructuredList/StructuredList.js +2 -2
- package/es/components/Tabs/Tabs.js +9 -4
- package/es/components/Tag/DismissibleTag.d.ts +1 -1
- package/es/components/Tag/DismissibleTag.js +2 -2
- package/es/components/Tag/OperationalTag.d.ts +1 -1
- package/es/components/Tag/OperationalTag.js +2 -2
- package/es/components/Tag/SelectableTag.d.ts +1 -1
- package/es/components/Tag/SelectableTag.js +2 -2
- package/es/components/Tag/Tag.d.ts +1 -1
- package/es/components/Tag/Tag.js +2 -2
- package/es/components/TextArea/TextArea.d.ts +1 -2
- package/es/components/TextArea/TextArea.js +4 -5
- package/es/components/TextInput/ControlledPasswordInput.js +1 -1
- package/es/components/TimePickerSelect/TimePickerSelect.d.ts +4 -4
- package/es/components/Toggletip/index.js +1 -2
- package/es/components/TreeView/TreeNode.js +2 -2
- package/es/components/TreeView/TreeView.d.ts +1 -1
- package/es/components/UIShell/HeaderPanel.d.ts +1 -1
- package/es/components/UIShell/HeaderPanel.js +4 -2
- package/es/components/UIShell/SideNav.js +3 -3
- package/es/components/UIShell/Switcher.d.ts +1 -1
- package/es/components/UIShell/Switcher.js +1 -1
- package/es/feature-flags.js +2 -2
- package/es/internal/FloatingMenu.js +3 -3
- package/lib/components/Accordion/AccordionItem.js +7 -5
- package/lib/components/ComboBox/ComboBox.js +3 -3
- package/lib/components/ComposedModal/ComposedModal.js +0 -1
- package/lib/components/ContainedList/ContainedList.d.ts +1 -1
- package/lib/components/ContainedList/ContainedList.js +9 -34
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +3 -3
- package/lib/components/ContentSwitcher/ContentSwitcher.js +1 -2
- package/lib/components/DataTable/DataTable.d.ts +6 -2
- package/lib/components/DataTable/DataTable.js +3 -1
- package/lib/components/DataTable/Table.js +1 -1
- package/lib/components/DataTable/TableToolbarSearch.d.ts +11 -2
- package/lib/components/DataTable/TableToolbarSearch.js +10 -3
- package/lib/components/DataTable/stories/examples/TableToolbarFilter.d.ts +3 -0
- package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +2 -12
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +1 -8
- package/lib/components/DatePicker/DatePicker.js +4 -1
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +2 -5
- package/lib/components/DatePickerInput/DatePickerInput.js +2 -13
- package/lib/components/Dropdown/Dropdown.js +1 -0
- package/lib/components/ExpandableSearch/ExpandableSearch.js +2 -1
- package/lib/components/ExpandableSearch/index.js +17 -0
- package/lib/components/FeatureFlags/index.js +5 -5
- package/lib/components/FluidSelect/FluidSelect.d.ts +3 -3
- package/lib/components/FluidTextArea/FluidTextArea.d.ts +2 -4
- package/lib/components/FluidTextArea/FluidTextArea.js +1 -2
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.d.ts +3 -3
- package/lib/components/Grid/Column.d.ts +1 -1
- package/lib/components/Grid/Column.js +2 -21
- package/lib/components/Loading/Loading.d.ts +1 -1
- package/lib/components/Loading/Loading.js +3 -1
- package/lib/components/Menu/Menu.d.ts +1 -1
- package/lib/components/Menu/Menu.js +6 -2
- package/lib/components/Menu/MenuItem.js +2 -2
- package/lib/components/Modal/Modal.js +0 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +4 -3
- package/lib/components/MultiSelect/MultiSelect.js +5 -8
- package/lib/components/MultiSelect/MultiSelectPropTypes.d.ts +6 -8
- package/lib/components/MultiSelect/tools/sorting.d.ts +16 -9
- package/lib/components/MultiSelect/tools/sorting.js +10 -14
- package/lib/components/OverflowMenu/OverflowMenu.js +1 -0
- package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +5 -1
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +12 -2
- package/lib/components/Popover/index.js +3 -3
- package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +7 -10
- package/lib/components/Search/Search.js +3 -2
- package/lib/components/Search/utils.d.ts +7 -0
- package/lib/components/Search/utils.js +12 -0
- package/lib/components/Select/Select.d.ts +2 -2
- package/lib/components/Select/Select.js +1 -1
- package/lib/components/SelectItem/SelectItem.d.ts +3 -3
- package/lib/components/StructuredList/StructuredList.js +2 -2
- package/lib/components/Tabs/Tabs.js +9 -4
- package/lib/components/Tag/DismissibleTag.d.ts +1 -1
- package/lib/components/Tag/DismissibleTag.js +2 -2
- package/lib/components/Tag/OperationalTag.d.ts +1 -1
- package/lib/components/Tag/OperationalTag.js +2 -2
- package/lib/components/Tag/SelectableTag.d.ts +1 -1
- package/lib/components/Tag/SelectableTag.js +2 -2
- package/lib/components/Tag/Tag.d.ts +1 -1
- package/lib/components/Tag/Tag.js +2 -2
- package/lib/components/TextArea/TextArea.d.ts +1 -2
- package/lib/components/TextArea/TextArea.js +4 -5
- package/lib/components/TextInput/ControlledPasswordInput.js +1 -1
- package/lib/components/TimePickerSelect/TimePickerSelect.d.ts +4 -4
- package/lib/components/Toggletip/index.js +1 -2
- package/lib/components/TreeView/TreeNode.js +2 -2
- package/lib/components/TreeView/TreeView.d.ts +1 -1
- package/lib/components/UIShell/HeaderPanel.d.ts +1 -1
- package/lib/components/UIShell/HeaderPanel.js +4 -2
- package/lib/components/UIShell/SideNav.js +3 -3
- package/lib/components/UIShell/Switcher.d.ts +1 -1
- package/lib/components/UIShell/Switcher.js +1 -1
- package/lib/feature-flags.js +2 -21
- package/lib/internal/FloatingMenu.js +3 -22
- package/package.json +7 -7
- package/telemetry.yml +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
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 PropTypes from 'prop-types';
|
|
8
|
-
import { HTMLAttributes } from 'react';
|
|
8
|
+
import { type HTMLAttributes, type OptionHTMLAttributes } from 'react';
|
|
9
9
|
export interface SelectItemProps extends HTMLAttributes<HTMLOptionElement> {
|
|
10
10
|
/**
|
|
11
11
|
* Specify an optional className to be applied to the node
|
|
@@ -26,7 +26,7 @@ export interface SelectItemProps extends HTMLAttributes<HTMLOptionElement> {
|
|
|
26
26
|
/**
|
|
27
27
|
* Specify the value of the <SelectItem>
|
|
28
28
|
*/
|
|
29
|
-
value:
|
|
29
|
+
value: OptionHTMLAttributes<HTMLOptionElement>['value'];
|
|
30
30
|
}
|
|
31
31
|
declare const SelectItem: {
|
|
32
32
|
({ className, value, disabled, hidden, text, ...other }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -152,8 +152,8 @@ function StructuredListRow(props) {
|
|
|
152
152
|
...other
|
|
153
153
|
} = props;
|
|
154
154
|
const [hasFocusWithin, setHasFocusWithin] = React.useState(false);
|
|
155
|
-
|
|
156
|
-
const rowId = id ??
|
|
155
|
+
const generatedRowId = useId.useId('grid-input');
|
|
156
|
+
const rowId = id ?? generatedRowId;
|
|
157
157
|
const selectedRow = React.useContext(GridSelectedRowStateContext);
|
|
158
158
|
const setSelectedRow = React.useContext(GridSelectedRowDispatchContext);
|
|
159
159
|
const prefix = usePrefix.usePrefix();
|
|
@@ -850,8 +850,8 @@ const Tab = /*#__PURE__*/React.forwardRef(({
|
|
|
850
850
|
if (tabRef.current && tabRef.current.parentElement) {
|
|
851
851
|
// determine number of tabs, excluding disabled
|
|
852
852
|
const tabCount = Array.from(tabRef.current.parentElement.childNodes).filter(node => {
|
|
853
|
-
|
|
854
|
-
return
|
|
853
|
+
if (!(node instanceof HTMLElement)) return false;
|
|
854
|
+
return node.classList.contains(`${prefix}--tabs__nav-link`) && !node.classList.contains(`${prefix}--tabs__nav-item--disabled`);
|
|
855
855
|
}).length;
|
|
856
856
|
|
|
857
857
|
// if not removing last tab focus on next tab
|
|
@@ -861,7 +861,10 @@ const Tab = /*#__PURE__*/React.forwardRef(({
|
|
|
861
861
|
// if removing last tab focus on previous tab
|
|
862
862
|
else {
|
|
863
863
|
const prevTabIndex = (tabCount - 2) * 2;
|
|
864
|
-
tabRef.current.parentElement.childNodes[prevTabIndex]
|
|
864
|
+
const previousTab = tabRef.current.parentElement.childNodes[prevTabIndex];
|
|
865
|
+
if (previousTab instanceof HTMLElement) {
|
|
866
|
+
previousTab.focus();
|
|
867
|
+
}
|
|
865
868
|
}
|
|
866
869
|
}
|
|
867
870
|
};
|
|
@@ -1162,7 +1165,9 @@ function TabPanels({
|
|
|
1162
1165
|
// set max height to TabList
|
|
1163
1166
|
const heights = refs.current.map(ref => ref?.offsetHeight || 0);
|
|
1164
1167
|
const max = Math.max(...heights);
|
|
1165
|
-
tabContainer
|
|
1168
|
+
if (tabContainer instanceof HTMLElement) {
|
|
1169
|
+
tabContainer.style.height = max + 'px';
|
|
1170
|
+
}
|
|
1166
1171
|
|
|
1167
1172
|
// re-hide hidden Tab Panels
|
|
1168
1173
|
refs.current.forEach((ref, index) => {
|
|
@@ -49,8 +49,8 @@ const DismissibleTag = /*#__PURE__*/React.forwardRef(({
|
|
|
49
49
|
}, forwardRef) => {
|
|
50
50
|
const prefix = usePrefix.usePrefix();
|
|
51
51
|
const tagLabelRef = React.useRef(null);
|
|
52
|
-
|
|
53
|
-
const tagId = id
|
|
52
|
+
const generatedTagId = useId.useId();
|
|
53
|
+
const tagId = id ?? `tag-${generatedTagId}`;
|
|
54
54
|
const tagClasses = cx(`${prefix}--tag--filter`, className);
|
|
55
55
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
56
56
|
useIsomorphicEffect.default(() => {
|
|
@@ -49,8 +49,8 @@ const OperationalTag = /*#__PURE__*/React.forwardRef(({
|
|
|
49
49
|
}, forwardRef) => {
|
|
50
50
|
const prefix = usePrefix.usePrefix();
|
|
51
51
|
const tagRef = React.useRef(null);
|
|
52
|
-
|
|
53
|
-
const tagId = id
|
|
52
|
+
const generatedTagId = useId.useId();
|
|
53
|
+
const tagId = id ?? `tag-${generatedTagId}`;
|
|
54
54
|
const tagClasses = cx(`${prefix}--tag--operational`, className);
|
|
55
55
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
56
56
|
useIsomorphicEffect.default(() => {
|
|
@@ -41,8 +41,8 @@ const SelectableTag = /*#__PURE__*/React.forwardRef(({
|
|
|
41
41
|
}, forwardRef) => {
|
|
42
42
|
const prefix = usePrefix.usePrefix();
|
|
43
43
|
const tagRef = React.useRef(null);
|
|
44
|
-
|
|
45
|
-
const tagId = id
|
|
44
|
+
const generatedTagId = useId.useId();
|
|
45
|
+
const tagId = id ?? `tag-${generatedTagId}`;
|
|
46
46
|
const [selectedTag, setSelectedTag] = useControllableState.useControllableState({
|
|
47
47
|
value: selected,
|
|
48
48
|
onChange: onChange,
|
|
@@ -78,8 +78,8 @@ const TagBase = /*#__PURE__*/React.forwardRef(({
|
|
|
78
78
|
console.warn('The `onClose` prop for Tag has been deprecated and will be removed in the next major version. Use DismissibleTag instead.');
|
|
79
79
|
}
|
|
80
80
|
const ref = useMergedRefs.useMergedRefs([forwardRef, tagRef]);
|
|
81
|
-
|
|
82
|
-
const tagId = id
|
|
81
|
+
const generatedTagId = useId.useId();
|
|
82
|
+
const tagId = id ?? `tag-${generatedTagId}`;
|
|
83
83
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
84
84
|
useIsomorphicEffect.default(() => {
|
|
85
85
|
const newElement = tagRef.current?.getElementsByClassName(`${prefix}--tag__label`)[0];
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
import React, { type ReactNode } from 'react';
|
|
8
8
|
export interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
9
9
|
/**
|
|
10
|
-
* Provide a custom className that is applied
|
|
11
|
-
* `<textarea>` node
|
|
10
|
+
* Provide a custom className that is applied to the wrapper node
|
|
12
11
|
*/
|
|
13
12
|
className?: string;
|
|
14
13
|
/**
|
|
@@ -42,7 +42,7 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
42
42
|
onKeyDown = noopFn.noopFn,
|
|
43
43
|
invalid = false,
|
|
44
44
|
invalidText = '',
|
|
45
|
-
helperText
|
|
45
|
+
helperText,
|
|
46
46
|
light,
|
|
47
47
|
placeholder = '',
|
|
48
48
|
enableCounter = false,
|
|
@@ -243,7 +243,7 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
243
243
|
ariaDescribedBy = warnId;
|
|
244
244
|
} else {
|
|
245
245
|
const ids = [];
|
|
246
|
-
if (!isFluid &&
|
|
246
|
+
if (!isFluid && hasHelper && helperId) ids.push(helperId);
|
|
247
247
|
if (counterDescriptionId) ids.push(counterDescriptionId);
|
|
248
248
|
ariaDescribedBy = ids.length > 0 ? ids.join(' ') : undefined;
|
|
249
249
|
}
|
|
@@ -282,7 +282,7 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
282
282
|
}, [ariaAnnouncement, prevAnnouncement, counterMode]);
|
|
283
283
|
const input = /*#__PURE__*/React.createElement("textarea", _rollupPluginBabelHelpers.extends({}, other, textareaProps, {
|
|
284
284
|
placeholder: placeholder,
|
|
285
|
-
"aria-readonly":
|
|
285
|
+
"aria-readonly": other.readOnly,
|
|
286
286
|
className: textareaClasses,
|
|
287
287
|
"aria-invalid": invalid,
|
|
288
288
|
"aria-describedby": ariaDescribedBy,
|
|
@@ -328,8 +328,7 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
328
328
|
TextArea.displayName = 'TextArea';
|
|
329
329
|
TextArea.propTypes = {
|
|
330
330
|
/**
|
|
331
|
-
* Provide a custom className that is applied
|
|
332
|
-
* `<textarea>` node
|
|
331
|
+
* Provide a custom className that is applied to the wrapper node
|
|
333
332
|
*/
|
|
334
333
|
className: PropTypes.string,
|
|
335
334
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
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 from 'react';
|
|
7
|
+
import React, { type SelectHTMLAttributes } from 'react';
|
|
8
8
|
export type TimePickerSelectProps = {
|
|
9
9
|
/**
|
|
10
10
|
* Provide the contents of your TimePickerSelect
|
|
@@ -17,7 +17,7 @@ export type TimePickerSelectProps = {
|
|
|
17
17
|
/**
|
|
18
18
|
* Optionally provide the default value of the `<select>`
|
|
19
19
|
*/
|
|
20
|
-
defaultValue?:
|
|
20
|
+
defaultValue?: SelectHTMLAttributes<HTMLSelectElement>['defaultValue'];
|
|
21
21
|
/**
|
|
22
22
|
* Specify whether the control is disabled
|
|
23
23
|
*/
|
|
@@ -39,7 +39,7 @@ declare const TimePickerSelect: React.ForwardRefExoticComponent<{
|
|
|
39
39
|
/**
|
|
40
40
|
* Optionally provide the default value of the `<select>`
|
|
41
41
|
*/
|
|
42
|
-
defaultValue?:
|
|
42
|
+
defaultValue?: SelectHTMLAttributes<HTMLSelectElement>["defaultValue"];
|
|
43
43
|
/**
|
|
44
44
|
* Specify whether the control is disabled
|
|
45
45
|
*/
|
|
@@ -138,8 +138,7 @@ function Toggletip({
|
|
|
138
138
|
const eventType = 'PointerEvent' in window ? 'pointerdown' : 'mousedown';
|
|
139
139
|
const handleOutsideClick = event => {
|
|
140
140
|
const node = event.target;
|
|
141
|
-
|
|
142
|
-
if (open && node && !ref.current.contains(node)) {
|
|
141
|
+
if (open && node && !ref.current?.contains(node)) {
|
|
143
142
|
setOpen(false);
|
|
144
143
|
}
|
|
145
144
|
};
|
|
@@ -245,7 +245,7 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
245
245
|
return node;
|
|
246
246
|
}
|
|
247
247
|
if (node.classList.contains(`${prefix}--tree-node-link-parent`)) {
|
|
248
|
-
return node.
|
|
248
|
+
return node.firstElementChild;
|
|
249
249
|
}
|
|
250
250
|
if (node.classList.contains(`${prefix}--tree`)) {
|
|
251
251
|
return null;
|
|
@@ -267,7 +267,7 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
267
267
|
* When focus is on a leaf node or a closed parent node, move focus to
|
|
268
268
|
* its parent node (unless its depth is level 1)
|
|
269
269
|
*/
|
|
270
|
-
const parentNode = findParentTreeNode(href ? currentNode.current?.parentElement?.parentElement : currentNode.current?.parentElement);
|
|
270
|
+
const parentNode = findParentTreeNode((href ? currentNode.current?.parentElement?.parentElement : currentNode.current?.parentElement) ?? null);
|
|
271
271
|
if (parentNode instanceof HTMLElement) {
|
|
272
272
|
parentNode.focus();
|
|
273
273
|
}
|
|
@@ -63,8 +63,10 @@ const HeaderPanel = /*#__PURE__*/React.forwardRef(({
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
useEvent.useWindowEvent('click', event => {
|
|
66
|
-
const
|
|
67
|
-
|
|
66
|
+
const {
|
|
67
|
+
target
|
|
68
|
+
} = event;
|
|
69
|
+
if (!(target instanceof Element)) return;
|
|
68
70
|
setLastClickedElement(target);
|
|
69
71
|
const isChildASwitcher = /*#__PURE__*/React.isValidElement(children) && typeof children.type !== 'string' && children.type === Switcher.default;
|
|
70
72
|
if (isChildASwitcher && !target.closest(`.${prefix}--header-panel--expanded`) && !target.closest(`.${prefix}--header__action`) && !headerPanelReference?.current?.classList.contains(`${prefix}--switcher`) && expanded) {
|
|
@@ -24,7 +24,7 @@ var useDelayedState = require('../../internal/useDelayedState.js');
|
|
|
24
24
|
var layout = require('@carbon/layout');
|
|
25
25
|
var useMatchMedia = require('../../internal/useMatchMedia.js');
|
|
26
26
|
|
|
27
|
-
//
|
|
27
|
+
// TODO: comment back in when footer is added for rails
|
|
28
28
|
// import SideNavFooter from './SideNavFooter';
|
|
29
29
|
|
|
30
30
|
const SideNavContext = /*#__PURE__*/React.createContext({});
|
|
@@ -39,7 +39,7 @@ const SideNav = frFn((props, ref) => {
|
|
|
39
39
|
children,
|
|
40
40
|
onToggle,
|
|
41
41
|
className: customClassName,
|
|
42
|
-
//
|
|
42
|
+
// TODO: comment back in when footer is added for rails
|
|
43
43
|
// translateById: t = (id) => translations[id],
|
|
44
44
|
href,
|
|
45
45
|
isFixedNav = false,
|
|
@@ -77,7 +77,7 @@ const SideNav = frFn((props, ref) => {
|
|
|
77
77
|
'aria-labelledby': ariaLabelledBy
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
//
|
|
80
|
+
// TODO: comment back in when footer is added for rails
|
|
81
81
|
// const assistiveText = expanded
|
|
82
82
|
// ? t('carbon.sidenav.state.open')
|
|
83
83
|
// : t('carbon.sidenav.state.closed');
|
|
@@ -65,7 +65,7 @@ const Switcher = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
|
65
65
|
}
|
|
66
66
|
})();
|
|
67
67
|
const switcherItem = switcherRef.current?.children[nextValidIndex]?.children[0];
|
|
68
|
-
if (switcherItem) {
|
|
68
|
+
if (switcherItem instanceof HTMLElement) {
|
|
69
69
|
switcherItem.focus();
|
|
70
70
|
}
|
|
71
71
|
};
|
package/lib/feature-flags.js
CHANGED
|
@@ -7,28 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var featureFlags = require('@carbon/feature-flags');
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
var n = Object.create(null);
|
|
14
|
-
if (e) {
|
|
15
|
-
Object.keys(e).forEach(function (k) {
|
|
16
|
-
if (k !== 'default') {
|
|
17
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () { return e[k]; }
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
n.default = e;
|
|
26
|
-
return Object.freeze(n);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespaceDefault(FeatureFlags);
|
|
30
|
-
|
|
31
|
-
FeatureFlags__namespace.merge({
|
|
12
|
+
featureFlags.merge({
|
|
32
13
|
'enable-css-custom-properties': true,
|
|
33
14
|
'enable-css-grid': true,
|
|
34
15
|
'enable-v11-release': true,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
var React = require('react');
|
|
11
|
-
var
|
|
11
|
+
var featureFlags = require('@carbon/feature-flags');
|
|
12
12
|
var ReactDOM = require('react-dom');
|
|
13
13
|
var keys = require('./keyboard/keys.js');
|
|
14
14
|
var match = require('./keyboard/match.js');
|
|
@@ -18,25 +18,6 @@ var usePrefix = require('./usePrefix.js');
|
|
|
18
18
|
var warning = require('./warning.js');
|
|
19
19
|
var wrapFocus = require('./wrapFocus.js');
|
|
20
20
|
|
|
21
|
-
function _interopNamespaceDefault(e) {
|
|
22
|
-
var n = Object.create(null);
|
|
23
|
-
if (e) {
|
|
24
|
-
Object.keys(e).forEach(function (k) {
|
|
25
|
-
if (k !== 'default') {
|
|
26
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
27
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () { return e[k]; }
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
n.default = e;
|
|
35
|
-
return Object.freeze(n);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespaceDefault(FeatureFlags);
|
|
39
|
-
|
|
40
21
|
const DIRECTION_LEFT = 'left';
|
|
41
22
|
const DIRECTION_TOP = 'top';
|
|
42
23
|
const DIRECTION_RIGHT = 'right';
|
|
@@ -295,8 +276,8 @@ const FloatingMenu = ({
|
|
|
295
276
|
});
|
|
296
277
|
}
|
|
297
278
|
};
|
|
298
|
-
const deprecatedFlag =
|
|
299
|
-
const focusTrapWithoutSentinelsFlag =
|
|
279
|
+
const deprecatedFlag = featureFlags.enabled('enable-experimental-focus-wrap-without-sentinels');
|
|
280
|
+
const focusTrapWithoutSentinelsFlag = featureFlags.enabled('enable-focus-wrap-without-sentinels');
|
|
300
281
|
const focusTrapWithoutSentinels = deprecatedFlag || focusTrapWithoutSentinelsFlag;
|
|
301
282
|
if (typeof document !== 'undefined') {
|
|
302
283
|
const portalTarget = target ? target() : document.body;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.102.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@babel/runtime": "^7.27.3",
|
|
55
|
-
"@carbon/feature-flags": "1.0.0",
|
|
56
|
-
"@carbon/icons-react": "^11.
|
|
55
|
+
"@carbon/feature-flags": "^1.0.0",
|
|
56
|
+
"@carbon/icons-react": "^11.76.0-rc.0",
|
|
57
57
|
"@carbon/layout": "^11.48.0",
|
|
58
|
-
"@carbon/styles": "^1.
|
|
58
|
+
"@carbon/styles": "^1.101.0-rc.0",
|
|
59
59
|
"@carbon/utilities": "^0.16.0",
|
|
60
60
|
"@floating-ui/react": "^0.27.4",
|
|
61
61
|
"@ibm/telemetry-js": "^1.5.0",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"@babel/preset-react": "^7.27.1",
|
|
80
80
|
"@babel/preset-typescript": "^7.27.1",
|
|
81
81
|
"@carbon/test-utils": "^10.40.0",
|
|
82
|
-
"@carbon/themes": "^11.
|
|
83
|
-
"@figma/code-connect": "^1.3.
|
|
82
|
+
"@carbon/themes": "^11.69.0-rc.0",
|
|
83
|
+
"@figma/code-connect": "^1.3.13",
|
|
84
84
|
"@rollup/plugin-babel": "^6.0.0",
|
|
85
85
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
86
86
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
@@ -131,5 +131,5 @@
|
|
|
131
131
|
"**/*.scss",
|
|
132
132
|
"**/*.css"
|
|
133
133
|
],
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "be65faf18c90ab4e6e60afdfad77d412220bd077"
|
|
135
135
|
}
|