@carbon/react 1.29.1 → 1.30.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/es/_virtual/_rollupPluginBabelHelpers.js +16 -5
- package/es/components/Accordion/Accordion.Skeleton.js +0 -7
- package/es/components/Accordion/Accordion.js +1 -8
- package/es/components/Accordion/AccordionItem.js +5 -19
- package/es/components/AspectRatio/AspectRatio.js +0 -5
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/es/components/Breadcrumb/Breadcrumb.js +0 -3
- package/es/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/es/components/Button/Button.Skeleton.js +2 -7
- package/es/components/Button/Button.js +2 -36
- package/es/components/ButtonSet/ButtonSet.js +0 -2
- package/es/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/es/components/Checkbox/Checkbox.js +4 -20
- package/es/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/es/components/ClassPrefix/index.d.ts +26 -0
- package/es/components/ClassPrefix/index.js +0 -2
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/es/components/CodeSnippet/CodeSnippet.js +6 -45
- package/es/components/ComboBox/ComboBox.js +12 -79
- package/es/components/ComboBox/tools/filter.js +0 -1
- package/es/components/ComboButton/index.js +0 -14
- package/es/components/ComposedModal/ComposedModal.js +2 -32
- package/es/components/ComposedModal/ModalFooter.js +0 -21
- package/es/components/ComposedModal/ModalHeader.js +0 -12
- package/es/components/ContainedList/ContainedList.js +5 -32
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/es/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/es/components/ContextMenu/useContextMenu.js +1 -6
- package/es/components/Copy/Copy.js +8 -31
- package/es/components/CopyButton/CopyButton.js +0 -4
- package/es/components/DangerButton/DangerButton.js +0 -1
- package/es/components/DataTable/DataTable.js +171 -91
- package/es/components/DataTable/Table.js +0 -6
- package/es/components/DataTable/TableBatchAction.js +0 -4
- package/es/components/DataTable/TableBatchActions.js +0 -8
- package/es/components/DataTable/TableBody.js +0 -1
- package/es/components/DataTable/TableContainer.js +0 -5
- package/es/components/DataTable/TableExpandHeader.js +0 -7
- package/es/components/DataTable/TableExpandRow.js +0 -6
- package/es/components/DataTable/TableExpandedRow.js +0 -6
- package/es/components/DataTable/TableHeader.d.ts +1 -1
- package/es/components/DataTable/TableHeader.js +3 -19
- package/es/components/DataTable/TableRow.js +4 -5
- package/es/components/DataTable/TableSelectAll.js +0 -8
- package/es/components/DataTable/TableSelectRow.js +2 -10
- package/es/components/DataTable/TableToolbar.js +0 -3
- package/es/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +3 -6
- package/es/components/DataTable/TableToolbarSearch.js +2 -30
- package/es/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/es/components/DataTable/state/sorting.js +5 -8
- package/es/components/DataTable/tools/denormalize.js +2 -2
- package/es/components/DataTable/tools/filter.js +0 -2
- package/es/components/DataTable/tools/instanceId.js +0 -1
- package/es/components/DataTable/tools/normalize.js +10 -10
- package/es/components/DataTable/tools/sorting.js +5 -13
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/es/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/es/components/DatePicker/DatePicker.js +152 -174
- package/es/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/es/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/es/components/DatePickerInput/DatePickerInput.js +2 -28
- package/es/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/es/components/Dropdown/Dropdown.js +43 -52
- package/es/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/es/components/FeatureFlags/index.js +8 -20
- package/es/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/es/components/FileUploader/FileUploader.js +3 -38
- package/es/components/FileUploader/FileUploaderButton.js +3 -24
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/es/components/FileUploader/FileUploaderItem.js +1 -11
- package/es/components/FileUploader/Filename.js +0 -10
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/es/components/FluidComboBox/FluidComboBox.js +0 -18
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/es/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/es/components/FluidDropdown/FluidDropdown.js +0 -18
- package/es/components/FluidForm/FluidForm.js +0 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/es/components/FluidSelect/FluidSelect.js +0 -10
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/es/components/FluidTextArea/FluidTextArea.js +0 -20
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/es/components/FluidTextInput/FluidTextInput.js +0 -14
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/es/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/es/components/Form/Form.d.ts +23 -0
- package/es/components/Form/Form.js +3 -6
- package/es/components/Form/index.d.ts +7 -0
- package/es/components/FormGroup/FormGroup.js +0 -7
- package/es/components/FormItem/FormItem.js +0 -2
- package/es/components/FormLabel/FormLabel.js +1 -7
- package/es/components/Grid/CSSGrid.js +2 -15
- package/es/components/Grid/Column.js +18 -59
- package/es/components/Grid/ColumnHang.js +2 -5
- package/es/components/Grid/FlexGrid.js +2 -8
- package/es/components/Grid/Grid.js +0 -8
- package/es/components/Grid/GridContext.js +1 -3
- package/es/components/Grid/Row.js +2 -7
- package/es/components/Heading/index.js +0 -4
- package/es/components/Icon/Icon.Skeleton.js +2 -2
- package/es/components/IconButton/index.js +0 -10
- package/es/components/IdPrefix/index.js +0 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/es/components/InlineLoading/InlineLoading.js +0 -12
- package/es/components/Layer/index.js +3 -6
- package/es/components/Layout/LayoutDirection.js +0 -3
- package/es/components/Layout/useLayoutDirection.js +0 -1
- package/es/components/Link/Link.js +3 -10
- package/es/components/ListBox/ListBox.js +2 -13
- package/es/components/ListBox/ListBoxField.js +0 -5
- package/es/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/es/components/ListBox/ListBoxMenuItem.js +2 -6
- package/es/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/es/components/ListBox/ListBoxSelection.js +1 -13
- package/es/components/ListBox/next/ListBoxSelection.js +1 -14
- package/es/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/es/components/ListItem/ListItem.d.ts +23 -0
- package/es/components/ListItem/ListItem.js +4 -8
- package/es/components/ListItem/index.d.ts +7 -0
- package/es/components/Loading/Loading.js +0 -6
- package/es/components/Menu/Menu.js +22 -40
- package/es/components/Menu/MenuContext.js +4 -5
- package/es/components/Menu/MenuItem.js +5 -39
- package/es/components/MenuButton/index.js +0 -9
- package/es/components/Modal/Modal.js +0 -43
- package/es/components/ModalWrapper/ModalWrapper.js +2 -15
- package/es/components/MultiSelect/FilterableMultiSelect.js +2 -60
- package/es/components/MultiSelect/MultiSelect.js +22 -70
- package/es/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/es/components/MultiSelect/index.js +0 -1
- package/es/components/MultiSelect/tools/itemToString.js +0 -2
- package/es/components/MultiSelect/tools/sorting.js +3 -4
- package/es/components/Notification/Notification.js +0 -78
- package/es/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/es/components/NumberInput/NumberInput.js +3 -60
- package/es/components/OrderedList/OrderedList.d.ts +39 -0
- package/es/components/OrderedList/OrderedList.js +7 -19
- package/es/components/{Form/index.js → OrderedList/index.d.ts} +1 -3
- package/es/components/OverflowMenu/OverflowMenu.js +65 -86
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/es/components/OverflowMenuV2/index.js +0 -5
- package/es/components/Pagination/Pagination.Skeleton.js +0 -2
- package/es/components/Pagination/Pagination.js +11 -47
- package/es/components/Pagination/experimental/PageSelector.js +0 -10
- package/es/components/Pagination/experimental/Pagination.js +2 -48
- package/es/components/PaginationNav/PaginationNav.js +15 -59
- package/es/components/Popover/index.d.ts +14 -8
- package/es/components/Popover/index.js +44 -48
- package/es/components/PrimaryButton/PrimaryButton.js +0 -1
- package/es/components/ProgressBar/ProgressBar.js +0 -15
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/es/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/es/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/es/components/RadioButton/RadioButton.js +0 -13
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/es/components/RadioTile/RadioTile.js +0 -12
- package/es/components/Search/Search.Skeleton.js +0 -2
- package/es/components/Search/Search.js +1 -28
- package/es/components/SecondaryButton/SecondaryButton.js +0 -1
- package/es/components/Select/Select.Skeleton.js +0 -2
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/Select/Select.js +6 -33
- package/es/components/SelectItem/SelectItem.js +0 -5
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/es/components/SelectItemGroup/SelectItemGroup.js +1 -7
- package/es/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/es/components/SkeletonText/SkeletonText.js +0 -12
- package/es/components/Slider/Slider.Skeleton.js +0 -2
- package/es/components/Slider/Slider.d.ts +0 -1
- package/es/components/Slider/Slider.js +112 -135
- package/es/components/Stack/Stack.js +1 -8
- package/es/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/es/components/StructuredList/StructuredList.js +1 -25
- package/es/components/Switch/IconSwitch.js +0 -18
- package/es/components/Switch/Switch.js +0 -11
- package/es/components/TabContent/TabContent.js +2 -6
- package/es/components/Tabs/Tabs.Skeleton.js +0 -4
- package/es/components/Tabs/Tabs.js +135 -104
- package/es/components/Tabs/usePressable.js +18 -31
- package/es/components/Tag/Tag.Skeleton.js +0 -2
- package/es/components/Tag/Tag.js +0 -15
- package/es/components/Text/Text.js +5 -18
- package/es/components/Text/TextDirection.js +0 -3
- package/es/components/Text/TextDirectionContext.js +0 -1
- package/es/components/Text/createTextComponent.js +0 -3
- package/es/components/TextArea/TextArea.Skeleton.js +0 -2
- package/es/components/TextArea/TextArea.js +11 -33
- package/es/components/TextInput/ControlledPasswordInput.js +0 -20
- package/es/components/TextInput/PasswordInput.js +0 -25
- package/es/components/TextInput/TextInput.Skeleton.js +0 -2
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +5 -33
- package/es/components/TextInput/util.js +3 -5
- package/es/components/Theme/index.js +1 -6
- package/es/components/Tile/Tile.js +32 -59
- package/es/components/TileGroup/TileGroup.js +1 -22
- package/es/components/TimePicker/TimePicker.js +6 -32
- package/es/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/es/components/Toggle/Toggle.Skeleton.js +0 -8
- package/es/components/Toggle/Toggle.js +0 -16
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/es/components/Toggletip/index.d.ts +148 -0
- package/es/components/Toggletip/index.js +20 -44
- package/es/components/Tooltip/DefinitionTooltip.js +0 -11
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/Tooltip/Tooltip.js +4 -21
- package/es/components/TreeView/TreeNode.js +21 -66
- package/es/components/TreeView/TreeView.js +11 -67
- package/es/components/UIShell/Content.js +2 -4
- package/es/components/UIShell/Header.js +0 -2
- package/es/components/UIShell/HeaderContainer.d.ts +33 -0
- package/es/components/UIShell/HeaderContainer.js +13 -11
- package/es/components/UIShell/HeaderGlobalAction.js +0 -6
- package/es/components/UIShell/HeaderGlobalBar.js +0 -1
- package/es/components/UIShell/HeaderMenu.js +32 -31
- package/es/components/UIShell/HeaderMenuButton.js +2 -4
- package/es/components/UIShell/HeaderMenuItem.js +0 -8
- package/es/components/UIShell/HeaderName.js +0 -5
- package/es/components/UIShell/HeaderNavigation.js +0 -2
- package/es/components/UIShell/HeaderPanel.js +0 -2
- package/es/components/UIShell/HeaderSideNavItems.js +0 -2
- package/es/components/UIShell/Link.js +2 -3
- package/es/components/UIShell/SideNav.d.ts +3 -1
- package/es/components/UIShell/SideNav.js +44 -36
- package/es/components/UIShell/SideNavDetails.js +0 -3
- package/es/components/UIShell/SideNavDivider.js +0 -1
- package/es/components/UIShell/SideNavFooter.js +1 -4
- package/es/components/UIShell/SideNavHeader.js +0 -4
- package/es/components/UIShell/SideNavIcon.js +0 -3
- package/es/components/UIShell/SideNavItem.js +0 -3
- package/es/components/UIShell/SideNavItems.js +2 -6
- package/es/components/UIShell/SideNavLink.js +3 -7
- package/es/components/UIShell/SideNavLinkText.js +0 -2
- package/es/components/UIShell/SideNavMenu.js +0 -16
- package/es/components/UIShell/SideNavMenuItem.js +0 -2
- package/es/components/UIShell/SideNavSwitcher.js +2 -5
- package/es/components/UIShell/SkipToContent.d.ts +32 -0
- package/es/components/UIShell/SkipToContent.js +8 -15
- package/es/components/UIShell/Switcher.js +0 -2
- package/es/components/UIShell/SwitcherDivider.js +0 -1
- package/es/components/UIShell/SwitcherItem.js +0 -3
- package/es/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/es/components/UnorderedList/UnorderedList.js +6 -16
- package/es/components/UnorderedList/index.d.ts +7 -0
- package/es/index.js +7 -8
- package/es/internal/ClickListener.js +3 -13
- package/es/internal/FloatingMenu.js +57 -63
- package/es/internal/OptimizedResize.js +6 -12
- package/es/internal/Selection.js +2 -25
- package/es/internal/createClassWrapper.js +0 -2
- package/es/internal/deprecateFieldOnObject.js +0 -4
- package/es/internal/focus/index.js +0 -1
- package/es/internal/keyboard/keys.js +2 -1
- package/es/internal/keyboard/match.js +1 -6
- package/es/internal/keyboard/navigation.js +8 -7
- package/es/internal/useAnnouncer.js +0 -1
- package/es/internal/useAttachedMenu.js +1 -9
- package/es/internal/useControllableState.js +6 -13
- package/es/internal/useDelayedState.js +2 -4
- package/es/internal/useEffectOnce.js +0 -1
- package/es/internal/useEvent.js +61 -3
- package/es/internal/useId.js +2 -5
- package/es/internal/useIsomorphicEffect.js +1 -0
- package/es/internal/useMergedRefs.js +2 -2
- package/es/internal/useNoInteractiveChildren.js +2 -13
- package/es/internal/useNormalizedInputProps.js +0 -3
- package/es/internal/useSavedCallback.js +0 -1
- package/es/internal/warning.js +0 -3
- package/es/internal/wrapFocus.js +1 -8
- package/es/prop-types/deprecate.js +2 -5
- package/es/prop-types/isRequiredOneOf.js +2 -5
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/es/tools/array.js +0 -3
- package/es/tools/events.js +0 -3
- package/es/tools/mergeRefs.js +0 -2
- package/es/tools/wrapComponent.js +2 -5
- package/lib/_virtual/_rollupPluginBabelHelpers.js +17 -4
- package/lib/components/Accordion/Accordion.Skeleton.js +0 -7
- package/lib/components/Accordion/Accordion.js +1 -27
- package/lib/components/Accordion/AccordionItem.js +5 -19
- package/lib/components/AspectRatio/AspectRatio.js +0 -5
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/lib/components/Breadcrumb/Breadcrumb.js +0 -3
- package/lib/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/lib/components/Button/Button.Skeleton.js +2 -26
- package/lib/components/Button/Button.js +2 -36
- package/lib/components/ButtonSet/ButtonSet.js +0 -2
- package/lib/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/lib/components/Checkbox/Checkbox.js +4 -20
- package/lib/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/lib/components/ClassPrefix/index.d.ts +26 -0
- package/lib/components/ClassPrefix/index.js +0 -2
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/lib/components/CodeSnippet/CodeSnippet.js +6 -45
- package/lib/components/ComboBox/ComboBox.js +19 -86
- package/lib/components/ComboBox/tools/filter.js +0 -1
- package/lib/components/ComboButton/index.js +0 -14
- package/lib/components/ComposedModal/ComposedModal.js +2 -32
- package/lib/components/ComposedModal/ModalFooter.js +0 -21
- package/lib/components/ComposedModal/ModalHeader.js +0 -12
- package/lib/components/ContainedList/ContainedList.js +5 -32
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/lib/components/ContextMenu/useContextMenu.js +1 -6
- package/lib/components/Copy/Copy.js +8 -50
- package/lib/components/CopyButton/CopyButton.js +0 -4
- package/lib/components/DangerButton/DangerButton.js +0 -1
- package/lib/components/DataTable/DataTable.js +171 -91
- package/lib/components/DataTable/Table.js +0 -6
- package/lib/components/DataTable/TableBatchAction.js +0 -4
- package/lib/components/DataTable/TableBatchActions.js +0 -8
- package/lib/components/DataTable/TableBody.js +0 -1
- package/lib/components/DataTable/TableContainer.js +0 -5
- package/lib/components/DataTable/TableExpandHeader.js +0 -7
- package/lib/components/DataTable/TableExpandRow.js +0 -6
- package/lib/components/DataTable/TableExpandedRow.js +0 -6
- package/lib/components/DataTable/TableHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.js +3 -19
- package/lib/components/DataTable/TableRow.js +4 -5
- package/lib/components/DataTable/TableSelectAll.js +0 -8
- package/lib/components/DataTable/TableSelectRow.js +2 -10
- package/lib/components/DataTable/TableToolbar.js +0 -3
- package/lib/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarMenu.js +3 -6
- package/lib/components/DataTable/TableToolbarSearch.js +2 -30
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/lib/components/DataTable/state/sorting.js +5 -8
- package/lib/components/DataTable/tools/denormalize.js +2 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/instanceId.js +0 -1
- package/lib/components/DataTable/tools/normalize.js +10 -10
- package/lib/components/DataTable/tools/sorting.js +5 -13
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/lib/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/lib/components/DatePicker/DatePicker.js +152 -174
- package/lib/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/lib/components/DatePickerInput/DatePickerInput.js +2 -28
- package/lib/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/lib/components/Dropdown/Dropdown.js +50 -59
- package/lib/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/lib/components/FeatureFlags/index.js +8 -20
- package/lib/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/lib/components/FileUploader/FileUploader.js +3 -57
- package/lib/components/FileUploader/FileUploaderButton.js +3 -43
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/lib/components/FileUploader/FileUploaderItem.js +1 -30
- package/lib/components/FileUploader/Filename.js +0 -10
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/lib/components/FluidComboBox/FluidComboBox.js +0 -18
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/lib/components/FluidDropdown/FluidDropdown.js +0 -18
- package/lib/components/FluidForm/FluidForm.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/lib/components/FluidSelect/FluidSelect.js +0 -10
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/lib/components/FluidTextArea/FluidTextArea.js +0 -20
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/lib/components/FluidTextInput/FluidTextInput.js +0 -14
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/lib/components/Form/Form.d.ts +23 -0
- package/lib/components/Form/Form.js +3 -6
- package/lib/components/Form/index.d.ts +7 -0
- package/lib/components/FormGroup/FormGroup.js +0 -7
- package/lib/components/FormItem/FormItem.js +0 -2
- package/lib/components/FormLabel/FormLabel.js +1 -26
- package/lib/components/Grid/CSSGrid.js +2 -15
- package/lib/components/Grid/Column.js +18 -59
- package/lib/components/Grid/ColumnHang.js +2 -5
- package/lib/components/Grid/FlexGrid.js +2 -8
- package/lib/components/Grid/Grid.js +0 -8
- package/lib/components/Grid/GridContext.js +1 -3
- package/lib/components/Grid/Row.js +2 -7
- package/lib/components/Heading/index.js +0 -4
- package/lib/components/Icon/Icon.Skeleton.js +2 -2
- package/lib/components/IconButton/index.js +0 -10
- package/lib/components/IdPrefix/index.js +0 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/lib/components/InlineLoading/InlineLoading.js +0 -12
- package/lib/components/Layer/index.js +3 -6
- package/lib/components/Layout/LayoutDirection.js +0 -3
- package/lib/components/Layout/useLayoutDirection.js +0 -1
- package/lib/components/Link/Link.js +3 -10
- package/lib/components/ListBox/ListBox.js +2 -13
- package/lib/components/ListBox/ListBoxField.js +0 -5
- package/lib/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/lib/components/ListBox/ListBoxMenuItem.js +2 -6
- package/lib/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/lib/components/ListBox/ListBoxSelection.js +1 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +1 -14
- package/lib/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/lib/components/ListItem/ListItem.d.ts +23 -0
- package/lib/components/ListItem/ListItem.js +4 -8
- package/lib/components/ListItem/index.d.ts +7 -0
- package/lib/components/Loading/Loading.js +0 -6
- package/lib/components/Menu/Menu.js +22 -40
- package/lib/components/Menu/MenuContext.js +4 -5
- package/lib/components/Menu/MenuItem.js +5 -39
- package/lib/components/MenuButton/index.js +0 -9
- package/lib/components/Modal/Modal.js +0 -43
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -15
- package/lib/components/MultiSelect/FilterableMultiSelect.js +8 -66
- package/lib/components/MultiSelect/MultiSelect.js +30 -78
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/lib/components/MultiSelect/index.js +0 -1
- package/lib/components/MultiSelect/tools/itemToString.js +0 -2
- package/lib/components/MultiSelect/tools/sorting.js +3 -4
- package/lib/components/Notification/Notification.js +0 -78
- package/lib/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/lib/components/NumberInput/NumberInput.js +3 -60
- package/lib/components/OrderedList/OrderedList.d.ts +39 -0
- package/lib/components/OrderedList/OrderedList.js +7 -19
- package/lib/components/OrderedList/index.d.ts +7 -0
- package/lib/components/OverflowMenu/OverflowMenu.js +65 -86
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/lib/components/OverflowMenuV2/index.js +0 -5
- package/lib/components/Pagination/Pagination.Skeleton.js +0 -2
- package/lib/components/Pagination/Pagination.js +11 -47
- package/lib/components/Pagination/experimental/PageSelector.js +0 -10
- package/lib/components/Pagination/experimental/Pagination.js +2 -67
- package/lib/components/PaginationNav/PaginationNav.js +15 -78
- package/lib/components/Popover/index.d.ts +14 -8
- package/lib/components/Popover/index.js +44 -48
- package/lib/components/PrimaryButton/PrimaryButton.js +0 -1
- package/lib/components/ProgressBar/ProgressBar.js +0 -15
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/lib/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/lib/components/RadioButton/RadioButton.js +0 -13
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/lib/components/RadioTile/RadioTile.js +0 -12
- package/lib/components/Search/Search.Skeleton.js +0 -2
- package/lib/components/Search/Search.js +1 -28
- package/lib/components/SecondaryButton/SecondaryButton.js +0 -1
- package/lib/components/Select/Select.Skeleton.js +0 -2
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.js +6 -33
- package/lib/components/SelectItem/SelectItem.js +0 -5
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -26
- package/lib/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/lib/components/SkeletonText/SkeletonText.js +0 -12
- package/lib/components/Slider/Slider.Skeleton.js +0 -2
- package/lib/components/Slider/Slider.d.ts +0 -1
- package/lib/components/Slider/Slider.js +112 -154
- package/lib/components/Stack/Stack.js +1 -8
- package/lib/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/lib/components/StructuredList/StructuredList.js +1 -25
- package/lib/components/Switch/IconSwitch.js +0 -18
- package/lib/components/Switch/Switch.js +0 -11
- package/lib/components/TabContent/TabContent.js +2 -6
- package/lib/components/Tabs/Tabs.Skeleton.js +0 -4
- package/lib/components/Tabs/Tabs.js +133 -102
- package/lib/components/Tabs/usePressable.js +18 -31
- package/lib/components/Tag/Tag.Skeleton.js +0 -2
- package/lib/components/Tag/Tag.js +0 -15
- package/lib/components/Text/Text.js +5 -18
- package/lib/components/Text/TextDirection.js +0 -3
- package/lib/components/Text/TextDirectionContext.js +0 -1
- package/lib/components/Text/createTextComponent.js +0 -3
- package/lib/components/TextArea/TextArea.Skeleton.js +0 -2
- package/lib/components/TextArea/TextArea.js +10 -32
- package/lib/components/TextInput/ControlledPasswordInput.js +0 -20
- package/lib/components/TextInput/PasswordInput.js +0 -25
- package/lib/components/TextInput/TextInput.Skeleton.js +0 -2
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +5 -52
- package/lib/components/TextInput/util.js +3 -5
- package/lib/components/Theme/index.js +1 -6
- package/lib/components/Tile/Tile.js +31 -58
- package/lib/components/TileGroup/TileGroup.js +1 -22
- package/lib/components/TimePicker/TimePicker.js +6 -32
- package/lib/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/lib/components/Toggle/Toggle.Skeleton.js +0 -8
- package/lib/components/Toggle/Toggle.js +0 -16
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/lib/components/Toggletip/index.d.ts +148 -0
- package/lib/components/Toggletip/index.js +20 -44
- package/lib/components/Tooltip/DefinitionTooltip.js +0 -11
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.js +4 -21
- package/lib/components/TreeView/TreeNode.js +21 -66
- package/lib/components/TreeView/TreeView.js +11 -67
- package/lib/components/UIShell/Content.js +2 -4
- package/lib/components/UIShell/Header.js +0 -2
- package/lib/components/UIShell/HeaderContainer.d.ts +33 -0
- package/lib/components/UIShell/HeaderContainer.js +13 -11
- package/lib/components/UIShell/HeaderGlobalAction.js +0 -6
- package/lib/components/UIShell/HeaderGlobalBar.js +0 -1
- package/lib/components/UIShell/HeaderMenu.js +32 -31
- package/lib/components/UIShell/HeaderMenuButton.js +2 -4
- package/lib/components/UIShell/HeaderMenuItem.js +0 -8
- package/lib/components/UIShell/HeaderName.js +0 -5
- package/lib/components/UIShell/HeaderNavigation.js +0 -2
- package/lib/components/UIShell/HeaderPanel.js +0 -2
- package/lib/components/UIShell/HeaderSideNavItems.js +0 -2
- package/lib/components/UIShell/Link.js +2 -3
- package/lib/components/UIShell/SideNav.d.ts +3 -1
- package/lib/components/UIShell/SideNav.js +43 -35
- package/lib/components/UIShell/SideNavDetails.js +0 -3
- package/lib/components/UIShell/SideNavDivider.js +0 -1
- package/lib/components/UIShell/SideNavFooter.js +1 -4
- package/lib/components/UIShell/SideNavHeader.js +0 -4
- package/lib/components/UIShell/SideNavIcon.js +0 -3
- package/lib/components/UIShell/SideNavItem.js +0 -3
- package/lib/components/UIShell/SideNavItems.js +2 -6
- package/lib/components/UIShell/SideNavLink.js +3 -7
- package/lib/components/UIShell/SideNavLinkText.js +0 -2
- package/lib/components/UIShell/SideNavMenu.js +0 -16
- package/lib/components/UIShell/SideNavMenuItem.js +0 -2
- package/lib/components/UIShell/SideNavSwitcher.js +2 -5
- package/lib/components/UIShell/SkipToContent.d.ts +32 -0
- package/lib/components/UIShell/SkipToContent.js +8 -15
- package/lib/components/UIShell/Switcher.js +0 -2
- package/lib/components/UIShell/SwitcherDivider.js +0 -1
- package/lib/components/UIShell/SwitcherItem.js +0 -3
- package/lib/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/lib/components/UnorderedList/UnorderedList.js +6 -16
- package/lib/components/UnorderedList/index.d.ts +7 -0
- package/lib/index.js +42 -43
- package/lib/internal/ClickListener.js +3 -13
- package/lib/internal/FloatingMenu.js +57 -63
- package/lib/internal/OptimizedResize.js +6 -12
- package/lib/internal/Selection.js +2 -25
- package/lib/internal/createClassWrapper.js +0 -2
- package/lib/internal/deprecateFieldOnObject.js +0 -4
- package/lib/internal/focus/index.js +0 -1
- package/lib/internal/keyboard/keys.js +2 -1
- package/lib/internal/keyboard/match.js +1 -6
- package/lib/internal/keyboard/navigation.js +8 -7
- package/lib/internal/useAnnouncer.js +0 -1
- package/lib/internal/useAttachedMenu.js +1 -9
- package/lib/internal/useControllableState.js +6 -13
- package/lib/internal/useDelayedState.js +2 -4
- package/lib/internal/useEffectOnce.js +0 -1
- package/lib/internal/useEvent.js +61 -2
- package/lib/internal/useId.js +2 -5
- package/lib/internal/useIsomorphicEffect.js +1 -0
- package/lib/internal/useMergedRefs.js +2 -2
- package/lib/internal/useNoInteractiveChildren.js +2 -13
- package/lib/internal/useNormalizedInputProps.js +0 -3
- package/lib/internal/useSavedCallback.js +0 -1
- package/lib/internal/warning.js +0 -3
- package/lib/internal/wrapFocus.js +1 -8
- package/lib/prop-types/deprecate.js +2 -5
- package/lib/prop-types/isRequiredOneOf.js +2 -5
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/lib/tools/array.js +0 -3
- package/lib/tools/events.js +0 -3
- package/lib/tools/mergeRefs.js +0 -2
- package/lib/tools/wrapComponent.js +2 -5
- package/package.json +9 -9
- package/es/components/Tab/Tab.js +0 -185
- package/es/components/Tab/index.js +0 -14
- package/es/components/TimePickerSelect/index.js +0 -13
- package/lib/components/Form/index.js +0 -17
- package/lib/components/Tab/Tab.js +0 -214
- package/lib/components/Tab/index.js +0 -39
- package/lib/components/TimePickerSelect/index.js +0 -38
|
@@ -17,62 +17,58 @@ import mergeRefs from '../../tools/mergeRefs.js';
|
|
|
17
17
|
import { PrefixContext } from '../../internal/usePrefix.js';
|
|
18
18
|
import deprecate from '../../prop-types/deprecate.js';
|
|
19
19
|
import { IconButton } from '../IconButton/index.js';
|
|
20
|
+
import setupGetInstanceId from '../../tools/setupGetInstanceId.js';
|
|
20
21
|
import { matches } from '../../internal/keyboard/match.js';
|
|
21
22
|
import { ArrowUp, ArrowRight, ArrowDown, ArrowLeft, Escape } from '../../internal/keyboard/keys.js';
|
|
22
23
|
|
|
24
|
+
const getInstanceId = setupGetInstanceId();
|
|
23
25
|
const on = function (element) {
|
|
24
26
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
25
27
|
args[_key - 1] = arguments[_key];
|
|
26
28
|
}
|
|
27
|
-
|
|
28
29
|
element.addEventListener(...args);
|
|
29
30
|
return {
|
|
30
31
|
release() {
|
|
31
32
|
element.removeEventListener(...args);
|
|
32
33
|
return null;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
+
|
|
37
38
|
/**
|
|
38
39
|
* The CSS property names of the arrow keyed by the floating menu direction.
|
|
39
40
|
* @type {Object<string, string>}
|
|
40
41
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
42
|
const triggerButtonPositionProps = {
|
|
44
43
|
[DIRECTION_TOP]: 'bottom',
|
|
45
44
|
[DIRECTION_BOTTOM]: 'top'
|
|
46
45
|
};
|
|
46
|
+
|
|
47
47
|
/**
|
|
48
48
|
* Determines how the position of arrow should affect the floating menu position.
|
|
49
49
|
* @type {Object<string, number>}
|
|
50
50
|
*/
|
|
51
|
-
|
|
52
51
|
const triggerButtonPositionFactors = {
|
|
53
52
|
[DIRECTION_TOP]: -2,
|
|
54
53
|
[DIRECTION_BOTTOM]: -1
|
|
55
54
|
};
|
|
55
|
+
|
|
56
56
|
/**
|
|
57
57
|
* @param {Element} menuBody The menu body with the menu arrow.
|
|
58
58
|
* @param {string} direction The floating menu direction.
|
|
59
59
|
* @returns {FloatingMenu~offset} The adjustment of the floating menu position, upon the position of the menu arrow.
|
|
60
60
|
* @private
|
|
61
61
|
*/
|
|
62
|
-
|
|
63
62
|
const getMenuOffset = (menuBody, direction, trigger, flip) => {
|
|
64
63
|
const triggerButtonPositionProp = triggerButtonPositionProps[direction];
|
|
65
64
|
const triggerButtonPositionFactor = triggerButtonPositionFactors[direction];
|
|
66
|
-
|
|
67
65
|
if (process.env.NODE_ENV !== "production") {
|
|
68
66
|
!(triggerButtonPositionProp && triggerButtonPositionFactor) ? process.env.NODE_ENV !== "production" ? invariant(false, '[OverflowMenu] wrong floating menu direction: `%s`', direction) : invariant(false) : void 0;
|
|
69
67
|
}
|
|
70
|
-
|
|
71
68
|
const {
|
|
72
69
|
offsetWidth: menuWidth,
|
|
73
70
|
offsetHeight: menuHeight
|
|
74
71
|
} = menuBody;
|
|
75
|
-
|
|
76
72
|
switch (triggerButtonPositionProp) {
|
|
77
73
|
case 'top':
|
|
78
74
|
case 'bottom':
|
|
@@ -84,7 +80,6 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
|
|
|
84
80
|
top: 0
|
|
85
81
|
};
|
|
86
82
|
}
|
|
87
|
-
|
|
88
83
|
case 'left':
|
|
89
84
|
case 'right':
|
|
90
85
|
{
|
|
@@ -97,22 +92,16 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
|
|
|
97
92
|
}
|
|
98
93
|
}
|
|
99
94
|
};
|
|
100
|
-
|
|
101
95
|
class OverflowMenu extends Component {
|
|
102
96
|
constructor() {
|
|
103
97
|
super(...arguments);
|
|
104
|
-
|
|
105
98
|
_defineProperty(this, "state", {});
|
|
106
|
-
|
|
99
|
+
_defineProperty(this, "instanceId", getInstanceId());
|
|
107
100
|
_defineProperty(this, "_hFocusIn", null);
|
|
108
|
-
|
|
109
101
|
_defineProperty(this, "_hBlurTimeout", void 0);
|
|
110
|
-
|
|
111
102
|
_defineProperty(this, "_triggerRef", /*#__PURE__*/React__default.createRef());
|
|
112
|
-
|
|
113
103
|
_defineProperty(this, "handleClick", evt => {
|
|
114
104
|
evt.stopPropagation();
|
|
115
|
-
|
|
116
105
|
if (!this._menuBody || !this._menuBody.contains(evt.target)) {
|
|
117
106
|
this.setState({
|
|
118
107
|
open: !this.state.open
|
|
@@ -120,7 +109,6 @@ class OverflowMenu extends Component {
|
|
|
120
109
|
this.props.onClick(evt);
|
|
121
110
|
}
|
|
122
111
|
});
|
|
123
|
-
|
|
124
112
|
_defineProperty(this, "closeMenuAndFocus", () => {
|
|
125
113
|
let wasOpen = this.state.open;
|
|
126
114
|
this.closeMenu(() => {
|
|
@@ -129,26 +117,24 @@ class OverflowMenu extends Component {
|
|
|
129
117
|
}
|
|
130
118
|
});
|
|
131
119
|
});
|
|
132
|
-
|
|
133
120
|
_defineProperty(this, "handleKeyPress", evt => {
|
|
134
121
|
if (this.state.open && matches(evt, [ArrowUp, ArrowRight, ArrowDown, ArrowLeft])) {
|
|
135
122
|
evt.preventDefault();
|
|
136
|
-
}
|
|
137
|
-
|
|
123
|
+
}
|
|
138
124
|
|
|
125
|
+
// Close the overflow menu on escape
|
|
139
126
|
if (matches(evt, [Escape])) {
|
|
140
|
-
this.closeMenuAndFocus();
|
|
127
|
+
this.closeMenuAndFocus();
|
|
141
128
|
|
|
129
|
+
// Stop the esc keypress from bubbling out and closing something it shouldn't
|
|
142
130
|
evt.stopPropagation();
|
|
143
131
|
}
|
|
144
132
|
});
|
|
145
|
-
|
|
146
133
|
_defineProperty(this, "handleClickOutside", evt => {
|
|
147
134
|
if (this.state.open && (!this._menuBody || !this._menuBody.contains(evt.target))) {
|
|
148
135
|
this.closeMenu();
|
|
149
136
|
}
|
|
150
137
|
});
|
|
151
|
-
|
|
152
138
|
_defineProperty(this, "closeMenu", onCloseMenu => {
|
|
153
139
|
this.setState({
|
|
154
140
|
open: false
|
|
@@ -157,21 +143,17 @@ class OverflowMenu extends Component {
|
|
|
157
143
|
if (onCloseMenu) {
|
|
158
144
|
onCloseMenu();
|
|
159
145
|
}
|
|
160
|
-
|
|
161
146
|
this.props.onClose();
|
|
162
147
|
});
|
|
163
148
|
});
|
|
164
|
-
|
|
165
149
|
_defineProperty(this, "focusMenuEl", () => {
|
|
166
150
|
const {
|
|
167
151
|
current: triggerEl
|
|
168
152
|
} = this._triggerRef;
|
|
169
|
-
|
|
170
153
|
if (triggerEl) {
|
|
171
154
|
triggerEl.focus();
|
|
172
155
|
}
|
|
173
156
|
});
|
|
174
|
-
|
|
175
157
|
_defineProperty(this, "handleOverflowMenuItemFocus", _ref => {
|
|
176
158
|
let {
|
|
177
159
|
currentIndex,
|
|
@@ -181,39 +163,30 @@ class OverflowMenu extends Component {
|
|
|
181
163
|
if (!curr.props.disabled) {
|
|
182
164
|
acc.push(i);
|
|
183
165
|
}
|
|
184
|
-
|
|
185
166
|
return acc;
|
|
186
167
|
}, []);
|
|
187
|
-
|
|
188
168
|
const nextValidIndex = (() => {
|
|
189
169
|
const nextIndex = enabledIndices.indexOf(currentIndex) + direction;
|
|
190
|
-
|
|
191
170
|
switch (nextIndex) {
|
|
192
171
|
case -1:
|
|
193
172
|
return enabledIndices.length - 1;
|
|
194
|
-
|
|
195
173
|
case enabledIndices.length:
|
|
196
174
|
return 0;
|
|
197
|
-
|
|
198
175
|
default:
|
|
199
176
|
return nextIndex;
|
|
200
177
|
}
|
|
201
178
|
})();
|
|
202
|
-
|
|
203
179
|
const overflowMenuItem = this[`overflowMenuItem${enabledIndices[nextValidIndex]}`];
|
|
204
|
-
overflowMenuItem
|
|
180
|
+
overflowMenuItem?.focus();
|
|
205
181
|
});
|
|
206
|
-
|
|
207
182
|
_defineProperty(this, "_bindMenuBody", menuBody => {
|
|
208
183
|
if (!menuBody) {
|
|
209
184
|
this._menuBody = menuBody;
|
|
210
185
|
}
|
|
211
|
-
|
|
212
186
|
if (!menuBody && this._hFocusIn) {
|
|
213
187
|
this._hFocusIn = this._hFocusIn.release();
|
|
214
188
|
}
|
|
215
189
|
});
|
|
216
|
-
|
|
217
190
|
_defineProperty(this, "_handlePlace", menuBody => {
|
|
218
191
|
if (menuBody) {
|
|
219
192
|
this._menuBody = menuBody;
|
|
@@ -224,7 +197,6 @@ class OverflowMenu extends Component {
|
|
|
224
197
|
const {
|
|
225
198
|
current: triggerEl
|
|
226
199
|
} = this._triggerRef;
|
|
227
|
-
|
|
228
200
|
if (typeof target.matches === 'function') {
|
|
229
201
|
if (!menuBody.contains(target) && triggerEl && !target.matches(`.${this.context}--overflow-menu,.${this.context}--overflow-menu-options`)) {
|
|
230
202
|
this.closeMenuAndFocus();
|
|
@@ -234,7 +206,6 @@ class OverflowMenu extends Component {
|
|
|
234
206
|
this.props.onOpen();
|
|
235
207
|
}
|
|
236
208
|
});
|
|
237
|
-
|
|
238
209
|
_defineProperty(this, "_getTarget", () => {
|
|
239
210
|
const {
|
|
240
211
|
current: triggerEl
|
|
@@ -242,17 +213,27 @@ class OverflowMenu extends Component {
|
|
|
242
213
|
return triggerEl && triggerEl.closest('[data-floating-menu-container]') || document.body;
|
|
243
214
|
});
|
|
244
215
|
}
|
|
245
|
-
|
|
216
|
+
/**
|
|
217
|
+
* The handle of `onfocusin` or `focus` event handler.
|
|
218
|
+
* @private
|
|
219
|
+
*/
|
|
220
|
+
/**
|
|
221
|
+
* The timeout handle for handling `blur` event.
|
|
222
|
+
* @private
|
|
223
|
+
*/
|
|
224
|
+
/**
|
|
225
|
+
* The element ref of the tooltip's trigger button.
|
|
226
|
+
* @type {React.RefObject<Element>}
|
|
227
|
+
* @private
|
|
228
|
+
*/
|
|
246
229
|
componentDidUpdate(_, prevState) {
|
|
247
230
|
const {
|
|
248
231
|
onClose
|
|
249
232
|
} = this.props;
|
|
250
|
-
|
|
251
233
|
if (!this.state.open && prevState.open) {
|
|
252
234
|
onClose();
|
|
253
235
|
}
|
|
254
236
|
}
|
|
255
|
-
|
|
256
237
|
componentDidMount() {
|
|
257
238
|
// ensure that if open=true on first render, we wait
|
|
258
239
|
// to render the floating menu until the trigger ref is not null
|
|
@@ -262,7 +243,6 @@ class OverflowMenu extends Component {
|
|
|
262
243
|
});
|
|
263
244
|
}
|
|
264
245
|
}
|
|
265
|
-
|
|
266
246
|
static getDerivedStateFromProps(_ref2, state) {
|
|
267
247
|
let {
|
|
268
248
|
open
|
|
@@ -275,7 +255,6 @@ class OverflowMenu extends Component {
|
|
|
275
255
|
prevOpen: open
|
|
276
256
|
};
|
|
277
257
|
}
|
|
278
|
-
|
|
279
258
|
componentWillUnmount() {
|
|
280
259
|
if (typeof this._hBlurTimeout === 'number') {
|
|
281
260
|
clearTimeout(this._hBlurTimeout);
|
|
@@ -283,6 +262,33 @@ class OverflowMenu extends Component {
|
|
|
283
262
|
}
|
|
284
263
|
}
|
|
285
264
|
|
|
265
|
+
/**
|
|
266
|
+
* Focuses the next enabled overflow menu item given the currently focused
|
|
267
|
+
* item index and direction to move
|
|
268
|
+
* @param {object} params
|
|
269
|
+
* @param {number} params.currentIndex - the index of the currently focused
|
|
270
|
+
* overflow menu item in the list of overflow menu items
|
|
271
|
+
* @param {number} params.direction - number denoting the direction to move
|
|
272
|
+
* focus (1 for forwards, -1 for backwards)
|
|
273
|
+
*/
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Handles the floating menu being unmounted or non-floating menu being
|
|
277
|
+
* mounted or unmounted.
|
|
278
|
+
* @param {Element} menuBody The DOM element of the menu body.
|
|
279
|
+
* @private
|
|
280
|
+
*/
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Handles the floating menu being placed.
|
|
284
|
+
* @param {Element} menuBody The DOM element of the menu body.
|
|
285
|
+
* @private
|
|
286
|
+
*/
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @returns {Element} The DOM element where the floating menu is placed in.
|
|
290
|
+
*/
|
|
291
|
+
|
|
286
292
|
render() {
|
|
287
293
|
const prefix = this.context;
|
|
288
294
|
const {
|
|
@@ -326,24 +332,22 @@ class OverflowMenu extends Component {
|
|
|
326
332
|
[`${prefix}--overflow-menu-options--${size}`]: size
|
|
327
333
|
});
|
|
328
334
|
const overflowMenuIconClasses = cx(`${prefix}--overflow-menu__icon`, iconClass);
|
|
329
|
-
const childrenWithProps = React__default.Children.toArray(children).map((child, index) => {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
index
|
|
339
|
-
});
|
|
340
|
-
});
|
|
335
|
+
const childrenWithProps = React__default.Children.toArray(children).map((child, index) => /*#__PURE__*/React__default.cloneElement(child, {
|
|
336
|
+
closeMenu: child?.props?.closeMenu || this.closeMenuAndFocus,
|
|
337
|
+
handleOverflowMenuItemFocus: this.handleOverflowMenuItemFocus,
|
|
338
|
+
ref: e => {
|
|
339
|
+
this[`overflowMenuItem${index}`] = e;
|
|
340
|
+
},
|
|
341
|
+
index
|
|
342
|
+
}));
|
|
343
|
+
const menuBodyId = `overflow-menu-${this.instanceId}__menu-body`;
|
|
341
344
|
const menuBody = /*#__PURE__*/React__default.createElement("ul", {
|
|
342
345
|
className: overflowMenuOptionsClasses,
|
|
343
346
|
tabIndex: "-1",
|
|
344
347
|
role: "menu",
|
|
345
348
|
"aria-label": ariaLabel || deprecatedAriaLabel,
|
|
346
|
-
onKeyDown: this.handleKeyPress
|
|
349
|
+
onKeyDown: this.handleKeyPress,
|
|
350
|
+
id: menuBodyId
|
|
347
351
|
}, childrenWithProps);
|
|
348
352
|
const wrappedMenuBody = /*#__PURE__*/React__default.createElement(FloatingMenu, {
|
|
349
353
|
focusTrap: focusTrap,
|
|
@@ -365,11 +369,13 @@ class OverflowMenu extends Component {
|
|
|
365
369
|
return /*#__PURE__*/React__default.createElement(ClickListener, {
|
|
366
370
|
onClickOutside: this.handleClickOutside
|
|
367
371
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
368
|
-
className: `${prefix}--overflow-menu__wrapper
|
|
372
|
+
className: `${prefix}--overflow-menu__wrapper`,
|
|
373
|
+
"aria-owns": open ? menuBodyId : null
|
|
369
374
|
}, /*#__PURE__*/React__default.createElement(IconButton, _extends({}, other, {
|
|
370
375
|
type: "button",
|
|
371
376
|
"aria-haspopup": true,
|
|
372
377
|
"aria-expanded": this.state.open,
|
|
378
|
+
"aria-controls": open ? menuBodyId : null,
|
|
373
379
|
className: overflowMenuClasses,
|
|
374
380
|
onClick: this.handleClick,
|
|
375
381
|
id: id,
|
|
@@ -378,67 +384,54 @@ class OverflowMenu extends Component {
|
|
|
378
384
|
label: iconDescription
|
|
379
385
|
}), /*#__PURE__*/React__default.createElement(IconElement, iconProps)), open && this.state.hasMountedTrigger && wrappedMenuBody));
|
|
380
386
|
}
|
|
381
|
-
|
|
382
387
|
}
|
|
383
|
-
|
|
384
388
|
_defineProperty(OverflowMenu, "propTypes", {
|
|
385
389
|
/**
|
|
386
390
|
* Specify a label to be read by screen readers on the container node
|
|
387
391
|
*/
|
|
388
392
|
['aria-label']: PropTypes.string,
|
|
389
|
-
|
|
390
393
|
/**
|
|
391
394
|
* Deprecated, please use `aria-label` instead.
|
|
392
395
|
* Specify a label to be read by screen readers on the container note.
|
|
393
396
|
*/
|
|
394
397
|
ariaLabel: deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
395
|
-
|
|
396
398
|
/**
|
|
397
399
|
* The child nodes.
|
|
398
400
|
*/
|
|
399
401
|
children: PropTypes.node,
|
|
400
|
-
|
|
401
402
|
/**
|
|
402
403
|
* The CSS class names.
|
|
403
404
|
*/
|
|
404
405
|
className: PropTypes.string,
|
|
405
|
-
|
|
406
406
|
/**
|
|
407
407
|
* The menu direction.
|
|
408
408
|
*/
|
|
409
409
|
direction: PropTypes.oneOf([DIRECTION_TOP, DIRECTION_BOTTOM]),
|
|
410
|
-
|
|
411
410
|
/**
|
|
412
411
|
* `true` if the menu alignment should be flipped.
|
|
413
412
|
*/
|
|
414
413
|
flipped: PropTypes.bool,
|
|
415
|
-
|
|
416
414
|
/**
|
|
417
415
|
* Enable or disable focus trap behavior
|
|
418
416
|
*/
|
|
419
417
|
focusTrap: PropTypes.bool,
|
|
420
|
-
|
|
421
418
|
/**
|
|
422
419
|
* The CSS class for the icon.
|
|
423
420
|
*/
|
|
424
421
|
iconClass: PropTypes.string,
|
|
425
|
-
|
|
426
422
|
/**
|
|
427
423
|
* The icon description.
|
|
428
424
|
*/
|
|
429
425
|
iconDescription: PropTypes.string.isRequired,
|
|
430
|
-
|
|
431
426
|
/**
|
|
432
427
|
* The element ID.
|
|
433
428
|
*/
|
|
434
429
|
id: PropTypes.string,
|
|
435
|
-
|
|
436
430
|
/**
|
|
437
431
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
438
432
|
* Don't use this to make OverflowMenu background color same as container background color.
|
|
439
433
|
*/
|
|
440
434
|
light: deprecate(PropTypes.bool, 'The `light` prop for `OverflowMenu` is no longer needed and has been deprecated. It will be removed in the next major release. Use the Layer component instead.'),
|
|
441
|
-
|
|
442
435
|
/**
|
|
443
436
|
* The adjustment in position applied to the floating menu.
|
|
444
437
|
*/
|
|
@@ -446,7 +439,6 @@ _defineProperty(OverflowMenu, "propTypes", {
|
|
|
446
439
|
top: PropTypes.number,
|
|
447
440
|
left: PropTypes.number
|
|
448
441
|
}), PropTypes.func]),
|
|
449
|
-
|
|
450
442
|
/**
|
|
451
443
|
* The adjustment in position applied to the floating menu.
|
|
452
444
|
*/
|
|
@@ -454,61 +446,49 @@ _defineProperty(OverflowMenu, "propTypes", {
|
|
|
454
446
|
top: PropTypes.number,
|
|
455
447
|
left: PropTypes.number
|
|
456
448
|
}), PropTypes.func]),
|
|
457
|
-
|
|
458
449
|
/**
|
|
459
450
|
* The class to apply to the menu options
|
|
460
451
|
*/
|
|
461
452
|
menuOptionsClass: PropTypes.string,
|
|
462
|
-
|
|
463
453
|
/**
|
|
464
454
|
* The event handler for the `click` event.
|
|
465
455
|
*/
|
|
466
456
|
onClick: PropTypes.func,
|
|
467
|
-
|
|
468
457
|
/**
|
|
469
458
|
* Function called when menu is closed
|
|
470
459
|
*/
|
|
471
460
|
onClose: PropTypes.func,
|
|
472
|
-
|
|
473
461
|
/**
|
|
474
462
|
* The event handler for the `focus` event.
|
|
475
463
|
*/
|
|
476
464
|
onFocus: PropTypes.func,
|
|
477
|
-
|
|
478
465
|
/**
|
|
479
466
|
* The event handler for the `keydown` event.
|
|
480
467
|
*/
|
|
481
468
|
onKeyDown: PropTypes.func,
|
|
482
|
-
|
|
483
469
|
/**
|
|
484
470
|
* Function called when menu is opened
|
|
485
471
|
*/
|
|
486
472
|
onOpen: PropTypes.func,
|
|
487
|
-
|
|
488
473
|
/**
|
|
489
474
|
* `true` if the menu should be open.
|
|
490
475
|
*/
|
|
491
476
|
open: PropTypes.bool,
|
|
492
|
-
|
|
493
477
|
/**
|
|
494
478
|
* Function called to override icon rendering.
|
|
495
479
|
*/
|
|
496
480
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
497
|
-
|
|
498
481
|
/**
|
|
499
482
|
* Specify a CSS selector that matches the DOM element that should
|
|
500
483
|
* be focused when the OverflowMenu opens
|
|
501
484
|
*/
|
|
502
485
|
selectorPrimaryFocus: PropTypes.string,
|
|
503
|
-
|
|
504
486
|
/**
|
|
505
487
|
* Specify the size of the OverflowMenu. Currently supports either `sm`, 'md' (default) or 'lg` as an option.
|
|
506
488
|
*/
|
|
507
489
|
size: PropTypes.oneOf(['sm', 'md', 'lg'])
|
|
508
490
|
});
|
|
509
|
-
|
|
510
491
|
_defineProperty(OverflowMenu, "contextType", PrefixContext);
|
|
511
|
-
|
|
512
492
|
_defineProperty(OverflowMenu, "defaultProps", {
|
|
513
493
|
['aria-label']: null,
|
|
514
494
|
iconDescription: 'Options',
|
|
@@ -529,7 +509,6 @@ _defineProperty(OverflowMenu, "defaultProps", {
|
|
|
529
509
|
const forwardRef = (props, ref) => /*#__PURE__*/React__default.createElement(OverflowMenu, _extends({}, props, {
|
|
530
510
|
innerRef: ref
|
|
531
511
|
}));
|
|
532
|
-
|
|
533
512
|
forwardRef.displayName = 'OverflowMenu';
|
|
534
513
|
return /*#__PURE__*/React__default.forwardRef(forwardRef);
|
|
535
514
|
})();
|
|
@@ -33,35 +33,29 @@ const OverflowMenuItem = /*#__PURE__*/React__default.forwardRef(function Overflo
|
|
|
33
33
|
...rest
|
|
34
34
|
} = _ref;
|
|
35
35
|
const prefix = usePrefix();
|
|
36
|
-
|
|
37
36
|
function setTabFocus(evt) {
|
|
38
37
|
if (match(evt, ArrowDown)) {
|
|
39
|
-
handleOverflowMenuItemFocus
|
|
38
|
+
handleOverflowMenuItemFocus?.({
|
|
40
39
|
currentIndex: index,
|
|
41
40
|
direction: 1
|
|
42
41
|
});
|
|
43
42
|
}
|
|
44
|
-
|
|
45
43
|
if (match(evt, ArrowUp)) {
|
|
46
|
-
handleOverflowMenuItemFocus
|
|
44
|
+
handleOverflowMenuItemFocus?.({
|
|
47
45
|
currentIndex: index,
|
|
48
46
|
direction: -1
|
|
49
47
|
});
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
|
-
|
|
53
50
|
function handleClick(evt) {
|
|
54
51
|
onClick(evt);
|
|
55
|
-
|
|
56
52
|
if (closeMenu) {
|
|
57
53
|
closeMenu();
|
|
58
54
|
}
|
|
59
55
|
}
|
|
60
|
-
|
|
61
56
|
if (process.env.NODE_ENV !== "production") {
|
|
62
57
|
process.env.NODE_ENV !== "production" ? warning(closeMenu, '`<OverflowMenuItem>` detected missing `closeMenu` prop. ' + '`closeMenu` is required to let `<OverflowMenu>` close the menu upon actions on `<OverflowMenuItem>`. ' + 'Please make sure `<OverflowMenuItem>` is a direct child of `<OverflowMenu>.') : void 0;
|
|
63
58
|
}
|
|
64
|
-
|
|
65
59
|
const overflowMenuBtnClasses = cx(`${prefix}--overflow-menu-options__btn`, className);
|
|
66
60
|
const overflowMenuItemClasses = cx(`${prefix}--overflow-menu-options__option`, {
|
|
67
61
|
[`${prefix}--overflow-menu--divider`]: hasDivider,
|
|
@@ -69,17 +63,14 @@ const OverflowMenuItem = /*#__PURE__*/React__default.forwardRef(function Overflo
|
|
|
69
63
|
[`${prefix}--overflow-menu-options__option--disabled`]: disabled
|
|
70
64
|
}, wrapperClassName);
|
|
71
65
|
const TagToUse = href ? 'a' : 'button';
|
|
72
|
-
|
|
73
66
|
const OverflowMenuItemContent = (() => {
|
|
74
67
|
if (typeof itemText !== 'string') {
|
|
75
68
|
return itemText;
|
|
76
69
|
}
|
|
77
|
-
|
|
78
70
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
79
71
|
className: `${prefix}--overflow-menu-options__option-content`
|
|
80
72
|
}, itemText);
|
|
81
73
|
})();
|
|
82
|
-
|
|
83
74
|
return /*#__PURE__*/React__default.createElement("li", {
|
|
84
75
|
className: overflowMenuItemClasses,
|
|
85
76
|
role: "none"
|
|
@@ -92,12 +83,14 @@ const OverflowMenuItem = /*#__PURE__*/React__default.forwardRef(function Overflo
|
|
|
92
83
|
setTabFocus(evt);
|
|
93
84
|
onKeyDown(evt);
|
|
94
85
|
},
|
|
95
|
-
role: "menuitem"
|
|
86
|
+
role: "menuitem"
|
|
87
|
+
// ref as any: the type of `ref` is `ForwardedRef<HTMLButtonElement>` in `Button` component
|
|
96
88
|
// but `OverflowMenuItem` can be rendered as `a` tag as well, which is `HTMLAnchorElement`
|
|
97
89
|
// so we have to use `any` here
|
|
98
90
|
,
|
|
99
91
|
ref: ref,
|
|
100
|
-
tabIndex: -1
|
|
92
|
+
tabIndex: -1
|
|
93
|
+
// itemText as any: itemText may be a ReactNode, but `title` only accepts string
|
|
101
94
|
// to avoid compatibility issue, we use `any` here. Consider to enforce `itemText` to be `string?`
|
|
102
95
|
// in the next major release
|
|
103
96
|
,
|
|
@@ -109,39 +102,32 @@ OverflowMenuItem.propTypes = {
|
|
|
109
102
|
* The CSS class name to be placed on the button element
|
|
110
103
|
*/
|
|
111
104
|
className: PropTypes.string,
|
|
112
|
-
|
|
113
105
|
/**
|
|
114
106
|
* A callback to tell the parent menu component that the menu should be closed.
|
|
115
107
|
*/
|
|
116
108
|
closeMenu: PropTypes.func,
|
|
117
|
-
|
|
118
109
|
/**
|
|
119
110
|
* `true` to make this menu item disabled.
|
|
120
111
|
*/
|
|
121
112
|
disabled: PropTypes.bool,
|
|
122
113
|
handleOverflowMenuItemFocus: PropTypes.func,
|
|
123
|
-
|
|
124
114
|
/**
|
|
125
115
|
* `true` to make this menu item a divider.
|
|
126
116
|
*/
|
|
127
117
|
hasDivider: PropTypes.bool,
|
|
128
|
-
|
|
129
118
|
/**
|
|
130
119
|
* If given, overflow item will render as a link with the given href
|
|
131
120
|
*/
|
|
132
121
|
href: PropTypes.string,
|
|
133
122
|
index: PropTypes.number,
|
|
134
|
-
|
|
135
123
|
/**
|
|
136
124
|
* `true` to make this menu item a "danger button".
|
|
137
125
|
*/
|
|
138
126
|
isDelete: PropTypes.bool,
|
|
139
|
-
|
|
140
127
|
/**
|
|
141
128
|
* The text in the menu item.
|
|
142
129
|
*/
|
|
143
130
|
itemText: PropTypes.node.isRequired,
|
|
144
|
-
|
|
145
131
|
/**
|
|
146
132
|
* event handlers
|
|
147
133
|
*/
|
|
@@ -154,17 +140,14 @@ OverflowMenuItem.propTypes = {
|
|
|
154
140
|
onMouseEnter: PropTypes.func,
|
|
155
141
|
onMouseLeave: PropTypes.func,
|
|
156
142
|
onMouseUp: PropTypes.func,
|
|
157
|
-
|
|
158
143
|
/**
|
|
159
144
|
* `true` if this menu item has long text and requires a browser tooltip
|
|
160
145
|
*/
|
|
161
146
|
requireTitle: PropTypes.bool,
|
|
162
|
-
|
|
163
147
|
/**
|
|
164
148
|
* Specify a title for the OverflowMenuItem
|
|
165
149
|
*/
|
|
166
150
|
title: PropTypes.string,
|
|
167
|
-
|
|
168
151
|
/**
|
|
169
152
|
* The CSS class name to be placed on the wrapper list item element
|
|
170
153
|
*/
|
|
@@ -16,7 +16,6 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
16
16
|
import { useAttachedMenu } from '../../internal/useAttachedMenu.js';
|
|
17
17
|
|
|
18
18
|
const defaultSize = 'md';
|
|
19
|
-
|
|
20
19
|
function OverflowMenuV2(_ref) {
|
|
21
20
|
let {
|
|
22
21
|
children,
|
|
@@ -63,23 +62,19 @@ function OverflowMenuV2(_ref) {
|
|
|
63
62
|
y: y
|
|
64
63
|
}, children));
|
|
65
64
|
}
|
|
66
|
-
|
|
67
65
|
OverflowMenuV2.propTypes = {
|
|
68
66
|
/**
|
|
69
67
|
* A collection of MenuItems to be rendered within this OverflowMenu.
|
|
70
68
|
*/
|
|
71
69
|
children: PropTypes.node,
|
|
72
|
-
|
|
73
70
|
/**
|
|
74
71
|
* Additional CSS class names for the trigger button.
|
|
75
72
|
*/
|
|
76
73
|
className: PropTypes.string,
|
|
77
|
-
|
|
78
74
|
/**
|
|
79
75
|
* Otionally provide a custom icon to be rendered on the trigger button.
|
|
80
76
|
*/
|
|
81
77
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
82
|
-
|
|
83
78
|
/**
|
|
84
79
|
* Specify the size of the menu, from a list of available sizes.
|
|
85
80
|
*/
|
|
@@ -13,7 +13,6 @@ import SkeletonText from '../SkeletonText/SkeletonText.js';
|
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
|
|
15
15
|
var _SkeletonText, _SkeletonText2, _SkeletonText3, _SkeletonText4;
|
|
16
|
-
|
|
17
16
|
function PaginationSkeleton(_ref) {
|
|
18
17
|
let {
|
|
19
18
|
className,
|
|
@@ -36,7 +35,6 @@ function PaginationSkeleton(_ref) {
|
|
|
36
35
|
width: "70px"
|
|
37
36
|
}))));
|
|
38
37
|
}
|
|
39
|
-
|
|
40
38
|
PaginationSkeleton.propTypes = {
|
|
41
39
|
/**
|
|
42
40
|
* Specify an optional className to add.
|