@carbon/react 1.27.0-rc.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 +28 -26
- 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 +211 -210
- 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 +27 -25
- 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 +210 -209
- 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 +9 -9
|
@@ -29,13 +29,6 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
29
29
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
30
30
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
31
31
|
|
|
32
|
-
var _NotificationButton$p, _NotificationButton$d, _iconTypes, _ToastNotification$pr, _InlineNotification$p, _ActionableNotificati;
|
|
33
|
-
|
|
34
|
-
var _excluded = ["children", "className", "onClick", "inline"],
|
|
35
|
-
_excluded2 = ["aria-label", "ariaLabel", "className", "type", "renderIcon", "name", "notificationType"],
|
|
36
|
-
_excluded3 = ["aria-label", "ariaLabel", "role", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "children", "kind", "lowContrast", "hideCloseButton", "timeout", "title", "caption", "subtitle"],
|
|
37
|
-
_excluded4 = ["aria-label", "children", "title", "subtitle", "role", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "kind", "lowContrast", "hideCloseButton"],
|
|
38
|
-
_excluded5 = ["actionButtonLabel", "aria-label", "ariaLabel", "children", "role", "onActionButtonClick", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "inline", "kind", "lowContrast", "hideCloseButton", "hasFocus", "closeOnEscape", "title", "subtitle"];
|
|
39
32
|
/**
|
|
40
33
|
* Conditionally call a callback when the escape key is pressed
|
|
41
34
|
* @param {node} ref - ref of the container element to scope the functionality to
|
|
@@ -44,34 +37,35 @@ var _excluded = ["children", "className", "onClick", "inline"],
|
|
|
44
37
|
*/
|
|
45
38
|
|
|
46
39
|
function useEscapeToClose(ref, callback) {
|
|
47
|
-
|
|
40
|
+
let override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
48
41
|
|
|
49
|
-
|
|
42
|
+
const handleKeyDown = event => {
|
|
50
43
|
// The callback should only be called when focus is on or within the container
|
|
51
|
-
|
|
44
|
+
const elementContainsFocus = ref.current && document.activeElement === ref.current || ref.current.contains(document.activeElement);
|
|
52
45
|
|
|
53
46
|
if (match.matches(event, [keys.Escape]) && override && elementContainsFocus) {
|
|
54
47
|
callback(event);
|
|
55
48
|
}
|
|
56
49
|
};
|
|
57
50
|
|
|
58
|
-
useIsomorphicEffect["default"](
|
|
51
|
+
useIsomorphicEffect["default"](() => {
|
|
59
52
|
document.addEventListener('keydown', handleKeyDown, false);
|
|
60
|
-
return
|
|
61
|
-
return document.removeEventListener('keydown', handleKeyDown, false);
|
|
62
|
-
};
|
|
53
|
+
return () => document.removeEventListener('keydown', handleKeyDown, false);
|
|
63
54
|
});
|
|
64
55
|
}
|
|
65
56
|
|
|
66
57
|
function NotificationActionButton(_ref) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
let {
|
|
59
|
+
children,
|
|
60
|
+
className: customClassName,
|
|
61
|
+
onClick,
|
|
62
|
+
inline,
|
|
63
|
+
...rest
|
|
64
|
+
} = _ref;
|
|
65
|
+
const prefix = usePrefix.usePrefix();
|
|
66
|
+
const className = cx__default["default"](customClassName, {
|
|
67
|
+
[`${prefix}--actionable-notification__action-button`]: true
|
|
68
|
+
});
|
|
75
69
|
return /*#__PURE__*/React__default["default"].createElement(Button["default"], _rollupPluginBabelHelpers["extends"]({
|
|
76
70
|
className: className,
|
|
77
71
|
kind: inline ? 'ghost' : 'tertiary',
|
|
@@ -101,18 +95,23 @@ NotificationActionButton.propTypes = {
|
|
|
101
95
|
onClick: PropTypes__default["default"].func
|
|
102
96
|
};
|
|
103
97
|
function NotificationButton(_ref2) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
98
|
+
let {
|
|
99
|
+
['aria-label']: ariaLabel,
|
|
100
|
+
ariaLabel: deprecatedAriaLabel,
|
|
101
|
+
className,
|
|
102
|
+
type,
|
|
103
|
+
renderIcon: IconTag,
|
|
104
|
+
name,
|
|
105
|
+
notificationType,
|
|
106
|
+
...rest
|
|
107
|
+
} = _ref2;
|
|
108
|
+
const prefix = usePrefix.usePrefix();
|
|
109
|
+
const buttonClassName = cx__default["default"](className, {
|
|
110
|
+
[`${prefix}--${notificationType}-notification__close-button`]: notificationType
|
|
111
|
+
});
|
|
112
|
+
const iconClassName = cx__default["default"]({
|
|
113
|
+
[`${prefix}--${notificationType}-notification__close-icon`]: notificationType
|
|
114
|
+
});
|
|
116
115
|
return /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
117
116
|
// eslint-disable-next-line react/button-has-type
|
|
118
117
|
type: type,
|
|
@@ -124,27 +123,75 @@ function NotificationButton(_ref2) {
|
|
|
124
123
|
name: name
|
|
125
124
|
}));
|
|
126
125
|
}
|
|
127
|
-
NotificationButton.propTypes =
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
NotificationButton.propTypes = {
|
|
127
|
+
/**
|
|
128
|
+
* Specify a label to be read by screen readers on the container node
|
|
129
|
+
*/
|
|
130
|
+
['aria-label']: PropTypes__default["default"].string,
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Deprecated, please use `aria-label` instead.
|
|
134
|
+
* Specify a label to be read by screen readers on the container note.
|
|
135
|
+
*/
|
|
136
|
+
ariaLabel: deprecate["default"](PropTypes__default["default"].string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Specify an optional className to be applied to the notification button
|
|
140
|
+
*/
|
|
141
|
+
className: PropTypes__default["default"].string,
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Specify an optional icon for the Button through a string,
|
|
145
|
+
* if something but regular "close" icon is desirable
|
|
146
|
+
*/
|
|
147
|
+
name: PropTypes__default["default"].string,
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Specify the notification type
|
|
151
|
+
*/
|
|
152
|
+
notificationType: PropTypes__default["default"].oneOf(['toast', 'inline', 'actionable']),
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Optional prop to allow overriding the icon rendering.
|
|
156
|
+
* Can be a React component class
|
|
157
|
+
*/
|
|
158
|
+
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Optional prop to specify the type of the Button
|
|
162
|
+
*/
|
|
163
|
+
type: PropTypes__default["default"].string
|
|
164
|
+
};
|
|
165
|
+
NotificationButton.defaultProps = {
|
|
166
|
+
['aria-label']: 'close notification',
|
|
167
|
+
notificationType: 'toast',
|
|
168
|
+
type: 'button',
|
|
169
|
+
renderIcon: iconsReact.Close
|
|
170
|
+
};
|
|
171
|
+
const iconTypes = {
|
|
130
172
|
error: iconsReact.ErrorFilled,
|
|
131
173
|
success: iconsReact.CheckmarkFilled,
|
|
132
|
-
warning: iconsReact.WarningFilled
|
|
133
|
-
|
|
174
|
+
warning: iconsReact.WarningFilled,
|
|
175
|
+
['warning-alt']: iconsReact.WarningAltFilled,
|
|
176
|
+
info: iconsReact.InformationFilled,
|
|
177
|
+
['info-square']: iconsReact.InformationSquareFilled
|
|
178
|
+
};
|
|
134
179
|
|
|
135
180
|
function NotificationIcon(_ref3) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
181
|
+
let {
|
|
182
|
+
iconDescription,
|
|
183
|
+
kind,
|
|
184
|
+
notificationType
|
|
185
|
+
} = _ref3;
|
|
186
|
+
const prefix = usePrefix.usePrefix();
|
|
187
|
+
const IconForKind = iconTypes[kind];
|
|
141
188
|
|
|
142
189
|
if (!IconForKind) {
|
|
143
190
|
return null;
|
|
144
191
|
}
|
|
145
192
|
|
|
146
193
|
return /*#__PURE__*/React__default["default"].createElement(IconForKind, {
|
|
147
|
-
className:
|
|
194
|
+
className: `${prefix}--${notificationType}-notification__icon`,
|
|
148
195
|
size: 20
|
|
149
196
|
}, /*#__PURE__*/React__default["default"].createElement("title", null, iconDescription));
|
|
150
197
|
}
|
|
@@ -155,65 +202,64 @@ NotificationIcon.propTypes = {
|
|
|
155
202
|
notificationType: PropTypes__default["default"].oneOf(['inline', 'toast']).isRequired
|
|
156
203
|
};
|
|
157
204
|
function ToastNotification(_ref4) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
var contentRef = React.useRef(null);
|
|
205
|
+
let {
|
|
206
|
+
['aria-label']: ariaLabel,
|
|
207
|
+
ariaLabel: deprecatedAriaLabel,
|
|
208
|
+
role,
|
|
209
|
+
onClose,
|
|
210
|
+
onCloseButtonClick,
|
|
211
|
+
statusIconDescription,
|
|
212
|
+
className,
|
|
213
|
+
children,
|
|
214
|
+
kind,
|
|
215
|
+
lowContrast,
|
|
216
|
+
hideCloseButton,
|
|
217
|
+
timeout,
|
|
218
|
+
title,
|
|
219
|
+
caption,
|
|
220
|
+
subtitle,
|
|
221
|
+
...rest
|
|
222
|
+
} = _ref4;
|
|
223
|
+
const [isOpen, setIsOpen] = React.useState(true);
|
|
224
|
+
const prefix = usePrefix.usePrefix();
|
|
225
|
+
const containerClassName = cx__default["default"](className, {
|
|
226
|
+
[`${prefix}--toast-notification`]: true,
|
|
227
|
+
[`${prefix}--toast-notification--low-contrast`]: lowContrast,
|
|
228
|
+
[`${prefix}--toast-notification--${kind}`]: kind
|
|
229
|
+
});
|
|
230
|
+
const contentRef = React.useRef(null);
|
|
185
231
|
useNoInteractiveChildren.useNoInteractiveChildren(contentRef);
|
|
186
232
|
|
|
187
|
-
|
|
233
|
+
const handleClose = evt => {
|
|
188
234
|
if (!onClose || onClose(evt) !== false) {
|
|
189
235
|
setIsOpen(false);
|
|
190
236
|
}
|
|
191
237
|
};
|
|
192
238
|
|
|
193
|
-
|
|
239
|
+
const ref = React.useRef(null);
|
|
194
240
|
|
|
195
241
|
function handleCloseButtonClick(event) {
|
|
196
242
|
onCloseButtonClick(event);
|
|
197
243
|
handleClose(event);
|
|
198
244
|
}
|
|
199
245
|
|
|
200
|
-
|
|
201
|
-
React.useEffect(
|
|
246
|
+
const savedOnClose = React.useRef(onClose);
|
|
247
|
+
React.useEffect(() => {
|
|
202
248
|
savedOnClose.current = onClose;
|
|
203
249
|
});
|
|
204
|
-
React.useEffect(
|
|
250
|
+
React.useEffect(() => {
|
|
205
251
|
if (!timeout) {
|
|
206
252
|
return;
|
|
207
253
|
}
|
|
208
254
|
|
|
209
|
-
|
|
255
|
+
const timeoutId = window.setTimeout(event => {
|
|
210
256
|
setIsOpen(false);
|
|
211
257
|
|
|
212
258
|
if (savedOnClose.current) {
|
|
213
259
|
savedOnClose.current(event);
|
|
214
260
|
}
|
|
215
261
|
}, timeout);
|
|
216
|
-
return
|
|
262
|
+
return () => {
|
|
217
263
|
window.clearTimeout(timeoutId);
|
|
218
264
|
};
|
|
219
265
|
}, [timeout]);
|
|
@@ -230,16 +276,16 @@ function ToastNotification(_ref4) {
|
|
|
230
276
|
}), /*#__PURE__*/React__default["default"].createElement(NotificationIcon, {
|
|
231
277
|
notificationType: "toast",
|
|
232
278
|
kind: kind,
|
|
233
|
-
iconDescription: statusIconDescription ||
|
|
279
|
+
iconDescription: statusIconDescription || `${kind} icon`
|
|
234
280
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
235
281
|
ref: contentRef,
|
|
236
|
-
className:
|
|
282
|
+
className: `${prefix}--toast-notification__details`
|
|
237
283
|
}, title && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
238
|
-
className:
|
|
284
|
+
className: `${prefix}--toast-notification__title`
|
|
239
285
|
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
240
|
-
className:
|
|
286
|
+
className: `${prefix}--toast-notification__subtitle`
|
|
241
287
|
}, subtitle), caption && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
242
|
-
className:
|
|
288
|
+
className: `${prefix}--toast-notification__caption`
|
|
243
289
|
}, caption), children), !hideCloseButton && /*#__PURE__*/React__default["default"].createElement(NotificationButton, {
|
|
244
290
|
notificationType: "toast",
|
|
245
291
|
onClick: handleCloseButtonClick,
|
|
@@ -248,48 +294,125 @@ function ToastNotification(_ref4) {
|
|
|
248
294
|
tabIndex: "-1"
|
|
249
295
|
}));
|
|
250
296
|
}
|
|
251
|
-
ToastNotification.propTypes =
|
|
297
|
+
ToastNotification.propTypes = {
|
|
298
|
+
/**
|
|
299
|
+
* Provide a description for "close" icon button that can be read by screen readers
|
|
300
|
+
*/
|
|
301
|
+
['aria-label']: PropTypes__default["default"].string,
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Deprecated, please use `aria-label` instead.
|
|
305
|
+
* Provide a description for "close" icon button that can be read by screen readers
|
|
306
|
+
*/
|
|
307
|
+
ariaLabel: deprecate["default"](PropTypes__default["default"].string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Specify the caption
|
|
311
|
+
*/
|
|
312
|
+
caption: PropTypes__default["default"].string,
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Specify the content
|
|
316
|
+
*/
|
|
317
|
+
children: PropTypes__default["default"].node,
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Specify an optional className to be applied to the notification box
|
|
321
|
+
*/
|
|
322
|
+
className: PropTypes__default["default"].string,
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Specify the close button should be disabled, or not
|
|
326
|
+
*/
|
|
327
|
+
hideCloseButton: PropTypes__default["default"].bool,
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Specify what state the notification represents
|
|
331
|
+
*/
|
|
332
|
+
kind: PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Specify whether you are using the low contrast variant of the ToastNotification.
|
|
336
|
+
*/
|
|
337
|
+
lowContrast: PropTypes__default["default"].bool,
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Provide a function that is called when menu is closed
|
|
341
|
+
*/
|
|
342
|
+
onClose: PropTypes__default["default"].func,
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Provide a function that is called when the close button is clicked
|
|
346
|
+
*/
|
|
347
|
+
onCloseButtonClick: PropTypes__default["default"].func,
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* By default, this value is "status". You can also provide an alternate
|
|
351
|
+
* role if it makes sense from the accessibility-side
|
|
352
|
+
*/
|
|
353
|
+
role: PropTypes__default["default"].oneOf(['alert', 'log', 'status']),
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Provide a description for "status" icon that can be read by screen readers
|
|
357
|
+
*/
|
|
358
|
+
statusIconDescription: PropTypes__default["default"].string,
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Specify the sub-title
|
|
362
|
+
*/
|
|
363
|
+
subtitle: PropTypes__default["default"].string,
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Specify an optional duration the notification should be closed in
|
|
367
|
+
*/
|
|
368
|
+
timeout: PropTypes__default["default"].number,
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Specify the title
|
|
372
|
+
*/
|
|
373
|
+
title: PropTypes__default["default"].string
|
|
374
|
+
};
|
|
252
375
|
ToastNotification.defaultProps = {
|
|
253
376
|
kind: 'error',
|
|
254
377
|
role: 'status',
|
|
255
|
-
onCloseButtonClick:
|
|
378
|
+
onCloseButtonClick: () => {},
|
|
256
379
|
hideCloseButton: false,
|
|
257
380
|
timeout: 0
|
|
258
381
|
};
|
|
259
382
|
function InlineNotification(_ref5) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
383
|
+
let {
|
|
384
|
+
['aria-label']: ariaLabel,
|
|
385
|
+
children,
|
|
386
|
+
title,
|
|
387
|
+
subtitle,
|
|
388
|
+
role,
|
|
389
|
+
onClose,
|
|
390
|
+
onCloseButtonClick,
|
|
391
|
+
statusIconDescription,
|
|
392
|
+
className,
|
|
393
|
+
kind,
|
|
394
|
+
lowContrast,
|
|
395
|
+
hideCloseButton,
|
|
396
|
+
...rest
|
|
397
|
+
} = _ref5;
|
|
398
|
+
const [isOpen, setIsOpen] = React.useState(true);
|
|
399
|
+
const prefix = usePrefix.usePrefix();
|
|
400
|
+
const containerClassName = cx__default["default"](className, {
|
|
401
|
+
[`${prefix}--inline-notification`]: true,
|
|
402
|
+
[`${prefix}--inline-notification--low-contrast`]: lowContrast,
|
|
403
|
+
[`${prefix}--inline-notification--${kind}`]: kind,
|
|
404
|
+
[`${prefix}--inline-notification--hide-close-button`]: hideCloseButton
|
|
405
|
+
});
|
|
406
|
+
const contentRef = React.useRef(null);
|
|
284
407
|
useNoInteractiveChildren.useNoInteractiveChildren(contentRef);
|
|
285
408
|
|
|
286
|
-
|
|
409
|
+
const handleClose = evt => {
|
|
287
410
|
if (!onClose || onClose(evt) !== false) {
|
|
288
411
|
setIsOpen(false);
|
|
289
412
|
}
|
|
290
413
|
};
|
|
291
414
|
|
|
292
|
-
|
|
415
|
+
const ref = React.useRef(null);
|
|
293
416
|
|
|
294
417
|
function handleCloseButtonClick(event) {
|
|
295
418
|
onCloseButtonClick(event);
|
|
@@ -306,18 +429,18 @@ function InlineNotification(_ref5) {
|
|
|
306
429
|
role: role,
|
|
307
430
|
className: containerClassName
|
|
308
431
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
309
|
-
className:
|
|
432
|
+
className: `${prefix}--inline-notification__details`
|
|
310
433
|
}, /*#__PURE__*/React__default["default"].createElement(NotificationIcon, {
|
|
311
434
|
notificationType: "inline",
|
|
312
435
|
kind: kind,
|
|
313
|
-
iconDescription: statusIconDescription ||
|
|
436
|
+
iconDescription: statusIconDescription || `${kind} icon`
|
|
314
437
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
315
438
|
ref: contentRef,
|
|
316
|
-
className:
|
|
439
|
+
className: `${prefix}--inline-notification__text-wrapper`
|
|
317
440
|
}, title && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
318
|
-
className:
|
|
441
|
+
className: `${prefix}--inline-notification__title`
|
|
319
442
|
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
320
|
-
className:
|
|
443
|
+
className: `${prefix}--inline-notification__subtitle`
|
|
321
444
|
}, subtitle), children)), !hideCloseButton && /*#__PURE__*/React__default["default"].createElement(NotificationButton, {
|
|
322
445
|
notificationType: "inline",
|
|
323
446
|
onClick: handleCloseButtonClick,
|
|
@@ -326,52 +449,114 @@ function InlineNotification(_ref5) {
|
|
|
326
449
|
tabIndex: "-1"
|
|
327
450
|
}));
|
|
328
451
|
}
|
|
329
|
-
InlineNotification.propTypes =
|
|
452
|
+
InlineNotification.propTypes = {
|
|
453
|
+
/**
|
|
454
|
+
* Provide a description for "close" icon button that can be read by screen readers
|
|
455
|
+
*/
|
|
456
|
+
['aria-label']: PropTypes__default["default"].string,
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Specify the content
|
|
460
|
+
*/
|
|
461
|
+
children: PropTypes__default["default"].node,
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Specify an optional className to be applied to the notification box
|
|
465
|
+
*/
|
|
466
|
+
className: PropTypes__default["default"].string,
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Specify the close button should be disabled, or not
|
|
470
|
+
*/
|
|
471
|
+
hideCloseButton: PropTypes__default["default"].bool,
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Specify what state the notification represents
|
|
475
|
+
*/
|
|
476
|
+
kind: PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Specify whether you are using the low contrast variant of the InlineNotification.
|
|
480
|
+
*/
|
|
481
|
+
lowContrast: PropTypes__default["default"].bool,
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Provide a function that is called when menu is closed
|
|
485
|
+
*/
|
|
486
|
+
onClose: PropTypes__default["default"].func,
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Provide a function that is called when the close button is clicked
|
|
490
|
+
*/
|
|
491
|
+
onCloseButtonClick: PropTypes__default["default"].func,
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* By default, this value is "status". You can also provide an alternate
|
|
495
|
+
* role if it makes sense from the accessibility-side.
|
|
496
|
+
*/
|
|
497
|
+
role: PropTypes__default["default"].oneOf(['alert', 'log', 'status']),
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Provide a description for "status" icon that can be read by screen readers
|
|
501
|
+
*/
|
|
502
|
+
statusIconDescription: PropTypes__default["default"].string,
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Specify the sub-title
|
|
506
|
+
*/
|
|
507
|
+
subtitle: PropTypes__default["default"].string,
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Specify the title
|
|
511
|
+
*/
|
|
512
|
+
title: PropTypes__default["default"].string
|
|
513
|
+
};
|
|
330
514
|
InlineNotification.defaultProps = {
|
|
331
515
|
kind: 'error',
|
|
332
516
|
role: 'status',
|
|
333
|
-
onCloseButtonClick:
|
|
517
|
+
onCloseButtonClick: () => {},
|
|
334
518
|
hideCloseButton: false
|
|
335
519
|
};
|
|
336
520
|
function ActionableNotification(_ref6) {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
521
|
+
let {
|
|
522
|
+
actionButtonLabel,
|
|
523
|
+
['aria-label']: ariaLabel,
|
|
524
|
+
ariaLabel: deprecatedAriaLabel,
|
|
525
|
+
children,
|
|
526
|
+
role,
|
|
527
|
+
onActionButtonClick,
|
|
528
|
+
onClose,
|
|
529
|
+
onCloseButtonClick,
|
|
530
|
+
statusIconDescription,
|
|
531
|
+
className,
|
|
532
|
+
inline,
|
|
533
|
+
kind,
|
|
534
|
+
lowContrast,
|
|
535
|
+
hideCloseButton,
|
|
536
|
+
hasFocus,
|
|
537
|
+
closeOnEscape,
|
|
538
|
+
title,
|
|
539
|
+
subtitle,
|
|
540
|
+
...rest
|
|
541
|
+
} = _ref6;
|
|
542
|
+
const [isOpen, setIsOpen] = React.useState(true);
|
|
543
|
+
const prefix = usePrefix.usePrefix();
|
|
544
|
+
const id = useId.useId('actionable-notification');
|
|
545
|
+
const containerClassName = cx__default["default"](className, {
|
|
546
|
+
[`${prefix}--actionable-notification`]: true,
|
|
547
|
+
[`${prefix}--actionable-notification--toast`]: !inline,
|
|
548
|
+
[`${prefix}--actionable-notification--low-contrast`]: lowContrast,
|
|
549
|
+
[`${prefix}--actionable-notification--${kind}`]: kind,
|
|
550
|
+
[`${prefix}--actionable-notification--hide-close-button`]: hideCloseButton
|
|
551
|
+
});
|
|
552
|
+
const ref = React.useRef(null);
|
|
553
|
+
useIsomorphicEffect["default"](() => {
|
|
369
554
|
if (ref.current && hasFocus) {
|
|
370
555
|
ref.current.focus();
|
|
371
556
|
}
|
|
372
557
|
});
|
|
373
558
|
|
|
374
|
-
|
|
559
|
+
const handleClose = evt => {
|
|
375
560
|
if (!onClose || onClose(evt) !== false) {
|
|
376
561
|
setIsOpen(false);
|
|
377
562
|
}
|
|
@@ -394,20 +579,20 @@ function ActionableNotification(_ref6) {
|
|
|
394
579
|
className: containerClassName,
|
|
395
580
|
"aria-labelledby": title ? id : undefined
|
|
396
581
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
397
|
-
className:
|
|
582
|
+
className: `${prefix}--actionable-notification__details`
|
|
398
583
|
}, /*#__PURE__*/React__default["default"].createElement(NotificationIcon, {
|
|
399
584
|
notificationType: inline ? 'inline' : 'toast',
|
|
400
585
|
kind: kind,
|
|
401
|
-
iconDescription: statusIconDescription ||
|
|
586
|
+
iconDescription: statusIconDescription || `${kind} icon`
|
|
402
587
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
403
|
-
className:
|
|
588
|
+
className: `${prefix}--actionable-notification__text-wrapper`
|
|
404
589
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
405
|
-
className:
|
|
590
|
+
className: `${prefix}--actionable-notification__content`
|
|
406
591
|
}, title && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
407
|
-
className:
|
|
592
|
+
className: `${prefix}--actionable-notification__title`,
|
|
408
593
|
id: id
|
|
409
594
|
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
410
|
-
className:
|
|
595
|
+
className: `${prefix}--actionable-notification__subtitle`
|
|
411
596
|
}, subtitle), children))), /*#__PURE__*/React__default["default"].createElement(NotificationActionButton, {
|
|
412
597
|
onClick: onActionButtonClick,
|
|
413
598
|
inline: inline
|
|
@@ -417,16 +602,103 @@ function ActionableNotification(_ref6) {
|
|
|
417
602
|
onClick: handleCloseButtonClick
|
|
418
603
|
}));
|
|
419
604
|
}
|
|
420
|
-
ActionableNotification.propTypes =
|
|
605
|
+
ActionableNotification.propTypes = {
|
|
421
606
|
/**
|
|
422
607
|
* Pass in the action button label that will be rendered within the ActionableNotification.
|
|
423
608
|
*/
|
|
424
|
-
actionButtonLabel: PropTypes__default["default"].string.isRequired
|
|
425
|
-
|
|
609
|
+
actionButtonLabel: PropTypes__default["default"].string.isRequired,
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Provide a description for "close" icon button that can be read by screen readers
|
|
613
|
+
*/
|
|
614
|
+
['aria-label']: PropTypes__default["default"].string,
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Deprecated, please use `aria-label` instead.
|
|
618
|
+
* Provide a description for "close" icon button that can be read by screen readers
|
|
619
|
+
*/
|
|
620
|
+
ariaLabel: deprecate["default"](PropTypes__default["default"].string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Specify the content
|
|
624
|
+
*/
|
|
625
|
+
children: PropTypes__default["default"].node,
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Specify an optional className to be applied to the notification box
|
|
629
|
+
*/
|
|
630
|
+
className: PropTypes__default["default"].string,
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Specify if pressing the escape key should close notifications
|
|
634
|
+
*/
|
|
635
|
+
closeOnEscape: PropTypes__default["default"].bool,
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Specify if focus should be moved to the component when the notification contains actions
|
|
639
|
+
*/
|
|
640
|
+
hasFocus: PropTypes__default["default"].bool,
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Specify the close button should be disabled, or not
|
|
644
|
+
*/
|
|
645
|
+
hideCloseButton: PropTypes__default["default"].bool,
|
|
646
|
+
|
|
647
|
+
/*
|
|
648
|
+
* Specify if the notification should have inline styling applied instead of toast
|
|
649
|
+
*/
|
|
650
|
+
inline: PropTypes__default["default"].bool,
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Specify what state the notification represents
|
|
654
|
+
*/
|
|
655
|
+
kind: PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']).isRequired,
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Specify whether you are using the low contrast variant of the ActionableNotification.
|
|
659
|
+
*/
|
|
660
|
+
lowContrast: PropTypes__default["default"].bool,
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Provide a function that is called when the action is clicked
|
|
664
|
+
*/
|
|
665
|
+
onActionButtonClick: PropTypes__default["default"].func,
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Provide a function that is called when menu is closed
|
|
669
|
+
*/
|
|
670
|
+
onClose: PropTypes__default["default"].func,
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Provide a function that is called when the close button is clicked
|
|
674
|
+
*/
|
|
675
|
+
onCloseButtonClick: PropTypes__default["default"].func,
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* By default, this value is "alertdialog". You can also provide an alternate
|
|
679
|
+
* role if it makes sense from the accessibility-side.
|
|
680
|
+
*/
|
|
681
|
+
role: PropTypes__default["default"].string,
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Provide a description for "status" icon that can be read by screen readers
|
|
685
|
+
*/
|
|
686
|
+
statusIconDescription: PropTypes__default["default"].string,
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Specify the sub-title
|
|
690
|
+
*/
|
|
691
|
+
subtitle: PropTypes__default["default"].string,
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Specify the title
|
|
695
|
+
*/
|
|
696
|
+
title: PropTypes__default["default"].string
|
|
697
|
+
};
|
|
426
698
|
ActionableNotification.defaultProps = {
|
|
427
699
|
kind: 'error',
|
|
428
700
|
role: 'alertdialog',
|
|
429
|
-
onCloseButtonClick:
|
|
701
|
+
onCloseButtonClick: () => {},
|
|
430
702
|
hideCloseButton: false,
|
|
431
703
|
hasFocus: true,
|
|
432
704
|
closeOnEscape: true,
|