@carbon/react 1.110.0 → 1.111.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 +927 -927
- package/es/components/AILabel/index.js +48 -1
- package/es/components/AISkeleton/AISkeletonIcon.js +7 -1
- package/es/components/AISkeleton/AISkeletonPlaceholder.js +7 -2
- package/es/components/AISkeleton/AISkeletonText.js +16 -1
- package/es/components/Accordion/Accordion.Skeleton.js +16 -1
- package/es/components/Accordion/Accordion.js +23 -1
- package/es/components/Accordion/AccordionItem.js +34 -1
- package/es/components/AspectRatio/AspectRatio.js +20 -1
- package/es/components/BadgeIndicator/index.js +10 -1
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +13 -1
- package/es/components/Breadcrumb/Breadcrumb.js +17 -1
- package/es/components/Breadcrumb/BreadcrumbItem.js +13 -1
- package/es/components/Button/Button.Skeleton.js +18 -1
- package/es/components/Button/Button.js +96 -0
- package/es/components/Button/ButtonBase.js +1 -1
- package/es/components/ButtonSet/ButtonSet.js +15 -1
- package/es/components/ChatButton/ChatButton.Skeleton.js +7 -1
- package/es/components/ChatButton/ChatButton.js +25 -1
- package/es/components/Checkbox/Checkbox.Skeleton.js +6 -2
- package/es/components/Checkbox/Checkbox.js +59 -2
- package/es/components/CheckboxGroup/CheckboxGroup.js +41 -1
- package/es/components/ClassPrefix/index.js +3 -0
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +7 -1
- package/es/components/CodeSnippet/CodeSnippet.js +77 -1
- package/es/components/ComboBox/ComboBox.js +141 -1
- package/es/components/ComboButton/index.js +28 -1
- package/es/components/ComposedModal/ComposedModal.js +70 -2
- package/es/components/ComposedModal/ModalFooter.js +65 -2
- package/es/components/ComposedModal/ModalHeader.js +36 -1
- package/es/components/ContainedList/ContainedList.js +22 -1
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +19 -1
- package/es/components/ContentSwitcher/ContentSwitcher.js +26 -1
- package/es/components/Copy/Copy.js +31 -2
- package/es/components/CopyButton/CopyButton.js +28 -2
- package/es/components/DataTable/DataTable.js +59 -0
- package/es/components/DataTable/Table.js +28 -1
- package/es/components/DataTable/TableBatchAction.js +10 -0
- package/es/components/DataTable/TableBatchActions.js +25 -1
- package/es/components/DataTable/TableBody.js +3 -0
- package/es/components/DataTable/TableCell.js +16 -1
- package/es/components/DataTable/TableContainer.js +19 -1
- package/es/components/DataTable/TableDecoratorRow.js +7 -1
- package/es/components/DataTable/TableExpandHeader.js +32 -1
- package/es/components/DataTable/TableExpandRow.js +30 -1
- package/es/components/DataTable/TableExpandedRow.js +10 -1
- package/es/components/DataTable/TableHeader.js +36 -1
- package/es/components/DataTable/TableRow.js +22 -1
- package/es/components/DataTable/TableSelectAll.js +29 -1
- package/es/components/DataTable/TableSelectRow.js +32 -1
- package/es/components/DataTable/TableSlugRow.js +7 -1
- package/es/components/DataTable/TableToolbar.js +16 -1
- package/es/components/DataTable/TableToolbarMenu.js +16 -1
- package/es/components/DataTable/TableToolbarSearch.js +60 -2
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +25 -1
- package/es/components/DatePicker/DatePicker.Skeleton.js +13 -1
- package/es/components/DatePicker/DatePicker.js +89 -1
- package/es/components/DatePickerInput/DatePickerInput.js +81 -2
- package/es/components/Dialog/Dialog.js +132 -5
- package/es/components/Dropdown/Dropdown.Skeleton.js +10 -1
- package/es/components/Dropdown/Dropdown.js +110 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +1 -1
- package/es/components/FeatureFlags/index.js +3 -0
- package/es/components/FileUploader/FileUploader.Skeleton.js +6 -2
- package/es/components/FileUploader/FileUploader.js +58 -1
- package/es/components/FileUploader/FileUploaderButton.js +49 -2
- package/es/components/FileUploader/FileUploaderDropContainer.js +44 -2
- package/es/components/FileUploader/FileUploaderItem.js +31 -2
- package/es/components/FileUploader/Filename.js +18 -0
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +6 -2
- package/es/components/FluidComboBox/FluidComboBox.js +62 -1
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +7 -1
- package/es/components/FluidDatePicker/FluidDatePicker.js +22 -1
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +6 -2
- package/es/components/FluidDropdown/FluidDropdown.js +66 -1
- package/es/components/FluidForm/FluidForm.js +7 -1
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +6 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +129 -1
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +6 -2
- package/es/components/FluidNumberInput/FluidNumberInput.js +96 -1
- package/es/components/FluidSearch/FluidSearch.Skeleton.js +6 -2
- package/es/components/FluidSearch/FluidSearch.js +46 -1
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +6 -2
- package/es/components/FluidSelect/FluidSelect.js +39 -1
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +6 -2
- package/es/components/FluidTextArea/FluidTextArea.js +68 -1
- package/es/components/FluidTextInput/FluidPasswordInput.js +59 -1
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +6 -2
- package/es/components/FluidTextInput/FluidTextInput.js +55 -1
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +7 -1
- package/es/components/FluidTimePicker/FluidTimePicker.js +29 -1
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +26 -0
- package/es/components/Form/Form.js +7 -1
- package/es/components/FormGroup/FormGroup.js +26 -1
- package/es/components/FormItem/FormItem.js +7 -1
- package/es/components/FormLabel/FormLabel.js +10 -1
- package/es/components/Grid/CSSGrid.js +44 -1
- package/es/components/Grid/Column.js +87 -1
- package/es/components/Grid/ColumnHang.js +10 -1
- package/es/components/Grid/FlexGrid.js +25 -1
- package/es/components/Grid/Grid.js +27 -0
- package/es/components/Grid/GridContext.js +10 -0
- package/es/components/Grid/Row.js +18 -1
- package/es/components/Heading/index.js +19 -0
- package/es/components/Icon/Icon.Skeleton.js +6 -2
- package/es/components/IconButton/index.js +69 -1
- package/es/components/IconIndicator/index.js +13 -1
- package/es/components/IdPrefix/index.js +3 -0
- package/es/components/InlineCheckbox/InlineCheckbox.js +34 -0
- package/es/components/InlineLoading/InlineLoading.js +20 -1
- package/es/components/Layer/index.js +18 -1
- package/es/components/Layout/index.js +35 -1
- package/es/components/LayoutDirection/LayoutDirection.js +10 -0
- package/es/components/Link/Link.d.ts +1 -1
- package/es/components/Link/Link.js +29 -1
- package/es/components/ListBox/ListBox.js +42 -1
- package/es/components/ListBox/ListBoxField.js +17 -0
- package/es/components/ListBox/ListBoxMenu.js +6 -0
- package/es/components/ListBox/ListBoxMenuIcon.js +8 -1
- package/es/components/ListBox/ListBoxMenuItem.js +17 -1
- package/es/components/ListBox/ListBoxSelection.d.ts +1 -1
- package/es/components/ListBox/ListBoxSelection.js +33 -10
- package/es/components/ListBox/next/ListBoxSelection.d.ts +1 -1
- package/es/components/ListBox/next/ListBoxSelection.js +42 -7
- package/es/components/ListBox/next/ListBoxTrigger.js +8 -1
- package/es/components/ListItem/ListItem.js +7 -1
- package/es/components/Loading/Loading.js +19 -1
- package/es/components/Menu/Menu.js +53 -1
- package/es/components/Menu/MenuItem.js +78 -2
- package/es/components/MenuButton/index.js +34 -1
- package/es/components/Modal/Modal.js +118 -4
- package/es/components/ModalWrapper/ModalWrapper.js +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +129 -1
- package/es/components/MultiSelect/MultiSelect.js +151 -3
- package/es/components/MultiSelect/MultiSelectPropTypes.js +25 -0
- package/es/components/Notification/Notification.js +210 -3
- package/es/components/NumberInput/NumberInput.Skeleton.js +10 -1
- package/es/components/NumberInput/NumberInput.js +139 -1
- package/es/components/OrderedList/OrderedList.js +16 -1
- package/es/components/OverflowMenu/OverflowMenu.js +78 -2
- package/es/components/OverflowMenu/next/index.js +31 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +38 -2
- package/es/components/PageHeader/PageHeader.js +49 -1
- package/es/components/Pagination/Pagination.Skeleton.js +6 -2
- package/es/components/Pagination/Pagination.d.ts +8 -0
- package/es/components/Pagination/Pagination.js +86 -4
- package/es/components/Pagination/experimental/PageSelector.js +9 -1
- package/es/components/Pagination/experimental/Pagination.js +55 -1
- package/es/components/PaginationNav/PaginationNav.js +81 -1
- package/es/components/Popover/index.js +59 -1
- package/es/components/ProgressBar/ProgressBar.js +28 -1
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +7 -1
- package/es/components/ProgressIndicator/ProgressIndicator.js +59 -1
- package/es/components/RadioButton/RadioButton.Skeleton.js +6 -2
- package/es/components/RadioButton/RadioButton.js +64 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +60 -1
- package/es/components/RadioTile/RadioTile.js +47 -2
- package/es/components/Search/Search.Skeleton.js +10 -1
- package/es/components/Search/Search.js +68 -3
- package/es/components/Select/Select.Skeleton.js +7 -1
- package/es/components/Select/Select.js +83 -20
- package/es/components/SelectItem/SelectItem.js +16 -1
- package/es/components/SelectItemGroup/SelectItemGroup.js +13 -1
- package/es/components/ShapeIndicator/index.js +13 -1
- package/es/components/SkeletonIcon/SkeletonIcon.js +6 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +6 -2
- package/es/components/SkeletonText/SkeletonText.js +16 -1
- package/es/components/Slider/Slider.Skeleton.js +16 -1
- package/es/components/Slider/Slider.js +105 -1
- package/es/components/Stack/Stack.js +21 -1
- package/es/components/StructuredList/StructuredList.Skeleton.js +7 -1
- package/es/components/StructuredList/StructuredList.js +98 -1
- package/es/components/Switch/IconSwitch.js +49 -2
- package/es/components/Switch/Switch.js +32 -2
- package/es/components/TabContent/TabContent.js +10 -1
- package/es/components/Tabs/Tabs.Skeleton.js +7 -1
- package/es/components/Tabs/Tabs.js +175 -2
- package/es/components/Tag/DismissibleTag.js +44 -1
- package/es/components/Tag/OperationalTag.js +23 -1
- package/es/components/Tag/SelectableTag.js +32 -1
- package/es/components/Tag/Tag.Skeleton.js +8 -1
- package/es/components/Tag/Tag.js +42 -1
- package/es/components/Text/Text.js +10 -0
- package/es/components/Text/TextDirection.js +11 -0
- package/es/components/TextArea/TextArea.Skeleton.js +7 -1
- package/es/components/TextArea/TextArea.js +82 -2
- package/es/components/TextInput/ControlledPasswordInput.js +66 -2
- package/es/components/TextInput/PasswordInput.js +84 -1
- package/es/components/TextInput/TextInput.Skeleton.js +10 -1
- package/es/components/TextInput/TextInput.js +77 -1
- package/es/components/Theme/index.js +22 -1
- package/es/components/Tile/Tile.js +158 -3
- package/es/components/TileGroup/TileGroup.js +29 -1
- package/es/components/TimePicker/TimePicker.js +68 -1
- package/es/components/TimePickerSelect/TimePickerSelect.js +16 -1
- package/es/components/Toggle/Toggle.Skeleton.js +1 -1
- package/es/components/Toggle/Toggle.js +47 -1
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +12 -1
- package/es/components/Toggletip/index.js +39 -1
- package/es/components/Tooltip/DefinitionTooltip.js +37 -1
- package/es/components/Tooltip/Tooltip.js +47 -1
- package/es/components/TreeView/TreeNode.js +65 -1
- package/es/components/TreeView/TreeView.js +33 -1
- package/es/components/UIShell/Content.js +10 -1
- package/es/components/UIShell/Header.js +10 -1
- package/es/components/UIShell/HeaderContainer.js +9 -0
- package/es/components/UIShell/HeaderGlobalAction.js +29 -1
- package/es/components/UIShell/HeaderMenu.js +38 -1
- package/es/components/UIShell/HeaderMenuButton.js +18 -1
- package/es/components/UIShell/HeaderMenuItem.js +26 -1
- package/es/components/UIShell/HeaderName.js +19 -1
- package/es/components/UIShell/HeaderNavigation.js +11 -1
- package/es/components/UIShell/HeaderPanel.js +21 -2
- package/es/components/UIShell/HeaderSideNavItems.js +12 -1
- package/es/components/UIShell/Link.js +14 -0
- package/es/components/UIShell/SideNav.js +54 -1
- package/es/components/UIShell/SideNavDetails.js +11 -1
- package/es/components/UIShell/SideNavDivider.js +6 -2
- package/es/components/UIShell/SideNavFooter.js +12 -1
- package/es/components/UIShell/SideNavHeader.js +14 -1
- package/es/components/UIShell/SideNavIcon.js +11 -1
- package/es/components/UIShell/SideNavItem.js +11 -1
- package/es/components/UIShell/SideNavItems.js +12 -1
- package/es/components/UIShell/SideNavLink.js +23 -1
- package/es/components/UIShell/SideNavLinkText.js +7 -1
- package/es/components/UIShell/SideNavMenu.js +32 -1
- package/es/components/UIShell/SideNavMenuItem.js +18 -1
- package/es/components/UIShell/SideNavSwitcher.js +17 -1
- package/es/components/UIShell/SkipToContent.js +12 -1
- package/es/components/UIShell/Switcher.js +13 -1
- package/es/components/UIShell/SwitcherDivider.js +6 -2
- package/es/components/UIShell/SwitcherItem.js +31 -1
- package/es/components/UnorderedList/UnorderedList.js +13 -1
- package/es/internal/FloatingMenu.js +1 -1
- package/es/internal/OptimizedResize.js +6 -2
- package/es/internal/usePresence.js +6 -0
- package/es/tools/wrapComponent.js +1 -1
- package/lib/components/AILabel/index.js +49 -2
- package/lib/components/AISkeleton/AISkeletonIcon.js +8 -2
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +8 -3
- package/lib/components/AISkeleton/AISkeletonText.js +17 -2
- package/lib/components/Accordion/Accordion.Skeleton.js +17 -2
- package/lib/components/Accordion/Accordion.js +24 -2
- package/lib/components/Accordion/AccordionItem.js +35 -2
- package/lib/components/AspectRatio/AspectRatio.js +21 -2
- package/lib/components/BadgeIndicator/index.js +11 -2
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +14 -2
- package/lib/components/Breadcrumb/Breadcrumb.js +18 -2
- package/lib/components/Breadcrumb/BreadcrumbItem.js +14 -2
- package/lib/components/Button/Button.Skeleton.js +19 -2
- package/lib/components/Button/Button.js +96 -0
- package/lib/components/Button/ButtonBase.js +2 -2
- package/lib/components/ButtonSet/ButtonSet.js +16 -2
- package/lib/components/ChatButton/ChatButton.Skeleton.js +8 -2
- package/lib/components/ChatButton/ChatButton.js +26 -2
- package/lib/components/Checkbox/Checkbox.Skeleton.js +7 -3
- package/lib/components/Checkbox/Checkbox.js +60 -3
- package/lib/components/CheckboxGroup/CheckboxGroup.js +42 -2
- package/lib/components/ClassPrefix/index.js +3 -0
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +8 -2
- package/lib/components/CodeSnippet/CodeSnippet.js +78 -2
- package/lib/components/ComboBox/ComboBox.js +142 -2
- package/lib/components/ComboButton/index.js +29 -2
- package/lib/components/ComposedModal/ComposedModal.js +71 -3
- package/lib/components/ComposedModal/ComposedModalContext.js +0 -1
- package/lib/components/ComposedModal/ModalFooter.js +66 -3
- package/lib/components/ComposedModal/ModalHeader.js +37 -2
- package/lib/components/ComposedModal/useComposedModalState.js +0 -1
- package/lib/components/ContainedList/ContainedList.js +23 -2
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +20 -2
- package/lib/components/ContainedList/index.js +2 -2
- package/lib/components/ContentSwitcher/ContentSwitcher.js +27 -2
- package/lib/components/ContextMenu/useContextMenu.js +0 -1
- package/lib/components/Copy/Copy.js +32 -3
- package/lib/components/CopyButton/CopyButton.js +29 -3
- package/lib/components/DataTable/DataTable.js +59 -0
- package/lib/components/DataTable/Table.js +29 -2
- package/lib/components/DataTable/TableBatchAction.js +10 -0
- package/lib/components/DataTable/TableBatchActions.js +26 -2
- package/lib/components/DataTable/TableBody.js +3 -0
- package/lib/components/DataTable/TableCell.js +17 -2
- package/lib/components/DataTable/TableContainer.js +20 -2
- package/lib/components/DataTable/TableContext.js +0 -1
- package/lib/components/DataTable/TableDecoratorRow.js +8 -2
- package/lib/components/DataTable/TableExpandHeader.js +33 -2
- package/lib/components/DataTable/TableExpandRow.js +31 -2
- package/lib/components/DataTable/TableExpandedRow.js +11 -2
- package/lib/components/DataTable/TableHeader.js +37 -2
- package/lib/components/DataTable/TableRow.js +23 -2
- package/lib/components/DataTable/TableSelectAll.js +30 -2
- package/lib/components/DataTable/TableSelectRow.js +33 -2
- package/lib/components/DataTable/TableSlugRow.js +8 -2
- package/lib/components/DataTable/TableToolbar.js +17 -2
- package/lib/components/DataTable/TableToolbarMenu.js +17 -2
- package/lib/components/DataTable/TableToolbarSearch.js +61 -3
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +26 -2
- package/lib/components/DatePicker/DatePicker.Skeleton.js +14 -2
- package/lib/components/DatePicker/DatePicker.js +90 -2
- package/lib/components/DatePickerInput/DatePickerInput.js +82 -3
- package/lib/components/Dialog/Dialog.js +133 -6
- package/lib/components/Dropdown/Dropdown.Skeleton.js +11 -2
- package/lib/components/Dropdown/Dropdown.js +111 -2
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +2 -2
- package/lib/components/FeatureFlags/index.js +3 -0
- package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -3
- package/lib/components/FileUploader/FileUploader.js +59 -2
- package/lib/components/FileUploader/FileUploaderButton.js +50 -3
- package/lib/components/FileUploader/FileUploaderDropContainer.js +45 -3
- package/lib/components/FileUploader/FileUploaderItem.js +32 -3
- package/lib/components/FileUploader/Filename.js +18 -0
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +7 -3
- package/lib/components/FluidComboBox/FluidComboBox.js +63 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +8 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.js +23 -2
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +7 -3
- package/lib/components/FluidDropdown/FluidDropdown.js +67 -2
- package/lib/components/FluidForm/FluidForm.js +8 -2
- package/lib/components/FluidForm/FormContext.js +0 -1
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +7 -3
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +130 -2
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +7 -3
- package/lib/components/FluidNumberInput/FluidNumberInput.js +97 -2
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +7 -3
- package/lib/components/FluidSearch/FluidSearch.js +47 -2
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +7 -3
- package/lib/components/FluidSelect/FluidSelect.js +40 -2
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +7 -3
- package/lib/components/FluidTextArea/FluidTextArea.js +69 -2
- package/lib/components/FluidTextInput/FluidPasswordInput.js +60 -2
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +7 -3
- package/lib/components/FluidTextInput/FluidTextInput.js +56 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +8 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.js +30 -2
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +26 -0
- package/lib/components/Form/Form.js +8 -2
- package/lib/components/FormGroup/FormGroup.js +27 -2
- package/lib/components/FormItem/FormItem.js +8 -2
- package/lib/components/FormLabel/FormLabel.js +11 -2
- package/lib/components/Grid/CSSGrid.js +45 -2
- package/lib/components/Grid/Column.js +88 -2
- package/lib/components/Grid/ColumnHang.js +11 -2
- package/lib/components/Grid/FlexGrid.js +26 -2
- package/lib/components/Grid/Grid.js +27 -0
- package/lib/components/Grid/GridContext.js +10 -0
- package/lib/components/Grid/Row.js +19 -2
- package/lib/components/Heading/index.js +19 -0
- package/lib/components/Icon/Icon.Skeleton.js +7 -3
- package/lib/components/IconButton/index.js +70 -2
- package/lib/components/IconIndicator/index.js +14 -2
- package/lib/components/IdPrefix/index.js +3 -0
- package/lib/components/InlineCheckbox/InlineCheckbox.js +34 -0
- package/lib/components/InlineLoading/InlineLoading.js +21 -2
- package/lib/components/Layer/index.js +19 -2
- package/lib/components/Layout/index.js +36 -2
- package/lib/components/LayoutDirection/LayoutDirection.js +10 -0
- package/lib/components/LayoutDirection/useLayoutDirection.js +0 -1
- package/lib/components/Link/Link.d.ts +1 -1
- package/lib/components/Link/Link.js +30 -2
- package/lib/components/ListBox/ListBox.js +43 -2
- package/lib/components/ListBox/ListBoxField.js +17 -0
- package/lib/components/ListBox/ListBoxMenu.js +6 -0
- package/lib/components/ListBox/ListBoxMenuIcon.js +9 -2
- package/lib/components/ListBox/ListBoxMenuItem.js +18 -2
- package/lib/components/ListBox/ListBoxSelection.d.ts +1 -1
- package/lib/components/ListBox/ListBoxSelection.js +34 -11
- package/lib/components/ListBox/next/ListBoxSelection.d.ts +1 -1
- package/lib/components/ListBox/next/ListBoxSelection.js +43 -8
- package/lib/components/ListBox/next/ListBoxTrigger.js +9 -2
- package/lib/components/ListItem/ListItem.js +8 -2
- package/lib/components/Loading/Loading.js +20 -2
- package/lib/components/Menu/Menu.js +54 -2
- package/lib/components/Menu/MenuContext.js +0 -1
- package/lib/components/Menu/MenuItem.js +79 -3
- package/lib/components/MenuButton/index.js +35 -2
- package/lib/components/Modal/Modal.js +119 -5
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +130 -2
- package/lib/components/MultiSelect/MultiSelect.js +151 -3
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +25 -0
- package/lib/components/Notification/Notification.js +211 -4
- package/lib/components/NumberInput/NumberInput.Skeleton.js +11 -2
- package/lib/components/NumberInput/NumberInput.js +140 -2
- package/lib/components/OrderedList/OrderedList.js +17 -2
- package/lib/components/OverflowMenu/OverflowMenu.js +79 -3
- package/lib/components/OverflowMenu/next/index.js +32 -2
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +39 -3
- package/lib/components/PageHeader/PageHeader.js +50 -2
- package/lib/components/Pagination/Pagination.Skeleton.js +7 -3
- package/lib/components/Pagination/Pagination.d.ts +8 -0
- package/lib/components/Pagination/Pagination.js +87 -5
- package/lib/components/Pagination/experimental/PageSelector.js +10 -2
- package/lib/components/Pagination/experimental/Pagination.js +56 -2
- package/lib/components/PaginationNav/PaginationNav.js +82 -2
- package/lib/components/Popover/index.js +60 -2
- package/lib/components/ProgressBar/ProgressBar.js +29 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +8 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.js +60 -2
- package/lib/components/RadioButton/RadioButton.Skeleton.js +7 -3
- package/lib/components/RadioButton/RadioButton.js +65 -2
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +61 -2
- package/lib/components/RadioTile/RadioTile.js +48 -3
- package/lib/components/Search/Search.Skeleton.js +11 -2
- package/lib/components/Search/Search.js +69 -4
- package/lib/components/Select/Select.Skeleton.js +8 -2
- package/lib/components/Select/Select.js +84 -21
- package/lib/components/SelectItem/SelectItem.js +17 -2
- package/lib/components/SelectItemGroup/SelectItemGroup.js +14 -2
- package/lib/components/ShapeIndicator/index.js +14 -2
- package/lib/components/SkeletonIcon/SkeletonIcon.js +7 -3
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +7 -3
- package/lib/components/SkeletonText/SkeletonText.js +17 -2
- package/lib/components/Slider/Slider.Skeleton.js +17 -2
- package/lib/components/Slider/Slider.js +106 -2
- package/lib/components/Stack/Stack.js +22 -2
- package/lib/components/StructuredList/StructuredList.Skeleton.js +8 -2
- package/lib/components/StructuredList/StructuredList.js +99 -2
- package/lib/components/Switch/IconSwitch.js +50 -3
- package/lib/components/Switch/Switch.js +33 -3
- package/lib/components/TabContent/TabContent.js +11 -2
- package/lib/components/Tabs/Tabs.Skeleton.js +8 -2
- package/lib/components/Tabs/Tabs.js +176 -3
- package/lib/components/Tabs/usePressable.js +0 -1
- package/lib/components/Tag/DismissibleTag.js +45 -2
- package/lib/components/Tag/OperationalTag.js +24 -2
- package/lib/components/Tag/SelectableTag.js +33 -2
- package/lib/components/Tag/Tag.Skeleton.js +9 -2
- package/lib/components/Tag/Tag.js +43 -2
- package/lib/components/Text/Text.js +10 -0
- package/lib/components/Text/TextDirection.js +11 -0
- package/lib/components/Text/TextDirectionContext.js +0 -1
- package/lib/components/TextArea/TextArea.Skeleton.js +8 -2
- package/lib/components/TextArea/TextArea.js +83 -3
- package/lib/components/TextInput/ControlledPasswordInput.js +67 -3
- package/lib/components/TextInput/PasswordInput.js +85 -2
- package/lib/components/TextInput/TextInput.Skeleton.js +11 -2
- package/lib/components/TextInput/TextInput.js +78 -2
- package/lib/components/Theme/index.js +23 -2
- package/lib/components/Tile/Tile.js +159 -4
- package/lib/components/TileGroup/TileGroup.js +29 -1
- package/lib/components/TimePicker/TimePicker.js +69 -2
- package/lib/components/TimePickerSelect/TimePickerSelect.js +17 -2
- package/lib/components/Toggle/Toggle.Skeleton.js +2 -2
- package/lib/components/Toggle/Toggle.js +48 -2
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +13 -2
- package/lib/components/Toggletip/index.js +40 -2
- package/lib/components/Tooltip/DefinitionTooltip.js +38 -2
- package/lib/components/Tooltip/Tooltip.js +48 -2
- package/lib/components/TreeView/TreeContext.js +0 -1
- package/lib/components/TreeView/TreeNode.js +66 -2
- package/lib/components/TreeView/TreeView.js +34 -2
- package/lib/components/UIShell/Content.js +11 -2
- package/lib/components/UIShell/Header.js +11 -2
- package/lib/components/UIShell/HeaderContainer.js +9 -0
- package/lib/components/UIShell/HeaderGlobalAction.js +30 -2
- package/lib/components/UIShell/HeaderMenu.js +39 -2
- package/lib/components/UIShell/HeaderMenuButton.js +19 -2
- package/lib/components/UIShell/HeaderMenuItem.js +27 -2
- package/lib/components/UIShell/HeaderName.js +20 -2
- package/lib/components/UIShell/HeaderNavigation.js +12 -2
- package/lib/components/UIShell/HeaderPanel.js +22 -3
- package/lib/components/UIShell/HeaderSideNavItems.js +13 -2
- package/lib/components/UIShell/Link.js +14 -0
- package/lib/components/UIShell/SideNav.js +55 -2
- package/lib/components/UIShell/SideNavDetails.js +12 -2
- package/lib/components/UIShell/SideNavDivider.js +7 -3
- package/lib/components/UIShell/SideNavFooter.js +13 -2
- package/lib/components/UIShell/SideNavHeader.js +15 -2
- package/lib/components/UIShell/SideNavIcon.js +12 -2
- package/lib/components/UIShell/SideNavItem.js +12 -2
- package/lib/components/UIShell/SideNavItems.js +13 -2
- package/lib/components/UIShell/SideNavLink.js +24 -2
- package/lib/components/UIShell/SideNavLinkText.js +8 -2
- package/lib/components/UIShell/SideNavMenu.js +33 -2
- package/lib/components/UIShell/SideNavMenuItem.js +19 -2
- package/lib/components/UIShell/SideNavSwitcher.js +18 -2
- package/lib/components/UIShell/SkipToContent.js +13 -2
- package/lib/components/UIShell/Switcher.js +14 -2
- package/lib/components/UIShell/SwitcherDivider.js +7 -3
- package/lib/components/UIShell/SwitcherItem.js +32 -2
- package/lib/components/UnorderedList/UnorderedList.js +14 -2
- package/lib/feature-flags.js +0 -1
- package/lib/index.js +241 -242
- package/lib/internal/FloatingMenu.js +1 -1
- package/lib/internal/OptimizedResize.js +6 -2
- package/lib/internal/useAttachedMenu.js +0 -1
- package/lib/internal/useControllableState.js +0 -1
- package/lib/internal/useDelayedState.js +0 -1
- package/lib/internal/useEvent.js +0 -1
- package/lib/internal/useIsomorphicEffect.js +0 -1
- package/lib/internal/useMatchMedia.js +0 -1
- package/lib/internal/useMergedRefs.js +0 -1
- package/lib/internal/useNoInteractiveChildren.js +0 -1
- package/lib/internal/useOutsideClick.js +0 -1
- package/lib/internal/useOverflowItems.js +0 -1
- package/lib/internal/usePresence.js +6 -1
- package/lib/internal/usePresenceContext.js +0 -1
- package/lib/internal/usePreviousValue.js +0 -1
- package/lib/internal/useResizeObserver.js +0 -1
- package/lib/internal/useSavedCallback.js +0 -1
- package/lib/internal/utils.js +0 -1
- package/lib/internal/wrapFocus.js +0 -1
- package/lib/tools/wrapComponent.js +2 -2
- package/package.json +9 -9
- package/telemetry.yml +12 -0
|
@@ -9,8 +9,8 @@ import { usePrefix } from "../../internal/usePrefix.js";
|
|
|
9
9
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
10
10
|
import { ListBoxSizePropType, ListBoxTypePropType } from "./ListBoxPropTypes.js";
|
|
11
11
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
12
|
-
import { forwardRef, useContext } from "react";
|
|
13
12
|
import classNames from "classnames";
|
|
13
|
+
import { forwardRef, useContext } from "react";
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
//#region src/components/ListBox/ListBox.tsx
|
|
@@ -73,18 +73,59 @@ const ListBox = forwardRef((props, ref) => {
|
|
|
73
73
|
});
|
|
74
74
|
ListBox.displayName = "ListBox";
|
|
75
75
|
ListBox.propTypes = {
|
|
76
|
+
/**
|
|
77
|
+
* Provide the contents of your ListBox
|
|
78
|
+
*/
|
|
76
79
|
children: PropTypes.node,
|
|
80
|
+
/**
|
|
81
|
+
* Specify a class name to be applied on the containing list box node
|
|
82
|
+
*/
|
|
77
83
|
className: PropTypes.string,
|
|
84
|
+
/**
|
|
85
|
+
* Specify whether the ListBox is currently disabled
|
|
86
|
+
*/
|
|
78
87
|
disabled: PropTypes.bool,
|
|
88
|
+
/**
|
|
89
|
+
* Specify whether the control is currently invalid
|
|
90
|
+
*/
|
|
79
91
|
invalid: PropTypes.bool,
|
|
92
|
+
/**
|
|
93
|
+
* Specify the text to be displayed when the control is invalid
|
|
94
|
+
*/
|
|
80
95
|
invalidText: PropTypes.node,
|
|
96
|
+
/**
|
|
97
|
+
* Specify the id to be applied to the element containing the invalid text
|
|
98
|
+
*/
|
|
81
99
|
invalidTextId: PropTypes.string,
|
|
100
|
+
/**
|
|
101
|
+
* Specify if the control should render open
|
|
102
|
+
*/
|
|
82
103
|
isOpen: PropTypes.bool,
|
|
104
|
+
/**
|
|
105
|
+
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
106
|
+
* Don't use this to make tile background color same as container background color.
|
|
107
|
+
*/
|
|
83
108
|
light: deprecate(PropTypes.bool, "The `light` prop for `ListBox` has been deprecated in favor of the new `Layer` component. It will be removed in the next major release."),
|
|
109
|
+
/**
|
|
110
|
+
* Specify the size of the ListBox. Currently supports either `xs`, `sm`, `md` or `lg` as an option.
|
|
111
|
+
*/
|
|
84
112
|
size: ListBoxSizePropType,
|
|
113
|
+
/**
|
|
114
|
+
* Specify the "type" of the ListBox. Currently supports either `default` or
|
|
115
|
+
* `inline` as an option.
|
|
116
|
+
*/
|
|
85
117
|
type: ListBoxTypePropType,
|
|
118
|
+
/**
|
|
119
|
+
* Specify whether the control is currently in warning state
|
|
120
|
+
*/
|
|
86
121
|
warn: PropTypes.bool,
|
|
122
|
+
/**
|
|
123
|
+
* Provide the text that is displayed when the control is in warning state
|
|
124
|
+
*/
|
|
87
125
|
warnText: PropTypes.string,
|
|
126
|
+
/**
|
|
127
|
+
* Specify the id to be applied to the element containing the warn text
|
|
128
|
+
*/
|
|
88
129
|
warnTextId: PropTypes.string
|
|
89
130
|
};
|
|
90
131
|
//#endregion
|
|
@@ -24,10 +24,27 @@ function ListBoxField({ children, disabled, tabIndex, ...rest }) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
ListBoxField.propTypes = {
|
|
27
|
+
/**
|
|
28
|
+
* Typically set by `getToggleButtonProps`, this should specify whether the
|
|
29
|
+
* field has a popup.
|
|
30
|
+
*/
|
|
27
31
|
"aria-haspopup": PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
32
|
+
/**
|
|
33
|
+
* Provide the contents of your ListBoxField
|
|
34
|
+
*/
|
|
28
35
|
children: PropTypes.node,
|
|
36
|
+
/**
|
|
37
|
+
* Specify if the parent <ListBox> is disabled
|
|
38
|
+
*/
|
|
29
39
|
disabled: PropTypes.bool,
|
|
40
|
+
/**
|
|
41
|
+
* The role for the component, should be set by `getToggleButtonProps` coming
|
|
42
|
+
* from Downshift
|
|
43
|
+
*/
|
|
30
44
|
role: PropTypes.string,
|
|
45
|
+
/**
|
|
46
|
+
* Optional prop to specify the tabIndex of the <ListBox> trigger button
|
|
47
|
+
*/
|
|
31
48
|
tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
32
49
|
};
|
|
33
50
|
//#endregion
|
|
@@ -34,12 +34,18 @@ const ListBoxMenu = forwardRef(({ children, id, ...rest }, ref) => {
|
|
|
34
34
|
});
|
|
35
35
|
ListBoxMenu.displayName = "ListBoxMenu";
|
|
36
36
|
ListBoxMenu.propTypes = {
|
|
37
|
+
/**
|
|
38
|
+
* Provide the contents of your ListBoxMenu
|
|
39
|
+
*/
|
|
37
40
|
children: PropTypes.oneOfType([
|
|
38
41
|
PropTypes.node,
|
|
39
42
|
PropTypes.arrayOf(PropTypes.oneOf([ListBoxMenuItem])),
|
|
40
43
|
PropTypes.shape({ type: PropTypes.oneOf([ListBoxMenuItem]) }),
|
|
41
44
|
PropTypes.bool
|
|
42
45
|
]),
|
|
46
|
+
/**
|
|
47
|
+
* Specify a custom `id`
|
|
48
|
+
*/
|
|
43
49
|
id: PropTypes.string.isRequired
|
|
44
50
|
};
|
|
45
51
|
//#endregion
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
|
-
import "react";
|
|
10
9
|
import classNames from "classnames";
|
|
10
|
+
import "react";
|
|
11
11
|
import PropTypes from "prop-types";
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
|
13
13
|
import { ChevronDown } from "@carbon/icons-react";
|
|
@@ -47,7 +47,14 @@ const ListBoxMenuIcon = ({ isOpen, translateWithId: t = defaultTranslateWithId }
|
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
49
|
ListBoxMenuIcon.propTypes = {
|
|
50
|
+
/**
|
|
51
|
+
* Specify whether the menu is currently open, which will influence the
|
|
52
|
+
* direction of the menu icon
|
|
53
|
+
*/
|
|
50
54
|
isOpen: PropTypes.bool.isRequired,
|
|
55
|
+
/**
|
|
56
|
+
* Translates component strings using your i18n tool.
|
|
57
|
+
*/
|
|
51
58
|
translateWithId: PropTypes.func
|
|
52
59
|
};
|
|
53
60
|
//#endregion
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
9
|
import { useMergedRefs } from "../../internal/useMergedRefs.js";
|
|
10
|
-
import { forwardRef, useEffect, useRef, useState } from "react";
|
|
11
10
|
import classNames from "classnames";
|
|
11
|
+
import { forwardRef, useEffect, useRef, useState } from "react";
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/ListBox/ListBoxMenuItem.tsx
|
|
@@ -69,10 +69,26 @@ const ListBoxMenuItem = forwardRef(({ children, isActive = false, isHighlighted
|
|
|
69
69
|
});
|
|
70
70
|
ListBoxMenuItem.displayName = "ListBoxMenuItem";
|
|
71
71
|
ListBoxMenuItem.propTypes = {
|
|
72
|
+
/**
|
|
73
|
+
* Specify any children nodes that should be rendered inside of the ListBox
|
|
74
|
+
* Menu Item
|
|
75
|
+
*/
|
|
72
76
|
children: PropTypes.node,
|
|
77
|
+
/**
|
|
78
|
+
* Specify if the item should be disabled
|
|
79
|
+
*/
|
|
73
80
|
disabled: PropTypes.bool,
|
|
81
|
+
/**
|
|
82
|
+
* Specify whether the current menu item is "active".
|
|
83
|
+
*/
|
|
74
84
|
isActive: PropTypes.bool,
|
|
85
|
+
/**
|
|
86
|
+
* Specify whether the current menu item is "highlighted".
|
|
87
|
+
*/
|
|
75
88
|
isHighlighted: PropTypes.bool,
|
|
89
|
+
/**
|
|
90
|
+
* Provide an optional tooltip for the ListBoxMenuItem
|
|
91
|
+
*/
|
|
76
92
|
title: PropTypes.string
|
|
77
93
|
};
|
|
78
94
|
//#endregion
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
|
-
import "react";
|
|
10
9
|
import classNames from "classnames";
|
|
10
|
+
import "react";
|
|
11
11
|
import PropTypes from "prop-types";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { Close } from "@carbon/icons-react";
|
|
14
14
|
//#region src/components/ListBox/ListBoxSelection.tsx
|
|
15
15
|
/**
|
|
16
|
-
* Copyright IBM Corp. 2016,
|
|
16
|
+
* Copyright IBM Corp. 2016, 2026
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -23,7 +23,7 @@ const translationIds = {
|
|
|
23
23
|
"clear.selection": "clear.selection"
|
|
24
24
|
};
|
|
25
25
|
const defaultTranslations = {
|
|
26
|
-
[translationIds["clear.all"]]: "Clear
|
|
26
|
+
[translationIds["clear.all"]]: "Clear selected items",
|
|
27
27
|
[translationIds["clear.selection"]]: "Clear selected item"
|
|
28
28
|
};
|
|
29
29
|
const defaultTranslateWithId = (messageId) => {
|
|
@@ -36,9 +36,11 @@ const defaultTranslateWithId = (messageId) => {
|
|
|
36
36
|
*/
|
|
37
37
|
const ListBoxSelection = ({ clearSelection, selectionCount, translateWithId: t = defaultTranslateWithId, disabled, onClearSelection, readOnly }) => {
|
|
38
38
|
const prefix = usePrefix();
|
|
39
|
+
const hasSelectionCount = (selectionCount ?? 0) > 0;
|
|
40
|
+
const hasMultipleSelections = (selectionCount ?? 0) > 1;
|
|
39
41
|
const className = classNames(`${prefix}--list-box__selection`, {
|
|
40
|
-
[`${prefix}--tag--filter`]:
|
|
41
|
-
[`${prefix}--list-box__selection--multi`]:
|
|
42
|
+
[`${prefix}--tag--filter`]: hasSelectionCount,
|
|
43
|
+
[`${prefix}--list-box__selection--multi`]: hasSelectionCount
|
|
42
44
|
});
|
|
43
45
|
const handleOnClick = (event) => {
|
|
44
46
|
event.stopPropagation();
|
|
@@ -46,9 +48,9 @@ const ListBoxSelection = ({ clearSelection, selectionCount, translateWithId: t =
|
|
|
46
48
|
clearSelection(event);
|
|
47
49
|
if (onClearSelection) onClearSelection(event);
|
|
48
50
|
};
|
|
49
|
-
const description =
|
|
51
|
+
const description = hasMultipleSelections ? t("clear.all") : t("clear.selection");
|
|
50
52
|
const tagClasses = classNames(`${prefix}--tag`, `${prefix}--tag--filter`, `${prefix}--tag--high-contrast`, { [`${prefix}--tag--disabled`]: disabled });
|
|
51
|
-
return
|
|
53
|
+
return hasSelectionCount ? /* @__PURE__ */ jsxs("div", {
|
|
52
54
|
className: tagClasses,
|
|
53
55
|
children: [/* @__PURE__ */ jsx("span", {
|
|
54
56
|
className: `${prefix}--tag__label`,
|
|
@@ -59,27 +61,48 @@ const ListBoxSelection = ({ clearSelection, selectionCount, translateWithId: t =
|
|
|
59
61
|
tabIndex: -1,
|
|
60
62
|
className: `${prefix}--tag__close-icon`,
|
|
61
63
|
onClick: handleOnClick,
|
|
62
|
-
"aria-label":
|
|
64
|
+
"aria-label": description,
|
|
63
65
|
title: description,
|
|
64
66
|
"aria-disabled": readOnly ? true : void 0,
|
|
65
67
|
children: /* @__PURE__ */ jsx(Close, {})
|
|
66
68
|
})]
|
|
67
|
-
}) : /* @__PURE__ */
|
|
69
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
68
70
|
role: "button",
|
|
69
71
|
className,
|
|
70
72
|
tabIndex: -1,
|
|
71
73
|
onClick: handleOnClick,
|
|
72
74
|
"aria-label": description,
|
|
73
75
|
title: description,
|
|
74
|
-
children:
|
|
76
|
+
children: /* @__PURE__ */ jsx(Close, {})
|
|
75
77
|
});
|
|
76
78
|
};
|
|
77
79
|
ListBoxSelection.propTypes = {
|
|
80
|
+
/**
|
|
81
|
+
* Specify a function to be invoked when a user interacts with the clear
|
|
82
|
+
* selection element.
|
|
83
|
+
*/
|
|
78
84
|
clearSelection: PropTypes.func.isRequired,
|
|
85
|
+
/**
|
|
86
|
+
* Specify whether or not the clear selection element should be disabled
|
|
87
|
+
*/
|
|
79
88
|
disabled: PropTypes.bool,
|
|
89
|
+
/**
|
|
90
|
+
* Specify an optional `onClearSelection` handler that is called when the underlying
|
|
91
|
+
* element is cleared
|
|
92
|
+
*/
|
|
80
93
|
onClearSelection: PropTypes.func,
|
|
94
|
+
/**
|
|
95
|
+
* Whether or not the Dropdown is readonly
|
|
96
|
+
*/
|
|
81
97
|
readOnly: PropTypes.bool,
|
|
98
|
+
/**
|
|
99
|
+
* Specify an optional `selectionCount` value that will be used to determine
|
|
100
|
+
* whether the selection should display a badge or a single clear icon.
|
|
101
|
+
*/
|
|
82
102
|
selectionCount: PropTypes.number,
|
|
103
|
+
/**
|
|
104
|
+
* Translates component strings using your i18n tool.
|
|
105
|
+
*/
|
|
83
106
|
translateWithId: PropTypes.func
|
|
84
107
|
};
|
|
85
108
|
//#endregion
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../../internal/usePrefix.js";
|
|
9
|
-
import "react";
|
|
10
9
|
import classNames from "classnames";
|
|
10
|
+
import "react";
|
|
11
11
|
import PropTypes from "prop-types";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { Close } from "@carbon/icons-react";
|
|
14
14
|
//#region src/components/ListBox/next/ListBoxSelection.tsx
|
|
15
15
|
/**
|
|
16
|
-
* Copyright IBM Corp. 2016,
|
|
16
|
+
* Copyright IBM Corp. 2016, 2026
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -28,7 +28,7 @@ const translationIds = {
|
|
|
28
28
|
"clear.selection": "clear.selection"
|
|
29
29
|
};
|
|
30
30
|
const defaultTranslations = {
|
|
31
|
-
[translationIds["clear.all"]]: "Clear
|
|
31
|
+
[translationIds["clear.all"]]: "Clear selected items",
|
|
32
32
|
[translationIds["clear.selection"]]: "Clear selected item"
|
|
33
33
|
};
|
|
34
34
|
const defaultTranslateWithId = (messageId) => {
|
|
@@ -36,11 +36,13 @@ const defaultTranslateWithId = (messageId) => {
|
|
|
36
36
|
};
|
|
37
37
|
function ListBoxSelection({ clearSelection, selectionCount, translateWithId: t = defaultTranslateWithId, disabled, readOnly, onClearSelection, ...rest }) {
|
|
38
38
|
const prefix = usePrefix();
|
|
39
|
+
const hasSelectionCount = (selectionCount ?? 0) > 0;
|
|
40
|
+
const hasMultipleSelections = (selectionCount ?? 0) > 1;
|
|
39
41
|
const className = classNames(`${prefix}--list-box__selection`, {
|
|
40
|
-
[`${prefix}--tag--filter`]:
|
|
41
|
-
[`${prefix}--list-box__selection--multi`]:
|
|
42
|
+
[`${prefix}--tag--filter`]: hasSelectionCount,
|
|
43
|
+
[`${prefix}--list-box__selection--multi`]: hasSelectionCount
|
|
42
44
|
});
|
|
43
|
-
const description =
|
|
45
|
+
const description = hasMultipleSelections ? t("clear.all") : t("clear.selection");
|
|
44
46
|
const tagClasses = classNames(`${prefix}--tag`, `${prefix}--tag--filter`, `${prefix}--tag--high-contrast`, { [`${prefix}--tag--disabled`]: disabled });
|
|
45
47
|
function onClick(event) {
|
|
46
48
|
event.stopPropagation();
|
|
@@ -48,7 +50,7 @@ function ListBoxSelection({ clearSelection, selectionCount, translateWithId: t =
|
|
|
48
50
|
clearSelection(event);
|
|
49
51
|
if (onClearSelection) onClearSelection(event);
|
|
50
52
|
}
|
|
51
|
-
if (
|
|
53
|
+
if (hasSelectionCount) return /* @__PURE__ */ jsxs("div", {
|
|
52
54
|
className: tagClasses,
|
|
53
55
|
children: [/* @__PURE__ */ jsx("span", {
|
|
54
56
|
className: `${prefix}--tag__label`,
|
|
@@ -80,14 +82,47 @@ function ListBoxSelection({ clearSelection, selectionCount, translateWithId: t =
|
|
|
80
82
|
});
|
|
81
83
|
}
|
|
82
84
|
ListBoxSelection.propTypes = {
|
|
85
|
+
/**
|
|
86
|
+
* Specify a function to be invoked when a user interacts with the clear
|
|
87
|
+
* selection element.
|
|
88
|
+
*/
|
|
83
89
|
clearSelection: PropTypes.func.isRequired,
|
|
90
|
+
/**
|
|
91
|
+
* Specify whether or not the clear selection element should be disabled
|
|
92
|
+
*/
|
|
84
93
|
disabled: PropTypes.bool,
|
|
94
|
+
/**
|
|
95
|
+
* Whether or not the listbox is readonly
|
|
96
|
+
*/
|
|
85
97
|
readOnly: PropTypes.bool,
|
|
98
|
+
/**
|
|
99
|
+
* Specify an optional `onClearSelection` handler that is called when the underlying
|
|
100
|
+
* element is cleared
|
|
101
|
+
*/
|
|
86
102
|
onClearSelection: PropTypes.func,
|
|
103
|
+
/**
|
|
104
|
+
* Specify an optional `onClick` handler that is called when the underlying
|
|
105
|
+
* clear selection element is clicked
|
|
106
|
+
*/
|
|
87
107
|
onClick: PropTypes.func,
|
|
108
|
+
/**
|
|
109
|
+
* Specify an optional `onClick` handler that is called when the underlying
|
|
110
|
+
* clear selection element is clicked
|
|
111
|
+
*/
|
|
88
112
|
onMouseUp: PropTypes.func,
|
|
113
|
+
/**
|
|
114
|
+
* Specify an optional `onKeyDown` handler that is called when the underlying
|
|
115
|
+
* clear selection element fires a keydown event
|
|
116
|
+
*/
|
|
89
117
|
onKeyDown: PropTypes.func,
|
|
118
|
+
/**
|
|
119
|
+
* Specify an optional `selectionCount` value that will be used to determine
|
|
120
|
+
* whether the selection should display a badge or a single clear icon.
|
|
121
|
+
*/
|
|
90
122
|
selectionCount: PropTypes.number,
|
|
123
|
+
/**
|
|
124
|
+
* Translates component strings using your i18n tool.
|
|
125
|
+
*/
|
|
91
126
|
translateWithId: PropTypes.func
|
|
92
127
|
};
|
|
93
128
|
//#endregion
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../../internal/usePrefix.js";
|
|
9
|
-
import React from "react";
|
|
10
9
|
import classNames from "classnames";
|
|
10
|
+
import React from "react";
|
|
11
11
|
import PropTypes from "prop-types";
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
|
13
13
|
import { ChevronDown } from "@carbon/icons-react";
|
|
@@ -52,7 +52,14 @@ const ListBoxTrigger = React.forwardRef(({ isOpen, translateWithId: t = defaultT
|
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
54
|
ListBoxTrigger.propTypes = {
|
|
55
|
+
/**
|
|
56
|
+
* Specify whether the menu is currently open, which will influence the
|
|
57
|
+
* direction of the menu icon
|
|
58
|
+
*/
|
|
55
59
|
isOpen: PropTypes.bool.isRequired,
|
|
60
|
+
/**
|
|
61
|
+
* Translates component strings using your i18n tool.
|
|
62
|
+
*/
|
|
56
63
|
translateWithId: PropTypes.func
|
|
57
64
|
};
|
|
58
65
|
//#endregion
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
9
|
import { Text } from "../Text/Text.js";
|
|
10
|
-
import "react";
|
|
11
10
|
import classNames from "classnames";
|
|
11
|
+
import "react";
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/ListItem/ListItem.tsx
|
|
@@ -27,7 +27,13 @@ function ListItem({ className, children, ...other }) {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
ListItem.propTypes = {
|
|
30
|
+
/**
|
|
31
|
+
* Specify the content for the ListItem
|
|
32
|
+
*/
|
|
30
33
|
children: PropTypes.node,
|
|
34
|
+
/**
|
|
35
|
+
* Specify an optional className to apply to the underlying `<li>` node
|
|
36
|
+
*/
|
|
31
37
|
className: PropTypes.string
|
|
32
38
|
};
|
|
33
39
|
//#endregion
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
9
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
10
|
-
import "react";
|
|
11
10
|
import classNames from "classnames";
|
|
11
|
+
import "react";
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/Loading/Loading.tsx
|
|
@@ -62,11 +62,29 @@ function Loading({ active = true, className: customClassName, withOverlay = true
|
|
|
62
62
|
}) : loading;
|
|
63
63
|
}
|
|
64
64
|
Loading.propTypes = {
|
|
65
|
+
/**
|
|
66
|
+
* Specify whether you want the loading indicator to be spinning or not
|
|
67
|
+
*/
|
|
65
68
|
active: PropTypes.bool,
|
|
69
|
+
/**
|
|
70
|
+
* Provide an optional className to be applied to the containing node
|
|
71
|
+
*/
|
|
66
72
|
className: PropTypes.string,
|
|
73
|
+
/**
|
|
74
|
+
* Specify a description that would be used to best describe the loading state
|
|
75
|
+
*/
|
|
67
76
|
description: PropTypes.string,
|
|
77
|
+
/**
|
|
78
|
+
* Provide an `id` to uniquely identify the label
|
|
79
|
+
*/
|
|
68
80
|
id: deprecate(PropTypes.string, `\nThe prop \`id\` is no longer needed.`),
|
|
81
|
+
/**
|
|
82
|
+
* Specify whether you would like the small variant of <Loading>
|
|
83
|
+
*/
|
|
69
84
|
small: PropTypes.bool,
|
|
85
|
+
/**
|
|
86
|
+
* Specify whether you want the loader to be applied with an overlay
|
|
87
|
+
*/
|
|
70
88
|
withOverlay: PropTypes.bool
|
|
71
89
|
};
|
|
72
90
|
//#endregion
|
|
@@ -13,8 +13,8 @@ import { useMergedRefs } from "../../internal/useMergedRefs.js";
|
|
|
13
13
|
import { MenuContext, menuReducer } from "./MenuContext.js";
|
|
14
14
|
import { useLayoutDirection } from "../LayoutDirection/useLayoutDirection.js";
|
|
15
15
|
import { canUseDOM } from "../../internal/environment.js";
|
|
16
|
-
import { forwardRef, useContext, useEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
17
16
|
import classNames from "classnames";
|
|
17
|
+
import { forwardRef, useContext, useEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
19
|
import { jsx } from "react/jsx-runtime";
|
|
20
20
|
import { createPortal } from "react-dom";
|
|
@@ -212,25 +212,77 @@ const Menu = forwardRef(function Menu({ backgroundToken = "layer", border = fals
|
|
|
212
212
|
return isRoot ? open && createPortal(rendered, target) || null : rendered;
|
|
213
213
|
});
|
|
214
214
|
Menu.propTypes = {
|
|
215
|
+
/**
|
|
216
|
+
* Specify the background token to use. Default is 'layer'.
|
|
217
|
+
*/
|
|
215
218
|
backgroundToken: PropTypes.oneOf(["layer", "background"]),
|
|
219
|
+
/**
|
|
220
|
+
* Specify whether a border should be rendered on the menu
|
|
221
|
+
*/
|
|
216
222
|
border: PropTypes.bool,
|
|
223
|
+
/**
|
|
224
|
+
* A collection of MenuItems to be rendered within this Menu.
|
|
225
|
+
*/
|
|
217
226
|
children: PropTypes.node,
|
|
227
|
+
/**
|
|
228
|
+
* Additional CSS class names.
|
|
229
|
+
*/
|
|
218
230
|
className: PropTypes.string,
|
|
231
|
+
/**
|
|
232
|
+
* A label describing the Menu.
|
|
233
|
+
*/
|
|
219
234
|
label: PropTypes.string,
|
|
235
|
+
/**
|
|
236
|
+
* Specify how the menu should align with the button element
|
|
237
|
+
*/
|
|
220
238
|
menuAlignment: PropTypes.string,
|
|
239
|
+
/**
|
|
240
|
+
* **Deprecated**: Menus now always support both icons as well as selectable items and nesting.
|
|
241
|
+
* The mode of this menu. Defaults to full.
|
|
242
|
+
* `full` supports nesting and selectable menu items, but no icons.
|
|
243
|
+
* `basic` supports icons but no nesting or selectable menu items.
|
|
244
|
+
*
|
|
245
|
+
* **This prop is not intended for use and will be set by the respective implementation (like useContextMenu, MenuButton, and ComboButton).**
|
|
246
|
+
*/
|
|
221
247
|
mode: deprecate(PropTypes.oneOf(["full", "basic"]), "Menus now always support both icons as well as selectable items and nesting."),
|
|
248
|
+
/**
|
|
249
|
+
* Provide an optional function to be called when the Menu should be closed,
|
|
250
|
+
* including if the Menu is blurred, the user presses escape, or the Menu is
|
|
251
|
+
* a submenu and the user presses ArrowLeft.
|
|
252
|
+
*/
|
|
222
253
|
onClose: PropTypes.func,
|
|
254
|
+
/**
|
|
255
|
+
* Provide an optional function to be called when the Menu is opened.
|
|
256
|
+
*/
|
|
223
257
|
onOpen: PropTypes.func,
|
|
258
|
+
/**
|
|
259
|
+
* Whether the Menu is open or not.
|
|
260
|
+
*/
|
|
224
261
|
open: PropTypes.bool,
|
|
262
|
+
/**
|
|
263
|
+
* Specify the size of the Menu.
|
|
264
|
+
*/
|
|
225
265
|
size: PropTypes.oneOf([
|
|
226
266
|
"xs",
|
|
227
267
|
"sm",
|
|
228
268
|
"md",
|
|
229
269
|
"lg"
|
|
230
270
|
]),
|
|
271
|
+
/**
|
|
272
|
+
* Specify a DOM node where the Menu should be rendered in. Defaults to document.body.
|
|
273
|
+
*/
|
|
231
274
|
target: PropTypes.object,
|
|
275
|
+
/**
|
|
276
|
+
* 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])
|
|
277
|
+
*/
|
|
232
278
|
x: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)]),
|
|
279
|
+
/**
|
|
280
|
+
* 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])
|
|
281
|
+
*/
|
|
233
282
|
y: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)]),
|
|
283
|
+
/**
|
|
284
|
+
* @deprecated Internal compatibility flag. Use `false` to enable auto-alignment behavior.
|
|
285
|
+
*/
|
|
234
286
|
legacyAutoalign: PropTypes.bool
|
|
235
287
|
};
|
|
236
288
|
//#endregion
|