@carbon/react 1.27.0 → 1.28.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 +1 -313
- package/es/components/Accordion/Accordion.Skeleton.js +28 -30
- package/es/components/Accordion/Accordion.js +18 -21
- package/es/components/Accordion/AccordionItem.js +37 -49
- package/es/components/AspectRatio/AspectRatio.js +10 -12
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +10 -11
- package/es/components/Breadcrumb/Breadcrumb.js +14 -13
- package/es/components/Breadcrumb/BreadcrumbItem.js +24 -22
- package/es/components/Button/Button.Skeleton.js +25 -23
- package/es/components/Button/Button.js +77 -72
- package/es/components/ButtonSet/ButtonSet.js +12 -10
- package/es/components/Checkbox/Checkbox.Skeleton.js +10 -11
- package/es/components/Checkbox/Checkbox.js +55 -52
- package/es/components/CheckboxGroup/CheckboxGroup.js +33 -31
- package/es/components/ClassPrefix/index.js +4 -2
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +15 -14
- package/es/components/CodeSnippet/CodeSnippet.js +199 -102
- package/es/components/ComboBox/ComboBox.js +349 -178
- package/es/components/ComboBox/tools/filter.js +6 -4
- package/es/components/ComboButton/index.js +38 -43
- package/es/components/ComposedModal/ComposedModal.js +187 -85
- package/es/components/ComposedModal/ModalFooter.js +54 -49
- package/es/components/ComposedModal/ModalHeader.js +39 -26
- package/es/components/ContainedList/ContainedList.js +18 -17
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +20 -18
- package/es/components/ContentSwitcher/ContentSwitcher.js +83 -98
- package/es/components/ContentSwitcher/index.js +1 -1
- package/es/components/ContextMenu/useContextMenu.js +12 -21
- package/es/components/Copy/Copy.js +24 -29
- package/es/components/CopyButton/CopyButton.js +10 -10
- package/es/components/DangerButton/DangerButton.js +3 -5
- package/es/components/DataTable/DataTable.js +334 -361
- package/es/components/DataTable/Table.js +29 -26
- package/es/components/DataTable/TableActionList.js +2 -4
- package/es/components/DataTable/TableBatchAction.js +2 -4
- package/es/components/DataTable/TableBatchActions.js +29 -30
- package/es/components/DataTable/TableBody.js +7 -8
- package/es/components/DataTable/TableCell.js +1 -1
- package/es/components/DataTable/TableContainer.js +23 -23
- package/es/components/DataTable/TableContext.js +1 -1
- package/es/components/DataTable/TableExpandHeader.js +19 -21
- package/es/components/DataTable/TableExpandRow.js +23 -23
- package/es/components/DataTable/TableExpandedRow.js +18 -23
- package/es/components/DataTable/TableHead.js +1 -1
- package/es/components/DataTable/TableHeader.js +45 -41
- package/es/components/DataTable/TableRow.js +7 -8
- package/es/components/DataTable/TableSelectAll.js +13 -11
- package/es/components/DataTable/TableSelectRow.js +29 -21
- package/es/components/DataTable/TableToolbar.js +19 -14
- package/es/components/DataTable/TableToolbarAction.js +6 -6
- package/es/components/DataTable/TableToolbarContent.js +2 -4
- package/es/components/DataTable/TableToolbarMenu.js +11 -12
- package/es/components/DataTable/TableToolbarSearch.js +52 -71
- package/es/components/DataTable/state/getDerivedStateFromProps.js +15 -15
- package/es/components/DataTable/state/sortStates.js +1 -1
- package/es/components/DataTable/state/sorting.js +28 -20
- package/es/components/DataTable/tools/cells.js +1 -3
- package/es/components/DataTable/tools/denormalize.js +4 -17
- package/es/components/DataTable/tools/filter.js +18 -16
- package/es/components/DataTable/tools/instanceId.js +2 -2
- package/es/components/DataTable/tools/normalize.js +28 -25
- package/es/components/DataTable/tools/sorting.js +28 -25
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +36 -38
- package/es/components/DatePicker/DatePicker.Skeleton.js +17 -18
- package/es/components/DatePicker/DatePicker.js +206 -195
- package/es/components/DatePicker/plugins/appendToPlugin.js +45 -43
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +117 -107
- package/es/components/DatePicker/plugins/rangePlugin.js +19 -11
- package/es/components/DatePickerInput/DatePickerInput.js +83 -74
- package/es/components/Dropdown/Dropdown.Skeleton.js +13 -12
- package/es/components/Dropdown/Dropdown.js +266 -109
- package/es/components/ErrorBoundary/ErrorBoundary.js +27 -48
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +3 -2
- package/es/components/ExpandableSearch/ExpandableSearch.d.ts +13 -0
- package/es/components/ExpandableSearch/ExpandableSearch.js +18 -25
- package/es/components/FeatureFlags/index.js +25 -43
- package/es/components/FileUploader/FileUploader.Skeleton.js +8 -9
- package/es/components/FileUploader/FileUploader.js +120 -147
- package/es/components/FileUploader/FileUploaderButton.js +36 -48
- package/es/components/FileUploader/FileUploaderDropContainer.js +49 -53
- package/es/components/FileUploader/FileUploaderItem.js +30 -30
- package/es/components/FileUploader/Filename.js +13 -14
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +11 -12
- package/es/components/FluidComboBox/FluidComboBox.js +11 -9
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +18 -18
- package/es/components/FluidDatePicker/FluidDatePicker.js +19 -16
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +11 -12
- package/es/components/FluidDropdown/FluidDropdown.js +11 -9
- package/es/components/FluidForm/FluidForm.js +9 -10
- package/es/components/FluidForm/FormContext.js +1 -1
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +11 -12
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +12 -10
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +11 -12
- package/es/components/FluidSelect/FluidSelect.js +9 -9
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +9 -10
- package/es/components/FluidTextArea/FluidTextArea.js +7 -8
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +9 -10
- package/es/components/FluidTextInput/FluidTextInput.js +10 -9
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +11 -10
- package/es/components/FluidTimePicker/FluidTimePicker.js +30 -26
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +7 -7
- package/es/components/Form/Form.js +9 -10
- package/es/components/FormGroup/FormGroup.js +16 -17
- package/es/components/FormItem/FormItem.js +8 -9
- package/es/components/FormLabel/FormLabel.js +11 -10
- package/es/components/Grid/CSSGrid.js +38 -39
- package/es/components/Grid/Column.js +86 -79
- package/es/components/Grid/ColumnHang.js +12 -14
- package/es/components/Grid/FlexGrid.js +19 -21
- package/es/components/Grid/Grid.js +2 -2
- package/es/components/Grid/GridContext.js +12 -11
- package/es/components/Grid/Row.js +16 -18
- package/es/components/Heading/index.js +11 -13
- package/es/components/Icon/Icon.Skeleton.js +10 -12
- package/es/components/IconButton/index.js +19 -22
- package/es/components/IdPrefix/index.js +4 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +89 -36
- package/es/components/InlineLoading/InlineLoading.js +23 -25
- package/es/components/Layer/LayerContext.js +1 -1
- package/es/components/Layer/index.js +17 -18
- package/es/components/Layout/LayoutDirection.js +8 -10
- package/es/components/Layout/LayoutDirectionContext.js +1 -1
- package/es/components/Link/Link.js +25 -25
- package/es/components/ListBox/ListBox.js +38 -31
- package/es/components/ListBox/ListBoxField.js +9 -10
- package/es/components/ListBox/ListBoxMenu.js +9 -10
- package/es/components/ListBox/ListBoxMenuIcon.js +16 -14
- package/es/components/ListBox/ListBoxMenuItem.js +23 -26
- package/es/components/ListBox/ListBoxPropTypes.js +4 -4
- package/es/components/ListBox/ListBoxSelection.js +30 -25
- package/es/components/ListBox/index.js +1 -1
- package/es/components/ListBox/next/ListBoxSelection.js +27 -24
- package/es/components/ListBox/next/ListBoxTrigger.js +20 -19
- package/es/components/ListItem/ListItem.js +9 -10
- package/es/components/Loading/Loading.js +24 -24
- package/es/components/Menu/Menu.js +67 -80
- package/es/components/Menu/MenuContext.js +9 -12
- package/es/components/Menu/MenuItem.js +104 -128
- package/es/components/MenuButton/index.js +37 -41
- package/es/components/Modal/Modal.js +281 -120
- package/es/components/ModalWrapper/ModalWrapper.js +72 -96
- package/es/components/MultiSelect/FilterableMultiSelect.js +299 -163
- package/es/components/MultiSelect/MultiSelect.js +162 -174
- package/es/components/MultiSelect/MultiSelectPropTypes.js +1 -1
- package/es/components/MultiSelect/tools/itemToString.js +3 -4
- package/es/components/MultiSelect/tools/sorting.js +15 -13
- package/es/components/Notification/Notification.js +436 -164
- package/es/components/NumberInput/NumberInput.Skeleton.js +10 -11
- package/es/components/NumberInput/NumberInput.js +140 -139
- package/es/components/OrderedList/OrderedList.js +17 -15
- package/es/components/OverflowMenu/OverflowMenu.js +359 -227
- package/es/components/OverflowMenu/index.js +1 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +32 -37
- package/es/components/OverflowMenuV2/index.js +26 -28
- package/es/components/Pagination/Pagination.Skeleton.js +9 -10
- package/es/components/Pagination/Pagination.js +98 -140
- package/es/components/Pagination/experimental/PageSelector.js +16 -16
- package/es/components/Pagination/experimental/Pagination.js +73 -94
- package/es/components/PaginationNav/PaginationNav.js +98 -117
- package/es/components/Popover/index.js +74 -80
- package/es/components/PrimaryButton/PrimaryButton.js +3 -5
- package/es/components/ProgressBar/ProgressBar.js +39 -37
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +15 -14
- package/es/components/ProgressIndicator/ProgressIndicator.js +71 -71
- package/es/components/RadioButton/RadioButton.Skeleton.js +9 -10
- package/es/components/RadioButton/RadioButton.js +27 -27
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +55 -65
- package/es/components/RadioTile/RadioTile.js +27 -25
- package/es/components/Search/Search.Skeleton.js +16 -16
- package/es/components/Search/Search.d.ts +83 -0
- package/es/components/Search/Search.js +65 -72
- package/es/components/Search/index.d.ts +11 -0
- package/es/components/SecondaryButton/SecondaryButton.js +3 -5
- package/es/components/Select/Select.Skeleton.js +12 -13
- package/es/components/Select/Select.js +79 -73
- package/es/components/SelectItem/SelectItem.js +17 -13
- package/es/components/SelectItemGroup/SelectItemGroup.js +11 -12
- package/es/components/SkeletonIcon/SkeletonIcon.js +11 -11
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +11 -11
- package/es/components/SkeletonText/SkeletonText.js +29 -29
- package/es/components/Slider/Slider.Skeleton.js +17 -18
- package/es/components/Slider/Slider.js +306 -329
- package/es/components/Slider/index.js +1 -1
- package/es/components/Stack/Stack.js +19 -20
- package/es/components/Stack/index.js +2 -2
- package/es/components/StructuredList/StructuredList.Skeleton.js +25 -24
- package/es/components/StructuredList/StructuredList.js +134 -106
- package/es/components/Switch/IconSwitch.js +48 -54
- package/es/components/Switch/Switch.js +33 -31
- package/es/components/Tab/Tab.js +77 -83
- package/es/components/Tab/index.js +1 -1
- package/es/components/TabContent/TabContent.js +16 -18
- package/es/components/Tabs/Tabs.Skeleton.js +14 -13
- package/es/components/Tabs/Tabs.js +195 -206
- package/es/components/Tabs/usePressable.js +27 -36
- package/es/components/Tag/Tag.Skeleton.js +10 -9
- package/es/components/Tag/Tag.js +34 -31
- package/es/components/Text/Text.js +20 -20
- package/es/components/Text/TextDirection.js +8 -7
- package/es/components/Text/TextDirectionContext.js +1 -1
- package/es/components/Text/index.js +1 -1
- package/es/components/TextArea/TextArea.Skeleton.js +11 -12
- package/es/components/TextArea/TextArea.js +89 -83
- package/es/components/TextInput/ControlledPasswordInput.js +79 -73
- package/es/components/TextInput/PasswordInput.js +101 -91
- package/es/components/TextInput/TextInput.Skeleton.js +11 -12
- package/es/components/TextInput/TextInput.js +104 -92
- package/es/components/TextInput/util.js +26 -28
- package/es/components/Theme/index.js +25 -20
- package/es/components/Tile/Tile.js +135 -176
- package/es/components/TileGroup/TileGroup.js +55 -70
- package/es/components/TileGroup/index.js +1 -1
- package/es/components/TimePicker/TimePicker.js +60 -67
- package/es/components/TimePickerSelect/TimePickerSelect.js +20 -18
- package/es/components/TimePickerSelect/index.js +1 -1
- package/es/components/Toggle/Toggle.Skeleton.js +63 -52
- package/es/components/Toggle/Toggle.js +44 -48
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +56 -50
- package/es/components/Toggletip/index.js +52 -48
- package/es/components/Tooltip/DefinitionTooltip.js +24 -31
- package/es/components/Tooltip/Tooltip.js +35 -50
- package/es/components/TreeView/TreeNode.js +94 -74
- package/es/components/TreeView/TreeView.js +72 -83
- package/es/components/UIShell/Content.js +12 -14
- package/es/components/UIShell/Header.js +16 -12
- package/es/components/UIShell/HeaderContainer.js +8 -14
- package/es/components/UIShell/HeaderGlobalAction.js +26 -19
- package/es/components/UIShell/HeaderGlobalBar.js +1 -3
- package/es/components/UIShell/HeaderMenu.js +114 -129
- package/es/components/UIShell/HeaderMenuButton.js +31 -22
- package/es/components/UIShell/HeaderMenuItem.js +28 -20
- package/es/components/UIShell/HeaderName.js +19 -14
- package/es/components/UIShell/HeaderNavigation.js +19 -15
- package/es/components/UIShell/HeaderPanel.js +23 -17
- package/es/components/UIShell/HeaderSideNavItems.js +11 -9
- package/es/components/UIShell/Link.js +11 -11
- package/es/components/UIShell/SideNav.js +66 -62
- package/es/components/UIShell/SideNavDetails.js +11 -12
- package/es/components/UIShell/SideNavDivider.js +5 -3
- package/es/components/UIShell/SideNavFooter.js +12 -12
- package/es/components/UIShell/SideNavHeader.js +8 -6
- package/es/components/UIShell/SideNavIcon.js +11 -8
- package/es/components/UIShell/SideNavItem.js +11 -9
- package/es/components/UIShell/SideNavItems.js +13 -11
- package/es/components/UIShell/SideNavLink.js +19 -17
- package/es/components/UIShell/SideNavLinkText.js +8 -9
- package/es/components/UIShell/SideNavMenu.js +28 -35
- package/es/components/UIShell/SideNavMenuItem.js +14 -14
- package/es/components/UIShell/SideNavSwitcher.js +19 -19
- package/es/components/UIShell/SkipToContent.js +10 -11
- package/es/components/UIShell/Switcher.js +20 -11
- package/es/components/UIShell/SwitcherDivider.js +10 -9
- package/es/components/UIShell/SwitcherItem.js +26 -19
- package/es/components/UIShell/_utils.js +1 -1
- package/es/components/UnorderedList/UnorderedList.js +14 -14
- package/es/index.js +5 -5
- package/es/internal/ClickListener.js +49 -65
- package/es/internal/FloatingMenu.js +193 -200
- package/es/internal/OptimizedResize.js +9 -8
- package/es/internal/Selection.js +92 -111
- package/es/internal/createClassWrapper.js +2 -2
- package/es/internal/deprecateFieldOnObject.js +5 -3
- package/es/internal/environment.js +1 -1
- package/es/internal/focus/index.js +1 -1
- package/es/internal/keyboard/keys.js +11 -11
- package/es/internal/keyboard/match.js +7 -6
- package/es/internal/keyboard/navigation.js +15 -5
- package/es/internal/useAnnouncer.js +2 -2
- package/es/internal/useAttachedMenu.js +12 -20
- package/es/internal/useControllableState.js +11 -16
- package/es/internal/useDelayedState.js +9 -18
- package/es/internal/useEffectOnce.js +4 -4
- package/es/internal/useEvent.js +4 -4
- package/es/internal/useId.js +15 -19
- package/es/internal/useIdPrefix.js +1 -1
- package/es/internal/useIsomorphicEffect.js +1 -1
- package/es/internal/useMergedRefs.js +3 -3
- package/es/internal/useNoInteractiveChildren.js +8 -19
- package/es/internal/useNormalizedInputProps.js +16 -14
- package/es/internal/usePrefix.js +1 -1
- package/es/internal/useSavedCallback.js +3 -3
- package/es/internal/warning.js +4 -4
- package/es/internal/wrapFocus.js +16 -21
- package/es/prop-types/AriaPropTypes.js +1 -1
- package/es/prop-types/deprecate.js +6 -5
- package/es/prop-types/isRequiredOneOf.js +12 -25
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +2 -2
- package/es/prop-types/types.js +1 -1
- package/es/tools/array.js +1 -1
- package/es/tools/events.js +21 -14
- package/es/tools/mergeRefs.js +3 -3
- package/es/tools/setupGetInstanceId.js +1 -1
- package/es/tools/uniqueId.js +3 -3
- package/es/tools/wrapComponent.js +14 -13
- package/lib/_virtual/_rollupPluginBabelHelpers.js +0 -336
- package/lib/components/Accordion/Accordion.Skeleton.js +27 -29
- package/lib/components/Accordion/Accordion.js +17 -20
- package/lib/components/Accordion/AccordionItem.js +36 -48
- package/lib/components/AspectRatio/AspectRatio.js +9 -11
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +9 -10
- package/lib/components/Breadcrumb/Breadcrumb.js +13 -12
- package/lib/components/Breadcrumb/BreadcrumbItem.js +23 -21
- package/lib/components/Button/Button.Skeleton.js +24 -22
- package/lib/components/Button/Button.js +76 -71
- package/lib/components/ButtonSet/ButtonSet.js +11 -9
- package/lib/components/Checkbox/Checkbox.Skeleton.js +9 -10
- package/lib/components/Checkbox/Checkbox.js +54 -51
- package/lib/components/CheckboxGroup/CheckboxGroup.js +32 -30
- package/lib/components/ClassPrefix/index.js +4 -2
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +14 -13
- package/lib/components/CodeSnippet/CodeSnippet.js +198 -101
- package/lib/components/ComboBox/ComboBox.js +348 -177
- package/lib/components/ComboBox/tools/filter.js +6 -4
- package/lib/components/ComboButton/index.js +37 -42
- package/lib/components/ComposedModal/ComposedModal.js +187 -85
- package/lib/components/ComposedModal/ModalFooter.js +53 -48
- package/lib/components/ComposedModal/ModalHeader.js +38 -25
- package/lib/components/ContainedList/ContainedList.js +18 -17
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +20 -18
- package/lib/components/ContentSwitcher/ContentSwitcher.js +82 -97
- package/lib/components/ContentSwitcher/index.js +1 -1
- package/lib/components/ContextMenu/useContextMenu.js +12 -21
- package/lib/components/Copy/Copy.js +23 -28
- package/lib/components/CopyButton/CopyButton.js +9 -9
- package/lib/components/DangerButton/DangerButton.js +3 -5
- package/lib/components/DataTable/DataTable.js +332 -359
- package/lib/components/DataTable/Table.js +28 -25
- package/lib/components/DataTable/TableActionList.js +2 -4
- package/lib/components/DataTable/TableBatchAction.js +2 -4
- package/lib/components/DataTable/TableBatchActions.js +28 -29
- package/lib/components/DataTable/TableBody.js +6 -7
- package/lib/components/DataTable/TableCell.js +1 -1
- package/lib/components/DataTable/TableContainer.js +22 -22
- package/lib/components/DataTable/TableContext.js +1 -1
- package/lib/components/DataTable/TableExpandHeader.js +18 -20
- package/lib/components/DataTable/TableExpandRow.js +22 -22
- package/lib/components/DataTable/TableExpandedRow.js +17 -22
- package/lib/components/DataTable/TableHead.js +1 -1
- package/lib/components/DataTable/TableHeader.js +43 -39
- package/lib/components/DataTable/TableRow.js +7 -8
- package/lib/components/DataTable/TableSelectAll.js +13 -11
- package/lib/components/DataTable/TableSelectRow.js +28 -20
- package/lib/components/DataTable/TableToolbar.js +18 -13
- package/lib/components/DataTable/TableToolbarAction.js +5 -5
- package/lib/components/DataTable/TableToolbarContent.js +2 -4
- package/lib/components/DataTable/TableToolbarMenu.js +10 -11
- package/lib/components/DataTable/TableToolbarSearch.js +51 -70
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +15 -15
- package/lib/components/DataTable/state/sortStates.js +1 -1
- package/lib/components/DataTable/state/sorting.js +28 -20
- package/lib/components/DataTable/tools/cells.js +1 -3
- package/lib/components/DataTable/tools/denormalize.js +4 -17
- package/lib/components/DataTable/tools/filter.js +18 -16
- package/lib/components/DataTable/tools/instanceId.js +2 -2
- package/lib/components/DataTable/tools/normalize.js +28 -25
- package/lib/components/DataTable/tools/sorting.js +27 -24
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +35 -37
- package/lib/components/DatePicker/DatePicker.Skeleton.js +16 -17
- package/lib/components/DatePicker/DatePicker.js +205 -194
- package/lib/components/DatePicker/plugins/appendToPlugin.js +45 -43
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +117 -107
- package/lib/components/DatePicker/plugins/rangePlugin.js +19 -11
- package/lib/components/DatePickerInput/DatePickerInput.js +83 -74
- package/lib/components/Dropdown/Dropdown.Skeleton.js +12 -11
- package/lib/components/Dropdown/Dropdown.js +265 -108
- package/lib/components/ErrorBoundary/ErrorBoundary.js +27 -48
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +3 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.d.ts +13 -0
- package/lib/components/ExpandableSearch/ExpandableSearch.js +17 -24
- package/lib/components/FeatureFlags/index.js +25 -43
- package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -8
- package/lib/components/FileUploader/FileUploader.js +119 -146
- package/lib/components/FileUploader/FileUploaderButton.js +35 -47
- package/lib/components/FileUploader/FileUploaderDropContainer.js +48 -52
- package/lib/components/FileUploader/FileUploaderItem.js +29 -29
- package/lib/components/FileUploader/Filename.js +12 -13
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +10 -11
- package/lib/components/FluidComboBox/FluidComboBox.js +10 -8
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +17 -17
- package/lib/components/FluidDatePicker/FluidDatePicker.js +18 -15
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +10 -11
- package/lib/components/FluidDropdown/FluidDropdown.js +10 -8
- package/lib/components/FluidForm/FluidForm.js +8 -9
- package/lib/components/FluidForm/FormContext.js +1 -1
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +10 -11
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +11 -9
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +10 -11
- package/lib/components/FluidSelect/FluidSelect.js +8 -8
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +8 -9
- package/lib/components/FluidTextArea/FluidTextArea.js +6 -7
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +8 -9
- package/lib/components/FluidTextInput/FluidTextInput.js +9 -8
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +10 -9
- package/lib/components/FluidTimePicker/FluidTimePicker.js +30 -26
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +6 -6
- package/lib/components/Form/Form.js +8 -9
- package/lib/components/FormGroup/FormGroup.js +15 -16
- package/lib/components/FormItem/FormItem.js +7 -8
- package/lib/components/FormLabel/FormLabel.js +10 -9
- package/lib/components/Grid/CSSGrid.js +37 -38
- package/lib/components/Grid/Column.js +85 -78
- package/lib/components/Grid/ColumnHang.js +11 -13
- package/lib/components/Grid/FlexGrid.js +19 -21
- package/lib/components/Grid/Grid.js +2 -2
- package/lib/components/Grid/GridContext.js +12 -11
- package/lib/components/Grid/Row.js +16 -18
- package/lib/components/Heading/index.js +11 -13
- package/lib/components/Icon/Icon.Skeleton.js +9 -11
- package/lib/components/IconButton/index.js +18 -21
- package/lib/components/IdPrefix/index.js +4 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +89 -36
- package/lib/components/InlineLoading/InlineLoading.js +22 -24
- package/lib/components/Layer/LayerContext.js +1 -1
- package/lib/components/Layer/index.js +16 -17
- package/lib/components/Layout/LayoutDirection.js +7 -9
- package/lib/components/Layout/LayoutDirectionContext.js +1 -1
- package/lib/components/Link/Link.js +24 -24
- package/lib/components/ListBox/ListBox.js +37 -30
- package/lib/components/ListBox/ListBoxField.js +8 -9
- package/lib/components/ListBox/ListBoxMenu.js +8 -9
- package/lib/components/ListBox/ListBoxMenuIcon.js +16 -14
- package/lib/components/ListBox/ListBoxMenuItem.js +22 -25
- package/lib/components/ListBox/ListBoxPropTypes.js +4 -4
- package/lib/components/ListBox/ListBoxSelection.js +30 -25
- package/lib/components/ListBox/index.js +1 -1
- package/lib/components/ListBox/next/ListBoxSelection.js +26 -23
- package/lib/components/ListBox/next/ListBoxTrigger.js +19 -18
- package/lib/components/ListItem/ListItem.js +8 -9
- package/lib/components/Loading/Loading.js +23 -23
- package/lib/components/Menu/Menu.js +66 -79
- package/lib/components/Menu/MenuContext.js +9 -12
- package/lib/components/Menu/MenuItem.js +103 -127
- package/lib/components/MenuButton/index.js +36 -40
- package/lib/components/Modal/Modal.js +280 -119
- package/lib/components/ModalWrapper/ModalWrapper.js +71 -95
- package/lib/components/MultiSelect/FilterableMultiSelect.js +298 -162
- package/lib/components/MultiSelect/MultiSelect.js +163 -175
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +1 -1
- package/lib/components/MultiSelect/tools/itemToString.js +3 -4
- package/lib/components/MultiSelect/tools/sorting.js +15 -13
- package/lib/components/Notification/Notification.js +434 -162
- package/lib/components/NumberInput/NumberInput.Skeleton.js +9 -10
- package/lib/components/NumberInput/NumberInput.js +139 -138
- package/lib/components/OrderedList/OrderedList.js +16 -14
- package/lib/components/OverflowMenu/OverflowMenu.js +358 -226
- package/lib/components/OverflowMenu/index.js +1 -1
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +31 -36
- package/lib/components/OverflowMenuV2/index.js +25 -27
- package/lib/components/Pagination/Pagination.Skeleton.js +8 -9
- package/lib/components/Pagination/Pagination.js +97 -139
- package/lib/components/Pagination/experimental/PageSelector.js +17 -17
- package/lib/components/Pagination/experimental/Pagination.js +72 -93
- package/lib/components/PaginationNav/PaginationNav.js +97 -116
- package/lib/components/Popover/index.js +73 -79
- package/lib/components/PrimaryButton/PrimaryButton.js +3 -5
- package/lib/components/ProgressBar/ProgressBar.js +38 -36
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +14 -13
- package/lib/components/ProgressIndicator/ProgressIndicator.js +70 -70
- package/lib/components/RadioButton/RadioButton.Skeleton.js +8 -9
- package/lib/components/RadioButton/RadioButton.js +26 -26
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +54 -64
- package/lib/components/RadioTile/RadioTile.js +26 -24
- package/lib/components/Search/Search.Skeleton.js +15 -15
- package/lib/components/Search/Search.d.ts +83 -0
- package/lib/components/Search/Search.js +62 -69
- package/lib/components/Search/index.d.ts +11 -0
- package/lib/components/SecondaryButton/SecondaryButton.js +3 -5
- package/lib/components/Select/Select.Skeleton.js +11 -12
- package/lib/components/Select/Select.js +78 -72
- package/lib/components/SelectItem/SelectItem.js +16 -12
- package/lib/components/SelectItemGroup/SelectItemGroup.js +10 -11
- package/lib/components/SkeletonIcon/SkeletonIcon.js +10 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +10 -10
- package/lib/components/SkeletonText/SkeletonText.js +28 -28
- package/lib/components/Slider/Slider.Skeleton.js +16 -17
- package/lib/components/Slider/Slider.js +305 -328
- package/lib/components/Slider/index.js +1 -1
- package/lib/components/Stack/Stack.js +18 -19
- package/lib/components/Stack/index.js +2 -2
- package/lib/components/StructuredList/StructuredList.Skeleton.js +24 -23
- package/lib/components/StructuredList/StructuredList.js +133 -105
- package/lib/components/Switch/IconSwitch.js +45 -51
- package/lib/components/Switch/Switch.js +33 -31
- package/lib/components/Tab/Tab.js +76 -82
- package/lib/components/Tab/index.js +1 -1
- package/lib/components/TabContent/TabContent.js +15 -17
- package/lib/components/Tabs/Tabs.Skeleton.js +13 -12
- package/lib/components/Tabs/Tabs.js +194 -205
- package/lib/components/Tabs/usePressable.js +27 -36
- package/lib/components/Tag/Tag.Skeleton.js +9 -8
- package/lib/components/Tag/Tag.js +33 -30
- package/lib/components/Text/Text.js +19 -19
- package/lib/components/Text/TextDirection.js +8 -7
- package/lib/components/Text/TextDirectionContext.js +1 -1
- package/lib/components/Text/index.js +1 -1
- package/lib/components/TextArea/TextArea.Skeleton.js +10 -11
- package/lib/components/TextArea/TextArea.js +88 -82
- package/lib/components/TextInput/ControlledPasswordInput.js +78 -72
- package/lib/components/TextInput/PasswordInput.js +100 -90
- package/lib/components/TextInput/TextInput.Skeleton.js +10 -11
- package/lib/components/TextInput/TextInput.js +104 -92
- package/lib/components/TextInput/util.js +28 -30
- package/lib/components/Theme/index.js +24 -19
- package/lib/components/Tile/Tile.js +134 -175
- package/lib/components/TileGroup/TileGroup.js +54 -69
- package/lib/components/TileGroup/index.js +1 -1
- package/lib/components/TimePicker/TimePicker.js +59 -66
- package/lib/components/TimePickerSelect/TimePickerSelect.js +19 -17
- package/lib/components/TimePickerSelect/index.js +1 -1
- package/lib/components/Toggle/Toggle.Skeleton.js +68 -57
- package/lib/components/Toggle/Toggle.js +43 -47
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +60 -54
- package/lib/components/Toggletip/index.js +51 -47
- package/lib/components/Tooltip/DefinitionTooltip.js +23 -30
- package/lib/components/Tooltip/Tooltip.js +34 -49
- package/lib/components/TreeView/TreeNode.js +93 -73
- package/lib/components/TreeView/TreeView.js +71 -82
- package/lib/components/UIShell/Content.js +12 -14
- package/lib/components/UIShell/Header.js +15 -11
- package/lib/components/UIShell/HeaderContainer.js +8 -14
- package/lib/components/UIShell/HeaderGlobalAction.js +25 -18
- package/lib/components/UIShell/HeaderGlobalBar.js +1 -3
- package/lib/components/UIShell/HeaderMenu.js +113 -128
- package/lib/components/UIShell/HeaderMenuButton.js +30 -21
- package/lib/components/UIShell/HeaderMenuItem.js +27 -19
- package/lib/components/UIShell/HeaderName.js +18 -13
- package/lib/components/UIShell/HeaderNavigation.js +18 -14
- package/lib/components/UIShell/HeaderPanel.js +22 -16
- package/lib/components/UIShell/HeaderSideNavItems.js +11 -9
- package/lib/components/UIShell/Link.js +11 -11
- package/lib/components/UIShell/SideNav.js +65 -61
- package/lib/components/UIShell/SideNavDetails.js +10 -11
- package/lib/components/UIShell/SideNavDivider.js +5 -3
- package/lib/components/UIShell/SideNavFooter.js +12 -12
- package/lib/components/UIShell/SideNavHeader.js +8 -6
- package/lib/components/UIShell/SideNavIcon.js +11 -8
- package/lib/components/UIShell/SideNavItem.js +11 -9
- package/lib/components/UIShell/SideNavItems.js +13 -11
- package/lib/components/UIShell/SideNavLink.js +18 -16
- package/lib/components/UIShell/SideNavLinkText.js +7 -8
- package/lib/components/UIShell/SideNavMenu.js +28 -35
- package/lib/components/UIShell/SideNavMenuItem.js +13 -13
- package/lib/components/UIShell/SideNavSwitcher.js +19 -19
- package/lib/components/UIShell/SkipToContent.js +9 -10
- package/lib/components/UIShell/Switcher.js +19 -10
- package/lib/components/UIShell/SwitcherDivider.js +9 -8
- package/lib/components/UIShell/SwitcherItem.js +25 -18
- package/lib/components/UIShell/_utils.js +1 -1
- package/lib/components/UnorderedList/UnorderedList.js +13 -13
- package/lib/index.js +10 -10
- package/lib/internal/ClickListener.js +49 -65
- package/lib/internal/FloatingMenu.js +192 -199
- package/lib/internal/OptimizedResize.js +9 -8
- package/lib/internal/Selection.js +91 -110
- package/lib/internal/createClassWrapper.js +2 -2
- package/lib/internal/deprecateFieldOnObject.js +5 -3
- package/lib/internal/environment.js +1 -1
- package/lib/internal/focus/index.js +1 -1
- package/lib/internal/keyboard/keys.js +11 -11
- package/lib/internal/keyboard/match.js +7 -6
- package/lib/internal/keyboard/navigation.js +15 -5
- package/lib/internal/useAnnouncer.js +2 -2
- package/lib/internal/useAttachedMenu.js +12 -20
- package/lib/internal/useControllableState.js +11 -16
- package/lib/internal/useDelayedState.js +9 -18
- package/lib/internal/useEffectOnce.js +4 -4
- package/lib/internal/useEvent.js +4 -4
- package/lib/internal/useId.js +14 -18
- package/lib/internal/useIdPrefix.js +1 -1
- package/lib/internal/useIsomorphicEffect.js +1 -1
- package/lib/internal/useMergedRefs.js +3 -3
- package/lib/internal/useNoInteractiveChildren.js +8 -19
- package/lib/internal/useNormalizedInputProps.js +16 -14
- package/lib/internal/usePrefix.js +1 -1
- package/lib/internal/useSavedCallback.js +3 -3
- package/lib/internal/warning.js +4 -4
- package/lib/internal/wrapFocus.js +16 -21
- package/lib/prop-types/AriaPropTypes.js +1 -1
- package/lib/prop-types/deprecate.js +6 -5
- package/lib/prop-types/isRequiredOneOf.js +15 -28
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +2 -2
- package/lib/prop-types/types.js +1 -1
- package/lib/tools/array.js +1 -1
- package/lib/tools/events.js +21 -14
- package/lib/tools/mergeRefs.js +3 -3
- package/lib/tools/setupGetInstanceId.js +1 -1
- package/lib/tools/uniqueId.js +3 -3
- package/lib/tools/wrapComponent.js +14 -13
- package/package.json +6 -6
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
11
11
|
import deprecate from '../../prop-types/deprecate.js';
|
|
12
12
|
import cx from 'classnames';
|
|
13
|
-
import { Close,
|
|
13
|
+
import { Close, ErrorFilled, CheckmarkFilled, WarningFilled, WarningAltFilled, InformationFilled, InformationSquareFilled } from '@carbon/icons-react';
|
|
14
14
|
import Button from '../Button/Button.js';
|
|
15
15
|
import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
16
16
|
import { useNoInteractiveChildren } from '../../internal/useNoInteractiveChildren.js';
|
|
@@ -19,13 +19,6 @@ import { useId } from '../../internal/useId.js';
|
|
|
19
19
|
import { matches } from '../../internal/keyboard/match.js';
|
|
20
20
|
import { Escape } from '../../internal/keyboard/keys.js';
|
|
21
21
|
|
|
22
|
-
var _NotificationButton$p, _NotificationButton$d, _iconTypes, _ToastNotification$pr, _InlineNotification$p, _ActionableNotificati;
|
|
23
|
-
|
|
24
|
-
var _excluded = ["children", "className", "onClick", "inline"],
|
|
25
|
-
_excluded2 = ["aria-label", "ariaLabel", "className", "type", "renderIcon", "name", "notificationType"],
|
|
26
|
-
_excluded3 = ["aria-label", "ariaLabel", "role", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "children", "kind", "lowContrast", "hideCloseButton", "timeout", "title", "caption", "subtitle"],
|
|
27
|
-
_excluded4 = ["aria-label", "children", "title", "subtitle", "role", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "kind", "lowContrast", "hideCloseButton"],
|
|
28
|
-
_excluded5 = ["actionButtonLabel", "aria-label", "ariaLabel", "children", "role", "onActionButtonClick", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "inline", "kind", "lowContrast", "hideCloseButton", "hasFocus", "closeOnEscape", "title", "subtitle"];
|
|
29
22
|
/**
|
|
30
23
|
* Conditionally call a callback when the escape key is pressed
|
|
31
24
|
* @param {node} ref - ref of the container element to scope the functionality to
|
|
@@ -34,34 +27,35 @@ var _excluded = ["children", "className", "onClick", "inline"],
|
|
|
34
27
|
*/
|
|
35
28
|
|
|
36
29
|
function useEscapeToClose(ref, callback) {
|
|
37
|
-
|
|
30
|
+
let override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
38
31
|
|
|
39
|
-
|
|
32
|
+
const handleKeyDown = event => {
|
|
40
33
|
// The callback should only be called when focus is on or within the container
|
|
41
|
-
|
|
34
|
+
const elementContainsFocus = ref.current && document.activeElement === ref.current || ref.current.contains(document.activeElement);
|
|
42
35
|
|
|
43
36
|
if (matches(event, [Escape]) && override && elementContainsFocus) {
|
|
44
37
|
callback(event);
|
|
45
38
|
}
|
|
46
39
|
};
|
|
47
40
|
|
|
48
|
-
useIsomorphicEffect(
|
|
41
|
+
useIsomorphicEffect(() => {
|
|
49
42
|
document.addEventListener('keydown', handleKeyDown, false);
|
|
50
|
-
return
|
|
51
|
-
return document.removeEventListener('keydown', handleKeyDown, false);
|
|
52
|
-
};
|
|
43
|
+
return () => document.removeEventListener('keydown', handleKeyDown, false);
|
|
53
44
|
});
|
|
54
45
|
}
|
|
55
46
|
|
|
56
47
|
function NotificationActionButton(_ref) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
48
|
+
let {
|
|
49
|
+
children,
|
|
50
|
+
className: customClassName,
|
|
51
|
+
onClick,
|
|
52
|
+
inline,
|
|
53
|
+
...rest
|
|
54
|
+
} = _ref;
|
|
55
|
+
const prefix = usePrefix();
|
|
56
|
+
const className = cx(customClassName, {
|
|
57
|
+
[`${prefix}--actionable-notification__action-button`]: true
|
|
58
|
+
});
|
|
65
59
|
return /*#__PURE__*/React__default.createElement(Button, _extends({
|
|
66
60
|
className: className,
|
|
67
61
|
kind: inline ? 'ghost' : 'tertiary',
|
|
@@ -91,18 +85,23 @@ NotificationActionButton.propTypes = {
|
|
|
91
85
|
onClick: PropTypes.func
|
|
92
86
|
};
|
|
93
87
|
function NotificationButton(_ref2) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
88
|
+
let {
|
|
89
|
+
['aria-label']: ariaLabel,
|
|
90
|
+
ariaLabel: deprecatedAriaLabel,
|
|
91
|
+
className,
|
|
92
|
+
type,
|
|
93
|
+
renderIcon: IconTag,
|
|
94
|
+
name,
|
|
95
|
+
notificationType,
|
|
96
|
+
...rest
|
|
97
|
+
} = _ref2;
|
|
98
|
+
const prefix = usePrefix();
|
|
99
|
+
const buttonClassName = cx(className, {
|
|
100
|
+
[`${prefix}--${notificationType}-notification__close-button`]: notificationType
|
|
101
|
+
});
|
|
102
|
+
const iconClassName = cx({
|
|
103
|
+
[`${prefix}--${notificationType}-notification__close-icon`]: notificationType
|
|
104
|
+
});
|
|
106
105
|
return /*#__PURE__*/React__default.createElement("button", _extends({}, rest, {
|
|
107
106
|
// eslint-disable-next-line react/button-has-type
|
|
108
107
|
type: type,
|
|
@@ -114,27 +113,75 @@ function NotificationButton(_ref2) {
|
|
|
114
113
|
name: name
|
|
115
114
|
}));
|
|
116
115
|
}
|
|
117
|
-
NotificationButton.propTypes =
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
NotificationButton.propTypes = {
|
|
117
|
+
/**
|
|
118
|
+
* Specify a label to be read by screen readers on the container node
|
|
119
|
+
*/
|
|
120
|
+
['aria-label']: PropTypes.string,
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Deprecated, please use `aria-label` instead.
|
|
124
|
+
* Specify a label to be read by screen readers on the container note.
|
|
125
|
+
*/
|
|
126
|
+
ariaLabel: deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Specify an optional className to be applied to the notification button
|
|
130
|
+
*/
|
|
131
|
+
className: PropTypes.string,
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Specify an optional icon for the Button through a string,
|
|
135
|
+
* if something but regular "close" icon is desirable
|
|
136
|
+
*/
|
|
137
|
+
name: PropTypes.string,
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Specify the notification type
|
|
141
|
+
*/
|
|
142
|
+
notificationType: PropTypes.oneOf(['toast', 'inline', 'actionable']),
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Optional prop to allow overriding the icon rendering.
|
|
146
|
+
* Can be a React component class
|
|
147
|
+
*/
|
|
148
|
+
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Optional prop to specify the type of the Button
|
|
152
|
+
*/
|
|
153
|
+
type: PropTypes.string
|
|
154
|
+
};
|
|
155
|
+
NotificationButton.defaultProps = {
|
|
156
|
+
['aria-label']: 'close notification',
|
|
157
|
+
notificationType: 'toast',
|
|
158
|
+
type: 'button',
|
|
159
|
+
renderIcon: Close
|
|
160
|
+
};
|
|
161
|
+
const iconTypes = {
|
|
120
162
|
error: ErrorFilled,
|
|
121
163
|
success: CheckmarkFilled,
|
|
122
|
-
warning: WarningFilled
|
|
123
|
-
|
|
164
|
+
warning: WarningFilled,
|
|
165
|
+
['warning-alt']: WarningAltFilled,
|
|
166
|
+
info: InformationFilled,
|
|
167
|
+
['info-square']: InformationSquareFilled
|
|
168
|
+
};
|
|
124
169
|
|
|
125
170
|
function NotificationIcon(_ref3) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
171
|
+
let {
|
|
172
|
+
iconDescription,
|
|
173
|
+
kind,
|
|
174
|
+
notificationType
|
|
175
|
+
} = _ref3;
|
|
176
|
+
const prefix = usePrefix();
|
|
177
|
+
const IconForKind = iconTypes[kind];
|
|
131
178
|
|
|
132
179
|
if (!IconForKind) {
|
|
133
180
|
return null;
|
|
134
181
|
}
|
|
135
182
|
|
|
136
183
|
return /*#__PURE__*/React__default.createElement(IconForKind, {
|
|
137
|
-
className:
|
|
184
|
+
className: `${prefix}--${notificationType}-notification__icon`,
|
|
138
185
|
size: 20
|
|
139
186
|
}, /*#__PURE__*/React__default.createElement("title", null, iconDescription));
|
|
140
187
|
}
|
|
@@ -145,65 +192,64 @@ NotificationIcon.propTypes = {
|
|
|
145
192
|
notificationType: PropTypes.oneOf(['inline', 'toast']).isRequired
|
|
146
193
|
};
|
|
147
194
|
function ToastNotification(_ref4) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
var contentRef = useRef(null);
|
|
195
|
+
let {
|
|
196
|
+
['aria-label']: ariaLabel,
|
|
197
|
+
ariaLabel: deprecatedAriaLabel,
|
|
198
|
+
role,
|
|
199
|
+
onClose,
|
|
200
|
+
onCloseButtonClick,
|
|
201
|
+
statusIconDescription,
|
|
202
|
+
className,
|
|
203
|
+
children,
|
|
204
|
+
kind,
|
|
205
|
+
lowContrast,
|
|
206
|
+
hideCloseButton,
|
|
207
|
+
timeout,
|
|
208
|
+
title,
|
|
209
|
+
caption,
|
|
210
|
+
subtitle,
|
|
211
|
+
...rest
|
|
212
|
+
} = _ref4;
|
|
213
|
+
const [isOpen, setIsOpen] = useState(true);
|
|
214
|
+
const prefix = usePrefix();
|
|
215
|
+
const containerClassName = cx(className, {
|
|
216
|
+
[`${prefix}--toast-notification`]: true,
|
|
217
|
+
[`${prefix}--toast-notification--low-contrast`]: lowContrast,
|
|
218
|
+
[`${prefix}--toast-notification--${kind}`]: kind
|
|
219
|
+
});
|
|
220
|
+
const contentRef = useRef(null);
|
|
175
221
|
useNoInteractiveChildren(contentRef);
|
|
176
222
|
|
|
177
|
-
|
|
223
|
+
const handleClose = evt => {
|
|
178
224
|
if (!onClose || onClose(evt) !== false) {
|
|
179
225
|
setIsOpen(false);
|
|
180
226
|
}
|
|
181
227
|
};
|
|
182
228
|
|
|
183
|
-
|
|
229
|
+
const ref = useRef(null);
|
|
184
230
|
|
|
185
231
|
function handleCloseButtonClick(event) {
|
|
186
232
|
onCloseButtonClick(event);
|
|
187
233
|
handleClose(event);
|
|
188
234
|
}
|
|
189
235
|
|
|
190
|
-
|
|
191
|
-
useEffect(
|
|
236
|
+
const savedOnClose = useRef(onClose);
|
|
237
|
+
useEffect(() => {
|
|
192
238
|
savedOnClose.current = onClose;
|
|
193
239
|
});
|
|
194
|
-
useEffect(
|
|
240
|
+
useEffect(() => {
|
|
195
241
|
if (!timeout) {
|
|
196
242
|
return;
|
|
197
243
|
}
|
|
198
244
|
|
|
199
|
-
|
|
245
|
+
const timeoutId = window.setTimeout(event => {
|
|
200
246
|
setIsOpen(false);
|
|
201
247
|
|
|
202
248
|
if (savedOnClose.current) {
|
|
203
249
|
savedOnClose.current(event);
|
|
204
250
|
}
|
|
205
251
|
}, timeout);
|
|
206
|
-
return
|
|
252
|
+
return () => {
|
|
207
253
|
window.clearTimeout(timeoutId);
|
|
208
254
|
};
|
|
209
255
|
}, [timeout]);
|
|
@@ -220,16 +266,16 @@ function ToastNotification(_ref4) {
|
|
|
220
266
|
}), /*#__PURE__*/React__default.createElement(NotificationIcon, {
|
|
221
267
|
notificationType: "toast",
|
|
222
268
|
kind: kind,
|
|
223
|
-
iconDescription: statusIconDescription ||
|
|
269
|
+
iconDescription: statusIconDescription || `${kind} icon`
|
|
224
270
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
225
271
|
ref: contentRef,
|
|
226
|
-
className:
|
|
272
|
+
className: `${prefix}--toast-notification__details`
|
|
227
273
|
}, title && /*#__PURE__*/React__default.createElement("div", {
|
|
228
|
-
className:
|
|
274
|
+
className: `${prefix}--toast-notification__title`
|
|
229
275
|
}, title), subtitle && /*#__PURE__*/React__default.createElement("div", {
|
|
230
|
-
className:
|
|
276
|
+
className: `${prefix}--toast-notification__subtitle`
|
|
231
277
|
}, subtitle), caption && /*#__PURE__*/React__default.createElement("div", {
|
|
232
|
-
className:
|
|
278
|
+
className: `${prefix}--toast-notification__caption`
|
|
233
279
|
}, caption), children), !hideCloseButton && /*#__PURE__*/React__default.createElement(NotificationButton, {
|
|
234
280
|
notificationType: "toast",
|
|
235
281
|
onClick: handleCloseButtonClick,
|
|
@@ -238,48 +284,125 @@ function ToastNotification(_ref4) {
|
|
|
238
284
|
tabIndex: "-1"
|
|
239
285
|
}));
|
|
240
286
|
}
|
|
241
|
-
ToastNotification.propTypes =
|
|
287
|
+
ToastNotification.propTypes = {
|
|
288
|
+
/**
|
|
289
|
+
* Provide a description for "close" icon button that can be read by screen readers
|
|
290
|
+
*/
|
|
291
|
+
['aria-label']: PropTypes.string,
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Deprecated, please use `aria-label` instead.
|
|
295
|
+
* Provide a description for "close" icon button that can be read by screen readers
|
|
296
|
+
*/
|
|
297
|
+
ariaLabel: deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Specify the caption
|
|
301
|
+
*/
|
|
302
|
+
caption: PropTypes.string,
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Specify the content
|
|
306
|
+
*/
|
|
307
|
+
children: PropTypes.node,
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Specify an optional className to be applied to the notification box
|
|
311
|
+
*/
|
|
312
|
+
className: PropTypes.string,
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Specify the close button should be disabled, or not
|
|
316
|
+
*/
|
|
317
|
+
hideCloseButton: PropTypes.bool,
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Specify what state the notification represents
|
|
321
|
+
*/
|
|
322
|
+
kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Specify whether you are using the low contrast variant of the ToastNotification.
|
|
326
|
+
*/
|
|
327
|
+
lowContrast: PropTypes.bool,
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Provide a function that is called when menu is closed
|
|
331
|
+
*/
|
|
332
|
+
onClose: PropTypes.func,
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Provide a function that is called when the close button is clicked
|
|
336
|
+
*/
|
|
337
|
+
onCloseButtonClick: PropTypes.func,
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* By default, this value is "status". You can also provide an alternate
|
|
341
|
+
* role if it makes sense from the accessibility-side
|
|
342
|
+
*/
|
|
343
|
+
role: PropTypes.oneOf(['alert', 'log', 'status']),
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Provide a description for "status" icon that can be read by screen readers
|
|
347
|
+
*/
|
|
348
|
+
statusIconDescription: PropTypes.string,
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Specify the sub-title
|
|
352
|
+
*/
|
|
353
|
+
subtitle: PropTypes.string,
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Specify an optional duration the notification should be closed in
|
|
357
|
+
*/
|
|
358
|
+
timeout: PropTypes.number,
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Specify the title
|
|
362
|
+
*/
|
|
363
|
+
title: PropTypes.string
|
|
364
|
+
};
|
|
242
365
|
ToastNotification.defaultProps = {
|
|
243
366
|
kind: 'error',
|
|
244
367
|
role: 'status',
|
|
245
|
-
onCloseButtonClick:
|
|
368
|
+
onCloseButtonClick: () => {},
|
|
246
369
|
hideCloseButton: false,
|
|
247
370
|
timeout: 0
|
|
248
371
|
};
|
|
249
372
|
function InlineNotification(_ref5) {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
373
|
+
let {
|
|
374
|
+
['aria-label']: ariaLabel,
|
|
375
|
+
children,
|
|
376
|
+
title,
|
|
377
|
+
subtitle,
|
|
378
|
+
role,
|
|
379
|
+
onClose,
|
|
380
|
+
onCloseButtonClick,
|
|
381
|
+
statusIconDescription,
|
|
382
|
+
className,
|
|
383
|
+
kind,
|
|
384
|
+
lowContrast,
|
|
385
|
+
hideCloseButton,
|
|
386
|
+
...rest
|
|
387
|
+
} = _ref5;
|
|
388
|
+
const [isOpen, setIsOpen] = useState(true);
|
|
389
|
+
const prefix = usePrefix();
|
|
390
|
+
const containerClassName = cx(className, {
|
|
391
|
+
[`${prefix}--inline-notification`]: true,
|
|
392
|
+
[`${prefix}--inline-notification--low-contrast`]: lowContrast,
|
|
393
|
+
[`${prefix}--inline-notification--${kind}`]: kind,
|
|
394
|
+
[`${prefix}--inline-notification--hide-close-button`]: hideCloseButton
|
|
395
|
+
});
|
|
396
|
+
const contentRef = useRef(null);
|
|
274
397
|
useNoInteractiveChildren(contentRef);
|
|
275
398
|
|
|
276
|
-
|
|
399
|
+
const handleClose = evt => {
|
|
277
400
|
if (!onClose || onClose(evt) !== false) {
|
|
278
401
|
setIsOpen(false);
|
|
279
402
|
}
|
|
280
403
|
};
|
|
281
404
|
|
|
282
|
-
|
|
405
|
+
const ref = useRef(null);
|
|
283
406
|
|
|
284
407
|
function handleCloseButtonClick(event) {
|
|
285
408
|
onCloseButtonClick(event);
|
|
@@ -296,18 +419,18 @@ function InlineNotification(_ref5) {
|
|
|
296
419
|
role: role,
|
|
297
420
|
className: containerClassName
|
|
298
421
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
299
|
-
className:
|
|
422
|
+
className: `${prefix}--inline-notification__details`
|
|
300
423
|
}, /*#__PURE__*/React__default.createElement(NotificationIcon, {
|
|
301
424
|
notificationType: "inline",
|
|
302
425
|
kind: kind,
|
|
303
|
-
iconDescription: statusIconDescription ||
|
|
426
|
+
iconDescription: statusIconDescription || `${kind} icon`
|
|
304
427
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
305
428
|
ref: contentRef,
|
|
306
|
-
className:
|
|
429
|
+
className: `${prefix}--inline-notification__text-wrapper`
|
|
307
430
|
}, title && /*#__PURE__*/React__default.createElement("div", {
|
|
308
|
-
className:
|
|
431
|
+
className: `${prefix}--inline-notification__title`
|
|
309
432
|
}, title), subtitle && /*#__PURE__*/React__default.createElement("div", {
|
|
310
|
-
className:
|
|
433
|
+
className: `${prefix}--inline-notification__subtitle`
|
|
311
434
|
}, subtitle), children)), !hideCloseButton && /*#__PURE__*/React__default.createElement(NotificationButton, {
|
|
312
435
|
notificationType: "inline",
|
|
313
436
|
onClick: handleCloseButtonClick,
|
|
@@ -316,52 +439,114 @@ function InlineNotification(_ref5) {
|
|
|
316
439
|
tabIndex: "-1"
|
|
317
440
|
}));
|
|
318
441
|
}
|
|
319
|
-
InlineNotification.propTypes =
|
|
442
|
+
InlineNotification.propTypes = {
|
|
443
|
+
/**
|
|
444
|
+
* Provide a description for "close" icon button that can be read by screen readers
|
|
445
|
+
*/
|
|
446
|
+
['aria-label']: PropTypes.string,
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Specify the content
|
|
450
|
+
*/
|
|
451
|
+
children: PropTypes.node,
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Specify an optional className to be applied to the notification box
|
|
455
|
+
*/
|
|
456
|
+
className: PropTypes.string,
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Specify the close button should be disabled, or not
|
|
460
|
+
*/
|
|
461
|
+
hideCloseButton: PropTypes.bool,
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Specify what state the notification represents
|
|
465
|
+
*/
|
|
466
|
+
kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Specify whether you are using the low contrast variant of the InlineNotification.
|
|
470
|
+
*/
|
|
471
|
+
lowContrast: PropTypes.bool,
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Provide a function that is called when menu is closed
|
|
475
|
+
*/
|
|
476
|
+
onClose: PropTypes.func,
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Provide a function that is called when the close button is clicked
|
|
480
|
+
*/
|
|
481
|
+
onCloseButtonClick: PropTypes.func,
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* By default, this value is "status". You can also provide an alternate
|
|
485
|
+
* role if it makes sense from the accessibility-side.
|
|
486
|
+
*/
|
|
487
|
+
role: PropTypes.oneOf(['alert', 'log', 'status']),
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Provide a description for "status" icon that can be read by screen readers
|
|
491
|
+
*/
|
|
492
|
+
statusIconDescription: PropTypes.string,
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Specify the sub-title
|
|
496
|
+
*/
|
|
497
|
+
subtitle: PropTypes.string,
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Specify the title
|
|
501
|
+
*/
|
|
502
|
+
title: PropTypes.string
|
|
503
|
+
};
|
|
320
504
|
InlineNotification.defaultProps = {
|
|
321
505
|
kind: 'error',
|
|
322
506
|
role: 'status',
|
|
323
|
-
onCloseButtonClick:
|
|
507
|
+
onCloseButtonClick: () => {},
|
|
324
508
|
hideCloseButton: false
|
|
325
509
|
};
|
|
326
510
|
function ActionableNotification(_ref6) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
511
|
+
let {
|
|
512
|
+
actionButtonLabel,
|
|
513
|
+
['aria-label']: ariaLabel,
|
|
514
|
+
ariaLabel: deprecatedAriaLabel,
|
|
515
|
+
children,
|
|
516
|
+
role,
|
|
517
|
+
onActionButtonClick,
|
|
518
|
+
onClose,
|
|
519
|
+
onCloseButtonClick,
|
|
520
|
+
statusIconDescription,
|
|
521
|
+
className,
|
|
522
|
+
inline,
|
|
523
|
+
kind,
|
|
524
|
+
lowContrast,
|
|
525
|
+
hideCloseButton,
|
|
526
|
+
hasFocus,
|
|
527
|
+
closeOnEscape,
|
|
528
|
+
title,
|
|
529
|
+
subtitle,
|
|
530
|
+
...rest
|
|
531
|
+
} = _ref6;
|
|
532
|
+
const [isOpen, setIsOpen] = useState(true);
|
|
533
|
+
const prefix = usePrefix();
|
|
534
|
+
const id = useId('actionable-notification');
|
|
535
|
+
const containerClassName = cx(className, {
|
|
536
|
+
[`${prefix}--actionable-notification`]: true,
|
|
537
|
+
[`${prefix}--actionable-notification--toast`]: !inline,
|
|
538
|
+
[`${prefix}--actionable-notification--low-contrast`]: lowContrast,
|
|
539
|
+
[`${prefix}--actionable-notification--${kind}`]: kind,
|
|
540
|
+
[`${prefix}--actionable-notification--hide-close-button`]: hideCloseButton
|
|
541
|
+
});
|
|
542
|
+
const ref = useRef(null);
|
|
543
|
+
useIsomorphicEffect(() => {
|
|
359
544
|
if (ref.current && hasFocus) {
|
|
360
545
|
ref.current.focus();
|
|
361
546
|
}
|
|
362
547
|
});
|
|
363
548
|
|
|
364
|
-
|
|
549
|
+
const handleClose = evt => {
|
|
365
550
|
if (!onClose || onClose(evt) !== false) {
|
|
366
551
|
setIsOpen(false);
|
|
367
552
|
}
|
|
@@ -384,20 +569,20 @@ function ActionableNotification(_ref6) {
|
|
|
384
569
|
className: containerClassName,
|
|
385
570
|
"aria-labelledby": title ? id : undefined
|
|
386
571
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
387
|
-
className:
|
|
572
|
+
className: `${prefix}--actionable-notification__details`
|
|
388
573
|
}, /*#__PURE__*/React__default.createElement(NotificationIcon, {
|
|
389
574
|
notificationType: inline ? 'inline' : 'toast',
|
|
390
575
|
kind: kind,
|
|
391
|
-
iconDescription: statusIconDescription ||
|
|
576
|
+
iconDescription: statusIconDescription || `${kind} icon`
|
|
392
577
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
393
|
-
className:
|
|
578
|
+
className: `${prefix}--actionable-notification__text-wrapper`
|
|
394
579
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
395
|
-
className:
|
|
580
|
+
className: `${prefix}--actionable-notification__content`
|
|
396
581
|
}, title && /*#__PURE__*/React__default.createElement("div", {
|
|
397
|
-
className:
|
|
582
|
+
className: `${prefix}--actionable-notification__title`,
|
|
398
583
|
id: id
|
|
399
584
|
}, title), subtitle && /*#__PURE__*/React__default.createElement("div", {
|
|
400
|
-
className:
|
|
585
|
+
className: `${prefix}--actionable-notification__subtitle`
|
|
401
586
|
}, subtitle), children))), /*#__PURE__*/React__default.createElement(NotificationActionButton, {
|
|
402
587
|
onClick: onActionButtonClick,
|
|
403
588
|
inline: inline
|
|
@@ -407,16 +592,103 @@ function ActionableNotification(_ref6) {
|
|
|
407
592
|
onClick: handleCloseButtonClick
|
|
408
593
|
}));
|
|
409
594
|
}
|
|
410
|
-
ActionableNotification.propTypes =
|
|
595
|
+
ActionableNotification.propTypes = {
|
|
411
596
|
/**
|
|
412
597
|
* Pass in the action button label that will be rendered within the ActionableNotification.
|
|
413
598
|
*/
|
|
414
|
-
actionButtonLabel: PropTypes.string.isRequired
|
|
415
|
-
|
|
599
|
+
actionButtonLabel: PropTypes.string.isRequired,
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Provide a description for "close" icon button that can be read by screen readers
|
|
603
|
+
*/
|
|
604
|
+
['aria-label']: PropTypes.string,
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Deprecated, please use `aria-label` instead.
|
|
608
|
+
* Provide a description for "close" icon button that can be read by screen readers
|
|
609
|
+
*/
|
|
610
|
+
ariaLabel: deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Specify the content
|
|
614
|
+
*/
|
|
615
|
+
children: PropTypes.node,
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Specify an optional className to be applied to the notification box
|
|
619
|
+
*/
|
|
620
|
+
className: PropTypes.string,
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Specify if pressing the escape key should close notifications
|
|
624
|
+
*/
|
|
625
|
+
closeOnEscape: PropTypes.bool,
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Specify if focus should be moved to the component when the notification contains actions
|
|
629
|
+
*/
|
|
630
|
+
hasFocus: PropTypes.bool,
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Specify the close button should be disabled, or not
|
|
634
|
+
*/
|
|
635
|
+
hideCloseButton: PropTypes.bool,
|
|
636
|
+
|
|
637
|
+
/*
|
|
638
|
+
* Specify if the notification should have inline styling applied instead of toast
|
|
639
|
+
*/
|
|
640
|
+
inline: PropTypes.bool,
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Specify what state the notification represents
|
|
644
|
+
*/
|
|
645
|
+
kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']).isRequired,
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Specify whether you are using the low contrast variant of the ActionableNotification.
|
|
649
|
+
*/
|
|
650
|
+
lowContrast: PropTypes.bool,
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Provide a function that is called when the action is clicked
|
|
654
|
+
*/
|
|
655
|
+
onActionButtonClick: PropTypes.func,
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Provide a function that is called when menu is closed
|
|
659
|
+
*/
|
|
660
|
+
onClose: PropTypes.func,
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Provide a function that is called when the close button is clicked
|
|
664
|
+
*/
|
|
665
|
+
onCloseButtonClick: PropTypes.func,
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* By default, this value is "alertdialog". You can also provide an alternate
|
|
669
|
+
* role if it makes sense from the accessibility-side.
|
|
670
|
+
*/
|
|
671
|
+
role: PropTypes.string,
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Provide a description for "status" icon that can be read by screen readers
|
|
675
|
+
*/
|
|
676
|
+
statusIconDescription: PropTypes.string,
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Specify the sub-title
|
|
680
|
+
*/
|
|
681
|
+
subtitle: PropTypes.string,
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Specify the title
|
|
685
|
+
*/
|
|
686
|
+
title: PropTypes.string
|
|
687
|
+
};
|
|
416
688
|
ActionableNotification.defaultProps = {
|
|
417
689
|
kind: 'error',
|
|
418
690
|
role: 'alertdialog',
|
|
419
|
-
onCloseButtonClick:
|
|
691
|
+
onCloseButtonClick: () => {},
|
|
420
692
|
hideCloseButton: false,
|
|
421
693
|
hasFocus: true,
|
|
422
694
|
closeOnEscape: true,
|