@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
package/es/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
/**
|
|
2
3
|
* Copyright IBM Corp. 2016, 2023
|
|
3
4
|
*
|
|
@@ -129,7 +130,8 @@ export { default as SelectItemGroup } from './components/SelectItemGroup/SelectI
|
|
|
129
130
|
export { default as SkeletonIcon } from './components/SkeletonIcon/SkeletonIcon.js';
|
|
130
131
|
export { default as SkeletonPlaceholder } from './components/SkeletonPlaceholder/SkeletonPlaceholder.js';
|
|
131
132
|
export { default as SkeletonText } from './components/SkeletonText/SkeletonText.js';
|
|
132
|
-
export {
|
|
133
|
+
export { Slider } from './components/Slider/Slider.js';
|
|
134
|
+
export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
|
|
133
135
|
export { HStack } from './components/Stack/HStack.js';
|
|
134
136
|
export { Stack } from './components/Stack/Stack.js';
|
|
135
137
|
export { VStack } from './components/Stack/VStack.js';
|
|
@@ -189,29 +191,29 @@ export { default as SideNavMenu } from './components/UIShell/SideNavMenu.js';
|
|
|
189
191
|
export { default as SideNavMenuItem } from './components/UIShell/SideNavMenuItem.js';
|
|
190
192
|
export { default as SideNavSwitcher } from './components/UIShell/SideNavSwitcher.js';
|
|
191
193
|
export { default as UnorderedList } from './components/UnorderedList/UnorderedList.js';
|
|
192
|
-
export { default as unstable__FluidComboBox } from './components/FluidComboBox/FluidComboBox.js';
|
|
193
|
-
export { default as unstable__FluidComboBoxSkeleton } from './components/FluidComboBox/FluidComboBox.Skeleton.js';
|
|
194
|
-
export { default as unstable__FluidDatePicker } from './components/FluidDatePicker/FluidDatePicker.js';
|
|
195
|
-
export { default as unstable__FluidDatePickerSkeleton } from './components/FluidDatePicker/FluidDatePicker.Skeleton.js';
|
|
196
|
-
export { default as unstable__FluidDatePickerInput } from './components/FluidDatePickerInput/FluidDatePickerInput.js';
|
|
197
|
-
export { default as unstable__FluidDropdown } from './components/FluidDropdown/FluidDropdown.js';
|
|
198
|
-
export { default as unstable__FluidDropdownSkeleton } from './components/FluidDropdown/FluidDropdown.Skeleton.js';
|
|
199
|
-
export { default as unstable__FluidMultiSelect } from './components/FluidMultiSelect/FluidMultiSelect.js';
|
|
200
|
-
export { default as unstable__FluidMultiSelectSkeleton } from './components/FluidMultiSelect/FluidMultiSelect.Skeleton.js';
|
|
201
|
-
export { default as unstable__FluidSelect } from './components/FluidSelect/FluidSelect.js';
|
|
202
|
-
export { default as unstable__FluidSelectSkeleton } from './components/FluidSelect/FluidSelect.Skeleton.js';
|
|
203
|
-
export { default as unstable__FluidSearch } from './components/FluidSearch/FluidSearch.js';
|
|
204
|
-
export { default as unstable__FluidSearchSkeleton } from './components/FluidSearch/FluidSearch.Skeleton.js';
|
|
205
|
-
export { default as unstable__FluidTextArea } from './components/FluidTextArea/FluidTextArea.js';
|
|
206
|
-
export { default as unstable__FluidTextAreaSkeleton } from './components/FluidTextArea/FluidTextArea.Skeleton.js';
|
|
207
|
-
export { default as unstable__FluidTextInput } from './components/FluidTextInput/FluidTextInput.js';
|
|
194
|
+
export { default as FluidComboBox, default as unstable__FluidComboBox } from './components/FluidComboBox/FluidComboBox.js';
|
|
195
|
+
export { default as FluidComboBoxSkeleton, default as unstable__FluidComboBoxSkeleton } from './components/FluidComboBox/FluidComboBox.Skeleton.js';
|
|
196
|
+
export { default as FluidDatePicker, default as unstable__FluidDatePicker } from './components/FluidDatePicker/FluidDatePicker.js';
|
|
197
|
+
export { default as FluidDatePickerSkeleton, default as unstable__FluidDatePickerSkeleton } from './components/FluidDatePicker/FluidDatePicker.Skeleton.js';
|
|
198
|
+
export { default as FluidDatePickerInput, default as unstable__FluidDatePickerInput } from './components/FluidDatePickerInput/FluidDatePickerInput.js';
|
|
199
|
+
export { default as FluidDropdown, default as unstable__FluidDropdown } from './components/FluidDropdown/FluidDropdown.js';
|
|
200
|
+
export { default as FluidDropdownSkeleton, default as unstable__FluidDropdownSkeleton } from './components/FluidDropdown/FluidDropdown.Skeleton.js';
|
|
201
|
+
export { default as FluidMultiSelect, default as unstable__FluidMultiSelect } from './components/FluidMultiSelect/FluidMultiSelect.js';
|
|
202
|
+
export { default as FluidMultiSelectSkeleton, default as unstable__FluidMultiSelectSkeleton } from './components/FluidMultiSelect/FluidMultiSelect.Skeleton.js';
|
|
203
|
+
export { default as FluidSelect, default as unstable__FluidSelect } from './components/FluidSelect/FluidSelect.js';
|
|
204
|
+
export { default as FluidSelectSkeleton, default as unstable__FluidSelectSkeleton } from './components/FluidSelect/FluidSelect.Skeleton.js';
|
|
205
|
+
export { default as FluidSearch, default as unstable__FluidSearch } from './components/FluidSearch/FluidSearch.js';
|
|
206
|
+
export { default as FluidSearchSkeleton, default as unstable__FluidSearchSkeleton } from './components/FluidSearch/FluidSearch.Skeleton.js';
|
|
207
|
+
export { default as FluidTextArea, default as unstable__FluidTextArea } from './components/FluidTextArea/FluidTextArea.js';
|
|
208
|
+
export { default as FluidTextAreaSkeleton, default as unstable__FluidTextAreaSkeleton } from './components/FluidTextArea/FluidTextArea.Skeleton.js';
|
|
209
|
+
export { default as FluidTextInput, default as unstable__FluidTextInput } from './components/FluidTextInput/FluidTextInput.js';
|
|
208
210
|
import './components/FluidTextInput/FluidPasswordInput.js';
|
|
209
|
-
export { default as unstable__FluidTextInputSkeleton } from './components/FluidTextInput/FluidTextInput.Skeleton.js';
|
|
210
|
-
export { default as unstable__FluidNumberInput } from './components/FluidNumberInput/FluidNumberInput.js';
|
|
211
|
-
export { default as unstable__FluidNumberInputSkeleton } from './components/FluidNumberInput/FluidNumberInput.Skeleton.js';
|
|
212
|
-
export { default as unstable__FluidTimePicker } from './components/FluidTimePicker/FluidTimePicker.js';
|
|
213
|
-
export { default as unstable__FluidTimePickerSkeleton } from './components/FluidTimePicker/FluidTimePicker.Skeleton.js';
|
|
214
|
-
export { default as unstable__FluidTimePickerSelect } from './components/FluidTimePickerSelect/FluidTimePickerSelect.js';
|
|
211
|
+
export { default as FluidTextInputSkeleton, default as unstable__FluidTextInputSkeleton } from './components/FluidTextInput/FluidTextInput.Skeleton.js';
|
|
212
|
+
export { default as FluidNumberInput, default as unstable__FluidNumberInput } from './components/FluidNumberInput/FluidNumberInput.js';
|
|
213
|
+
export { default as FluidNumberInputSkeleton, default as unstable__FluidNumberInputSkeleton } from './components/FluidNumberInput/FluidNumberInput.Skeleton.js';
|
|
214
|
+
export { default as FluidTimePicker, default as unstable__FluidTimePicker } from './components/FluidTimePicker/FluidTimePicker.js';
|
|
215
|
+
export { default as FluidTimePickerSkeleton, default as unstable__FluidTimePickerSkeleton } from './components/FluidTimePicker/FluidTimePicker.Skeleton.js';
|
|
216
|
+
export { default as FluidTimePickerSelect, default as unstable__FluidTimePickerSelect } from './components/FluidTimePickerSelect/FluidTimePickerSelect.js';
|
|
215
217
|
export { Heading, Section } from './components/Heading/index.js';
|
|
216
218
|
export { IconButton, IconButtonKinds } from './components/IconButton/index.js';
|
|
217
219
|
export { Layer, useLayer } from './components/Layer/index.js';
|
|
@@ -239,6 +241,5 @@ export { default as unstable_PageSelector } from './components/Pagination/experi
|
|
|
239
241
|
export { default as unstable_Pagination } from './components/Pagination/experimental/Pagination.js';
|
|
240
242
|
export { default as ContainedListItem } from './components/ContainedList/ContainedListItem/ContainedListItem.js';
|
|
241
243
|
export { default as ContainedList } from './components/ContainedList/ContainedList.js';
|
|
242
|
-
export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
|
|
243
244
|
export { Text as unstable_Text } from './components/Text/Text.js';
|
|
244
245
|
export { TextDirection as unstable_TextDirection } from './components/Text/TextDirection.js';
|
|
@@ -198,6 +198,7 @@ const FloatingMenu = ({
|
|
|
198
198
|
}
|
|
199
199
|
placeInProgressRef.current = false;
|
|
200
200
|
}
|
|
201
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
201
202
|
}, [floatingPosition, onPlace]);
|
|
202
203
|
|
|
203
204
|
// Attach a resize listener.
|
|
@@ -208,11 +209,13 @@ const FloatingMenu = ({
|
|
|
208
209
|
return () => {
|
|
209
210
|
resizeHandler.remove();
|
|
210
211
|
};
|
|
212
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
211
213
|
}, [triggerRef, menuOffset, menuDirection, flipped, target, updateOrientation]);
|
|
212
214
|
|
|
213
215
|
// Update menu position when key props change.
|
|
214
216
|
useEffect(() => {
|
|
215
217
|
updateMenuPosition();
|
|
218
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
216
219
|
}, [menuOffset, menuDirection, flipped, triggerRef, target, updateOrientation]);
|
|
217
220
|
|
|
218
221
|
/**
|
|
@@ -274,7 +277,10 @@ const FloatingMenu = ({
|
|
|
274
277
|
const focusTrapWithoutSentinels = FeatureFlags.enabled('enable-experimental-focus-wrap-without-sentinels');
|
|
275
278
|
if (typeof document !== 'undefined') {
|
|
276
279
|
const portalTarget = target ? target() : document.body;
|
|
277
|
-
return /*#__PURE__*/ReactDOM.createPortal(
|
|
280
|
+
return /*#__PURE__*/ReactDOM.createPortal(
|
|
281
|
+
/*#__PURE__*/
|
|
282
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
283
|
+
React.createElement("div", {
|
|
278
284
|
onBlur: focusTrap && !focusTrapWithoutSentinels ? handleBlur : undefined,
|
|
279
285
|
onKeyDown: focusTrapWithoutSentinels ? handleKeyDown : undefined
|
|
280
286
|
}, !focusTrapWithoutSentinels && /*#__PURE__*/React.createElement("span", {
|
package/es/internal/Selection.js
CHANGED
|
@@ -42,21 +42,28 @@ const useSelection = ({
|
|
|
42
42
|
const savedOnChange = useRef(onChange);
|
|
43
43
|
const [uncontrolledItems, setUncontrolledItems] = useState(initialSelectedItems);
|
|
44
44
|
const isControlled = !!controlledItems;
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
45
46
|
const selectedItems = isControlled ? controlledItems : uncontrolledItems;
|
|
46
47
|
const onItemChange = useCallback(item => {
|
|
47
48
|
if (disabled) return;
|
|
48
49
|
|
|
49
50
|
// Assert special properties (e.g., `disabled`, `isSelectAll`, etc.) are
|
|
50
51
|
// `any` since those properties aren’t part of the generic type.
|
|
51
|
-
const allSelectableItems = filteredItems.filter(
|
|
52
|
-
|
|
52
|
+
const allSelectableItems = filteredItems.filter(
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
54
|
+
item => !item?.disabled && !item?.isSelectAll);
|
|
55
|
+
const disabledItemCount = filteredItems.filter(
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
57
|
+
item => item?.disabled).length;
|
|
53
58
|
let newSelectedItems;
|
|
54
59
|
|
|
55
60
|
// deselect all on click to All/indeterminate option
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
56
62
|
if (item?.isSelectAll && selectedItems.length > 0) {
|
|
57
63
|
newSelectedItems = [];
|
|
58
64
|
}
|
|
59
65
|
// select all options
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
60
67
|
else if (item?.isSelectAll && selectedItems.length === 0) {
|
|
61
68
|
newSelectedItems = allSelectableItems;
|
|
62
69
|
} else {
|
|
@@ -69,7 +76,9 @@ const useSelection = ({
|
|
|
69
76
|
}
|
|
70
77
|
} else {
|
|
71
78
|
newSelectedItems = removeAtIndex(selectedItems, selectedIndex);
|
|
72
|
-
newSelectedItems = newSelectedItems.filter(
|
|
79
|
+
newSelectedItems = newSelectedItems.filter(
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
81
|
+
item => !item?.isSelectAll);
|
|
73
82
|
}
|
|
74
83
|
}
|
|
75
84
|
callOnChangeHandler({
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
export declare const defaultItemToString: <ItemType>(item: ItemType | null) => string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const defaultItemToString = item => {
|
|
9
|
+
if (typeof item === 'string') return item;
|
|
10
|
+
if (typeof item === 'number') return `${item}`;
|
|
11
|
+
if (item && typeof item === 'object' && 'label' in item && typeof item.label === 'string') {
|
|
12
|
+
return item.label;
|
|
13
|
+
}
|
|
14
|
+
return '';
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { defaultItemToString };
|
package/es/internal/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { useMemo, useCallback } from 'react';
|
|
|
16
16
|
* node, assigns that node to every ref in the array.
|
|
17
17
|
*/
|
|
18
18
|
const useMergedRefs = refs => {
|
|
19
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
19
20
|
const memoizedRefs = useMemo(() => refs, refs);
|
|
20
21
|
return useCallback(node => {
|
|
21
22
|
memoizedRefs.forEach(ref => {
|
|
@@ -14,13 +14,16 @@ const useNoInteractiveChildren = (ref, message = 'component should have no inter
|
|
|
14
14
|
/*
|
|
15
15
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
16
16
|
*/
|
|
17
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
17
18
|
useEffect(() => {
|
|
18
19
|
const node = ref.current ? getInteractiveContent(ref.current) : false;
|
|
19
20
|
if (node) {
|
|
20
21
|
const errorMessage = `Error: ${message}.\n\nInstead found: ${node.outerHTML}`;
|
|
22
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
21
23
|
console.error(errorMessage);
|
|
22
24
|
throw new Error(errorMessage);
|
|
23
25
|
}
|
|
26
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
24
27
|
}, []);
|
|
25
28
|
}
|
|
26
29
|
};
|
|
@@ -31,6 +34,7 @@ const useInteractiveChildrenNeedDescription = (ref, message = `interactive child
|
|
|
31
34
|
/*
|
|
32
35
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
33
36
|
*/
|
|
37
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
34
38
|
useEffect(() => {
|
|
35
39
|
const node = ref.current ? getInteractiveContent(ref.current) : false;
|
|
36
40
|
if (node && !node.hasAttribute('aria-describedby')) {
|
|
@@ -23,6 +23,7 @@ const useOutsideClick = (ref, callback) => {
|
|
|
23
23
|
/*
|
|
24
24
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
25
25
|
*/
|
|
26
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
26
27
|
useWindowEvent('click', event => {
|
|
27
28
|
const {
|
|
28
29
|
target
|
|
@@ -36,6 +36,7 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
|
|
|
36
36
|
setMaxWidth(newMax);
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
39
40
|
useResizeObserver({
|
|
40
41
|
ref: containerRef,
|
|
41
42
|
onResize: handleResize
|
|
@@ -85,14 +86,17 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
|
|
|
85
86
|
};
|
|
86
87
|
|
|
87
88
|
// Memoize visible items calculation to avoid recalculating on every render
|
|
89
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
88
90
|
const visibleItems = useMemo(() => {
|
|
89
91
|
if (!Array.isArray(items)) {
|
|
90
92
|
return [];
|
|
91
93
|
}
|
|
92
94
|
return getVisibleItems();
|
|
95
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
93
96
|
}, [items, maxWidth, maxItems]);
|
|
94
97
|
|
|
95
98
|
// Memoize hidden items calculation
|
|
99
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
96
100
|
const hiddenItems = useMemo(() => {
|
|
97
101
|
if (!Array.isArray(items)) {
|
|
98
102
|
return [];
|
|
@@ -101,9 +105,11 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
|
|
|
101
105
|
}, [items, visibleItems]);
|
|
102
106
|
|
|
103
107
|
// Use previous value to compare and only call onChange when needed
|
|
108
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
104
109
|
const previousHiddenItems = usePreviousValue(hiddenItems);
|
|
105
110
|
|
|
106
111
|
// Only call onChange if hidden items actually changed
|
|
112
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
107
113
|
useEffect(() => {
|
|
108
114
|
}, [hiddenItems, previousHiddenItems, onChange]);
|
|
109
115
|
return {
|
|
@@ -35,6 +35,7 @@ const useResizeObserver = ({
|
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
getInitialSize();
|
|
38
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
38
39
|
}, [width, height]);
|
|
39
40
|
useLayoutEffect(() => {
|
|
40
41
|
if (!ref?.current) {
|
|
@@ -47,6 +48,8 @@ const useResizeObserver = ({
|
|
|
47
48
|
const entry = entriesToHandle.current[0];
|
|
48
49
|
setWidth(entry.contentRect.width);
|
|
49
50
|
setHeight(entry.contentRect.height);
|
|
51
|
+
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
50
53
|
cb.current && cb.current(entry.contentRect);
|
|
51
54
|
};
|
|
52
55
|
const observer = new ResizeObserver(entries => {
|
|
@@ -63,6 +66,7 @@ const useResizeObserver = ({
|
|
|
63
66
|
return () => {
|
|
64
67
|
observer.disconnect();
|
|
65
68
|
};
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
66
70
|
}, []);
|
|
67
71
|
return {
|
|
68
72
|
width,
|
|
@@ -15,6 +15,7 @@ import { useRef, useEffect, useCallback } from 'react';
|
|
|
15
15
|
*
|
|
16
16
|
* @param callback - The callback to track.
|
|
17
17
|
*/
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
18
19
|
const useSavedCallback = callback => {
|
|
19
20
|
const savedCallback = useRef(callback);
|
|
20
21
|
useEffect(() => {
|
package/es/internal/warning.js
CHANGED
|
@@ -22,6 +22,7 @@ const warning = process.env.NODE_ENV !== 'production' ? (condition, message) =>
|
|
|
22
22
|
throw new Error('`warning(condition, message)` requires a warning ' + 'format argument');
|
|
23
23
|
}
|
|
24
24
|
if (!condition) {
|
|
25
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
25
26
|
console.warn('Warning: ' + message);
|
|
26
27
|
}
|
|
27
28
|
} : noopFn;
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import type { Requireable, Validator } from 'prop-types';
|
|
8
|
+
export declare const deprecateValuesWithin: <T>(propType: Requireable<T>, allowedValues?: readonly unknown[], propMappingFunction?: (deprecatedValue: T) => T) => Validator<T> | Requireable<T>;
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
import { warning } from '../internal/warning.js';
|
|
9
9
|
|
|
10
10
|
const didWarnAboutDeprecation = {};
|
|
11
|
-
|
|
12
|
-
return
|
|
13
|
-
if (props[propName] === undefined) {
|
|
14
|
-
return;
|
|
11
|
+
const deprecateValuesWithin = (propType, allowedValues, propMappingFunction) => {
|
|
12
|
+
return (props, propName, componentName, ...rest) => {
|
|
13
|
+
if (typeof props[propName] === 'undefined') {
|
|
14
|
+
return null;
|
|
15
15
|
}
|
|
16
16
|
if (!didWarnAboutDeprecation[componentName] || !didWarnAboutDeprecation[componentName][propName]) {
|
|
17
17
|
didWarnAboutDeprecation[componentName] = {
|
|
@@ -27,6 +27,6 @@ function deprecateValuesWithin(propType, allowedValues, propMappingFunction) {
|
|
|
27
27
|
}
|
|
28
28
|
return propType(props, propName, componentName, ...rest);
|
|
29
29
|
};
|
|
30
|
-
}
|
|
30
|
+
};
|
|
31
31
|
|
|
32
|
-
export { deprecateValuesWithin
|
|
32
|
+
export { deprecateValuesWithin };
|
|
@@ -13,9 +13,12 @@
|
|
|
13
13
|
* are the names of the props, and the values are the prop-type validators.
|
|
14
14
|
* @returns A new object of wrapped prop-type validators.
|
|
15
15
|
*/
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
16
17
|
const isRequiredOneOf = propTypes => {
|
|
17
18
|
const names = Object.keys(propTypes);
|
|
18
|
-
const checker = propType =>
|
|
19
|
+
const checker = propType =>
|
|
20
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
21
|
+
(props, propName, componentName, ...rest) => {
|
|
19
22
|
if (process.env.NODE_ENV !== 'production' && names.every(name => typeof props[name] === 'undefined')) {
|
|
20
23
|
return new Error(`${componentName} requires one of the following props: ${names.join(', ')}`);
|
|
21
24
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import type { Validator } from 'prop-types';
|
|
7
8
|
/**
|
|
8
|
-
* @param
|
|
9
|
-
*
|
|
10
|
-
* @param
|
|
11
|
-
* @returns
|
|
12
|
-
*
|
|
9
|
+
* @param name The name of the prop that must exist to validate the current
|
|
10
|
+
* prop.
|
|
11
|
+
* @param propType The original prop type checker.
|
|
12
|
+
* @returns The new prop type checker for the current prop that becomes required
|
|
13
|
+
* if the prop corresponding to the provided prop name exists.
|
|
13
14
|
*/
|
|
14
|
-
export
|
|
15
|
+
export declare const requiredIfGivenPropIsTruthy: <T>(name: string, propType: Validator<T>) => Validator<T>;
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @param
|
|
10
|
-
*
|
|
11
|
-
* @param
|
|
12
|
-
* @returns
|
|
13
|
-
*
|
|
9
|
+
* @param name The name of the prop that must exist to validate the current
|
|
10
|
+
* prop.
|
|
11
|
+
* @param propType The original prop type checker.
|
|
12
|
+
* @returns The new prop type checker for the current prop that becomes required
|
|
13
|
+
* if the prop corresponding to the provided prop name exists.
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
return
|
|
17
|
-
if (process.env.NODE_ENV !== 'production' && props[name]
|
|
15
|
+
const requiredIfGivenPropIsTruthy = (name, propType) => {
|
|
16
|
+
return (props, propName, componentName, ...rest) => {
|
|
17
|
+
if (process.env.NODE_ENV !== 'production' && props[name] === true && props[propName] === null) {
|
|
18
18
|
return new Error(`You must provide a value for \`${propName}\` in \`${componentName}\` if \`${name}\` exists.`);
|
|
19
19
|
}
|
|
20
20
|
return propType(props, propName, componentName, ...rest);
|
|
21
21
|
};
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
|
|
24
|
-
export { requiredIfGivenPropIsTruthy
|
|
24
|
+
export { requiredIfGivenPropIsTruthy };
|
package/es/tools/events.js
CHANGED
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
* @param handlers - An array of event handler functions.
|
|
15
15
|
* @returns A composite event handler.
|
|
16
16
|
*/
|
|
17
|
-
const composeEventHandlers = handlers =>
|
|
17
|
+
const composeEventHandlers = handlers =>
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
19
|
+
(event, ...args) => {
|
|
18
20
|
for (const handler of handlers) {
|
|
19
21
|
if (event.defaultPrevented) {
|
|
20
22
|
break;
|
|
@@ -21,17 +21,19 @@ var deprecate = require('../../prop-types/deprecate.js');
|
|
|
21
21
|
var _Undo;
|
|
22
22
|
const AILabelContent = /*#__PURE__*/React.forwardRef(function AILabelContent({
|
|
23
23
|
className,
|
|
24
|
-
children
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
children
|
|
25
|
+
}, ref // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
26
|
+
) {
|
|
27
27
|
const prefix = usePrefix.usePrefix();
|
|
28
28
|
const hasAILabelActions = React.Children.toArray(children).some(child => {
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
29
30
|
const item = child;
|
|
30
31
|
// TODO: Is there supposed to be a `return` here? If so, this issue would
|
|
31
32
|
// have been caught by ESLint. It's concerning that this code is 7 months
|
|
32
33
|
// old and no one has noticed any issues with it. It also makes me question
|
|
33
34
|
// whether the code is necessary.
|
|
34
35
|
// https://github.com/carbon-design-system/carbon/issues/18991
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
35
37
|
item.type === AILabelActions;
|
|
36
38
|
});
|
|
37
39
|
const aiLabelContentClasses = cx(className, {
|
|
@@ -55,9 +57,9 @@ AILabelContent.propTypes = {
|
|
|
55
57
|
};
|
|
56
58
|
const AILabelActions = /*#__PURE__*/React.forwardRef(function AILabelActions({
|
|
57
59
|
className,
|
|
58
|
-
children
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
children
|
|
61
|
+
}, ref // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
62
|
+
) {
|
|
61
63
|
const prefix = usePrefix.usePrefix();
|
|
62
64
|
const aiLabelActionsClasses = cx(className, {
|
|
63
65
|
[`${prefix}--ai-label-actions`]: true
|
|
@@ -37,6 +37,8 @@ const BreadcrumbItem = frFn((props, ref) => {
|
|
|
37
37
|
[`${prefix}--breadcrumb-item--current`]: isCurrentPage && ariaCurrent !== 'page',
|
|
38
38
|
[customClassName]: !!customClassName
|
|
39
39
|
});
|
|
40
|
+
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
40
42
|
const child = children;
|
|
41
43
|
if (child.type && child.type.displayName !== undefined && child.type.displayName.includes('OverflowMenu')) {
|
|
42
44
|
const horizontalOverflowIcon = /*#__PURE__*/React.createElement(iconsReact.OverflowMenuHorizontal, {
|
|
@@ -25,6 +25,8 @@ function isIconOnlyButton(hasIconOnly, _kind) {
|
|
|
25
25
|
}
|
|
26
26
|
return false;
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
28
30
|
const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
29
31
|
const {
|
|
30
32
|
as,
|
|
@@ -47,6 +49,7 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
47
49
|
...rest
|
|
48
50
|
} = props;
|
|
49
51
|
if (ButtonImageElement && !children && !iconDescription) {
|
|
52
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
50
53
|
console.error('Button: renderIcon property specified without also providing an iconDescription property. ' + 'This may impact accessibility for screen reader users.');
|
|
51
54
|
}
|
|
52
55
|
const iconOnlyImage = !ButtonImageElement ? null : /*#__PURE__*/React.createElement(ButtonImageElement, null);
|
|
@@ -42,6 +42,7 @@ const ChatButton = /*#__PURE__*/React.forwardRef(function ChatButton({
|
|
|
42
42
|
} else {
|
|
43
43
|
// Check if size is valid and warn if not
|
|
44
44
|
if (size && !allowedSizes.includes(size)) {
|
|
45
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
45
46
|
console.error(`Invalid size "${size}" provided to ChatButton. Size must be one of: ${allowedSizes.join(', ')}. Defaulting to "lg".`);
|
|
46
47
|
size = 'lg';
|
|
47
48
|
}
|
|
@@ -19,6 +19,8 @@ var iconsReact = require('@carbon/icons-react');
|
|
|
19
19
|
var useId = require('../../internal/useId.js');
|
|
20
20
|
var index = require('../AILabel/index.js');
|
|
21
21
|
var utils = require('../../internal/utils.js');
|
|
22
|
+
var Checkbox = require('../Checkbox/Checkbox.js');
|
|
23
|
+
require('../Checkbox/Checkbox.Skeleton.js');
|
|
22
24
|
|
|
23
25
|
const CheckboxGroup = ({
|
|
24
26
|
children,
|
|
@@ -61,6 +63,23 @@ const CheckboxGroup = ({
|
|
|
61
63
|
size: 'mini',
|
|
62
64
|
kind: 'default'
|
|
63
65
|
}) : null;
|
|
66
|
+
const clonedChildren = React.Children.map(children, child => {
|
|
67
|
+
if (/*#__PURE__*/React.isValidElement(child) && child.type === Checkbox.default) {
|
|
68
|
+
const childProps = {
|
|
69
|
+
...(typeof invalid !== 'undefined' && typeof child.props.invalid === 'undefined' ? {
|
|
70
|
+
invalid
|
|
71
|
+
} : {}),
|
|
72
|
+
...(typeof readOnly !== 'undefined' && typeof child.props.readOnly === 'undefined' ? {
|
|
73
|
+
readOnly
|
|
74
|
+
} : {}),
|
|
75
|
+
...(typeof warn !== 'undefined' && typeof child.props.warn === 'undefined' ? {
|
|
76
|
+
warn
|
|
77
|
+
} : {})
|
|
78
|
+
};
|
|
79
|
+
return Object.keys(childProps).length ? /*#__PURE__*/React.cloneElement(child, childProps) : child;
|
|
80
|
+
}
|
|
81
|
+
return child;
|
|
82
|
+
});
|
|
64
83
|
return /*#__PURE__*/React.createElement("fieldset", _rollupPluginBabelHelpers.extends({
|
|
65
84
|
className: fieldsetClasses,
|
|
66
85
|
"data-invalid": invalid ? true : undefined,
|
|
@@ -72,7 +91,7 @@ const CheckboxGroup = ({
|
|
|
72
91
|
id: legendId || rest['aria-labelledby']
|
|
73
92
|
}, legendText, slug ? normalizedDecorator : decorator ? /*#__PURE__*/React.createElement("div", {
|
|
74
93
|
className: `${prefix}--checkbox-group-inner--decorator`
|
|
75
|
-
}, normalizedDecorator) : ''),
|
|
94
|
+
}, normalizedDecorator) : ''), clonedChildren, /*#__PURE__*/React.createElement("div", {
|
|
76
95
|
className: `${prefix}--checkbox-group__validation-msg`
|
|
77
96
|
}, !readOnly && invalid && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(iconsReact.WarningFilled, {
|
|
78
97
|
className: `${prefix}--checkbox__invalid-icon`
|
|
@@ -111,7 +111,7 @@ declare namespace CodeSnippet {
|
|
|
111
111
|
/**
|
|
112
112
|
* Specify how the trigger should align with the tooltip
|
|
113
113
|
*/
|
|
114
|
-
align:
|
|
114
|
+
align: PropTypes.Requireable<string> | PropTypes.Validator<string>;
|
|
115
115
|
/**
|
|
116
116
|
* Specify a label to be read by screen readers on the containing textbox
|
|
117
117
|
* node
|
|
@@ -238,7 +238,7 @@ CodeSnippet.propTypes = {
|
|
|
238
238
|
/**
|
|
239
239
|
* Specify how the trigger should align with the tooltip
|
|
240
240
|
*/
|
|
241
|
-
align: deprecateValuesWithin.
|
|
241
|
+
align: deprecateValuesWithin.deprecateValuesWithin(PropTypes.oneOf(['top', 'top-left',
|
|
242
242
|
// deprecated use top-start instead
|
|
243
243
|
'top-right',
|
|
244
244
|
// deprecated use top-end instead
|