@carbon/react 1.83.0 → 1.84.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 +909 -874
- package/README.md +1 -1
- package/es/components/AILabel/index.js +27 -30
- package/es/components/AISkeleton/AISkeletonIcon.js +4 -5
- package/es/components/AISkeleton/AISkeletonPlaceholder.js +4 -5
- package/es/components/AISkeleton/AISkeletonText.js +4 -5
- package/es/components/Accordion/Accordion.Skeleton.js +9 -10
- package/es/components/Accordion/Accordion.js +10 -11
- package/es/components/Accordion/AccordionItem.js +13 -14
- package/es/components/Accordion/AccordionProvider.js +4 -5
- package/es/components/AspectRatio/AspectRatio.js +7 -8
- package/es/components/BadgeIndicator/index.js +5 -6
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +4 -5
- package/es/components/Button/Button.Skeleton.js +7 -8
- package/es/components/Button/ButtonBase.js +23 -24
- package/es/components/ChatButton/ChatButton.Skeleton.js +5 -6
- package/es/components/ChatButton/ChatButton.js +11 -12
- package/es/components/Checkbox/Checkbox.Skeleton.js +4 -5
- package/es/components/Checkbox/Checkbox.js +19 -20
- package/es/components/CheckboxGroup/CheckboxGroup.js +16 -17
- package/es/components/ClassPrefix/index.js +4 -5
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +5 -6
- package/es/components/CodeSnippet/CodeSnippet.js +25 -26
- package/es/components/ComboBox/ComboBox.js +24 -30
- package/es/components/ComboBox/tools/filter.js +9 -12
- package/es/components/ComboButton/index.js +16 -18
- package/es/components/ComposedModal/ComposedModal.js +50 -36
- package/es/components/ComposedModal/ModalFooter.js +37 -42
- package/es/components/ComposedModal/ModalHeader.js +14 -15
- package/es/components/ContainedList/ContainedList.js +10 -11
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +9 -10
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +9 -29
- package/es/components/ContentSwitcher/ContentSwitcher.js +96 -128
- package/es/components/ContentSwitcher/index.d.ts +3 -4
- package/es/components/ContextMenu/useContextMenu.js +1 -2
- package/es/components/Copy/Copy.js +11 -12
- package/es/components/CopyButton/CopyButton.js +10 -11
- package/es/components/DataTable/DataTable.js +45 -53
- package/es/components/DataTable/Table.js +15 -18
- package/es/components/DataTable/TableBatchAction.js +8 -11
- package/es/components/DataTable/TableBatchActions.js +18 -20
- package/es/components/DataTable/TableBody.js +8 -11
- package/es/components/DataTable/TableContainer.js +9 -10
- package/es/components/DataTable/TableDecoratorRow.js +4 -5
- package/es/components/DataTable/TableExpandHeader.js +14 -15
- package/es/components/DataTable/TableExpandRow.js +13 -14
- package/es/components/DataTable/TableExpandedRow.js +6 -7
- package/es/components/DataTable/TableHeader.js +15 -16
- package/es/components/DataTable/TableSelectAll.js +11 -12
- package/es/components/DataTable/TableSelectRow.js +12 -13
- package/es/components/DataTable/TableSlugRow.js +4 -5
- package/es/components/DataTable/TableToolbar.js +7 -8
- package/es/components/DataTable/TableToolbarMenu.js +8 -9
- package/es/components/DataTable/TableToolbarSearch.js +22 -24
- package/es/components/DataTable/state/sorting.js +3 -4
- package/es/components/DataTable/tools/filter.js +10 -12
- package/es/components/DataTable/tools/normalize.js +6 -8
- package/es/components/DataTable/tools/sorting.js +24 -30
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +11 -12
- package/es/components/DatePicker/DatePicker.Skeleton.js +7 -8
- package/es/components/DatePicker/DatePicker.js +88 -65
- package/es/components/DatePickerInput/DatePickerInput.js +5 -6
- package/es/components/Dialog/index.d.ts +193 -8
- package/es/components/Dialog/index.js +454 -35
- package/es/components/Dropdown/Dropdown.Skeleton.js +6 -7
- package/es/components/Dropdown/Dropdown.js +40 -43
- package/es/components/ErrorBoundary/ErrorBoundary.js +2 -2
- package/es/components/ExpandableSearch/ExpandableSearch.js +9 -10
- package/es/components/FeatureFlags/index.js +11 -12
- package/es/components/FileUploader/FileUploader.Skeleton.js +4 -5
- package/es/components/FileUploader/FileUploader.js +22 -24
- package/es/components/FileUploader/FileUploaderButton.js +16 -17
- package/es/components/FileUploader/FileUploaderDropContainer.js +15 -16
- package/es/components/FileUploader/FileUploaderItem.js +13 -14
- package/es/components/FileUploader/Filename.js +9 -10
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +4 -5
- package/es/components/FluidComboBox/FluidComboBox.js +5 -6
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +5 -6
- package/es/components/FluidDatePicker/FluidDatePicker.js +10 -11
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +4 -5
- package/es/components/FluidDropdown/FluidDropdown.js +5 -6
- package/es/components/FluidForm/FluidForm.js +5 -6
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +4 -5
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +6 -7
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +4 -5
- package/es/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
- package/es/components/FluidNumberInput/FluidNumberInput.js +38 -5
- package/es/components/FluidSearch/FluidSearch.Skeleton.js +4 -5
- package/es/components/FluidSearch/FluidSearch.js +4 -5
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +4 -5
- package/es/components/FluidSelect/FluidSelect.js +5 -6
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +4 -5
- package/es/components/FluidTextArea/FluidTextArea.js +4 -5
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +4 -5
- package/es/components/FluidTextInput/FluidTextInput.js +5 -6
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +5 -6
- package/es/components/FluidTimePicker/FluidTimePicker.js +11 -12
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +5 -6
- package/es/components/Form/Form.js +5 -6
- package/es/components/FormGroup/FormGroup.js +11 -12
- package/es/components/FormItem/FormItem.js +5 -6
- package/es/components/FormLabel/FormLabel.js +6 -7
- package/es/components/Grid/CSSGrid.js +17 -19
- package/es/components/Grid/Column.js +28 -27
- package/es/components/Grid/ColumnHang.js +6 -7
- package/es/components/Grid/FlexGrid.js +9 -10
- package/es/components/Grid/GridContext.js +5 -6
- package/es/components/Grid/Row.js +8 -9
- package/es/components/Heading/index.js +5 -6
- package/es/components/Icon/Icon.Skeleton.js +4 -5
- package/es/components/IconButton/index.js +20 -21
- package/es/components/IconIndicator/index.js +7 -8
- package/es/components/IdPrefix/index.js +4 -5
- package/es/components/InlineLoading/InlineLoading.js +9 -10
- package/es/components/Layer/index.js +8 -9
- package/es/components/Layout/index.js +21 -26
- package/es/components/LayoutDirection/LayoutDirection.js +6 -7
- package/es/components/Link/Link.d.ts +1 -1
- package/es/components/Link/Link.js +14 -15
- package/es/components/ListBox/ListBoxField.js +6 -7
- package/es/components/ListBox/ListBoxMenu.js +5 -6
- package/es/components/ListBox/ListBoxMenuIcon.js +4 -5
- package/es/components/ListBox/ListBoxMenuItem.js +8 -10
- package/es/components/ListBox/ListBoxSelection.js +8 -9
- package/es/components/ListBox/next/ListBoxSelection.js +9 -10
- package/es/components/ListBox/next/ListBoxTrigger.js +5 -6
- package/es/components/ListItem/ListItem.js +5 -6
- package/es/components/Loading/Loading.js +8 -9
- package/es/components/Menu/Menu.js +23 -24
- package/es/components/Menu/MenuItem.js +39 -44
- package/es/components/MenuButton/index.js +16 -18
- package/es/components/Modal/Modal.js +74 -65
- package/es/components/ModalWrapper/ModalWrapper.js +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +67 -48
- package/es/components/MultiSelect/MultiSelect.js +43 -45
- package/es/components/MultiSelect/tools/sorting.js +11 -15
- package/es/components/Notification/Notification.js +96 -105
- package/es/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
- package/es/components/NumberInput/NumberFormatPropTypes.js +40 -0
- package/es/components/NumberInput/NumberInput.Skeleton.js +6 -7
- package/es/components/NumberInput/NumberInput.d.ts +39 -3
- package/es/components/NumberInput/NumberInput.js +174 -44
- package/es/components/OrderedList/OrderedList.js +7 -8
- package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
- package/es/components/OverflowMenu/OverflowMenu.js +39 -46
- package/es/components/OverflowMenu/next/index.js +12 -13
- package/es/components/PageHeader/PageHeader.d.ts +39 -14
- package/es/components/PageHeader/PageHeader.js +187 -81
- package/es/components/PageHeader/index.d.ts +2 -2
- package/es/components/PageHeader/index.js +1 -1
- package/es/components/Pagination/Pagination.Skeleton.js +4 -5
- package/es/components/Pagination/Pagination.js +24 -25
- package/es/components/Pagination/experimental/PageSelector.js +8 -9
- package/es/components/Pagination/experimental/Pagination.js +20 -21
- package/es/components/PaginationNav/PaginationNav.js +33 -38
- package/es/components/Popover/index.js +26 -28
- package/es/components/ProgressBar/ProgressBar.js +11 -12
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +5 -6
- package/es/components/ProgressIndicator/ProgressIndicator.js +29 -32
- package/es/components/RadioTile/RadioTile.js +17 -18
- package/es/components/Search/Search.Skeleton.js +5 -6
- package/es/components/Search/Search.js +26 -29
- package/es/components/Select/Select.Skeleton.js +5 -6
- package/es/components/Select/Select.js +24 -25
- package/es/components/SelectItem/SelectItem.js +8 -9
- package/es/components/SelectItemGroup/SelectItemGroup.js +7 -8
- package/es/components/ShapeIndicator/index.js +7 -8
- package/es/components/SkeletonIcon/SkeletonIcon.js +4 -5
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -5
- package/es/components/SkeletonText/SkeletonText.js +8 -9
- package/es/components/Slider/Slider.Skeleton.js +8 -9
- package/es/components/Slider/Slider.js +75 -83
- package/es/components/Slider/SliderHandles.js +6 -6
- package/es/components/StructuredList/StructuredList.Skeleton.js +5 -6
- package/es/components/Tabs/Tabs.Skeleton.js +5 -6
- package/es/components/Tabs/Tabs.js +83 -98
- package/es/components/Tabs/usePressable.js +7 -8
- package/es/components/Tag/DismissibleTag.js +16 -17
- package/es/components/Tag/OperationalTag.js +10 -11
- package/es/components/Tag/SelectableTag.js +13 -14
- package/es/components/Tag/Tag.Skeleton.js +5 -6
- package/es/components/Tag/Tag.js +19 -20
- package/es/components/Text/Text.js +6 -7
- package/es/components/Text/TextDirection.js +5 -6
- package/es/components/TextArea/TextArea.js +7 -7
- package/es/components/TextInput/ControlledPasswordInput.js +24 -25
- package/es/components/TextInput/PasswordInput.js +26 -27
- package/es/components/TextInput/TextInput.Skeleton.js +5 -6
- package/es/components/TextInput/TextInput.js +27 -28
- package/es/components/TextInput/util.js +14 -17
- package/es/components/Theme/index.js +10 -12
- package/es/components/Tile/Tile.js +68 -74
- package/es/components/TileGroup/TileGroup.d.ts +4 -4
- package/es/components/TileGroup/TileGroup.js +45 -53
- package/es/components/TileGroup/index.d.ts +3 -3
- package/es/components/Toggle/Toggle.Skeleton.js +4 -5
- package/es/components/Toggle/Toggle.js +17 -18
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +6 -7
- package/es/components/Toggletip/index.js +33 -39
- package/es/components/Tooltip/DefinitionTooltip.js +13 -14
- package/es/components/Tooltip/Tooltip.js +15 -16
- package/es/components/TreeView/TreeNode.js +20 -21
- package/es/components/TreeView/TreeView.js +14 -16
- package/es/components/UIShell/Content.js +6 -7
- package/es/components/UIShell/Header.js +5 -6
- package/es/components/UIShell/HeaderContainer.js +5 -6
- package/es/components/UIShell/HeaderGlobalAction.js +12 -13
- package/es/components/UIShell/HeaderMenu.d.ts +10 -112
- package/es/components/UIShell/HeaderMenu.js +154 -201
- package/es/components/UIShell/HeaderMenuButton.js +10 -11
- package/es/components/UIShell/HeaderMenuItem.js +12 -12
- package/es/components/UIShell/HeaderName.js +6 -7
- package/es/components/UIShell/HeaderNavigation.js +7 -8
- package/es/components/UIShell/HeaderPanel.js +9 -10
- package/es/components/UIShell/HeaderSideNavItems.js +5 -6
- package/es/components/UIShell/Link.js +8 -9
- package/es/components/UIShell/SideNav.js +23 -25
- package/es/components/UIShell/SideNavDetails.js +6 -7
- package/es/components/UIShell/SideNavDivider.js +3 -4
- package/es/components/UIShell/SideNavFooter.js +6 -7
- package/es/components/UIShell/SideNavHeader.js +5 -6
- package/es/components/UIShell/SideNavIcon.js +5 -6
- package/es/components/UIShell/SideNavItem.js +5 -6
- package/es/components/UIShell/SideNavItems.js +5 -6
- package/es/components/UIShell/SideNavLink.js +10 -11
- package/es/components/UIShell/SideNavLinkText.js +5 -6
- package/es/components/UIShell/SideNavMenu.js +11 -12
- package/es/components/UIShell/SkipToContent.js +7 -8
- package/es/components/UIShell/Switcher.js +4 -5
- package/es/components/UIShell/SwitcherDivider.js +4 -5
- package/es/components/UnorderedList/UnorderedList.js +6 -7
- package/es/index.js +3 -3
- package/es/internal/FloatingMenu.js +26 -28
- package/es/internal/Selection.js +15 -17
- package/es/internal/getAnnouncement.d.ts +8 -0
- package/es/internal/getAnnouncement.js +22 -0
- package/es/internal/keyboard/match.js +6 -7
- package/es/internal/useControllableState.d.ts +1 -1
- package/es/internal/useControllableState.js +8 -9
- package/es/internal/useDelayedState.js +1 -2
- package/es/internal/useDocumentLang.d.ts +12 -0
- package/es/internal/useId.js +2 -4
- package/es/internal/useMatchMedia.js +1 -2
- package/es/internal/useMergedRefs.d.ts +1 -1
- package/es/internal/useNoInteractiveChildren.js +2 -4
- package/es/internal/useNormalizedInputProps.js +9 -10
- package/es/internal/useOverflowItems.d.ts +29 -0
- package/es/internal/useOverflowItems.js +122 -0
- package/es/internal/useResizeObserver.js +4 -5
- package/es/internal/useSavedCallback.js +1 -3
- package/es/internal/wrapFocus.js +20 -29
- package/es/prop-types/deprecate.js +1 -4
- package/es/prop-types/deprecateValuesWithin.js +1 -4
- package/es/prop-types/isRequiredOneOf.js +1 -4
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
- package/es/tools/events.js +1 -4
- package/es/tools/mergeRefs.js +9 -14
- package/es/tools/uniqueId.js +1 -2
- package/es/tools/wrapComponent.js +9 -11
- package/lib/components/AILabel/index.js +27 -30
- package/lib/components/AISkeleton/AISkeletonIcon.js +4 -5
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -5
- package/lib/components/AISkeleton/AISkeletonText.js +4 -5
- package/lib/components/Accordion/Accordion.Skeleton.js +9 -10
- package/lib/components/Accordion/Accordion.js +10 -11
- package/lib/components/Accordion/AccordionItem.js +13 -14
- package/lib/components/Accordion/AccordionProvider.js +4 -5
- package/lib/components/AspectRatio/AspectRatio.js +7 -8
- package/lib/components/BadgeIndicator/index.js +5 -6
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +4 -5
- package/lib/components/Button/Button.Skeleton.js +7 -8
- package/lib/components/Button/ButtonBase.js +23 -24
- package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -6
- package/lib/components/ChatButton/ChatButton.js +11 -12
- package/lib/components/Checkbox/Checkbox.Skeleton.js +4 -5
- package/lib/components/Checkbox/Checkbox.js +19 -20
- package/lib/components/CheckboxGroup/CheckboxGroup.js +16 -17
- package/lib/components/ClassPrefix/index.js +4 -5
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +5 -6
- package/lib/components/CodeSnippet/CodeSnippet.js +25 -26
- package/lib/components/ComboBox/ComboBox.js +24 -30
- package/lib/components/ComboBox/tools/filter.js +9 -12
- package/lib/components/ComboButton/index.js +16 -18
- package/lib/components/ComposedModal/ComposedModal.js +50 -36
- package/lib/components/ComposedModal/ModalFooter.js +37 -42
- package/lib/components/ComposedModal/ModalHeader.js +14 -15
- package/lib/components/ContainedList/ContainedList.js +10 -11
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +9 -10
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +9 -29
- package/lib/components/ContentSwitcher/ContentSwitcher.js +94 -126
- package/lib/components/ContentSwitcher/index.d.ts +3 -4
- package/lib/components/ContextMenu/useContextMenu.js +1 -2
- package/lib/components/Copy/Copy.js +11 -12
- package/lib/components/CopyButton/CopyButton.js +10 -11
- package/lib/components/DataTable/DataTable.js +45 -53
- package/lib/components/DataTable/Table.js +15 -18
- package/lib/components/DataTable/TableBatchAction.js +8 -11
- package/lib/components/DataTable/TableBatchActions.js +18 -20
- package/lib/components/DataTable/TableBody.js +8 -11
- package/lib/components/DataTable/TableContainer.js +9 -10
- package/lib/components/DataTable/TableDecoratorRow.js +4 -5
- package/lib/components/DataTable/TableExpandHeader.js +14 -15
- package/lib/components/DataTable/TableExpandRow.js +13 -14
- package/lib/components/DataTable/TableExpandedRow.js +6 -7
- package/lib/components/DataTable/TableHeader.js +15 -16
- package/lib/components/DataTable/TableSelectAll.js +11 -12
- package/lib/components/DataTable/TableSelectRow.js +12 -13
- package/lib/components/DataTable/TableSlugRow.js +4 -5
- package/lib/components/DataTable/TableToolbar.js +7 -8
- package/lib/components/DataTable/TableToolbarMenu.js +8 -9
- package/lib/components/DataTable/TableToolbarSearch.js +22 -24
- package/lib/components/DataTable/state/sorting.js +3 -4
- package/lib/components/DataTable/tools/filter.js +10 -12
- package/lib/components/DataTable/tools/normalize.js +6 -8
- package/lib/components/DataTable/tools/sorting.js +24 -30
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +11 -12
- package/lib/components/DatePicker/DatePicker.Skeleton.js +7 -8
- package/lib/components/DatePicker/DatePicker.js +87 -64
- package/lib/components/DatePickerInput/DatePickerInput.js +5 -6
- package/lib/components/Dialog/index.d.ts +193 -8
- package/lib/components/Dialog/index.js +457 -33
- package/lib/components/Dropdown/Dropdown.Skeleton.js +6 -7
- package/lib/components/Dropdown/Dropdown.js +40 -43
- package/lib/components/ErrorBoundary/ErrorBoundary.js +2 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +9 -10
- package/lib/components/FeatureFlags/index.js +11 -12
- package/lib/components/FileUploader/FileUploader.Skeleton.js +4 -5
- package/lib/components/FileUploader/FileUploader.js +22 -24
- package/lib/components/FileUploader/FileUploaderButton.js +16 -17
- package/lib/components/FileUploader/FileUploaderDropContainer.js +15 -16
- package/lib/components/FileUploader/FileUploaderItem.js +13 -14
- package/lib/components/FileUploader/Filename.js +9 -10
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +4 -5
- package/lib/components/FluidComboBox/FluidComboBox.js +5 -6
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +5 -6
- package/lib/components/FluidDatePicker/FluidDatePicker.js +10 -11
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +4 -5
- package/lib/components/FluidDropdown/FluidDropdown.js +5 -6
- package/lib/components/FluidForm/FluidForm.js +5 -6
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +4 -5
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +6 -7
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +4 -5
- package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
- package/lib/components/FluidNumberInput/FluidNumberInput.js +38 -5
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +4 -5
- package/lib/components/FluidSearch/FluidSearch.js +4 -5
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +4 -5
- package/lib/components/FluidSelect/FluidSelect.js +5 -6
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +4 -5
- package/lib/components/FluidTextArea/FluidTextArea.js +4 -5
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +4 -5
- package/lib/components/FluidTextInput/FluidTextInput.js +5 -6
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +5 -6
- package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -12
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +5 -6
- package/lib/components/Form/Form.js +5 -6
- package/lib/components/FormGroup/FormGroup.js +11 -12
- package/lib/components/FormItem/FormItem.js +5 -6
- package/lib/components/FormLabel/FormLabel.js +6 -7
- package/lib/components/Grid/CSSGrid.js +17 -19
- package/lib/components/Grid/Column.js +28 -27
- package/lib/components/Grid/ColumnHang.js +6 -7
- package/lib/components/Grid/FlexGrid.js +9 -10
- package/lib/components/Grid/GridContext.js +5 -6
- package/lib/components/Grid/Row.js +8 -9
- package/lib/components/Heading/index.js +5 -6
- package/lib/components/Icon/Icon.Skeleton.js +4 -5
- package/lib/components/IconButton/index.js +20 -21
- package/lib/components/IconIndicator/index.js +7 -8
- package/lib/components/IdPrefix/index.js +4 -5
- package/lib/components/InlineLoading/InlineLoading.js +9 -10
- package/lib/components/Layer/index.js +8 -9
- package/lib/components/Layout/index.js +21 -26
- package/lib/components/LayoutDirection/LayoutDirection.js +6 -7
- package/lib/components/Link/Link.d.ts +1 -1
- package/lib/components/Link/Link.js +14 -15
- package/lib/components/ListBox/ListBoxField.js +6 -7
- package/lib/components/ListBox/ListBoxMenu.js +5 -6
- package/lib/components/ListBox/ListBoxMenuIcon.js +4 -5
- package/lib/components/ListBox/ListBoxMenuItem.js +8 -10
- package/lib/components/ListBox/ListBoxSelection.js +8 -9
- package/lib/components/ListBox/next/ListBoxSelection.js +9 -10
- package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
- package/lib/components/ListItem/ListItem.js +5 -6
- package/lib/components/Loading/Loading.js +8 -9
- package/lib/components/Menu/Menu.js +23 -24
- package/lib/components/Menu/MenuItem.js +39 -44
- package/lib/components/MenuButton/index.js +16 -18
- package/lib/components/Modal/Modal.js +74 -65
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +66 -47
- package/lib/components/MultiSelect/MultiSelect.js +43 -45
- package/lib/components/MultiSelect/tools/sorting.js +11 -15
- package/lib/components/Notification/Notification.js +96 -105
- package/lib/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
- package/lib/components/NumberInput/NumberFormatPropTypes.js +48 -0
- package/lib/components/NumberInput/NumberInput.Skeleton.js +6 -7
- package/lib/components/NumberInput/NumberInput.d.ts +39 -3
- package/lib/components/NumberInput/NumberInput.js +173 -43
- package/lib/components/OrderedList/OrderedList.js +7 -8
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +39 -46
- package/lib/components/OverflowMenu/next/index.js +12 -13
- package/lib/components/PageHeader/PageHeader.d.ts +39 -14
- package/lib/components/PageHeader/PageHeader.js +185 -81
- package/lib/components/PageHeader/index.d.ts +2 -2
- package/lib/components/PageHeader/index.js +0 -2
- package/lib/components/Pagination/Pagination.Skeleton.js +4 -5
- package/lib/components/Pagination/Pagination.js +24 -25
- package/lib/components/Pagination/experimental/PageSelector.js +8 -9
- package/lib/components/Pagination/experimental/Pagination.js +20 -21
- package/lib/components/PaginationNav/PaginationNav.js +33 -38
- package/lib/components/Popover/index.js +26 -28
- package/lib/components/ProgressBar/ProgressBar.js +11 -12
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +5 -6
- package/lib/components/ProgressIndicator/ProgressIndicator.js +29 -32
- package/lib/components/RadioTile/RadioTile.js +17 -18
- package/lib/components/Search/Search.Skeleton.js +5 -6
- package/lib/components/Search/Search.js +26 -29
- package/lib/components/Select/Select.Skeleton.js +5 -6
- package/lib/components/Select/Select.js +24 -25
- package/lib/components/SelectItem/SelectItem.js +8 -9
- package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -8
- package/lib/components/ShapeIndicator/index.js +7 -8
- package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -5
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -5
- package/lib/components/SkeletonText/SkeletonText.js +8 -9
- package/lib/components/Slider/Slider.Skeleton.js +8 -9
- package/lib/components/Slider/Slider.js +75 -83
- package/lib/components/Slider/SliderHandles.js +6 -6
- package/lib/components/StructuredList/StructuredList.Skeleton.js +5 -6
- package/lib/components/Tabs/Tabs.Skeleton.js +5 -6
- package/lib/components/Tabs/Tabs.js +83 -98
- package/lib/components/Tabs/usePressable.js +7 -8
- package/lib/components/Tag/DismissibleTag.js +16 -17
- package/lib/components/Tag/OperationalTag.js +10 -11
- package/lib/components/Tag/SelectableTag.js +13 -14
- package/lib/components/Tag/Tag.Skeleton.js +5 -6
- package/lib/components/Tag/Tag.js +19 -20
- package/lib/components/Text/Text.js +6 -7
- package/lib/components/Text/TextDirection.js +5 -6
- package/lib/components/TextArea/TextArea.js +7 -7
- package/lib/components/TextInput/ControlledPasswordInput.js +24 -25
- package/lib/components/TextInput/PasswordInput.js +26 -27
- package/lib/components/TextInput/TextInput.Skeleton.js +5 -6
- package/lib/components/TextInput/TextInput.js +27 -28
- package/lib/components/TextInput/util.js +14 -17
- package/lib/components/Theme/index.js +10 -12
- package/lib/components/Tile/Tile.js +68 -74
- package/lib/components/TileGroup/TileGroup.d.ts +4 -4
- package/lib/components/TileGroup/TileGroup.js +44 -52
- package/lib/components/TileGroup/index.d.ts +3 -3
- package/lib/components/Toggle/Toggle.Skeleton.js +4 -5
- package/lib/components/Toggle/Toggle.js +17 -18
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +6 -7
- package/lib/components/Toggletip/index.js +33 -39
- package/lib/components/Tooltip/DefinitionTooltip.js +13 -14
- package/lib/components/Tooltip/Tooltip.js +15 -16
- package/lib/components/TreeView/TreeNode.js +20 -21
- package/lib/components/TreeView/TreeView.js +14 -16
- package/lib/components/UIShell/Content.js +6 -7
- package/lib/components/UIShell/Header.js +5 -6
- package/lib/components/UIShell/HeaderContainer.js +5 -6
- package/lib/components/UIShell/HeaderGlobalAction.js +12 -13
- package/lib/components/UIShell/HeaderMenu.d.ts +10 -112
- package/lib/components/UIShell/HeaderMenu.js +152 -199
- package/lib/components/UIShell/HeaderMenuButton.js +10 -11
- package/lib/components/UIShell/HeaderMenuItem.js +12 -12
- package/lib/components/UIShell/HeaderName.js +6 -7
- package/lib/components/UIShell/HeaderNavigation.js +7 -8
- package/lib/components/UIShell/HeaderPanel.js +9 -10
- package/lib/components/UIShell/HeaderSideNavItems.js +5 -6
- package/lib/components/UIShell/Link.js +8 -9
- package/lib/components/UIShell/SideNav.js +23 -25
- package/lib/components/UIShell/SideNavDetails.js +6 -7
- package/lib/components/UIShell/SideNavDivider.js +3 -4
- package/lib/components/UIShell/SideNavFooter.js +6 -7
- package/lib/components/UIShell/SideNavHeader.js +5 -6
- package/lib/components/UIShell/SideNavIcon.js +5 -6
- package/lib/components/UIShell/SideNavItem.js +5 -6
- package/lib/components/UIShell/SideNavItems.js +5 -6
- package/lib/components/UIShell/SideNavLink.js +10 -11
- package/lib/components/UIShell/SideNavLinkText.js +5 -6
- package/lib/components/UIShell/SideNavMenu.js +11 -12
- package/lib/components/UIShell/SkipToContent.js +7 -8
- package/lib/components/UIShell/Switcher.js +4 -5
- package/lib/components/UIShell/SwitcherDivider.js +4 -5
- package/lib/components/UnorderedList/UnorderedList.js +6 -7
- package/lib/index.js +36 -36
- package/lib/internal/FloatingMenu.js +26 -28
- package/lib/internal/Selection.js +15 -17
- package/lib/internal/getAnnouncement.d.ts +8 -0
- package/lib/internal/getAnnouncement.js +26 -0
- package/lib/internal/keyboard/match.js +6 -7
- package/lib/internal/useControllableState.d.ts +1 -1
- package/lib/internal/useControllableState.js +8 -9
- package/lib/internal/useDelayedState.js +1 -2
- package/lib/internal/useDocumentLang.d.ts +12 -0
- package/lib/internal/useId.js +2 -4
- package/lib/internal/useMatchMedia.js +1 -2
- package/lib/internal/useMergedRefs.d.ts +1 -1
- package/lib/internal/useNoInteractiveChildren.js +2 -4
- package/lib/internal/useNormalizedInputProps.js +9 -10
- package/lib/internal/useOverflowItems.d.ts +29 -0
- package/lib/internal/useOverflowItems.js +126 -0
- package/lib/internal/useResizeObserver.js +4 -5
- package/lib/internal/useSavedCallback.js +1 -3
- package/lib/internal/wrapFocus.js +20 -29
- package/lib/prop-types/deprecate.js +1 -4
- package/lib/prop-types/deprecateValuesWithin.js +1 -4
- package/lib/prop-types/isRequiredOneOf.js +1 -4
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
- package/lib/tools/events.js +1 -4
- package/lib/tools/mergeRefs.js +9 -14
- package/lib/tools/uniqueId.js +1 -2
- package/lib/tools/wrapComponent.js +9 -11
- package/package.json +21 -19
- package/telemetry.yml +25 -1
- package/es/components/ContentSwitcher/index.js +0 -13
- package/es/feature-flags.d.ts +0 -7
- package/es/internal/useAnnouncer.js +0 -21
- package/lib/components/ContentSwitcher/index.js +0 -18
- package/lib/feature-flags.d.ts +0 -7
- package/lib/internal/useAnnouncer.js +0 -25
|
@@ -20,6 +20,7 @@ var AriaPropTypes = require('../../prop-types/AriaPropTypes.js');
|
|
|
20
20
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
21
21
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
22
22
|
var events = require('../../tools/events.js');
|
|
23
|
+
var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
23
24
|
|
|
24
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
26
|
|
|
@@ -27,204 +28,163 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
27
28
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
28
29
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
const frFn = React.forwardRef;
|
|
32
|
+
const HeaderMenu = frFn((props, ref) => {
|
|
33
|
+
const {
|
|
34
|
+
isActive,
|
|
35
|
+
isCurrentPage,
|
|
36
|
+
'aria-label': ariaLabel,
|
|
37
|
+
'aria-labelledby': ariaLabelledBy,
|
|
38
|
+
className: customClassName,
|
|
39
|
+
children,
|
|
40
|
+
renderMenuContent: MenuContent,
|
|
41
|
+
menuLinkName,
|
|
42
|
+
focusRef,
|
|
43
|
+
onBlur,
|
|
44
|
+
onClick,
|
|
45
|
+
onKeyDown,
|
|
46
|
+
...rest
|
|
47
|
+
} = props;
|
|
48
|
+
const prefix = React.useContext(usePrefix.PrefixContext);
|
|
49
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
50
|
+
const menuButtonRef = React.useRef(null);
|
|
51
|
+
const subMenusRef = React.useRef(null);
|
|
52
|
+
const itemRefs = React.useRef([]);
|
|
53
|
+
const mergedButtonRef = useMergedRefs.useMergedRefs([ref, focusRef, menuButtonRef]);
|
|
36
54
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_rollupPluginBabelHelpers.defineProperty(this, "handleOnClick", e => {
|
|
47
|
-
const {
|
|
48
|
-
current: subMenusNode
|
|
49
|
-
} = this._subMenus;
|
|
50
|
-
if (!subMenusNode || !subMenusNode.contains(e.target)) {
|
|
51
|
-
e.preventDefault();
|
|
52
|
-
}
|
|
53
|
-
this.setState(prevState => ({
|
|
54
|
-
expanded: !prevState.expanded
|
|
55
|
-
}));
|
|
56
|
-
});
|
|
57
|
-
/**
|
|
58
|
-
* Keyboard event handler for the entire menu.
|
|
59
|
-
*/
|
|
60
|
-
_rollupPluginBabelHelpers.defineProperty(this, "handleOnKeyDown", event => {
|
|
61
|
-
// Handle enter or space key for toggling the expanded state of the menu.
|
|
62
|
-
if (match.matches(event, [keys.Enter, keys.Space])) {
|
|
63
|
-
event.stopPropagation();
|
|
64
|
-
event.preventDefault();
|
|
65
|
-
this.setState(prevState => ({
|
|
66
|
-
expanded: !prevState.expanded
|
|
67
|
-
}));
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
/**
|
|
72
|
-
* Handle our blur event from our underlying menuitems. Will mostly be used
|
|
73
|
-
* for closing our menu in response to a user clicking off or tabbing out of
|
|
74
|
-
* the menu or menubar.
|
|
75
|
-
*/
|
|
76
|
-
_rollupPluginBabelHelpers.defineProperty(this, "handleOnBlur", event => {
|
|
77
|
-
// Close the menu on blur when the related target is not a sibling menu item
|
|
78
|
-
// or a child in a submenu
|
|
79
|
-
const siblingItemBlurredTo = this.items.find(element => element === event.relatedTarget);
|
|
80
|
-
const childItemBlurredTo = this._subMenus.current?.contains(event.relatedTarget);
|
|
81
|
-
if (!siblingItemBlurredTo && !childItemBlurredTo) {
|
|
82
|
-
this.setState({
|
|
83
|
-
expanded: false,
|
|
84
|
-
selectedIndex: null
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
/**
|
|
89
|
-
* ref handler for our menu button. If we are supplied a `focusRef` prop, we also
|
|
90
|
-
* forward along the node.
|
|
91
|
-
*
|
|
92
|
-
* This is useful when this component is a child in a
|
|
93
|
-
* menu or menubar as it will allow the parent to explicitly focus the menu
|
|
94
|
-
* button node when that child should receive focus.
|
|
95
|
-
*/
|
|
96
|
-
_rollupPluginBabelHelpers.defineProperty(this, "handleMenuButtonRef", node => {
|
|
97
|
-
const {
|
|
98
|
-
focusRef
|
|
99
|
-
} = this.props;
|
|
100
|
-
// Check if focusRef is a function before calling it
|
|
101
|
-
if (typeof focusRef === 'function') {
|
|
102
|
-
focusRef(node);
|
|
103
|
-
}
|
|
104
|
-
this.menuButtonRef = node;
|
|
105
|
-
});
|
|
106
|
-
/**
|
|
107
|
-
* Handles individual menuitem refs. We assign them to a class instance
|
|
108
|
-
* property so that we can properly manage focus of our children.
|
|
109
|
-
*/
|
|
110
|
-
_rollupPluginBabelHelpers.defineProperty(this, "handleItemRef", index => node => {
|
|
111
|
-
this.items[index] = node;
|
|
112
|
-
});
|
|
113
|
-
_rollupPluginBabelHelpers.defineProperty(this, "handleMenuClose", event => {
|
|
114
|
-
// Handle ESC keydown for closing the expanded menu.
|
|
115
|
-
if (match.matches(event, [keys.Escape]) && this.state.expanded) {
|
|
116
|
-
event.stopPropagation();
|
|
117
|
-
event.preventDefault();
|
|
118
|
-
this.setState(() => ({
|
|
119
|
-
expanded: false,
|
|
120
|
-
selectedIndex: null
|
|
121
|
-
}));
|
|
55
|
+
/**
|
|
56
|
+
* Toggle the expanded state of the menu on click.
|
|
57
|
+
*/
|
|
58
|
+
const handleOnClick = e => {
|
|
59
|
+
if (!subMenusRef.current || e.target instanceof Node && !subMenusRef.current.contains(e.target)) {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
}
|
|
62
|
+
setExpanded(prev => !prev);
|
|
63
|
+
};
|
|
122
64
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Keyboard event handler for the entire menu.
|
|
67
|
+
*/
|
|
68
|
+
const handleOnKeyDown = event => {
|
|
69
|
+
// Handle enter or space key for toggling the expanded state of the menu.
|
|
70
|
+
if (match.matches(event, [keys.Enter, keys.Space])) {
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
setExpanded(prev => !prev);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Handle our blur event from our underlying menuitems. Will mostly be used
|
|
80
|
+
* for closing our menu in response to a user clicking off or tabbing out of
|
|
81
|
+
* the menu or menubar.
|
|
82
|
+
*/
|
|
83
|
+
const handleOnBlur = event => {
|
|
84
|
+
// Close the menu on blur when the related target is not a sibling menu item
|
|
85
|
+
// or a child in a submenu
|
|
86
|
+
const siblingItemBlurredTo = itemRefs.current.find(element => element === event.relatedTarget);
|
|
87
|
+
const childItemBlurredTo = subMenusRef.current?.contains(event.relatedTarget);
|
|
88
|
+
if (!siblingItemBlurredTo && !childItemBlurredTo) {
|
|
89
|
+
setExpanded(false);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Handles individual menuitem refs. We assign them to a class instance
|
|
95
|
+
* property so that we can properly manage focus of our children.
|
|
96
|
+
*/
|
|
97
|
+
const handleItemRef = index => node => {
|
|
98
|
+
itemRefs.current[index] = node;
|
|
99
|
+
};
|
|
100
|
+
const handleMenuClose = event => {
|
|
101
|
+
// Handle ESC keydown for closing the expanded menu.
|
|
102
|
+
if (match.matches(event, [keys.Escape]) && expanded) {
|
|
103
|
+
event.stopPropagation();
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
setExpanded(false);
|
|
106
|
+
|
|
107
|
+
// Return focus to menu button when the user hits ESC.
|
|
108
|
+
if (menuButtonRef.current) {
|
|
109
|
+
menuButtonRef.current.focus();
|
|
141
110
|
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
selectedIndex: null
|
|
149
|
-
};
|
|
150
|
-
this.items = [];
|
|
151
|
-
}
|
|
152
|
-
render() {
|
|
153
|
-
const prefix = this.context;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const hasActiveDescendant = childrenArg => React.Children.toArray(childrenArg).some(child => {
|
|
114
|
+
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
154
117
|
const {
|
|
155
118
|
isActive,
|
|
156
119
|
isCurrentPage,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
renderMenuContent: MenuContent,
|
|
162
|
-
menuLinkName,
|
|
163
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
164
|
-
focusRef,
|
|
165
|
-
onBlur,
|
|
166
|
-
onClick,
|
|
167
|
-
onKeyDown,
|
|
168
|
-
...rest
|
|
169
|
-
} = this.props;
|
|
170
|
-
const hasActiveDescendant = childrenArg => React__default["default"].Children.toArray(childrenArg).some(child => {
|
|
171
|
-
if (! /*#__PURE__*/React__default["default"].isValidElement(child)) {
|
|
172
|
-
return false;
|
|
173
|
-
}
|
|
120
|
+
children
|
|
121
|
+
} = child.props;
|
|
122
|
+
return isActive || isCurrentPage || Array.isArray(children) && hasActiveDescendant(children);
|
|
123
|
+
});
|
|
174
124
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
125
|
+
/**
|
|
126
|
+
* We capture the `ref` for each child inside of `this.items` to properly
|
|
127
|
+
* manage focus. In addition to this focus management, all items receive a
|
|
128
|
+
* `tabIndex: -1` so the user won't hit a large number of items in their tab
|
|
129
|
+
* sequence when they might not want to go through all the items.
|
|
130
|
+
*/
|
|
131
|
+
const renderMenuItem = (item, index) => {
|
|
132
|
+
if (/*#__PURE__*/React.isValidElement(item)) {
|
|
133
|
+
return /*#__PURE__*/React.cloneElement(item, {
|
|
134
|
+
ref: handleItemRef(index)
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return item;
|
|
138
|
+
};
|
|
139
|
+
const accessibilityLabel = {
|
|
140
|
+
'aria-label': ariaLabel,
|
|
141
|
+
'aria-labelledby': ariaLabelledBy
|
|
142
|
+
};
|
|
143
|
+
const itemClassName = cx__default["default"]({
|
|
144
|
+
[`${prefix}--header__submenu`]: true,
|
|
145
|
+
[`${customClassName}`]: !!customClassName
|
|
146
|
+
});
|
|
147
|
+
const isActivePage = isActive ? isActive : isCurrentPage;
|
|
148
|
+
const linkClassName = cx__default["default"]({
|
|
149
|
+
[`${prefix}--header__menu-item`]: true,
|
|
150
|
+
[`${prefix}--header__menu-title`]: true,
|
|
151
|
+
// We set the current class only if `isActive` is passed in and we do
|
|
152
|
+
// not have an `aria-current="page"` set for the breadcrumb item
|
|
153
|
+
[`${prefix}--header__menu-item--current`]: isActivePage || hasActiveDescendant(children) && !expanded
|
|
154
|
+
});
|
|
195
155
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
156
|
+
// Notes on eslint comments and based on the examples in:
|
|
157
|
+
// https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-1/menubar-1.html#
|
|
158
|
+
// - The focus is handled by the <a> menuitem, onMouseOver is for mouse
|
|
159
|
+
// users
|
|
160
|
+
// - aria-haspopup can definitely have the value "menu"
|
|
161
|
+
// - aria-expanded is on their example node with role="menuitem"
|
|
162
|
+
// - href can be set to javascript:void(0), ideally this will be a button
|
|
163
|
+
return /*#__PURE__*/React__default["default"].createElement("li", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
164
|
+
className: itemClassName,
|
|
165
|
+
onKeyDown: events.composeEventHandlers([onKeyDown, handleMenuClose]),
|
|
166
|
+
onClick: events.composeEventHandlers([onClick, handleOnClick]),
|
|
167
|
+
onBlur: events.composeEventHandlers([onBlur, handleOnBlur]),
|
|
168
|
+
ref: ref
|
|
169
|
+
}), /*#__PURE__*/React__default["default"].createElement("a", _rollupPluginBabelHelpers["extends"]({
|
|
170
|
+
// eslint-disable-line jsx-a11y/role-supports-aria-props,jsx-a11y/anchor-is-valid
|
|
171
|
+
"aria-haspopup": "menu" // eslint-disable-line jsx-a11y/aria-proptypes
|
|
172
|
+
,
|
|
173
|
+
"aria-expanded": expanded,
|
|
174
|
+
className: linkClassName,
|
|
175
|
+
href: "#",
|
|
176
|
+
onKeyDown: handleOnKeyDown,
|
|
177
|
+
ref: mergedButtonRef,
|
|
178
|
+
tabIndex: 0
|
|
179
|
+
}, accessibilityLabel), menuLinkName, MenuContent ? /*#__PURE__*/React__default["default"].createElement(MenuContent, null) : /*#__PURE__*/React__default["default"].createElement(iconsReact.ChevronDown, {
|
|
180
|
+
className: `${prefix}--header__menu-arrow`
|
|
181
|
+
})), /*#__PURE__*/React__default["default"].createElement("ul", _rollupPluginBabelHelpers["extends"]({}, accessibilityLabel, {
|
|
182
|
+
ref: subMenusRef,
|
|
183
|
+
className: `${prefix}--header__menu`
|
|
184
|
+
}), React.Children.map(children, renderMenuItem)));
|
|
185
|
+
});
|
|
186
|
+
HeaderMenu.displayName = 'HeaderMenu';
|
|
187
|
+
HeaderMenu.propTypes = {
|
|
228
188
|
/**
|
|
229
189
|
* Required props for the accessibility label of the menu
|
|
230
190
|
*/
|
|
@@ -273,14 +233,7 @@ _rollupPluginBabelHelpers.defineProperty(HeaderMenu, "propTypes", {
|
|
|
273
233
|
* Optionally provide a tabIndex for the underlying menu button
|
|
274
234
|
*/
|
|
275
235
|
tabIndex: PropTypes__default["default"].number
|
|
276
|
-
}
|
|
277
|
-
_rollupPluginBabelHelpers.defineProperty(HeaderMenu, "contextType", usePrefix.PrefixContext);
|
|
278
|
-
const HeaderMenuForwardRef = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => {
|
|
279
|
-
return /*#__PURE__*/React__default["default"].createElement(HeaderMenu, _rollupPluginBabelHelpers["extends"]({}, props, {
|
|
280
|
-
focusRef: ref
|
|
281
|
-
}));
|
|
282
|
-
});
|
|
283
|
-
HeaderMenuForwardRef.displayName = 'HeaderMenu';
|
|
236
|
+
};
|
|
284
237
|
|
|
285
238
|
exports.HeaderMenu = HeaderMenu;
|
|
286
|
-
exports["default"] =
|
|
239
|
+
exports["default"] = HeaderMenu;
|
|
@@ -24,17 +24,16 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
24
24
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
25
25
|
|
|
26
26
|
var _Menu, _Close;
|
|
27
|
-
function HeaderMenuButton(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
27
|
+
function HeaderMenuButton({
|
|
28
|
+
'aria-label': ariaLabel,
|
|
29
|
+
'aria-labelledby': ariaLabelledBy,
|
|
30
|
+
className: customClassName,
|
|
31
|
+
renderMenuIcon,
|
|
32
|
+
renderCloseIcon,
|
|
33
|
+
isActive,
|
|
34
|
+
isCollapsible,
|
|
35
|
+
...rest
|
|
36
|
+
}) {
|
|
38
37
|
const prefix = usePrefix.usePrefix();
|
|
39
38
|
const className = cx__default["default"]({
|
|
40
39
|
...(typeof customClassName === 'string' && {
|
|
@@ -23,18 +23,18 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
23
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
24
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
25
|
|
|
26
|
-
const HeaderMenuItem = /*#__PURE__*/React.forwardRef(function HeaderMenuItem(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} = _ref;
|
|
26
|
+
const HeaderMenuItem = /*#__PURE__*/React.forwardRef(function HeaderMenuItem({
|
|
27
|
+
className,
|
|
28
|
+
isActive,
|
|
29
|
+
isCurrentPage,
|
|
30
|
+
'aria-current': ariaCurrent,
|
|
31
|
+
children,
|
|
32
|
+
role,
|
|
33
|
+
tabIndex,
|
|
34
|
+
...rest
|
|
35
|
+
}, ref) {
|
|
37
36
|
const prefix = usePrefix.usePrefix();
|
|
37
|
+
const resolvedTabIndex = tabIndex ?? 0;
|
|
38
38
|
if (isCurrentPage) {
|
|
39
39
|
isActive = isCurrentPage;
|
|
40
40
|
}
|
|
@@ -53,7 +53,7 @@ const HeaderMenuItem = /*#__PURE__*/React.forwardRef(function HeaderMenuItem(_re
|
|
|
53
53
|
"aria-current": hasCurrentClass ? true : ariaCurrent,
|
|
54
54
|
className: linkClassName,
|
|
55
55
|
ref: ref,
|
|
56
|
-
tabIndex:
|
|
56
|
+
tabIndex: resolvedTabIndex
|
|
57
57
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
58
58
|
className: `${prefix}--text-truncate--end`
|
|
59
59
|
}, children)));
|
|
@@ -22,13 +22,12 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
22
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
23
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
24
|
|
|
25
|
-
function HeaderName(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
25
|
+
function HeaderName({
|
|
26
|
+
children,
|
|
27
|
+
className: customClassName,
|
|
28
|
+
prefix = 'IBM',
|
|
29
|
+
...rest
|
|
30
|
+
}) {
|
|
32
31
|
const selectorPrefix = usePrefix.usePrefix();
|
|
33
32
|
const className = cx__default["default"](`${selectorPrefix}--header__name`, customClassName);
|
|
34
33
|
return /*#__PURE__*/React__default["default"].createElement(Link["default"], _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
@@ -22,14 +22,13 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
22
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
23
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
24
|
|
|
25
|
-
function HeaderNavigation(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
25
|
+
function HeaderNavigation({
|
|
26
|
+
'aria-label': ariaLabel,
|
|
27
|
+
'aria-labelledby': ariaLabelledBy,
|
|
28
|
+
children,
|
|
29
|
+
className: customClassName,
|
|
30
|
+
...rest
|
|
31
|
+
}) {
|
|
33
32
|
const prefix = usePrefix.usePrefix();
|
|
34
33
|
const className = cx__default["default"](`${prefix}--header__nav`, customClassName);
|
|
35
34
|
return /*#__PURE__*/React__default["default"].createElement("nav", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
@@ -26,16 +26,15 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
26
26
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
27
27
|
|
|
28
28
|
const noopFn = () => {};
|
|
29
|
-
const HeaderPanel = /*#__PURE__*/React__default["default"].forwardRef(function HeaderPanel(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} = _ref;
|
|
29
|
+
const HeaderPanel = /*#__PURE__*/React__default["default"].forwardRef(function HeaderPanel({
|
|
30
|
+
children,
|
|
31
|
+
className: customClassName,
|
|
32
|
+
expanded,
|
|
33
|
+
addFocusListeners = true,
|
|
34
|
+
onHeaderPanelFocus = noopFn,
|
|
35
|
+
href,
|
|
36
|
+
...rest
|
|
37
|
+
}, ref) {
|
|
39
38
|
const prefix = usePrefix.usePrefix();
|
|
40
39
|
const headerPanelReference = React.useRef(null);
|
|
41
40
|
const headerPanelRef = useMergedRefs.useMergedRefs([headerPanelReference, ref]);
|
|
@@ -20,12 +20,11 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
20
20
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
21
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
22
|
|
|
23
|
-
function HeaderSideNavItems(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref;
|
|
23
|
+
function HeaderSideNavItems({
|
|
24
|
+
className: customClassName,
|
|
25
|
+
children,
|
|
26
|
+
hasDivider = false
|
|
27
|
+
}) {
|
|
29
28
|
const prefix = usePrefix.usePrefix();
|
|
30
29
|
const className = cx__default["default"]({
|
|
31
30
|
[`${prefix}--side-nav__header-navigation`]: true,
|
|
@@ -21,15 +21,14 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
21
21
|
|
|
22
22
|
// First define the component without generics
|
|
23
23
|
|
|
24
|
-
const LinkBase = (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
24
|
+
const LinkBase = ({
|
|
25
|
+
element,
|
|
26
|
+
as: BaseComponent,
|
|
27
|
+
// Captured here to prevent it from being passed into the created element.
|
|
28
|
+
// See https://github.com/carbon-design-system/carbon/issues/3970
|
|
29
|
+
isSideNavExpanded: _isSideNavExpanded,
|
|
30
|
+
...rest
|
|
31
|
+
}, ref) => {
|
|
33
32
|
const BaseComponentAsAny = BaseComponent ?? element ?? 'a';
|
|
34
33
|
return /*#__PURE__*/React__default["default"].createElement(BaseComponentAsAny, _rollupPluginBabelHelpers["extends"]({
|
|
35
34
|
ref: ref
|
|
@@ -34,29 +34,28 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
34
34
|
// import SideNavFooter from './SideNavFooter';
|
|
35
35
|
|
|
36
36
|
const SideNavContext = /*#__PURE__*/React.createContext({});
|
|
37
|
-
function SideNavRenderFunction(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} = _ref;
|
|
37
|
+
function SideNavRenderFunction({
|
|
38
|
+
expanded: expandedProp,
|
|
39
|
+
defaultExpanded = false,
|
|
40
|
+
isChildOfHeader = true,
|
|
41
|
+
'aria-label': ariaLabel,
|
|
42
|
+
'aria-labelledby': ariaLabelledBy,
|
|
43
|
+
children,
|
|
44
|
+
onToggle,
|
|
45
|
+
className: customClassName,
|
|
46
|
+
// TO-DO: comment back in when footer is added for rails
|
|
47
|
+
// translateById: t = (id) => translations[id],
|
|
48
|
+
href,
|
|
49
|
+
isFixedNav = false,
|
|
50
|
+
isRail,
|
|
51
|
+
isPersistent = true,
|
|
52
|
+
addFocusListeners = true,
|
|
53
|
+
addMouseListeners = true,
|
|
54
|
+
onOverlayClick,
|
|
55
|
+
onSideNavBlur,
|
|
56
|
+
enterDelayMs = 100,
|
|
57
|
+
...other
|
|
58
|
+
}, ref) {
|
|
60
59
|
const prefix = usePrefix.usePrefix();
|
|
61
60
|
const {
|
|
62
61
|
current: controlled
|
|
@@ -66,8 +65,7 @@ function SideNavRenderFunction(_ref, ref) {
|
|
|
66
65
|
const expanded = controlled ? expandedProp : expandedState;
|
|
67
66
|
const sideNavRef = React.useRef(null);
|
|
68
67
|
const navRef = useMergedRefs.useMergedRefs([sideNavRef, ref]);
|
|
69
|
-
const handleToggle =
|
|
70
|
-
let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !expanded;
|
|
68
|
+
const handleToggle = (event, value = !expanded) => {
|
|
71
69
|
if (!controlled) {
|
|
72
70
|
setExpandedState(value, enterDelayMs);
|
|
73
71
|
}
|
|
@@ -21,13 +21,12 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
21
21
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
23
|
|
|
24
|
-
const SideNavDetails =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} = _ref;
|
|
24
|
+
const SideNavDetails = ({
|
|
25
|
+
children,
|
|
26
|
+
className: customClassName,
|
|
27
|
+
title,
|
|
28
|
+
...rest
|
|
29
|
+
}) => {
|
|
31
30
|
const prefix = usePrefix.usePrefix();
|
|
32
31
|
const className = cx__default["default"](`${prefix}--side-nav__details`, customClassName);
|
|
33
32
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|