@carbon/react 1.89.0 → 1.90.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 +877 -877
- package/README.md +2 -2
- package/es/components/AILabel/index.js +8 -6
- package/es/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/es/components/Button/Button.js +3 -0
- package/es/components/ChatButton/ChatButton.js +1 -0
- package/es/components/CheckboxGroup/CheckboxGroup.js +21 -2
- package/es/components/ComboBox/ComboBox.js +17 -1
- package/es/components/ComboButton/index.js +1 -0
- package/es/components/ComposedModal/ComposedModal.js +18 -4
- package/es/components/DataTable/DataTable.d.ts +3 -8
- package/es/components/DataTable/DataTable.js +14 -0
- package/es/components/DataTable/Table.js +3 -3
- package/es/components/DataTable/TableExpandHeader.js +5 -1
- package/es/components/DataTable/TableExpandRow.d.ts +33 -5
- package/es/components/DataTable/TableExpandRow.js +5 -2
- package/es/components/DataTable/TableHeader.d.ts +1 -2
- package/es/components/DataTable/TableHeader.js +3 -2
- package/es/components/DataTable/TableRow.d.ts +3 -6
- package/es/components/DataTable/TableRow.js +40 -22
- package/es/components/DataTable/TableSlugRow.js +1 -0
- package/es/components/DataTable/TableToolbarMenu.js +3 -0
- package/es/components/DataTable/state/sorting.d.ts +57 -14
- package/es/components/DataTable/state/sorting.js +42 -50
- package/es/components/DataTable/tools/sorting.js +5 -0
- package/es/components/DatePicker/DatePicker.js +14 -3
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/Dialog/Dialog.js +10 -2
- package/es/components/Dropdown/Dropdown.js +16 -4
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/es/components/FileUploader/FileUploader.js +9 -2
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +3 -0
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/es/components/FluidSearch/FluidSearch.js +3 -2
- package/es/components/FluidSelect/FluidSelect.js +3 -2
- package/es/components/FluidTextInput/FluidTextInput.js +3 -2
- package/es/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/es/components/Grid/CSSGrid.js +5 -0
- package/es/components/Grid/Column.js +3 -0
- package/es/components/Grid/ColumnHang.js +1 -0
- package/es/components/Grid/FlexGrid.js +1 -0
- package/es/components/Grid/Row.js +1 -0
- package/es/components/Heading/index.js +3 -1
- package/es/components/IconButton/index.js +4 -2
- package/es/components/IconIndicator/index.js +4 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/es/components/Layout/index.js +6 -4
- package/es/components/LayoutDirection/LayoutDirection.js +2 -0
- package/es/components/Link/Link.js +3 -0
- package/es/components/ListBox/ListBoxMenuItem.js +4 -1
- package/es/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/es/components/Menu/Menu.js +6 -9
- package/es/components/Menu/MenuContext.js +1 -0
- package/es/components/Menu/MenuItem.js +5 -13
- package/es/components/MenuButton/index.js +7 -2
- package/es/components/Modal/Modal.js +15 -6
- package/es/components/ModalWrapper/ModalWrapper.js +2 -0
- package/es/components/MultiSelect/FilterableMultiSelect.js +24 -5
- package/es/components/MultiSelect/MultiSelect.js +21 -5
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/NumberInput/NumberInput.js +18 -7
- package/es/components/OverflowMenu/OverflowMenu.js +2 -0
- package/es/components/OverflowMenu/next/index.js +3 -2
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/es/components/PageHeader/PageHeader.d.ts +3 -3
- package/es/components/PageHeader/PageHeader.js +22 -8
- package/es/components/Pagination/Pagination.js +6 -2
- package/es/components/PaginationNav/PaginationNav.js +2 -5
- package/es/components/Popover/index.js +20 -6
- package/es/components/ProgressBar/ProgressBar.js +4 -2
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Search/Search.js +2 -2
- package/es/components/Select/Select.js +2 -3
- package/es/components/ShapeIndicator/index.js +4 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/es/components/SkeletonText/SkeletonText.js +0 -2
- package/es/components/Slider/Slider.js +11 -16
- package/es/components/Stack/HStack.js +1 -0
- package/es/components/Stack/Stack.js +6 -9
- package/es/components/Stack/VStack.js +1 -0
- package/es/components/StructuredList/StructuredList.js +3 -0
- package/es/components/Switch/Switch.js +1 -1
- package/es/components/Tabs/Tabs.js +28 -17
- package/es/components/Tag/DismissibleTag.d.ts +5 -0
- package/es/components/Tag/DismissibleTag.js +8 -1
- package/es/components/Tag/OperationalTag.js +2 -0
- package/es/components/Tag/SelectableTag.js +2 -0
- package/es/components/Tag/Tag.js +4 -0
- package/es/components/Tag/isEllipsisActive.js +1 -0
- package/es/components/Text/Text.js +1 -0
- package/es/components/TextInput/ControlledPasswordInput.js +2 -4
- package/es/components/TextInput/PasswordInput.js +7 -2
- package/es/components/TextInput/TextInput.js +4 -2
- package/es/components/Theme/index.js +8 -3
- package/es/components/Tile/Tile.js +14 -17
- package/es/components/TimePicker/TimePicker.js +1 -0
- package/es/components/Toggle/Toggle.js +1 -1
- package/es/components/Toggletip/index.js +23 -8
- package/es/components/Tooltip/DefinitionTooltip.js +1 -0
- package/es/components/Tooltip/Tooltip.js +30 -23
- package/es/components/TreeView/TreeNode.d.ts +28 -0
- package/es/components/TreeView/TreeNode.js +19 -10
- package/es/components/TreeView/TreeView.js +7 -0
- package/es/components/UIShell/HeaderContainer.js +3 -1
- package/es/components/UIShell/HeaderGlobalAction.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +3 -3
- package/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/components/UIShell/Link.js +2 -0
- package/es/components/UIShell/SideNavItems.js +1 -0
- package/es/components/UIShell/SideNavMenu.js +2 -2
- package/es/components/UIShell/SideNavMenuItem.js +1 -1
- package/es/components/UIShell/SideNavSwitcher.js +1 -1
- package/es/components/UIShell/Switcher.js +2 -1
- package/es/components/UIShell/SwitcherItem.js +4 -2
- package/es/internal/FloatingMenu.js +7 -1
- package/es/internal/Selection.js +12 -3
- package/es/internal/useMergedRefs.js +1 -0
- package/es/internal/useNoInteractiveChildren.js +4 -0
- package/es/internal/useOutsideClick.js +1 -0
- package/es/internal/useOverflowItems.js +6 -0
- package/es/internal/useResizeObserver.js +4 -0
- package/es/internal/useSavedCallback.js +1 -0
- package/es/internal/warning.js +1 -0
- package/es/prop-types/isRequiredOneOf.js +4 -1
- package/es/tools/events.js +3 -1
- package/es/tools/wrapComponent.js +1 -0
- package/lib/components/AILabel/index.js +8 -6
- package/lib/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/lib/components/Button/Button.js +3 -0
- package/lib/components/ChatButton/ChatButton.js +1 -0
- package/lib/components/CheckboxGroup/CheckboxGroup.js +20 -1
- package/lib/components/ComboBox/ComboBox.js +17 -1
- package/lib/components/ComboButton/index.js +1 -0
- package/lib/components/ComposedModal/ComposedModal.js +18 -4
- package/lib/components/DataTable/DataTable.d.ts +3 -8
- package/lib/components/DataTable/DataTable.js +14 -0
- package/lib/components/DataTable/Table.js +3 -3
- package/lib/components/DataTable/TableExpandHeader.js +5 -1
- package/lib/components/DataTable/TableExpandRow.d.ts +33 -5
- package/lib/components/DataTable/TableExpandRow.js +5 -2
- package/lib/components/DataTable/TableHeader.d.ts +1 -2
- package/lib/components/DataTable/TableHeader.js +3 -2
- package/lib/components/DataTable/TableRow.d.ts +3 -6
- package/lib/components/DataTable/TableRow.js +39 -21
- package/lib/components/DataTable/TableSlugRow.js +1 -0
- package/lib/components/DataTable/TableToolbarMenu.js +3 -0
- package/lib/components/DataTable/state/sorting.d.ts +57 -14
- package/lib/components/DataTable/state/sorting.js +41 -50
- package/lib/components/DataTable/tools/sorting.js +5 -0
- package/lib/components/DatePicker/DatePicker.js +14 -3
- package/lib/components/DatePickerInput/DatePickerInput.js +6 -0
- package/lib/components/Dialog/Dialog.js +10 -2
- package/lib/components/Dropdown/Dropdown.js +16 -4
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/lib/components/FileUploader/FileUploader.js +9 -2
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +3 -0
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/lib/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/lib/components/FluidSearch/FluidSearch.js +3 -2
- package/lib/components/FluidSelect/FluidSelect.js +3 -2
- package/lib/components/FluidTextInput/FluidTextInput.js +3 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/lib/components/Grid/CSSGrid.js +5 -0
- package/lib/components/Grid/Column.js +3 -0
- package/lib/components/Grid/ColumnHang.js +1 -0
- package/lib/components/Grid/FlexGrid.js +1 -0
- package/lib/components/Grid/Row.js +1 -0
- package/lib/components/Heading/index.js +3 -1
- package/lib/components/IconButton/index.js +4 -2
- package/lib/components/IconIndicator/index.js +4 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/lib/components/Layout/index.js +6 -4
- package/lib/components/LayoutDirection/LayoutDirection.js +2 -0
- package/lib/components/Link/Link.js +3 -0
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -1
- package/lib/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/lib/components/Menu/Menu.js +6 -9
- package/lib/components/Menu/MenuContext.js +1 -0
- package/lib/components/Menu/MenuItem.js +5 -13
- package/lib/components/MenuButton/index.js +7 -2
- package/lib/components/Modal/Modal.js +15 -6
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.js +24 -5
- package/lib/components/MultiSelect/MultiSelect.js +21 -5
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/NumberInput/NumberInput.js +17 -6
- package/lib/components/OverflowMenu/OverflowMenu.js +2 -0
- package/lib/components/OverflowMenu/next/index.js +3 -2
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/lib/components/PageHeader/PageHeader.d.ts +3 -3
- package/lib/components/PageHeader/PageHeader.js +22 -8
- package/lib/components/Pagination/Pagination.js +6 -2
- package/lib/components/PaginationNav/PaginationNav.js +2 -5
- package/lib/components/Popover/index.js +20 -6
- package/lib/components/ProgressBar/ProgressBar.js +4 -2
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Search/Search.js +2 -2
- package/lib/components/Select/Select.js +2 -3
- package/lib/components/ShapeIndicator/index.js +4 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/lib/components/SkeletonText/SkeletonText.js +0 -2
- package/lib/components/Slider/Slider.js +11 -16
- package/lib/components/Stack/HStack.js +1 -0
- package/lib/components/Stack/Stack.js +6 -9
- package/lib/components/Stack/VStack.js +1 -0
- package/lib/components/StructuredList/StructuredList.js +3 -0
- package/lib/components/Switch/Switch.js +1 -1
- package/lib/components/Tabs/Tabs.js +28 -17
- package/lib/components/Tag/DismissibleTag.d.ts +5 -0
- package/lib/components/Tag/DismissibleTag.js +8 -1
- package/lib/components/Tag/OperationalTag.js +2 -0
- package/lib/components/Tag/SelectableTag.js +2 -0
- package/lib/components/Tag/Tag.js +4 -0
- package/lib/components/Tag/isEllipsisActive.js +1 -0
- package/lib/components/Text/Text.js +1 -0
- package/lib/components/TextInput/ControlledPasswordInput.js +2 -4
- package/lib/components/TextInput/PasswordInput.js +7 -2
- package/lib/components/TextInput/TextInput.js +4 -2
- package/lib/components/Theme/index.js +8 -3
- package/lib/components/Tile/Tile.js +14 -17
- package/lib/components/TimePicker/TimePicker.js +1 -0
- package/lib/components/Toggle/Toggle.js +1 -1
- package/lib/components/Toggletip/index.js +22 -7
- package/lib/components/Tooltip/DefinitionTooltip.js +1 -0
- package/lib/components/Tooltip/Tooltip.js +30 -23
- package/lib/components/TreeView/TreeNode.d.ts +28 -0
- package/lib/components/TreeView/TreeNode.js +19 -10
- package/lib/components/TreeView/TreeView.js +7 -0
- package/lib/components/UIShell/HeaderContainer.js +3 -1
- package/lib/components/UIShell/HeaderGlobalAction.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +3 -3
- package/lib/components/UIShell/HeaderPanel.js +2 -2
- package/lib/components/UIShell/Link.js +2 -0
- package/lib/components/UIShell/SideNavItems.js +1 -0
- package/lib/components/UIShell/SideNavMenu.js +2 -2
- package/lib/components/UIShell/SideNavMenuItem.js +1 -1
- package/lib/components/UIShell/SideNavSwitcher.js +1 -1
- package/lib/components/UIShell/Switcher.js +2 -1
- package/lib/components/UIShell/SwitcherItem.js +4 -2
- package/lib/internal/FloatingMenu.js +7 -1
- package/lib/internal/Selection.js +12 -3
- package/lib/internal/useMergedRefs.js +1 -0
- package/lib/internal/useNoInteractiveChildren.js +4 -0
- package/lib/internal/useOutsideClick.js +1 -0
- package/lib/internal/useOverflowItems.js +6 -0
- package/lib/internal/useResizeObserver.js +4 -0
- package/lib/internal/useSavedCallback.js +1 -0
- package/lib/internal/warning.js +1 -0
- package/lib/prop-types/isRequiredOneOf.js +4 -1
- package/lib/tools/events.js +3 -1
- package/lib/tools/wrapComponent.js +1 -0
- package/package.json +11 -11
- package/telemetry.yml +14 -0
|
@@ -95,6 +95,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(({
|
|
|
95
95
|
ref.current.close();
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
98
99
|
}, [modal, open]);
|
|
99
100
|
React.useEffect(() => {
|
|
100
101
|
if (!open && focusAfterCloseRef) {
|
|
@@ -125,6 +126,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(({
|
|
|
125
126
|
ref.current.setAttribute('aria-labelledby', title.id);
|
|
126
127
|
}
|
|
127
128
|
}
|
|
129
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
128
130
|
}, [open, ariaLabel, ariaLabelledBy, prefix]);
|
|
129
131
|
return /*#__PURE__*/React.createElement(DialogContext.Provider, {
|
|
130
132
|
value: contextValue
|
|
@@ -229,6 +231,7 @@ const DialogControls = /*#__PURE__*/React.forwardRef(({
|
|
|
229
231
|
const prefix = usePrefix.usePrefix();
|
|
230
232
|
return (
|
|
231
233
|
/*#__PURE__*/
|
|
234
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
232
235
|
// @ts-ignore
|
|
233
236
|
React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
234
237
|
className: `${prefix}--dialog__header-controls`,
|
|
@@ -257,6 +260,7 @@ const DialogCloseButton = /*#__PURE__*/React.forwardRef(({
|
|
|
257
260
|
const prefix = usePrefix.usePrefix();
|
|
258
261
|
return (
|
|
259
262
|
/*#__PURE__*/
|
|
263
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
260
264
|
// @ts-ignore
|
|
261
265
|
React.createElement(index.IconButton, _rollupPluginBabelHelpers.extends({
|
|
262
266
|
kind: "ghost",
|
|
@@ -492,7 +496,9 @@ const DialogFooter = /*#__PURE__*/React.forwardRef(({
|
|
|
492
496
|
buttonText,
|
|
493
497
|
onClick: onButtonClick
|
|
494
498
|
}, i) => /*#__PURE__*/React.createElement(Button.default, {
|
|
495
|
-
key: `${buttonText}-${i}
|
|
499
|
+
key: `${buttonText}-${i}`
|
|
500
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
501
|
+
,
|
|
496
502
|
autoFocus: danger,
|
|
497
503
|
kind: "secondary",
|
|
498
504
|
ref: i === 0 && danger ? setSecondaryButtonRef : undefined,
|
|
@@ -500,7 +506,9 @@ const DialogFooter = /*#__PURE__*/React.forwardRef(({
|
|
|
500
506
|
}, buttonText)) : secondaryButtonText && /*#__PURE__*/React.createElement(Button.default, {
|
|
501
507
|
ref: danger ? setSecondaryButtonRef : undefined,
|
|
502
508
|
disabled: loadingActive,
|
|
503
|
-
kind: "secondary"
|
|
509
|
+
kind: "secondary"
|
|
510
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
511
|
+
,
|
|
504
512
|
autoFocus: danger,
|
|
505
513
|
onClick: onSecondaryButtonClick
|
|
506
514
|
}, secondaryButtonText), /*#__PURE__*/React.createElement(Button.default, {
|
|
@@ -153,6 +153,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
156
157
|
}, [floatingStyles, autoAlign, refs.floating]);
|
|
157
158
|
const prefix = usePrefix.usePrefix();
|
|
158
159
|
const {
|
|
@@ -167,6 +168,8 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
167
168
|
});
|
|
168
169
|
}
|
|
169
170
|
}, [onChange]);
|
|
171
|
+
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
170
173
|
const isItemDisabled = React.useCallback((item, _index) => {
|
|
171
174
|
const isObject = item !== null && typeof item === 'object';
|
|
172
175
|
return isObject && 'disabled' in item && item.disabled === true;
|
|
@@ -175,7 +178,9 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
175
178
|
const {
|
|
176
179
|
highlightedIndex
|
|
177
180
|
} = changes;
|
|
178
|
-
if (highlightedIndex !== undefined && highlightedIndex > -1 &&
|
|
181
|
+
if (highlightedIndex !== undefined && highlightedIndex > -1 &&
|
|
182
|
+
// eslint-disable-next-line valid-typeof , no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
183
|
+
typeof window !== undefined) {
|
|
179
184
|
const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
|
|
180
185
|
const highlightedItem = itemArray[highlightedIndex];
|
|
181
186
|
if (highlightedItem) {
|
|
@@ -196,7 +201,9 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
196
201
|
isItemDisabled,
|
|
197
202
|
onHighlightedIndexChange,
|
|
198
203
|
...downshiftProps
|
|
199
|
-
}),
|
|
204
|
+
}),
|
|
205
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
206
|
+
[items, itemToString, initialSelectedItem, onSelectedItemChange, stateReducer, isItemDisabled, onHighlightedIndexChange, downshiftProps]);
|
|
200
207
|
const dropdownInstanceId = useId.useId();
|
|
201
208
|
|
|
202
209
|
// only set selectedItem if the prop is defined. Setting if it is undefined
|
|
@@ -285,7 +292,9 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
285
292
|
if (toggleButtonProps.onKeyDown && (evt.key !== 'ArrowUp' || isOpen && evt.key === 'ArrowUp')) {
|
|
286
293
|
toggleButtonProps.onKeyDown(evt);
|
|
287
294
|
}
|
|
288
|
-
},
|
|
295
|
+
},
|
|
296
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
297
|
+
[isTyping, currTimer, toggleButtonProps]);
|
|
289
298
|
const readOnlyEventHandlers = React.useMemo(() => {
|
|
290
299
|
if (readOnly) {
|
|
291
300
|
return {
|
|
@@ -308,6 +317,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
308
317
|
onKeyDown: onKeyDownHandler
|
|
309
318
|
};
|
|
310
319
|
}
|
|
320
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
311
321
|
}, [readOnly, onKeyDownHandler]);
|
|
312
322
|
const menuProps = React.useMemo(() => getMenuProps({
|
|
313
323
|
ref: enableFloatingStyles || autoAlign ? refs.setFloating : null
|
|
@@ -358,7 +368,9 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
358
368
|
ref: mergedRef
|
|
359
369
|
}), /*#__PURE__*/React.createElement("span", {
|
|
360
370
|
className: `${prefix}--list-box__label`
|
|
361
|
-
}, selectedItem ? renderSelectedItem ? renderSelectedItem(selectedItem) : itemToString(selectedItem) :
|
|
371
|
+
}, selectedItem ? renderSelectedItem ? renderSelectedItem(selectedItem) : itemToString(selectedItem) :
|
|
372
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
373
|
+
label), /*#__PURE__*/React.createElement(index$2.default.MenuIcon, {
|
|
362
374
|
isOpen: isOpen,
|
|
363
375
|
translateWithId: translateWithId
|
|
364
376
|
})), slug ? normalizedDecorator : decorator ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -11,6 +11,7 @@ var React = require('react');
|
|
|
11
11
|
|
|
12
12
|
const ErrorBoundaryContext = /*#__PURE__*/React.createContext({
|
|
13
13
|
log(error, info) {
|
|
14
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
14
15
|
console.log(info.componentStack);
|
|
15
16
|
}
|
|
16
17
|
});
|
|
@@ -24,6 +24,7 @@ var useId = require('../../internal/useId.js');
|
|
|
24
24
|
var index = require('../FeatureFlags/index.js');
|
|
25
25
|
var Text = require('../Text/Text.js');
|
|
26
26
|
|
|
27
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
27
28
|
const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
28
29
|
accept,
|
|
29
30
|
buttonKind,
|
|
@@ -47,6 +48,8 @@ const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
|
47
48
|
const enhancedFileUploaderEnabled = index.useFeatureFlag('enable-enhanced-file-uploader');
|
|
48
49
|
const [fileItems, setFileItems] = React.useState([]);
|
|
49
50
|
const [legacyFileNames, setLegacyFileNames] = React.useState([]);
|
|
51
|
+
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
50
53
|
const [fileObjects, setFileObjects] = React.useState(new Map());
|
|
51
54
|
const nodes = [];
|
|
52
55
|
const createFileItem = file => ({
|
|
@@ -99,7 +102,9 @@ const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
|
99
102
|
onChange(evt);
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
|
-
},
|
|
105
|
+
},
|
|
106
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
107
|
+
[enhancedFileUploaderEnabled, fileItems, legacyFileNames, multiple, onChange]);
|
|
103
108
|
const handleClick = React.useCallback((evt, {
|
|
104
109
|
index,
|
|
105
110
|
filenameStatus
|
|
@@ -154,7 +159,9 @@ const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
|
154
159
|
}
|
|
155
160
|
uploaderButton.current?.focus?.();
|
|
156
161
|
}
|
|
157
|
-
},
|
|
162
|
+
},
|
|
163
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
164
|
+
[enhancedFileUploaderEnabled, fileItems, legacyFileNames, onDelete, onChange, onClick]);
|
|
158
165
|
React.useImperativeHandle(ref, () => ({
|
|
159
166
|
clearFiles() {
|
|
160
167
|
if (enhancedFileUploaderEnabled) {
|
|
@@ -34,13 +34,13 @@ function FileUploaderButton({
|
|
|
34
34
|
onChange = noopFn.noopFn,
|
|
35
35
|
name,
|
|
36
36
|
size = 'md',
|
|
37
|
-
// eslint-disable-next-line react/prop-types
|
|
38
37
|
innerRef,
|
|
39
38
|
...other
|
|
40
39
|
}) {
|
|
41
40
|
const prefix = usePrefix.usePrefix();
|
|
42
41
|
const [labelText, setLabelText] = React.useState(ownerLabelText);
|
|
43
42
|
const [prevOwnerLabelText, setPrevOwnerLabelText] = React.useState(ownerLabelText);
|
|
43
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
44
44
|
const {
|
|
45
45
|
current: inputId
|
|
46
46
|
} = React.useRef(id || useId.useId());
|
|
@@ -32,12 +32,12 @@ function FileUploaderDropContainer({
|
|
|
32
32
|
onAddFiles = noopFn.noopFn,
|
|
33
33
|
onClick,
|
|
34
34
|
pattern = '.[0-9a-z]+$',
|
|
35
|
-
// eslint-disable-next-line react/prop-types
|
|
36
35
|
innerRef,
|
|
37
36
|
...rest
|
|
38
37
|
}) {
|
|
39
38
|
const prefix = usePrefix.usePrefix();
|
|
40
39
|
const inputRef = React.useRef(null);
|
|
40
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
41
41
|
const {
|
|
42
42
|
current: uid
|
|
43
43
|
} = React.useRef(id || useId.useId());
|
|
@@ -40,6 +40,7 @@ function FileUploaderItem({
|
|
|
40
40
|
const textRef = React.useRef(null);
|
|
41
41
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
42
42
|
const prefix = usePrefix.usePrefix();
|
|
43
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
43
44
|
const {
|
|
44
45
|
current: id
|
|
45
46
|
} = React.useRef(uuid || useId.useId());
|
|
@@ -52,6 +53,8 @@ function FileUploaderItem({
|
|
|
52
53
|
const filterSpaceName = name => {
|
|
53
54
|
return name?.replace(/\s+/g, '');
|
|
54
55
|
};
|
|
56
|
+
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
55
58
|
const isEllipsisActive = element => {
|
|
56
59
|
setIsEllipsisApplied(element.offsetWidth < element.scrollWidth);
|
|
57
60
|
return element.offsetWidth < element.scrollWidth;
|
|
@@ -34,12 +34,14 @@ const FluidMultiSelect = /*#__PURE__*/React.forwardRef(function FluidMultiSelect
|
|
|
34
34
|
}
|
|
35
35
|
}, isFilterable ?
|
|
36
36
|
/*#__PURE__*/
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
37
38
|
// @ts-ignore
|
|
38
39
|
React.createElement(FilterableMultiSelect.FilterableMultiSelect, _rollupPluginBabelHelpers.extends({
|
|
39
40
|
ref: ref,
|
|
40
41
|
className: classNames
|
|
41
42
|
}, other)) :
|
|
42
43
|
/*#__PURE__*/
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
43
45
|
// @ts-ignore
|
|
44
46
|
React.createElement(MultiSelect.MultiSelect, _rollupPluginBabelHelpers.extends({
|
|
45
47
|
ref: ref,
|
|
@@ -19,10 +19,11 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
19
19
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
20
20
|
var NumberFormatPropTypes = require('../NumberInput/NumberFormatPropTypes.js');
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
23
|
+
const FluidNumberInput = /*#__PURE__*/React.forwardRef(({
|
|
23
24
|
className,
|
|
24
25
|
...other
|
|
25
|
-
}, ref) {
|
|
26
|
+
}, ref) => {
|
|
26
27
|
const prefix = usePrefix.usePrefix();
|
|
27
28
|
const classNames = cx(`${prefix}--number-input--fluid`, className);
|
|
28
29
|
return /*#__PURE__*/React.createElement(FormContext.FormContext.Provider, {
|
|
@@ -18,10 +18,11 @@ require('../Search/Search.Skeleton.js');
|
|
|
18
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
19
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
22
|
+
const FluidSearch = /*#__PURE__*/React.forwardRef(({
|
|
22
23
|
className,
|
|
23
24
|
...other
|
|
24
|
-
}, ref) {
|
|
25
|
+
}, ref) => {
|
|
25
26
|
const prefix = usePrefix.usePrefix();
|
|
26
27
|
const classNames = cx(`${prefix}--search--fluid`, className);
|
|
27
28
|
return /*#__PURE__*/React.createElement(FormContext.FormContext.Provider, {
|
|
@@ -18,11 +18,12 @@ require('../Select/Select.Skeleton.js');
|
|
|
18
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
19
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
22
|
+
const FluidSelect = /*#__PURE__*/React.forwardRef(({
|
|
22
23
|
className,
|
|
23
24
|
children,
|
|
24
25
|
...other
|
|
25
|
-
}, ref) {
|
|
26
|
+
}, ref) => {
|
|
26
27
|
const prefix = usePrefix.usePrefix();
|
|
27
28
|
const classNames = cx(`${prefix}--select--fluid`, className);
|
|
28
29
|
return /*#__PURE__*/React.createElement(FormContext.FormContext.Provider, {
|
|
@@ -20,11 +20,12 @@ var PasswordInput = require('../TextInput/PasswordInput.js');
|
|
|
20
20
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
21
21
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
24
|
+
const FluidTextInput = /*#__PURE__*/React.forwardRef(({
|
|
24
25
|
className,
|
|
25
26
|
isPassword,
|
|
26
27
|
...other
|
|
27
|
-
}, ref) {
|
|
28
|
+
}, ref) => {
|
|
28
29
|
const prefix = usePrefix.usePrefix();
|
|
29
30
|
const classNames = cx(className, {
|
|
30
31
|
[`${prefix}--text-input--fluid`]: !isPassword
|
|
@@ -19,7 +19,8 @@ require('../FluidTextInput/FluidTextInput.Skeleton.js');
|
|
|
19
19
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
20
|
var iconsReact = require('@carbon/icons-react');
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
23
|
+
const FluidTimePicker = /*#__PURE__*/React.forwardRef(({
|
|
23
24
|
className,
|
|
24
25
|
children,
|
|
25
26
|
disabled,
|
|
@@ -29,7 +30,7 @@ const FluidTimePicker = /*#__PURE__*/React.forwardRef(function FluidTimePicker({
|
|
|
29
30
|
warnText,
|
|
30
31
|
readOnly,
|
|
31
32
|
...other
|
|
32
|
-
}, ref) {
|
|
33
|
+
}, ref) => {
|
|
33
34
|
const prefix = usePrefix.usePrefix();
|
|
34
35
|
const classNames = cx(className, {
|
|
35
36
|
[`${prefix}--time-picker--fluid`]: true,
|
|
@@ -49,12 +50,18 @@ const FluidTimePicker = /*#__PURE__*/React.forwardRef(function FluidTimePicker({
|
|
|
49
50
|
const error = invalid || warn;
|
|
50
51
|
const childrenWithProps = () => {
|
|
51
52
|
if (disabled) {
|
|
52
|
-
return React.Children.toArray(children).map(child =>
|
|
53
|
+
return React.Children.toArray(children).map(child =>
|
|
54
|
+
/*#__PURE__*/
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
56
|
+
React.cloneElement(child, {
|
|
53
57
|
disabled: true
|
|
54
58
|
}));
|
|
55
59
|
}
|
|
56
60
|
if (readOnly) {
|
|
57
|
-
return React.Children.toArray(children).map(child =>
|
|
61
|
+
return React.Children.toArray(children).map(child =>
|
|
62
|
+
/*#__PURE__*/
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
64
|
+
React.cloneElement(child, {
|
|
58
65
|
readOnly: true
|
|
59
66
|
}));
|
|
60
67
|
}
|
|
@@ -15,11 +15,12 @@ var PropTypes = require('prop-types');
|
|
|
15
15
|
var FluidSelect = require('../FluidSelect/FluidSelect.js');
|
|
16
16
|
require('../FluidSelect/FluidSelect.Skeleton.js');
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
19
|
+
const FluidTimePickerSelect = /*#__PURE__*/React.forwardRef(({
|
|
19
20
|
children,
|
|
20
21
|
className,
|
|
21
22
|
...other
|
|
22
|
-
}, ref) {
|
|
23
|
+
}, ref) => {
|
|
23
24
|
return /*#__PURE__*/React.createElement(FluidSelect.default, _rollupPluginBabelHelpers.extends({
|
|
24
25
|
className: className,
|
|
25
26
|
ref: ref
|
|
@@ -14,6 +14,7 @@ var React = require('react');
|
|
|
14
14
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
15
15
|
var GridContext = require('./GridContext.js');
|
|
16
16
|
|
|
17
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
17
18
|
const CSSGrid = /*#__PURE__*/React.forwardRef(({
|
|
18
19
|
align,
|
|
19
20
|
as,
|
|
@@ -96,6 +97,10 @@ CSSGrid.propTypes = {
|
|
|
96
97
|
*/
|
|
97
98
|
narrow: PropTypes.bool
|
|
98
99
|
};
|
|
100
|
+
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
102
|
+
|
|
103
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
99
104
|
const Subgrid = /*#__PURE__*/React.forwardRef(({
|
|
100
105
|
as,
|
|
101
106
|
className: customClassName,
|
|
@@ -36,6 +36,7 @@ function _interopNamespaceDefault(e) {
|
|
|
36
36
|
|
|
37
37
|
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespaceDefault(FeatureFlags);
|
|
38
38
|
|
|
39
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
39
40
|
const Column = /*#__PURE__*/React.forwardRef(({
|
|
40
41
|
as,
|
|
41
42
|
children,
|
|
@@ -137,6 +138,8 @@ Column.propTypes = {
|
|
|
137
138
|
*/
|
|
138
139
|
xlg: spanPropType
|
|
139
140
|
};
|
|
141
|
+
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any , react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
140
143
|
const CSSGridColumn = /*#__PURE__*/React.forwardRef(({
|
|
141
144
|
as: BaseComponent = 'div',
|
|
142
145
|
children,
|
|
@@ -26,6 +26,7 @@ function ColumnHang({
|
|
|
26
26
|
const prefix = usePrefix.usePrefix();
|
|
27
27
|
const className = cx(customClassName, `${prefix}--grid-column-hang`);
|
|
28
28
|
// cast as any to let TypeScript allow passing in attributes to base component
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
29
30
|
const BaseComponentAsAny = BaseComponent;
|
|
30
31
|
return /*#__PURE__*/React.createElement(BaseComponentAsAny, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
31
32
|
className: className
|
|
@@ -14,6 +14,7 @@ var React = require('react');
|
|
|
14
14
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
15
15
|
var GridContext = require('./GridContext.js');
|
|
16
16
|
|
|
17
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
17
18
|
const FlexGrid = /*#__PURE__*/React.forwardRef(({
|
|
18
19
|
as,
|
|
19
20
|
condensed = false,
|
|
@@ -30,6 +30,7 @@ function Row({
|
|
|
30
30
|
[`${prefix}--row--narrow`]: narrow
|
|
31
31
|
});
|
|
32
32
|
// TypeScript type validation reports conflicts on different instances of keyof JSX.IntrinsicElements
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
33
34
|
const BaseComponentAsAny = BaseComponent;
|
|
34
35
|
return /*#__PURE__*/React.createElement(BaseComponentAsAny, _rollupPluginBabelHelpers.extends({
|
|
35
36
|
className: className
|
|
@@ -19,6 +19,7 @@ const Section = /*#__PURE__*/React.forwardRef(function Section({
|
|
|
19
19
|
}, ref) {
|
|
20
20
|
const parentLevel = React.useContext(HeadingContext);
|
|
21
21
|
const level = levelOverride ?? parentLevel + 1;
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
22
23
|
const BaseComponentAsAny = BaseComponent;
|
|
23
24
|
return /*#__PURE__*/React.createElement(HeadingContext.Provider, {
|
|
24
25
|
value: Math.min(level, 6)
|
|
@@ -45,7 +46,8 @@ Section.propTypes = {
|
|
|
45
46
|
*/
|
|
46
47
|
level: PropTypes.number
|
|
47
48
|
};
|
|
48
|
-
|
|
49
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
50
|
+
const Heading = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
49
51
|
const HeadingIntrinsic = `h${React.useContext(HeadingContext)}`;
|
|
50
52
|
return /*#__PURE__*/React.createElement(HeadingIntrinsic, _rollupPluginBabelHelpers.extends({
|
|
51
53
|
ref: ref
|
|
@@ -21,7 +21,8 @@ var index = require('../BadgeIndicator/index.js');
|
|
|
21
21
|
var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
|
|
22
22
|
|
|
23
23
|
const IconButtonKinds = ['primary', 'secondary', 'ghost', 'tertiary'];
|
|
24
|
-
|
|
24
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
25
|
+
const IconButton = /*#__PURE__*/React.forwardRef(({
|
|
25
26
|
align,
|
|
26
27
|
autoAlign = false,
|
|
27
28
|
badgeCount,
|
|
@@ -40,12 +41,13 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton({
|
|
|
40
41
|
size,
|
|
41
42
|
isSelected,
|
|
42
43
|
...rest
|
|
43
|
-
}, ref) {
|
|
44
|
+
}, ref) => {
|
|
44
45
|
const prefix = usePrefix.usePrefix();
|
|
45
46
|
const tooltipClasses = cx(wrapperClasses, `${prefix}--icon-tooltip`, {
|
|
46
47
|
[`${prefix}--icon-tooltip--disabled`]: disabled
|
|
47
48
|
});
|
|
48
49
|
if (badgeCount && (kind !== 'ghost' || size !== 'lg')) {
|
|
50
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
49
51
|
console.warn("The prop BadgeCount must be used with hasIconOnly=true, kind='ghost' and size='lg'");
|
|
50
52
|
}
|
|
51
53
|
const badgeId = useId.useId('badge-indicator');
|
|
@@ -30,13 +30,15 @@ const iconTypes = {
|
|
|
30
30
|
unknown: iconsReact.UnknownFilled,
|
|
31
31
|
informative: iconsReact.WarningSquareFilled
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
34
|
+
const IconIndicator = /*#__PURE__*/React.forwardRef(({
|
|
34
35
|
className: customClassName,
|
|
35
36
|
kind,
|
|
36
37
|
label,
|
|
37
38
|
size = 16,
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
38
40
|
...rest
|
|
39
|
-
}, ref) {
|
|
41
|
+
}, ref) => {
|
|
40
42
|
const prefix = usePrefix.usePrefix();
|
|
41
43
|
const classNames = cx(`${prefix}--icon-indicator`, customClassName, {
|
|
42
44
|
[`${prefix}--icon-indicator--20`]: size == 20
|
|
@@ -15,7 +15,8 @@ var deprecate = require('../../prop-types/deprecate.js');
|
|
|
15
15
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
16
16
|
var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
19
|
+
const InlineCheckbox = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
19
20
|
const {
|
|
20
21
|
['aria-label']: ariaLabel,
|
|
21
22
|
ariaLabel: deprecatedAriaLabel,
|
|
@@ -64,7 +65,7 @@ const InlineCheckbox = /*#__PURE__*/React.forwardRef(function InlineCheckbox(pro
|
|
|
64
65
|
className: `${prefix}--checkbox--inline`
|
|
65
66
|
}, /*#__PURE__*/React.createElement("input", inputProps),
|
|
66
67
|
/*#__PURE__*/
|
|
67
|
-
/* eslint-disable jsx-a11y/
|
|
68
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions */
|
|
68
69
|
React.createElement("label", {
|
|
69
70
|
htmlFor: id,
|
|
70
71
|
className: `${prefix}--checkbox-label`,
|
|
@@ -24,14 +24,15 @@ const densities = ['condensed', 'normal'];
|
|
|
24
24
|
* Size of components within this layout
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
28
|
+
const Layout = /*#__PURE__*/React.forwardRef(({
|
|
28
29
|
as: BaseComponent = 'div',
|
|
29
30
|
children,
|
|
30
31
|
className,
|
|
31
32
|
density,
|
|
32
33
|
size,
|
|
33
34
|
...rest
|
|
34
|
-
}, forwardRef) {
|
|
35
|
+
}, forwardRef) => {
|
|
35
36
|
const prefix = usePrefix.usePrefix();
|
|
36
37
|
const classes = cx(className, `${prefix}--layout`, {
|
|
37
38
|
[`${prefix}--layout--size-${size}`]: size && sizes.includes(size),
|
|
@@ -66,14 +67,15 @@ Layout.propTypes = {
|
|
|
66
67
|
*/
|
|
67
68
|
size: PropTypes.oneOf(sizes)
|
|
68
69
|
};
|
|
69
|
-
|
|
70
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
71
|
+
const LayoutConstraint = /*#__PURE__*/React.forwardRef(({
|
|
70
72
|
as: BaseComponent = 'div',
|
|
71
73
|
children,
|
|
72
74
|
className,
|
|
73
75
|
density,
|
|
74
76
|
size,
|
|
75
77
|
...rest
|
|
76
|
-
}, forwardRef) {
|
|
78
|
+
}, forwardRef) => {
|
|
77
79
|
const prefix = usePrefix.usePrefix();
|
|
78
80
|
const classes = cx(className, Object.entries({
|
|
79
81
|
size,
|
|
@@ -12,6 +12,8 @@ var PropTypes = require('prop-types');
|
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var LayoutDirectionContext = require('./LayoutDirectionContext.js');
|
|
14
14
|
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
16
|
+
|
|
15
17
|
function LayoutDirection({
|
|
16
18
|
as: BaseComponent = 'div',
|
|
17
19
|
children,
|
|
@@ -16,6 +16,7 @@ var React = require('react');
|
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
|
|
18
18
|
// First create the component with basic types
|
|
19
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
19
20
|
const LinkBase = /*#__PURE__*/React.forwardRef(({
|
|
20
21
|
as: BaseComponent,
|
|
21
22
|
children,
|
|
@@ -51,6 +52,8 @@ const LinkBase = /*#__PURE__*/React.forwardRef(({
|
|
|
51
52
|
linkProps.role = 'link';
|
|
52
53
|
linkProps['aria-disabled'] = true;
|
|
53
54
|
}
|
|
55
|
+
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
54
57
|
const BaseComponentAsAny = BaseComponent ?? 'a';
|
|
55
58
|
const handleOnClick = event => {
|
|
56
59
|
if (disabled) {
|
|
@@ -26,7 +26,9 @@ var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
|
26
26
|
* @param deps - Dependencies to re-run the truncation check.
|
|
27
27
|
* @returns An object containing the truncation state and the merged ref.
|
|
28
28
|
*/
|
|
29
|
-
const useIsTruncated = (forwardedRef,
|
|
29
|
+
const useIsTruncated = (forwardedRef,
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
31
|
+
deps = []) => {
|
|
30
32
|
const localRef = React.useRef(null);
|
|
31
33
|
const mergedRef = useMergedRefs.useMergedRefs([...(forwardedRef ? [forwardedRef] : []), localRef]);
|
|
32
34
|
const [isTruncated, setIsTruncated] = React.useState(false);
|
|
@@ -39,6 +41,7 @@ const useIsTruncated = (forwardedRef, deps = []) => {
|
|
|
39
41
|
} = element;
|
|
40
42
|
setIsTruncated(offsetWidth < scrollWidth);
|
|
41
43
|
}
|
|
44
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
42
45
|
}, [localRef, ...deps]);
|
|
43
46
|
return {
|
|
44
47
|
isTruncated,
|
|
@@ -31,11 +31,12 @@ const defaultTranslateWithId = id => defaultTranslations[id];
|
|
|
31
31
|
* state of the menu for a given `ListBox`
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
35
|
+
const ListBoxTrigger = /*#__PURE__*/React.forwardRef(({
|
|
35
36
|
isOpen,
|
|
36
37
|
translateWithId: t = defaultTranslateWithId,
|
|
37
38
|
...rest
|
|
38
|
-
}, ref) {
|
|
39
|
+
}, ref) => {
|
|
39
40
|
const prefix = usePrefix.usePrefix();
|
|
40
41
|
const className = cx({
|
|
41
42
|
[`${prefix}--list-box__menu-icon`]: true,
|