@carbon/react 1.90.0-rc.0 → 1.91.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 +923 -964
- 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/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/es/components/CodeSnippet/CodeSnippet.js +1 -1
- package/es/components/ComboBox/ComboBox.js +18 -13
- package/es/components/ComboButton/index.js +2 -1
- package/es/components/ComposedModal/ComposedModal.js +5 -2
- package/es/components/Copy/Copy.d.ts +1 -1
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/CopyButton/CopyButton.d.ts +1 -1
- package/es/components/CopyButton/CopyButton.js +1 -1
- package/es/components/DataTable/DataTable.d.ts +60 -15
- package/es/components/DataTable/DataTable.js +119 -178
- package/es/components/DataTable/Table.d.ts +2 -2
- package/es/components/DataTable/Table.js +4 -4
- package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableExpandHeader.js +6 -2
- package/es/components/DataTable/TableExpandRow.js +1 -0
- package/es/components/DataTable/TableHeader.js +2 -0
- package/es/components/DataTable/TableRow.js +5 -0
- package/es/components/DataTable/TableSlugRow.js +1 -0
- package/es/components/DataTable/TableToolbarMenu.js +3 -0
- package/es/components/DataTable/state/sorting.d.ts +3 -1
- package/es/components/DataTable/state/sorting.js +2 -0
- package/es/components/DataTable/tools/sorting.js +1 -0
- package/es/components/DatePicker/DatePicker.d.ts +0 -12
- package/es/components/DatePicker/DatePicker.js +17 -6
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +19 -2
- package/es/components/DatePicker/plugins/rangePlugin.js +18 -14
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/Dialog/Dialog.js +10 -2
- package/es/components/Dropdown/Dropdown.js +17 -16
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/es/components/FeatureFlags/index.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 +5 -3
- 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.d.ts +1 -1
- package/es/components/Menu/MenuItem.js +10 -18
- package/es/components/MenuButton/index.js +7 -2
- package/es/components/Modal/Modal.js +4 -1
- package/es/components/ModalWrapper/ModalWrapper.js +2 -0
- package/es/components/MultiSelect/FilterableMultiSelect.js +25 -6
- package/es/components/MultiSelect/MultiSelect.js +22 -17
- package/es/components/Notification/Notification.d.ts +6 -6
- package/es/components/Notification/Notification.js +7 -7
- package/es/components/NumberInput/NumberInput.js +7 -1
- package/es/components/OverflowMenu/OverflowMenu.js +3 -1
- package/es/components/OverflowMenu/next/index.js +4 -3
- 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 +15 -5
- package/es/components/ProgressBar/ProgressBar.js +4 -2
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Search/Search.d.ts +4 -2
- package/es/components/Search/Search.js +7 -6
- 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.d.ts +144 -188
- package/es/components/Slider/Slider.js +798 -726
- package/es/components/Slider/index.d.ts +2 -2
- 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.d.ts +4 -0
- package/es/components/Tabs/Tabs.js +28 -17
- package/es/components/Tag/DismissibleTag.js +2 -0
- 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/TextArea/TextArea.js +13 -6
- package/es/components/TextInput/ControlledPasswordInput.js +4 -6
- package/es/components/TextInput/PasswordInput.js +9 -4
- package/es/components/TextInput/TextInput.js +6 -4
- package/es/components/TextInput/util.d.ts +17 -5
- package/es/components/TextInput/util.js +2 -7
- 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 +4 -0
- package/es/components/Tooltip/DefinitionTooltip.js +1 -0
- package/es/components/Tooltip/Tooltip.js +30 -23
- package/es/components/TreeView/TreeNode.js +13 -5
- 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.d.ts +1 -1
- 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/index.d.ts +12 -13
- package/es/index.js +25 -24
- package/es/internal/FloatingMenu.js +7 -1
- package/es/internal/Selection.js +12 -3
- package/es/internal/defaultItemToString.d.ts +7 -0
- package/es/internal/defaultItemToString.js +17 -0
- package/es/internal/index.d.ts +1 -0
- 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/deprecateValuesWithin.d.ts +8 -1
- package/es/prop-types/deprecateValuesWithin.js +6 -6
- package/es/prop-types/isRequiredOneOf.js +4 -1
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +8 -7
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +10 -10
- 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/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/lib/components/CodeSnippet/CodeSnippet.js +1 -1
- package/lib/components/ComboBox/ComboBox.js +20 -15
- package/lib/components/ComboButton/index.js +2 -1
- package/lib/components/ComposedModal/ComposedModal.js +5 -2
- package/lib/components/Copy/Copy.d.ts +1 -1
- package/lib/components/Copy/Copy.js +1 -1
- package/lib/components/CopyButton/CopyButton.d.ts +1 -1
- package/lib/components/CopyButton/CopyButton.js +1 -1
- package/lib/components/DataTable/DataTable.d.ts +60 -15
- package/lib/components/DataTable/DataTable.js +119 -178
- package/lib/components/DataTable/Table.d.ts +2 -2
- package/lib/components/DataTable/Table.js +4 -4
- package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableExpandHeader.js +6 -2
- package/lib/components/DataTable/TableExpandRow.js +1 -0
- package/lib/components/DataTable/TableHeader.js +2 -0
- package/lib/components/DataTable/TableRow.js +5 -0
- package/lib/components/DataTable/TableSlugRow.js +1 -0
- package/lib/components/DataTable/TableToolbarMenu.js +3 -0
- package/lib/components/DataTable/state/sorting.d.ts +3 -1
- package/lib/components/DataTable/state/sorting.js +2 -0
- package/lib/components/DataTable/tools/sorting.js +1 -0
- package/lib/components/DatePicker/DatePicker.d.ts +0 -12
- package/lib/components/DatePicker/DatePicker.js +16 -5
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +19 -2
- package/lib/components/DatePicker/plugins/rangePlugin.js +18 -16
- package/lib/components/DatePickerInput/DatePickerInput.js +6 -0
- package/lib/components/Dialog/Dialog.js +10 -2
- package/lib/components/Dropdown/Dropdown.js +19 -18
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/lib/components/FeatureFlags/index.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 +5 -3
- 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.d.ts +1 -1
- package/lib/components/Menu/MenuItem.js +11 -19
- package/lib/components/MenuButton/index.js +7 -2
- package/lib/components/Modal/Modal.js +4 -1
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.js +32 -13
- package/lib/components/MultiSelect/MultiSelect.js +23 -18
- package/lib/components/Notification/Notification.d.ts +6 -6
- package/lib/components/Notification/Notification.js +7 -7
- package/lib/components/NumberInput/NumberInput.js +7 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +3 -1
- package/lib/components/OverflowMenu/next/index.js +4 -3
- 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 +15 -5
- package/lib/components/ProgressBar/ProgressBar.js +4 -2
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Search/Search.d.ts +4 -2
- package/lib/components/Search/Search.js +7 -6
- 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.d.ts +144 -188
- package/lib/components/Slider/Slider.js +795 -725
- package/lib/components/Slider/index.d.ts +2 -2
- 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.d.ts +4 -0
- package/lib/components/Tabs/Tabs.js +28 -17
- package/lib/components/Tag/DismissibleTag.js +2 -0
- 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/TextArea/TextArea.js +13 -6
- package/lib/components/TextInput/ControlledPasswordInput.js +3 -5
- package/lib/components/TextInput/PasswordInput.js +8 -3
- package/lib/components/TextInput/TextInput.js +5 -3
- package/lib/components/TextInput/util.d.ts +17 -5
- package/lib/components/TextInput/util.js +2 -7
- 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 +4 -0
- package/lib/components/Tooltip/DefinitionTooltip.js +1 -0
- package/lib/components/Tooltip/Tooltip.js +30 -23
- package/lib/components/TreeView/TreeNode.js +13 -5
- 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.d.ts +1 -1
- 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/index.d.ts +12 -13
- package/lib/index.js +51 -28
- package/lib/internal/FloatingMenu.js +7 -1
- package/lib/internal/Selection.js +12 -3
- package/lib/internal/defaultItemToString.d.ts +7 -0
- package/lib/internal/defaultItemToString.js +19 -0
- package/lib/internal/index.d.ts +1 -0
- 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/deprecateValuesWithin.d.ts +8 -1
- package/lib/prop-types/deprecateValuesWithin.js +6 -8
- package/lib/prop-types/isRequiredOneOf.js +4 -1
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +8 -7
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +10 -12
- package/lib/tools/events.js +3 -1
- package/lib/tools/wrapComponent.js +1 -0
- package/package.json +10 -9
- package/es/components/MultiSelect/tools/itemToString.d.ts +0 -1
- package/es/components/MultiSelect/tools/itemToString.js +0 -21
- package/es/components/Slider/index.js +0 -14
- package/es/internal/createClassWrapper.js +0 -23
- package/lib/components/MultiSelect/tools/itemToString.d.ts +0 -1
- package/lib/components/MultiSelect/tools/itemToString.js +0 -23
- package/lib/components/Slider/index.js +0 -20
- package/lib/internal/createClassWrapper.js +0 -25
|
@@ -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');
|
|
@@ -78,7 +80,7 @@ IconButton.propTypes = {
|
|
|
78
80
|
/**
|
|
79
81
|
* Specify how the trigger should align with the tooltip
|
|
80
82
|
*/
|
|
81
|
-
align: deprecateValuesWithin.
|
|
83
|
+
align: deprecateValuesWithin.deprecateValuesWithin(PropTypes.oneOf(['top', 'top-left',
|
|
82
84
|
// deprecated use top-start instead
|
|
83
85
|
'top-right',
|
|
84
86
|
// deprecated use top-end instead
|
|
@@ -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,
|
|
@@ -30,7 +30,6 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu({
|
|
|
30
30
|
containerRef,
|
|
31
31
|
label,
|
|
32
32
|
menuAlignment,
|
|
33
|
-
mode,
|
|
34
33
|
onClose,
|
|
35
34
|
onOpen,
|
|
36
35
|
open,
|
|
@@ -120,6 +119,8 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu({
|
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
function focusItem(e) {
|
|
122
|
+
const validItems = focusableItems?.filter(item => item?.ref?.current);
|
|
123
|
+
if (!validItems?.length) return;
|
|
123
124
|
const currentItem = focusableItems.findIndex(item => item.ref?.current?.contains(document.activeElement));
|
|
124
125
|
let indexToFocus = currentItem;
|
|
125
126
|
|
|
@@ -136,14 +137,14 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu({
|
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
if (indexToFocus < 0) {
|
|
139
|
-
indexToFocus =
|
|
140
|
+
indexToFocus = validItems.length - 1;
|
|
140
141
|
}
|
|
141
|
-
if (indexToFocus >=
|
|
142
|
+
if (indexToFocus >= validItems.length) {
|
|
142
143
|
indexToFocus = 0;
|
|
143
144
|
}
|
|
144
145
|
if (indexToFocus !== currentItem) {
|
|
145
|
-
const nodeToFocus =
|
|
146
|
-
nodeToFocus
|
|
146
|
+
const nodeToFocus = validItems[indexToFocus];
|
|
147
|
+
nodeToFocus?.ref?.current?.focus();
|
|
147
148
|
e?.preventDefault();
|
|
148
149
|
}
|
|
149
150
|
}
|
|
@@ -306,7 +307,6 @@ Menu.propTypes = {
|
|
|
306
307
|
/**
|
|
307
308
|
* A label describing the Menu.
|
|
308
309
|
*/
|
|
309
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
310
310
|
label: PropTypes.string,
|
|
311
311
|
/**
|
|
312
312
|
* Specify how the menu should align with the button element
|
|
@@ -342,17 +342,14 @@ Menu.propTypes = {
|
|
|
342
342
|
/**
|
|
343
343
|
* Specify a DOM node where the Menu should be rendered in. Defaults to document.body.
|
|
344
344
|
*/
|
|
345
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
346
345
|
target: PropTypes.object,
|
|
347
346
|
/**
|
|
348
347
|
* Specify the x position of the Menu. Either pass a single number or an array with two numbers describing your activator's boundaries ([x1, x2])
|
|
349
348
|
*/
|
|
350
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
351
349
|
x: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)]),
|
|
352
350
|
/**
|
|
353
351
|
* Specify the y position of the Menu. Either pass a single number or an array with two numbers describing your activator's boundaries ([y1, y2])
|
|
354
352
|
*/
|
|
355
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
356
353
|
y: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)])
|
|
357
354
|
};
|
|
358
355
|
|
|
@@ -46,6 +46,7 @@ function menuReducer(state, action) {
|
|
|
46
46
|
const MenuContext = /*#__PURE__*/React.createContext({
|
|
47
47
|
state: menuDefaultState,
|
|
48
48
|
// 'dispatch' is populated by the root menu
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
49
50
|
dispatch: _ => {}
|
|
50
51
|
});
|
|
51
52
|
|
|
@@ -80,7 +80,7 @@ export interface MenuItemRadioGroupProps<Item> extends Omit<ComponentProps<'ul'>
|
|
|
80
80
|
*/
|
|
81
81
|
defaultSelectedItem?: Item;
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* Converts an item into a string for display.
|
|
84
84
|
*/
|
|
85
85
|
itemToString?: (item: Item) => string;
|
|
86
86
|
/**
|
|
@@ -23,6 +23,7 @@ var MenuContext = require('./MenuContext.js');
|
|
|
23
23
|
require('../LayoutDirection/LayoutDirection.js');
|
|
24
24
|
var useLayoutDirection = require('../LayoutDirection/useLayoutDirection.js');
|
|
25
25
|
require('../Text/index.js');
|
|
26
|
+
var defaultItemToString = require('../../internal/defaultItemToString.js');
|
|
26
27
|
var Text = require('../Text/Text.js');
|
|
27
28
|
|
|
28
29
|
var _Checkmark, _CaretLeft, _CaretRight;
|
|
@@ -152,7 +153,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem({
|
|
|
152
153
|
}, [direction]);
|
|
153
154
|
React.useEffect(() => {
|
|
154
155
|
if (IconElement && !context.state.hasIcons) {
|
|
155
|
-
// @ts-
|
|
156
|
+
// @ts-expect-error - TODO: Should we be passing payload?
|
|
156
157
|
context.dispatch({
|
|
157
158
|
type: 'enableIcons'
|
|
158
159
|
});
|
|
@@ -180,15 +181,15 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem({
|
|
|
180
181
|
"aria-expanded": hasChildren ? submenuOpen : undefined,
|
|
181
182
|
onClick: handleClick,
|
|
182
183
|
onKeyDown: handleKeyDown,
|
|
183
|
-
onKeyUp: handleKeyUp
|
|
184
|
+
onKeyUp: handleKeyUp,
|
|
185
|
+
title: label
|
|
184
186
|
}, getReferenceProps()), /*#__PURE__*/React.createElement("div", {
|
|
185
187
|
className: `${prefix}--menu-item__selection-icon`
|
|
186
188
|
}, rest['aria-checked'] && (_Checkmark || (_Checkmark = /*#__PURE__*/React.createElement(iconsReact.Checkmark, null)))), /*#__PURE__*/React.createElement("div", {
|
|
187
189
|
className: `${prefix}--menu-item__icon`
|
|
188
190
|
}, IconElement && /*#__PURE__*/React.createElement(IconElement, null)), /*#__PURE__*/React.createElement(Text.Text, {
|
|
189
191
|
as: "div",
|
|
190
|
-
className: `${prefix}--menu-item__label
|
|
191
|
-
title: label
|
|
192
|
+
className: `${prefix}--menu-item__label`
|
|
192
193
|
}, label), shortcut && !hasChildren && /*#__PURE__*/React.createElement("div", {
|
|
193
194
|
className: `${prefix}--menu-item__shortcut`
|
|
194
195
|
}, shortcut), hasChildren && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -227,17 +228,14 @@ MenuItem.propTypes = {
|
|
|
227
228
|
/**
|
|
228
229
|
* Provide an optional function to be called when the MenuItem is clicked.
|
|
229
230
|
*/
|
|
230
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
231
231
|
onClick: PropTypes.func,
|
|
232
232
|
/**
|
|
233
233
|
* A component used to render an icon.
|
|
234
234
|
*/
|
|
235
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
236
235
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
237
236
|
/**
|
|
238
237
|
* Provide a shortcut for the action of this MenuItem. Note that the component will only render it as a hint but not actually register the shortcut.
|
|
239
238
|
*/
|
|
240
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
241
239
|
shortcut: PropTypes.string
|
|
242
240
|
};
|
|
243
241
|
const MenuItemSelectable = /*#__PURE__*/React.forwardRef(function MenuItemSelectable({
|
|
@@ -255,12 +253,12 @@ const MenuItemSelectable = /*#__PURE__*/React.forwardRef(function MenuItemSelect
|
|
|
255
253
|
onChange,
|
|
256
254
|
defaultValue: defaultSelected ?? false
|
|
257
255
|
});
|
|
258
|
-
function handleClick(
|
|
256
|
+
function handleClick() {
|
|
259
257
|
setChecked(!checked);
|
|
260
258
|
}
|
|
261
259
|
React.useEffect(() => {
|
|
262
260
|
if (!context.state.hasSelectableItems) {
|
|
263
|
-
// @ts-
|
|
261
|
+
// @ts-expect-error - TODO: Should we be passing payload?
|
|
264
262
|
context.dispatch({
|
|
265
263
|
type: 'enableSelectableItems'
|
|
266
264
|
});
|
|
@@ -284,7 +282,6 @@ MenuItemSelectable.propTypes = {
|
|
|
284
282
|
/**
|
|
285
283
|
* Specify whether the option should be selected by default.
|
|
286
284
|
*/
|
|
287
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
288
285
|
defaultSelected: PropTypes.bool,
|
|
289
286
|
/**
|
|
290
287
|
* A required label titling this option.
|
|
@@ -293,12 +290,10 @@ MenuItemSelectable.propTypes = {
|
|
|
293
290
|
/**
|
|
294
291
|
* Provide an optional function to be called when the selection state changes.
|
|
295
292
|
*/
|
|
296
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
297
293
|
onChange: PropTypes.func,
|
|
298
294
|
/**
|
|
299
295
|
* Pass a bool to props.selected to control the state of this option.
|
|
300
296
|
*/
|
|
301
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
302
297
|
selected: PropTypes.bool
|
|
303
298
|
};
|
|
304
299
|
const MenuItemGroup = /*#__PURE__*/React.forwardRef(function MenuItemGroup({
|
|
@@ -332,12 +327,11 @@ MenuItemGroup.propTypes = {
|
|
|
332
327
|
*/
|
|
333
328
|
label: PropTypes.string.isRequired
|
|
334
329
|
};
|
|
335
|
-
const defaultItemToString = item => item.toString();
|
|
336
330
|
const MenuItemRadioGroup = /*#__PURE__*/React.forwardRef(function MenuItemRadioGroup({
|
|
337
331
|
className,
|
|
338
332
|
defaultSelectedItem,
|
|
339
333
|
items,
|
|
340
|
-
itemToString = defaultItemToString,
|
|
334
|
+
itemToString = defaultItemToString.defaultItemToString,
|
|
341
335
|
label,
|
|
342
336
|
onChange,
|
|
343
337
|
selectedItem,
|
|
@@ -350,12 +344,13 @@ const MenuItemRadioGroup = /*#__PURE__*/React.forwardRef(function MenuItemRadioG
|
|
|
350
344
|
onChange,
|
|
351
345
|
defaultValue: defaultSelectedItem ?? {}
|
|
352
346
|
});
|
|
347
|
+
//eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
353
348
|
function handleClick(item, e) {
|
|
354
349
|
setSelection(item);
|
|
355
350
|
}
|
|
356
351
|
React.useEffect(() => {
|
|
357
352
|
if (!context.state.hasSelectableItems) {
|
|
358
|
-
// @ts-
|
|
353
|
+
// @ts-expect-error - TODO: Should we be passing payload?
|
|
359
354
|
context.dispatch({
|
|
360
355
|
type: 'enableSelectableItems'
|
|
361
356
|
});
|
|
@@ -389,14 +384,12 @@ MenuItemRadioGroup.propTypes = {
|
|
|
389
384
|
*/
|
|
390
385
|
defaultSelectedItem: PropTypes.any,
|
|
391
386
|
/**
|
|
392
|
-
*
|
|
387
|
+
* Converts an item into a string for display.
|
|
393
388
|
*/
|
|
394
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
395
389
|
itemToString: PropTypes.func,
|
|
396
390
|
/**
|
|
397
391
|
* Provide the options for this radio group. Can be of any type, as long as you provide an appropriate props.itemToString function.
|
|
398
392
|
*/
|
|
399
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
400
393
|
items: PropTypes.array,
|
|
401
394
|
/**
|
|
402
395
|
* A required label titling this radio group.
|
|
@@ -405,7 +398,6 @@ MenuItemRadioGroup.propTypes = {
|
|
|
405
398
|
/**
|
|
406
399
|
* Provide an optional function to be called when the selection changes.
|
|
407
400
|
*/
|
|
408
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
409
401
|
onChange: PropTypes.func,
|
|
410
402
|
/**
|
|
411
403
|
* Provide props.selectedItem to control the state of this radio group. Must match the type of props.items.
|
|
@@ -25,7 +25,8 @@ var mergeRefs = require('../../tools/mergeRefs.js');
|
|
|
25
25
|
|
|
26
26
|
const validButtonKinds = ['primary', 'tertiary', 'ghost'];
|
|
27
27
|
const defaultButtonKind = 'primary';
|
|
28
|
-
|
|
28
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
29
|
+
const MenuButton = /*#__PURE__*/React.forwardRef(({
|
|
29
30
|
children,
|
|
30
31
|
className,
|
|
31
32
|
disabled,
|
|
@@ -36,13 +37,14 @@ const MenuButton = /*#__PURE__*/React.forwardRef(function MenuButton({
|
|
|
36
37
|
tabIndex = 0,
|
|
37
38
|
menuTarget,
|
|
38
39
|
...rest
|
|
39
|
-
}, forwardRef) {
|
|
40
|
+
}, forwardRef) => {
|
|
40
41
|
// feature flag utilized to separate out only the dynamic styles from @floating-ui
|
|
41
42
|
// flag is turned on when collision detection (ie. flip, hide) logic is not desired
|
|
42
43
|
const enableOnlyFloatingStyles = index.useFeatureFlag('enable-v12-dynamic-floating-styles');
|
|
43
44
|
const id = useId.useId('MenuButton');
|
|
44
45
|
const prefix = usePrefix.usePrefix();
|
|
45
46
|
const triggerRef = React.useRef(null);
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
46
48
|
let middlewares = [];
|
|
47
49
|
if (!enableOnlyFloatingStyles) {
|
|
48
50
|
middlewares = [react.flip({
|
|
@@ -161,6 +163,7 @@ MenuButton.propTypes = {
|
|
|
161
163
|
/**
|
|
162
164
|
* Specify the type of button to be used as the base for the trigger button.
|
|
163
165
|
*/
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
164
167
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
165
168
|
kind: PropTypes.oneOf(validButtonKinds),
|
|
166
169
|
/**
|
|
@@ -174,11 +177,13 @@ MenuButton.propTypes = {
|
|
|
174
177
|
/**
|
|
175
178
|
* Specify the size of the button and menu.
|
|
176
179
|
*/
|
|
180
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
177
181
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
178
182
|
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
179
183
|
/**
|
|
180
184
|
* Specify the tabIndex of the button.
|
|
181
185
|
*/
|
|
186
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
182
187
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
183
188
|
tabIndex: PropTypes.number,
|
|
184
189
|
/**
|
|
@@ -177,6 +177,8 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal({
|
|
|
177
177
|
}
|
|
178
178
|
const lastContent = modalContent.children[modalContent.children.length - 1];
|
|
179
179
|
const gradientSpacing = modalContent.scrollHeight - lastContent.offsetTop - lastContent.clientHeight;
|
|
180
|
+
|
|
181
|
+
// eslint-disable-next-line prefer-const -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
180
182
|
for (let elem of modalContent.children) {
|
|
181
183
|
if (elem.contains(currentActiveNode)) {
|
|
182
184
|
const spaceBelow = modalContent.clientHeight - elem.offsetTop + modalContent.scrollTop - elem.clientHeight;
|
|
@@ -239,6 +241,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal({
|
|
|
239
241
|
return () => {
|
|
240
242
|
document.removeEventListener('keydown', handleEscapeKey, true);
|
|
241
243
|
};
|
|
244
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
242
245
|
}, [open]);
|
|
243
246
|
React.useEffect(() => {
|
|
244
247
|
return () => {
|
|
@@ -471,7 +474,7 @@ Modal.propTypes = {
|
|
|
471
474
|
/**
|
|
472
475
|
* Required props for the accessibility label of the header
|
|
473
476
|
*/
|
|
474
|
-
['aria-label']: requiredIfGivenPropIsTruthy.
|
|
477
|
+
['aria-label']: requiredIfGivenPropIsTruthy.requiredIfGivenPropIsTruthy('hasScrollingContent', PropTypes.string),
|
|
475
478
|
/**
|
|
476
479
|
* Provide the contents of your Modal
|
|
477
480
|
*/
|
|
@@ -21,6 +21,7 @@ var keys = require('../../internal/keyboard/keys.js');
|
|
|
21
21
|
var match = require('../../internal/keyboard/match.js');
|
|
22
22
|
|
|
23
23
|
let didWarnAboutDeprecation = false;
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
24
25
|
process.env.NODE_ENV !== 'production';
|
|
25
26
|
class ModalWrapper extends React.Component {
|
|
26
27
|
constructor(...args) {
|
|
@@ -57,6 +58,7 @@ class ModalWrapper extends React.Component {
|
|
|
57
58
|
handleSubmit?.(evt);
|
|
58
59
|
});
|
|
59
60
|
}
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
60
62
|
if(isDev) {
|
|
61
63
|
process.env.NODE_ENV !== "production" ? warning.warning(didWarnAboutDeprecation, '`<ModalWrapper>` has been deprecated in favor of `<ComposedModal/>` and will be removed in the next major version, `@carbon/react@v2.x`') : void 0;
|
|
62
64
|
didWarnAboutDeprecation = true;
|