@patternfly/react-core 4.243.0 → 4.244.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/CHANGELOG.md +24 -0
- package/dist/esm/components/Alert/Alert.d.ts +41 -34
- package/dist/esm/components/Alert/Alert.d.ts.map +1 -1
- package/dist/esm/components/Alert/Alert.js.map +1 -1
- package/dist/esm/components/Alert/AlertActionCloseButton.d.ts +8 -5
- package/dist/esm/components/Alert/AlertActionCloseButton.d.ts.map +1 -1
- package/dist/esm/components/Alert/AlertActionCloseButton.js.map +1 -1
- package/dist/esm/components/Alert/AlertActionLink.d.ts +5 -2
- package/dist/esm/components/Alert/AlertActionLink.d.ts.map +1 -1
- package/dist/esm/components/Alert/AlertActionLink.js.map +1 -1
- package/dist/esm/components/Alert/AlertIcon.d.ts +4 -4
- package/dist/esm/components/Alert/AlertIcon.d.ts.map +1 -1
- package/dist/esm/components/Alert/AlertToggleExpandButton.d.ts +5 -5
- package/dist/esm/components/Alert/AlertToggleExpandButton.d.ts.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts +34 -28
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.js +1 -0
- package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/esm/components/DatePicker/DatePicker.d.ts +43 -36
- package/dist/esm/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts +34 -24
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts +10 -5
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
- package/dist/esm/components/FileUpload/FileUpload.d.ts +53 -47
- package/dist/esm/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/esm/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/esm/components/FileUpload/FileUploadField.d.ts +51 -46
- package/dist/esm/components/FileUpload/FileUploadField.d.ts.map +1 -1
- package/dist/esm/components/FileUpload/FileUploadField.js.map +1 -1
- package/dist/esm/components/Modal/Modal.d.ts +57 -48
- package/dist/esm/components/Modal/Modal.d.ts.map +1 -1
- package/dist/esm/components/Modal/Modal.js.map +1 -1
- package/dist/esm/components/Modal/ModalBox.d.ts +12 -12
- package/dist/esm/components/Modal/ModalBox.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxBody.d.ts +2 -2
- package/dist/esm/components/Modal/ModalBoxBody.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts +2 -2
- package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxDescription.d.ts +3 -3
- package/dist/esm/components/Modal/ModalBoxDescription.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxFooter.d.ts +2 -2
- package/dist/esm/components/Modal/ModalBoxFooter.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxHeader.d.ts +3 -3
- package/dist/esm/components/Modal/ModalBoxHeader.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxTitle.d.ts +8 -9
- package/dist/esm/components/Modal/ModalBoxTitle.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalBoxTitle.js.map +1 -1
- package/dist/esm/components/Modal/ModalContent.d.ts +56 -48
- package/dist/esm/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/esm/components/Modal/ModalContent.js.map +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts +17 -13
- package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.js +3 -3
- package/dist/esm/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/esm/components/Pagination/Navigation.d.ts +33 -33
- package/dist/esm/components/Pagination/Navigation.d.ts.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.d.ts +27 -26
- package/dist/esm/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.d.ts +76 -65
- package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +1 -1
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +22 -18
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/esm/components/Pagination/ToggleTemplate.d.ts +3 -0
- package/dist/esm/components/Pagination/ToggleTemplate.d.ts.map +1 -1
- package/dist/esm/components/Pagination/ToggleTemplate.js.map +1 -1
- package/dist/esm/components/Popover/Popover.d.ts +88 -73
- package/dist/esm/components/Popover/Popover.d.ts.map +1 -1
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts +27 -26
- package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.d.ts +71 -60
- package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Slider/Slider.d.ts +45 -39
- package/dist/esm/components/Slider/Slider.d.ts.map +1 -1
- package/dist/esm/components/Slider/Slider.js.map +1 -1
- package/dist/esm/components/Slider/SliderStep.d.ts +10 -10
- package/dist/esm/components/Slider/SliderStep.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeView.d.ts +65 -53
- package/dist/esm/components/TreeView/TreeView.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeView.js.map +1 -1
- package/dist/esm/components/TreeView/TreeViewList.d.ts +4 -4
- package/dist/esm/components/TreeView/TreeViewList.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeViewListItem.d.ts +46 -39
- package/dist/esm/components/TreeView/TreeViewListItem.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeViewListItem.js.map +1 -1
- package/dist/esm/components/TreeView/TreeViewRoot.d.ts +4 -4
- package/dist/esm/components/TreeView/TreeViewRoot.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeViewSearch.d.ts +11 -8
- package/dist/esm/components/TreeView/TreeViewSearch.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeViewSearch.js.map +1 -1
- package/dist/esm/helpers/Popper/Popper.js +8 -8
- package/dist/esm/helpers/Popper/Popper.js.map +1 -1
- package/dist/js/components/Alert/Alert.d.ts +41 -34
- package/dist/js/components/Alert/Alert.d.ts.map +1 -1
- package/dist/js/components/Alert/Alert.js.map +1 -1
- package/dist/js/components/Alert/AlertActionCloseButton.d.ts +8 -5
- package/dist/js/components/Alert/AlertActionCloseButton.d.ts.map +1 -1
- package/dist/js/components/Alert/AlertActionCloseButton.js.map +1 -1
- package/dist/js/components/Alert/AlertActionLink.d.ts +5 -2
- package/dist/js/components/Alert/AlertActionLink.d.ts.map +1 -1
- package/dist/js/components/Alert/AlertActionLink.js.map +1 -1
- package/dist/js/components/Alert/AlertIcon.d.ts +4 -4
- package/dist/js/components/Alert/AlertIcon.d.ts.map +1 -1
- package/dist/js/components/Alert/AlertToggleExpandButton.d.ts +5 -5
- package/dist/js/components/Alert/AlertToggleExpandButton.d.ts.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts +34 -28
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.js +1 -0
- package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/js/components/DatePicker/DatePicker.d.ts +43 -36
- package/dist/js/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/js/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts +34 -24
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts +10 -5
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
- package/dist/js/components/FileUpload/FileUpload.d.ts +53 -47
- package/dist/js/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/js/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/js/components/FileUpload/FileUploadField.d.ts +51 -46
- package/dist/js/components/FileUpload/FileUploadField.d.ts.map +1 -1
- package/dist/js/components/FileUpload/FileUploadField.js.map +1 -1
- package/dist/js/components/Modal/Modal.d.ts +57 -48
- package/dist/js/components/Modal/Modal.d.ts.map +1 -1
- package/dist/js/components/Modal/Modal.js.map +1 -1
- package/dist/js/components/Modal/ModalBox.d.ts +12 -12
- package/dist/js/components/Modal/ModalBox.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxBody.d.ts +2 -2
- package/dist/js/components/Modal/ModalBoxBody.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxCloseButton.d.ts +2 -2
- package/dist/js/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxDescription.d.ts +3 -3
- package/dist/js/components/Modal/ModalBoxDescription.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxFooter.d.ts +2 -2
- package/dist/js/components/Modal/ModalBoxFooter.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxHeader.d.ts +3 -3
- package/dist/js/components/Modal/ModalBoxHeader.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxTitle.d.ts +8 -9
- package/dist/js/components/Modal/ModalBoxTitle.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalBoxTitle.js.map +1 -1
- package/dist/js/components/Modal/ModalContent.d.ts +56 -48
- package/dist/js/components/Modal/ModalContent.d.ts.map +1 -1
- package/dist/js/components/Modal/ModalContent.js.map +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.d.ts +17 -13
- package/dist/js/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.js +3 -3
- package/dist/js/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/js/components/Pagination/Navigation.d.ts +33 -33
- package/dist/js/components/Pagination/Navigation.d.ts.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.d.ts +27 -26
- package/dist/js/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/js/components/Pagination/Pagination.d.ts +76 -65
- package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/js/components/Pagination/Pagination.js +1 -1
- package/dist/js/components/Pagination/Pagination.js.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +22 -18
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/js/components/Pagination/ToggleTemplate.d.ts +3 -0
- package/dist/js/components/Pagination/ToggleTemplate.d.ts.map +1 -1
- package/dist/js/components/Pagination/ToggleTemplate.js.map +1 -1
- package/dist/js/components/Popover/Popover.d.ts +88 -73
- package/dist/js/components/Popover/Popover.d.ts.map +1 -1
- package/dist/js/components/Popover/Popover.js.map +1 -1
- package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts +27 -26
- package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
- package/dist/js/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.d.ts +71 -60
- package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/js/components/Slider/Slider.d.ts +45 -39
- package/dist/js/components/Slider/Slider.d.ts.map +1 -1
- package/dist/js/components/Slider/Slider.js.map +1 -1
- package/dist/js/components/Slider/SliderStep.d.ts +10 -10
- package/dist/js/components/Slider/SliderStep.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeView.d.ts +65 -53
- package/dist/js/components/TreeView/TreeView.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeView.js.map +1 -1
- package/dist/js/components/TreeView/TreeViewList.d.ts +4 -4
- package/dist/js/components/TreeView/TreeViewList.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeViewListItem.d.ts +46 -39
- package/dist/js/components/TreeView/TreeViewListItem.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeViewListItem.js.map +1 -1
- package/dist/js/components/TreeView/TreeViewRoot.d.ts +4 -4
- package/dist/js/components/TreeView/TreeViewRoot.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeViewSearch.d.ts +11 -8
- package/dist/js/components/TreeView/TreeViewSearch.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeViewSearch.js.map +1 -1
- package/dist/js/helpers/Popper/Popper.js +8 -8
- package/dist/js/helpers/Popper/Popper.js.map +1 -1
- package/dist/umd/react-core.min.css +3498 -3498
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +2 -2
- package/src/components/Alert/Alert.tsx +42 -34
- package/src/components/Alert/AlertActionCloseButton.tsx +9 -5
- package/src/components/Alert/AlertActionLink.tsx +6 -2
- package/src/components/Alert/AlertIcon.tsx +4 -4
- package/src/components/Alert/AlertToggleExpandButton.tsx +5 -5
- package/src/components/Badge/__tests__/Badge.test.tsx +45 -8
- package/src/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap +2 -12
- package/src/components/CalendarMonth/CalendarMonth.tsx +36 -28
- package/src/components/DatePicker/DatePicker.tsx +45 -36
- package/src/components/ExpandableSection/ExpandableSection.tsx +35 -24
- package/src/components/ExpandableSection/ExpandableSectionToggle.tsx +11 -5
- package/src/components/FileUpload/FileUpload.tsx +56 -49
- package/src/components/FileUpload/FileUploadField.tsx +56 -50
- package/src/components/Modal/Modal.tsx +57 -48
- package/src/components/Modal/ModalBox.tsx +12 -12
- package/src/components/Modal/ModalBoxBody.tsx +2 -2
- package/src/components/Modal/ModalBoxCloseButton.tsx +2 -2
- package/src/components/Modal/ModalBoxDescription.tsx +3 -3
- package/src/components/Modal/ModalBoxFooter.tsx +2 -2
- package/src/components/Modal/ModalBoxHeader.tsx +3 -3
- package/src/components/Modal/ModalBoxTitle.tsx +8 -9
- package/src/components/Modal/ModalContent.tsx +56 -48
- package/src/components/Modal/examples/Modal.md +1 -3
- package/src/components/NotificationBadge/NotificationBadge.tsx +22 -15
- package/src/components/NotificationBadge/__tests__/NotificationBadge.test.tsx +25 -1
- package/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap +5 -0
- package/src/components/NotificationBadge/examples/NotificationBadge.md +16 -3
- package/src/components/NotificationBadge/examples/NotificationBadgeBasic.tsx +26 -13
- package/src/components/NotificationBadge/examples/NotificationBadgeWithCount.tsx +28 -18
- package/src/components/NumberInput/examples/NumberInput.md +9 -448
- package/src/components/NumberInput/examples/NumberInputCustomStep.tsx +29 -0
- package/src/components/NumberInput/examples/NumberInputCustomStepAndThreshold.tsx +52 -0
- package/src/components/NumberInput/examples/NumberInputDefault.tsx +34 -0
- package/src/components/NumberInput/examples/NumberInputDisabled.tsx +40 -0
- package/src/components/NumberInput/examples/NumberInputUnit.tsx +57 -0
- package/src/components/NumberInput/examples/NumberInputUnitThreshold.tsx +55 -0
- package/src/components/NumberInput/examples/NumberInputVaryingSizes.tsx +80 -0
- package/src/components/NumberInput/examples/{WithStatus.tsx → NumberInputWithStatus.tsx} +4 -3
- package/src/components/Pagination/Navigation.tsx +33 -33
- package/src/components/Pagination/OptionsToggle.tsx +27 -26
- package/src/components/Pagination/Pagination.tsx +79 -65
- package/src/components/Pagination/PaginationOptionsMenu.tsx +22 -18
- package/src/components/Pagination/ToggleTemplate.tsx +4 -0
- package/src/components/Popover/Popover.tsx +89 -73
- package/src/components/SearchInput/AdvancedSearchMenu.tsx +29 -28
- package/src/components/SearchInput/SearchInput.tsx +76 -62
- package/src/components/Slider/Slider.tsx +47 -41
- package/src/components/Slider/SliderStep.tsx +10 -10
- package/src/components/TreeView/TreeView.tsx +67 -53
- package/src/components/TreeView/TreeViewList.tsx +4 -4
- package/src/components/TreeView/TreeViewListItem.tsx +46 -39
- package/src/components/TreeView/TreeViewRoot.tsx +4 -4
- package/src/components/TreeView/TreeViewSearch.tsx +12 -8
- package/src/demos/Masthead.md +9 -193
- package/src/demos/NotificationDrawer/NotificationDrawer.md +2 -0
- package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +305 -0
- package/src/helpers/Popper/Popper.tsx +8 -8
|
@@ -15,62 +15,70 @@ import { ModalBoxHeader } from './ModalBoxHeader';
|
|
|
15
15
|
import { ModalBoxTitle, isVariantIcon } from './ModalBoxTitle';
|
|
16
16
|
|
|
17
17
|
export interface ModalContentProps extends OUIAProps {
|
|
18
|
-
/**
|
|
18
|
+
/** Action buttons to add to the standard modal footer. Ignored if the footer property
|
|
19
|
+
* is passed in.
|
|
20
|
+
*/
|
|
21
|
+
actions?: any;
|
|
22
|
+
/** Id to use for the modal box descriptor. */
|
|
23
|
+
'aria-describedby'?: string;
|
|
24
|
+
/** Accessible descriptor of the modal. */
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
/** Id to use for the modal box label. */
|
|
27
|
+
'aria-labelledby'?: string | null;
|
|
28
|
+
/** Accessible label applied to the modal box body. This should be used to communicate
|
|
29
|
+
* important information about the modal box body div element if needed, such as that it
|
|
30
|
+
* is scrollable.
|
|
31
|
+
*/
|
|
32
|
+
bodyAriaLabel?: string;
|
|
33
|
+
/** Accessible role applied to the modal box body. This will default to "region" if the
|
|
34
|
+
* bodyAriaLabel property is passed in. Set to a more appropriate role as applicable
|
|
35
|
+
* based on the modal content and context.
|
|
36
|
+
*/
|
|
37
|
+
bodyAriaRole?: string;
|
|
38
|
+
/** Id of the modal box container. */
|
|
39
|
+
boxId: string;
|
|
40
|
+
/** Content rendered inside the modal. */
|
|
19
41
|
children: React.ReactNode;
|
|
20
|
-
/** Additional classes added to the
|
|
42
|
+
/** Additional classes added to the modal box. */
|
|
21
43
|
className?: string;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
/**
|
|
44
|
+
/** Description of the modal. */
|
|
45
|
+
description?: React.ReactNode;
|
|
46
|
+
/** Id of the modal box description. */
|
|
47
|
+
descriptorId: string;
|
|
48
|
+
/** Flag to disable focus trap. */
|
|
49
|
+
disableFocusTrap?: boolean;
|
|
50
|
+
/** Custom footer. */
|
|
51
|
+
footer?: React.ReactNode;
|
|
52
|
+
/** Flag indicating if modal content should be placed in a modal box body wrapper. */
|
|
53
|
+
hasNoBodyWrapper?: boolean;
|
|
54
|
+
/** Complex header (more than just text), supersedes the title property for header content. */
|
|
31
55
|
header?: React.ReactNode;
|
|
32
|
-
/** Optional help section for the
|
|
56
|
+
/** Optional help section for the modal header. */
|
|
33
57
|
help?: React.ReactNode;
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
/**
|
|
58
|
+
/** Flag to show the modal. */
|
|
59
|
+
isOpen?: boolean;
|
|
60
|
+
/** Id of the modal box title. */
|
|
61
|
+
labelId: string;
|
|
62
|
+
/** A callback for when the close button is clicked. */
|
|
63
|
+
onClose?: () => void;
|
|
64
|
+
/** Alternate position of the modal. */
|
|
65
|
+
position?: 'top';
|
|
66
|
+
/** Offset from alternate position. Can be any valid CSS length/percentage. */
|
|
67
|
+
positionOffset?: string;
|
|
68
|
+
/** Flag to show the close button in the header area of the modal. */
|
|
69
|
+
showClose?: boolean;
|
|
70
|
+
/** Simple text content of the modal header. Also used for the aria-label on the body. */
|
|
37
71
|
title?: string;
|
|
38
|
-
/** Optional alert icon (or other) to show before the title of the
|
|
39
|
-
*
|
|
40
|
-
|
|
72
|
+
/** Optional alert icon (or other) to show before the title of the modal header. When the
|
|
73
|
+
* predefined alert types are used the default styling will be automatically applied.
|
|
74
|
+
*/
|
|
41
75
|
titleIconVariant?: 'success' | 'danger' | 'warning' | 'info' | 'default' | React.ComponentType<any>;
|
|
42
|
-
/** Optional title label text for screen readers */
|
|
76
|
+
/** Optional title label text for screen readers. */
|
|
43
77
|
titleLabel?: string;
|
|
44
|
-
/**
|
|
45
|
-
'
|
|
46
|
-
/**
|
|
47
|
-
'aria-label'?: string;
|
|
48
|
-
/** Id of Modal Box description */
|
|
49
|
-
'aria-describedby'?: string;
|
|
50
|
-
/** Accessible label applied to the modal box body. This should be used to communicate important information about the modal box body div if needed, such as that it is scrollable */
|
|
51
|
-
bodyAriaLabel?: string;
|
|
52
|
-
/** Accessible role applied to the modal box body. This will default to region if a body aria label is applied. Set to a more appropriate role as applicable based on the modal content and context */
|
|
53
|
-
bodyAriaRole?: string;
|
|
54
|
-
/** Flag to show the close button in the header area of the modal */
|
|
55
|
-
showClose?: boolean;
|
|
56
|
-
/** Default width of the content. */
|
|
78
|
+
/** Variant of the modal. */
|
|
79
|
+
variant?: 'small' | 'medium' | 'large' | 'default';
|
|
80
|
+
/** Default width of the modal. */
|
|
57
81
|
width?: number | string;
|
|
58
|
-
/** Custom footer */
|
|
59
|
-
footer?: React.ReactNode;
|
|
60
|
-
/** Action buttons to add to the standard Modal Footer, ignored if `footer` is given */
|
|
61
|
-
actions?: any;
|
|
62
|
-
/** A callback for when the close button is clicked */
|
|
63
|
-
onClose?: () => void;
|
|
64
|
-
/** Id of the ModalBox container */
|
|
65
|
-
boxId: string;
|
|
66
|
-
/** Id of the ModalBox title */
|
|
67
|
-
labelId: string;
|
|
68
|
-
/** Id of the ModalBoxBody */
|
|
69
|
-
descriptorId: string;
|
|
70
|
-
/** Flag to disable focus trap */
|
|
71
|
-
disableFocusTrap?: boolean;
|
|
72
|
-
/** Flag indicating if modal content should be placed in a modal box body wrapper */
|
|
73
|
-
hasNoBodyWrapper?: boolean;
|
|
74
82
|
}
|
|
75
83
|
|
|
76
84
|
export const ModalContent: React.FunctionComponent<ModalContentProps> = ({
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
id: Modal
|
|
3
3
|
section: components
|
|
4
4
|
cssPrefix: pf-c-modal-box
|
|
5
|
-
propComponents: ['Modal'
|
|
5
|
+
propComponents: ['Modal']
|
|
6
6
|
ouia: true
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -94,5 +94,3 @@ If the content that you're passing to the modal is likely to overflow the modal
|
|
|
94
94
|
|
|
95
95
|
```ts file="ModalWithOverflowingContent.tsx"
|
|
96
96
|
```
|
|
97
|
-
|
|
98
|
-
|
|
@@ -12,22 +12,26 @@ export enum NotificationBadgeVariant {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export interface NotificationBadgeProps extends Omit<ButtonProps, 'variant'> {
|
|
15
|
-
/**
|
|
16
|
-
isRead?: boolean;
|
|
17
|
-
/** Determines the variant of the notification badge */
|
|
18
|
-
variant?: NotificationBadgeVariant | 'read' | 'unread' | 'attention';
|
|
19
|
-
/** A number displayed in the badge alongside the icon */
|
|
20
|
-
count?: number;
|
|
21
|
-
/** content rendered inside the notification badge */
|
|
22
|
-
children?: React.ReactNode;
|
|
23
|
-
/** additional classes added to the notification badge */
|
|
24
|
-
className?: string;
|
|
25
|
-
/** Adds accessible text to the notification badge. */
|
|
15
|
+
/** Adds an accessible label to the notification badge. */
|
|
26
16
|
'aria-label'?: string;
|
|
27
|
-
/** Icon to display for attention variant */
|
|
17
|
+
/** Icon to display for attention variant. */
|
|
28
18
|
attentionIcon?: React.ReactNode;
|
|
29
|
-
/**
|
|
19
|
+
/** Content rendered inside the notification badge. */
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
/** Additional classes added to the notification badge. */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** A number displayed in the badge alongside the icon. */
|
|
24
|
+
count?: number;
|
|
25
|
+
/** Icon to display in the notification badge. */
|
|
30
26
|
icon?: React.ReactNode;
|
|
27
|
+
/** Flag for applying expanded styling and setting the aria-expanded attribute on the
|
|
28
|
+
* notification badge.
|
|
29
|
+
*/
|
|
30
|
+
isExpanded?: boolean;
|
|
31
|
+
/** @deprecated Use the variant prop instead - Adds styling to the notification badge to indicate it has been read. */
|
|
32
|
+
isRead?: boolean;
|
|
33
|
+
/** Determines the variant of the notification badge. */
|
|
34
|
+
variant?: NotificationBadgeVariant | 'read' | 'unread' | 'attention';
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
export const NotificationBadge: React.FunctionComponent<NotificationBadgeProps> = ({
|
|
@@ -38,6 +42,7 @@ export const NotificationBadge: React.FunctionComponent<NotificationBadgeProps>
|
|
|
38
42
|
attentionIcon = <AttentionBellIcon />,
|
|
39
43
|
icon = <BellIcon />,
|
|
40
44
|
className,
|
|
45
|
+
isExpanded = false,
|
|
41
46
|
...props
|
|
42
47
|
}: NotificationBadgeProps) => {
|
|
43
48
|
let notificationChild = icon;
|
|
@@ -47,8 +52,10 @@ export const NotificationBadge: React.FunctionComponent<NotificationBadgeProps>
|
|
|
47
52
|
notificationChild = attentionIcon;
|
|
48
53
|
}
|
|
49
54
|
return (
|
|
50
|
-
<Button variant={ButtonVariant.plain} className={className} {...props}>
|
|
51
|
-
<span
|
|
55
|
+
<Button variant={ButtonVariant.plain} className={className} aria-expanded={isExpanded} {...props}>
|
|
56
|
+
<span
|
|
57
|
+
className={css(styles.notificationBadge, styles.modifiers[variant], isExpanded && styles.modifiers.expanded)}
|
|
58
|
+
>
|
|
52
59
|
{notificationChild}
|
|
53
60
|
{count > 0 && <span className={css(styles.notificationBadgeCount)}>{count}</span>}
|
|
54
61
|
</span>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NotificationBadge } from '../NotificationBadge';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { render } from '@testing-library/react';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
4
|
|
|
5
5
|
Object.values([true, false]).forEach(isRead => {
|
|
6
6
|
test(`${isRead} NotificationBadge`, () => {
|
|
@@ -24,3 +24,27 @@ test(`NotificationBadge count`, () => {
|
|
|
24
24
|
const { asFragment } = render(<NotificationBadge variant="read" count={3} />);
|
|
25
25
|
expect(asFragment()).toMatchSnapshot();
|
|
26
26
|
});
|
|
27
|
+
|
|
28
|
+
test('Renders with aria-expanded="false" when isExpanded is not passed in.', () => {
|
|
29
|
+
render(<NotificationBadge />);
|
|
30
|
+
|
|
31
|
+
expect(screen.getByRole('button')).toHaveAttribute('aria-expanded', 'false');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('Renders with aria-expanded="true" when isExpanded is passed in.', () => {
|
|
35
|
+
render(<NotificationBadge isExpanded />);
|
|
36
|
+
|
|
37
|
+
expect(screen.getByRole('button')).toHaveAttribute('aria-expanded', 'true');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('Does not render with .pf-m-expanded when isExpanded is not passed in.', () => {
|
|
41
|
+
render(<NotificationBadge />);
|
|
42
|
+
|
|
43
|
+
expect(screen.getByRole('button').firstChild).not.toHaveClass('pf-m-expanded');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('Renders with .pf-m-expanded when isExpanded is passed in.', () => {
|
|
47
|
+
render(<NotificationBadge isExpanded />);
|
|
48
|
+
|
|
49
|
+
expect(screen.getByRole('button').firstChild).toHaveClass('pf-m-expanded');
|
|
50
|
+
});
|
package/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap
CHANGED
|
@@ -4,6 +4,7 @@ exports[`NotificationBadge count 1`] = `
|
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<button
|
|
6
6
|
aria-disabled="false"
|
|
7
|
+
aria-expanded="false"
|
|
7
8
|
class="pf-c-button pf-m-plain"
|
|
8
9
|
data-ouia-component-id="OUIA-Generated-Button-plain-5"
|
|
9
10
|
data-ouia-component-type="PF4/Button"
|
|
@@ -40,6 +41,7 @@ exports[`false NotificationBadge 1`] = `
|
|
|
40
41
|
<DocumentFragment>
|
|
41
42
|
<button
|
|
42
43
|
aria-disabled="false"
|
|
44
|
+
aria-expanded="false"
|
|
43
45
|
class="pf-c-button pf-m-plain"
|
|
44
46
|
data-ouia-component-id="OUIA-Generated-Button-plain-2"
|
|
45
47
|
data-ouia-component-type="PF4/Button"
|
|
@@ -71,6 +73,7 @@ exports[`false NotificationBadge needs attention 1`] = `
|
|
|
71
73
|
<DocumentFragment>
|
|
72
74
|
<button
|
|
73
75
|
aria-disabled="false"
|
|
76
|
+
aria-expanded="false"
|
|
74
77
|
class="pf-c-button pf-m-plain"
|
|
75
78
|
data-ouia-component-id="OUIA-Generated-Button-plain-4"
|
|
76
79
|
data-ouia-component-type="PF4/Button"
|
|
@@ -90,6 +93,7 @@ exports[`true NotificationBadge 1`] = `
|
|
|
90
93
|
<DocumentFragment>
|
|
91
94
|
<button
|
|
92
95
|
aria-disabled="false"
|
|
96
|
+
aria-expanded="false"
|
|
93
97
|
class="pf-c-button pf-m-plain"
|
|
94
98
|
data-ouia-component-id="OUIA-Generated-Button-plain-1"
|
|
95
99
|
data-ouia-component-type="PF4/Button"
|
|
@@ -121,6 +125,7 @@ exports[`true NotificationBadge needs attention 1`] = `
|
|
|
121
125
|
<DocumentFragment>
|
|
122
126
|
<button
|
|
123
127
|
aria-disabled="false"
|
|
128
|
+
aria-expanded="false"
|
|
124
129
|
class="pf-c-button pf-m-plain"
|
|
125
130
|
data-ouia-component-id="OUIA-Generated-Button-plain-3"
|
|
126
131
|
data-ouia-component-type="PF4/Button"
|
|
@@ -4,15 +4,28 @@ section: components
|
|
|
4
4
|
cssPrefix: pf-c-notification-badge
|
|
5
5
|
propComponents: ['NotificationBadge']
|
|
6
6
|
---
|
|
7
|
+
|
|
7
8
|
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
8
9
|
import './notificationBadge.css';
|
|
9
10
|
|
|
10
11
|
## Examples
|
|
11
12
|
|
|
12
13
|
### Basic
|
|
13
|
-
|
|
14
|
+
|
|
15
|
+
The following example demonstrates the three variants of notification badge that are available: "read", "unread", and "attention".
|
|
16
|
+
|
|
17
|
+
The `isExpanded` property is also passed in to:
|
|
18
|
+
|
|
19
|
+
- set the `aria-expanded` attribute on the notification badge,
|
|
20
|
+
- apply visual styling on the notification badge, and
|
|
21
|
+
- to indiciate that a notification drawer is expanded, for use-cases as seen in our [notification drawer react demos](/components/notification-drawer/react-demos).
|
|
22
|
+
|
|
23
|
+
```ts file='./NotificationBadgeBasic.tsx'
|
|
14
24
|
```
|
|
15
25
|
|
|
16
26
|
### With count
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
|
|
28
|
+
You can display a number within the notification badge by passing in the `count` property, to indicate how many read, unread, or attention notifications there are. The `isExpanded` property is also passed in, similar to the [notification badge basic example](/components/notification-badge#basic).
|
|
29
|
+
|
|
30
|
+
```ts file='./NotificationBadgeWithCount.tsx'
|
|
31
|
+
```
|
|
@@ -1,29 +1,42 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { NotificationBadge, NotificationBadgeVariant } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
|
-
export const
|
|
5
|
-
const [
|
|
6
|
-
const [
|
|
4
|
+
export const NotificationBadgeBasic: React.FunctionComponent = () => {
|
|
5
|
+
const [readExpanded, setReadExpanded] = React.useState(false);
|
|
6
|
+
const [unreadExpanded, setUnreadExpanded] = React.useState(false);
|
|
7
|
+
const [attentionExpanded, setAttentionExpanded] = React.useState(false);
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
-
|
|
9
|
+
const onReadClick = () => {
|
|
10
|
+
setReadExpanded(!readExpanded);
|
|
10
11
|
};
|
|
11
12
|
|
|
12
|
-
const
|
|
13
|
-
|
|
13
|
+
const onUnreadClick = () => {
|
|
14
|
+
setUnreadExpanded(!unreadExpanded);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const onAttentionClick = () => {
|
|
18
|
+
setAttentionExpanded(!attentionExpanded);
|
|
14
19
|
};
|
|
15
20
|
|
|
16
21
|
return (
|
|
17
22
|
<div className="pf-t-dark">
|
|
18
23
|
<NotificationBadge
|
|
19
|
-
variant={
|
|
20
|
-
onClick={
|
|
21
|
-
aria-label="
|
|
24
|
+
variant={NotificationBadgeVariant.read}
|
|
25
|
+
onClick={onReadClick}
|
|
26
|
+
aria-label="Basic notification badge with read variant"
|
|
27
|
+
isExpanded={readExpanded}
|
|
28
|
+
/>
|
|
29
|
+
<NotificationBadge
|
|
30
|
+
variant={NotificationBadgeVariant.unread}
|
|
31
|
+
onClick={onUnreadClick}
|
|
32
|
+
aria-label="Basic notification badge with unread variant"
|
|
33
|
+
isExpanded={unreadExpanded}
|
|
22
34
|
/>
|
|
23
35
|
<NotificationBadge
|
|
24
|
-
variant={
|
|
25
|
-
onClick={
|
|
26
|
-
aria-label="
|
|
36
|
+
variant={NotificationBadgeVariant.attention}
|
|
37
|
+
onClick={onAttentionClick}
|
|
38
|
+
aria-label="Basic notification badge with attention variant"
|
|
39
|
+
isExpanded={attentionExpanded}
|
|
27
40
|
/>
|
|
28
41
|
</div>
|
|
29
42
|
);
|
|
@@ -2,34 +2,44 @@ import React from 'react';
|
|
|
2
2
|
import { NotificationBadge, NotificationBadgeVariant } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
4
|
export const NotificationBadgeWithCount: React.FunctionComponent = () => {
|
|
5
|
-
const [
|
|
6
|
-
const [
|
|
7
|
-
const [
|
|
8
|
-
const [secondVariantCount, setSecondVariantCount] = React.useState(30);
|
|
5
|
+
const [readExpanded, setReadExpanded] = React.useState(false);
|
|
6
|
+
const [unreadExpanded, setUnreadExpanded] = React.useState(false);
|
|
7
|
+
const [attentionExpanded, setAttentionExpanded] = React.useState(false);
|
|
9
8
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
setFirstVariantCount(10);
|
|
9
|
+
const onReadClick = () => {
|
|
10
|
+
setReadExpanded(!readExpanded);
|
|
13
11
|
};
|
|
14
12
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const onUnreadClick = () => {
|
|
14
|
+
setUnreadExpanded(!unreadExpanded);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const onAttentionClick = () => {
|
|
18
|
+
setAttentionExpanded(!attentionExpanded);
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
22
|
<div className="pf-t-dark">
|
|
22
23
|
<NotificationBadge
|
|
23
|
-
variant={
|
|
24
|
-
onClick={
|
|
25
|
-
aria-label="
|
|
26
|
-
|
|
24
|
+
variant={NotificationBadgeVariant.read}
|
|
25
|
+
onClick={onReadClick}
|
|
26
|
+
aria-label="Notification badge with count and read variant"
|
|
27
|
+
isExpanded={readExpanded}
|
|
28
|
+
count={10}
|
|
29
|
+
/>
|
|
30
|
+
<NotificationBadge
|
|
31
|
+
variant={NotificationBadgeVariant.unread}
|
|
32
|
+
onClick={onUnreadClick}
|
|
33
|
+
aria-label="Notification badge with count and unread variant"
|
|
34
|
+
isExpanded={unreadExpanded}
|
|
35
|
+
count={10}
|
|
27
36
|
/>
|
|
28
37
|
<NotificationBadge
|
|
29
|
-
variant={
|
|
30
|
-
onClick={
|
|
31
|
-
aria-label="
|
|
32
|
-
|
|
38
|
+
variant={NotificationBadgeVariant.attention}
|
|
39
|
+
onClick={onAttentionClick}
|
|
40
|
+
aria-label="Notification badge with count and attention variant"
|
|
41
|
+
isExpanded={attentionExpanded}
|
|
42
|
+
count={10}
|
|
33
43
|
/>
|
|
34
44
|
</div>
|
|
35
45
|
);
|