@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.
Files changed (263) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/components/Alert/Alert.d.ts +41 -34
  3. package/dist/esm/components/Alert/Alert.d.ts.map +1 -1
  4. package/dist/esm/components/Alert/Alert.js.map +1 -1
  5. package/dist/esm/components/Alert/AlertActionCloseButton.d.ts +8 -5
  6. package/dist/esm/components/Alert/AlertActionCloseButton.d.ts.map +1 -1
  7. package/dist/esm/components/Alert/AlertActionCloseButton.js.map +1 -1
  8. package/dist/esm/components/Alert/AlertActionLink.d.ts +5 -2
  9. package/dist/esm/components/Alert/AlertActionLink.d.ts.map +1 -1
  10. package/dist/esm/components/Alert/AlertActionLink.js.map +1 -1
  11. package/dist/esm/components/Alert/AlertIcon.d.ts +4 -4
  12. package/dist/esm/components/Alert/AlertIcon.d.ts.map +1 -1
  13. package/dist/esm/components/Alert/AlertToggleExpandButton.d.ts +5 -5
  14. package/dist/esm/components/Alert/AlertToggleExpandButton.d.ts.map +1 -1
  15. package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts +34 -28
  16. package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
  17. package/dist/esm/components/CalendarMonth/CalendarMonth.js +1 -0
  18. package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
  19. package/dist/esm/components/DatePicker/DatePicker.d.ts +43 -36
  20. package/dist/esm/components/DatePicker/DatePicker.d.ts.map +1 -1
  21. package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
  22. package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts +34 -24
  23. package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
  24. package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
  25. package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts +10 -5
  26. package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
  27. package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
  28. package/dist/esm/components/FileUpload/FileUpload.d.ts +53 -47
  29. package/dist/esm/components/FileUpload/FileUpload.d.ts.map +1 -1
  30. package/dist/esm/components/FileUpload/FileUpload.js.map +1 -1
  31. package/dist/esm/components/FileUpload/FileUploadField.d.ts +51 -46
  32. package/dist/esm/components/FileUpload/FileUploadField.d.ts.map +1 -1
  33. package/dist/esm/components/FileUpload/FileUploadField.js.map +1 -1
  34. package/dist/esm/components/Modal/Modal.d.ts +57 -48
  35. package/dist/esm/components/Modal/Modal.d.ts.map +1 -1
  36. package/dist/esm/components/Modal/Modal.js.map +1 -1
  37. package/dist/esm/components/Modal/ModalBox.d.ts +12 -12
  38. package/dist/esm/components/Modal/ModalBox.d.ts.map +1 -1
  39. package/dist/esm/components/Modal/ModalBoxBody.d.ts +2 -2
  40. package/dist/esm/components/Modal/ModalBoxBody.d.ts.map +1 -1
  41. package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts +2 -2
  42. package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
  43. package/dist/esm/components/Modal/ModalBoxDescription.d.ts +3 -3
  44. package/dist/esm/components/Modal/ModalBoxDescription.d.ts.map +1 -1
  45. package/dist/esm/components/Modal/ModalBoxFooter.d.ts +2 -2
  46. package/dist/esm/components/Modal/ModalBoxFooter.d.ts.map +1 -1
  47. package/dist/esm/components/Modal/ModalBoxHeader.d.ts +3 -3
  48. package/dist/esm/components/Modal/ModalBoxHeader.d.ts.map +1 -1
  49. package/dist/esm/components/Modal/ModalBoxTitle.d.ts +8 -9
  50. package/dist/esm/components/Modal/ModalBoxTitle.d.ts.map +1 -1
  51. package/dist/esm/components/Modal/ModalBoxTitle.js.map +1 -1
  52. package/dist/esm/components/Modal/ModalContent.d.ts +56 -48
  53. package/dist/esm/components/Modal/ModalContent.d.ts.map +1 -1
  54. package/dist/esm/components/Modal/ModalContent.js.map +1 -1
  55. package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts +17 -13
  56. package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
  57. package/dist/esm/components/NotificationBadge/NotificationBadge.js +3 -3
  58. package/dist/esm/components/NotificationBadge/NotificationBadge.js.map +1 -1
  59. package/dist/esm/components/Pagination/Navigation.d.ts +33 -33
  60. package/dist/esm/components/Pagination/Navigation.d.ts.map +1 -1
  61. package/dist/esm/components/Pagination/OptionsToggle.d.ts +27 -26
  62. package/dist/esm/components/Pagination/OptionsToggle.d.ts.map +1 -1
  63. package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
  64. package/dist/esm/components/Pagination/Pagination.d.ts +76 -65
  65. package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
  66. package/dist/esm/components/Pagination/Pagination.js +1 -1
  67. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  68. package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +22 -18
  69. package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
  70. package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
  71. package/dist/esm/components/Pagination/ToggleTemplate.d.ts +3 -0
  72. package/dist/esm/components/Pagination/ToggleTemplate.d.ts.map +1 -1
  73. package/dist/esm/components/Pagination/ToggleTemplate.js.map +1 -1
  74. package/dist/esm/components/Popover/Popover.d.ts +88 -73
  75. package/dist/esm/components/Popover/Popover.d.ts.map +1 -1
  76. package/dist/esm/components/Popover/Popover.js.map +1 -1
  77. package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts +27 -26
  78. package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
  79. package/dist/esm/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
  80. package/dist/esm/components/SearchInput/SearchInput.d.ts +71 -60
  81. package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
  82. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  83. package/dist/esm/components/Slider/Slider.d.ts +45 -39
  84. package/dist/esm/components/Slider/Slider.d.ts.map +1 -1
  85. package/dist/esm/components/Slider/Slider.js.map +1 -1
  86. package/dist/esm/components/Slider/SliderStep.d.ts +10 -10
  87. package/dist/esm/components/Slider/SliderStep.d.ts.map +1 -1
  88. package/dist/esm/components/TreeView/TreeView.d.ts +65 -53
  89. package/dist/esm/components/TreeView/TreeView.d.ts.map +1 -1
  90. package/dist/esm/components/TreeView/TreeView.js.map +1 -1
  91. package/dist/esm/components/TreeView/TreeViewList.d.ts +4 -4
  92. package/dist/esm/components/TreeView/TreeViewList.d.ts.map +1 -1
  93. package/dist/esm/components/TreeView/TreeViewListItem.d.ts +46 -39
  94. package/dist/esm/components/TreeView/TreeViewListItem.d.ts.map +1 -1
  95. package/dist/esm/components/TreeView/TreeViewListItem.js.map +1 -1
  96. package/dist/esm/components/TreeView/TreeViewRoot.d.ts +4 -4
  97. package/dist/esm/components/TreeView/TreeViewRoot.d.ts.map +1 -1
  98. package/dist/esm/components/TreeView/TreeViewSearch.d.ts +11 -8
  99. package/dist/esm/components/TreeView/TreeViewSearch.d.ts.map +1 -1
  100. package/dist/esm/components/TreeView/TreeViewSearch.js.map +1 -1
  101. package/dist/esm/helpers/Popper/Popper.js +8 -8
  102. package/dist/esm/helpers/Popper/Popper.js.map +1 -1
  103. package/dist/js/components/Alert/Alert.d.ts +41 -34
  104. package/dist/js/components/Alert/Alert.d.ts.map +1 -1
  105. package/dist/js/components/Alert/Alert.js.map +1 -1
  106. package/dist/js/components/Alert/AlertActionCloseButton.d.ts +8 -5
  107. package/dist/js/components/Alert/AlertActionCloseButton.d.ts.map +1 -1
  108. package/dist/js/components/Alert/AlertActionCloseButton.js.map +1 -1
  109. package/dist/js/components/Alert/AlertActionLink.d.ts +5 -2
  110. package/dist/js/components/Alert/AlertActionLink.d.ts.map +1 -1
  111. package/dist/js/components/Alert/AlertActionLink.js.map +1 -1
  112. package/dist/js/components/Alert/AlertIcon.d.ts +4 -4
  113. package/dist/js/components/Alert/AlertIcon.d.ts.map +1 -1
  114. package/dist/js/components/Alert/AlertToggleExpandButton.d.ts +5 -5
  115. package/dist/js/components/Alert/AlertToggleExpandButton.d.ts.map +1 -1
  116. package/dist/js/components/CalendarMonth/CalendarMonth.d.ts +34 -28
  117. package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
  118. package/dist/js/components/CalendarMonth/CalendarMonth.js +1 -0
  119. package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
  120. package/dist/js/components/DatePicker/DatePicker.d.ts +43 -36
  121. package/dist/js/components/DatePicker/DatePicker.d.ts.map +1 -1
  122. package/dist/js/components/DatePicker/DatePicker.js.map +1 -1
  123. package/dist/js/components/ExpandableSection/ExpandableSection.d.ts +34 -24
  124. package/dist/js/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
  125. package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
  126. package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts +10 -5
  127. package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
  128. package/dist/js/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
  129. package/dist/js/components/FileUpload/FileUpload.d.ts +53 -47
  130. package/dist/js/components/FileUpload/FileUpload.d.ts.map +1 -1
  131. package/dist/js/components/FileUpload/FileUpload.js.map +1 -1
  132. package/dist/js/components/FileUpload/FileUploadField.d.ts +51 -46
  133. package/dist/js/components/FileUpload/FileUploadField.d.ts.map +1 -1
  134. package/dist/js/components/FileUpload/FileUploadField.js.map +1 -1
  135. package/dist/js/components/Modal/Modal.d.ts +57 -48
  136. package/dist/js/components/Modal/Modal.d.ts.map +1 -1
  137. package/dist/js/components/Modal/Modal.js.map +1 -1
  138. package/dist/js/components/Modal/ModalBox.d.ts +12 -12
  139. package/dist/js/components/Modal/ModalBox.d.ts.map +1 -1
  140. package/dist/js/components/Modal/ModalBoxBody.d.ts +2 -2
  141. package/dist/js/components/Modal/ModalBoxBody.d.ts.map +1 -1
  142. package/dist/js/components/Modal/ModalBoxCloseButton.d.ts +2 -2
  143. package/dist/js/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
  144. package/dist/js/components/Modal/ModalBoxDescription.d.ts +3 -3
  145. package/dist/js/components/Modal/ModalBoxDescription.d.ts.map +1 -1
  146. package/dist/js/components/Modal/ModalBoxFooter.d.ts +2 -2
  147. package/dist/js/components/Modal/ModalBoxFooter.d.ts.map +1 -1
  148. package/dist/js/components/Modal/ModalBoxHeader.d.ts +3 -3
  149. package/dist/js/components/Modal/ModalBoxHeader.d.ts.map +1 -1
  150. package/dist/js/components/Modal/ModalBoxTitle.d.ts +8 -9
  151. package/dist/js/components/Modal/ModalBoxTitle.d.ts.map +1 -1
  152. package/dist/js/components/Modal/ModalBoxTitle.js.map +1 -1
  153. package/dist/js/components/Modal/ModalContent.d.ts +56 -48
  154. package/dist/js/components/Modal/ModalContent.d.ts.map +1 -1
  155. package/dist/js/components/Modal/ModalContent.js.map +1 -1
  156. package/dist/js/components/NotificationBadge/NotificationBadge.d.ts +17 -13
  157. package/dist/js/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
  158. package/dist/js/components/NotificationBadge/NotificationBadge.js +3 -3
  159. package/dist/js/components/NotificationBadge/NotificationBadge.js.map +1 -1
  160. package/dist/js/components/Pagination/Navigation.d.ts +33 -33
  161. package/dist/js/components/Pagination/Navigation.d.ts.map +1 -1
  162. package/dist/js/components/Pagination/OptionsToggle.d.ts +27 -26
  163. package/dist/js/components/Pagination/OptionsToggle.d.ts.map +1 -1
  164. package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
  165. package/dist/js/components/Pagination/Pagination.d.ts +76 -65
  166. package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
  167. package/dist/js/components/Pagination/Pagination.js +1 -1
  168. package/dist/js/components/Pagination/Pagination.js.map +1 -1
  169. package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +22 -18
  170. package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
  171. package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
  172. package/dist/js/components/Pagination/ToggleTemplate.d.ts +3 -0
  173. package/dist/js/components/Pagination/ToggleTemplate.d.ts.map +1 -1
  174. package/dist/js/components/Pagination/ToggleTemplate.js.map +1 -1
  175. package/dist/js/components/Popover/Popover.d.ts +88 -73
  176. package/dist/js/components/Popover/Popover.d.ts.map +1 -1
  177. package/dist/js/components/Popover/Popover.js.map +1 -1
  178. package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts +27 -26
  179. package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
  180. package/dist/js/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
  181. package/dist/js/components/SearchInput/SearchInput.d.ts +71 -60
  182. package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
  183. package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
  184. package/dist/js/components/Slider/Slider.d.ts +45 -39
  185. package/dist/js/components/Slider/Slider.d.ts.map +1 -1
  186. package/dist/js/components/Slider/Slider.js.map +1 -1
  187. package/dist/js/components/Slider/SliderStep.d.ts +10 -10
  188. package/dist/js/components/Slider/SliderStep.d.ts.map +1 -1
  189. package/dist/js/components/TreeView/TreeView.d.ts +65 -53
  190. package/dist/js/components/TreeView/TreeView.d.ts.map +1 -1
  191. package/dist/js/components/TreeView/TreeView.js.map +1 -1
  192. package/dist/js/components/TreeView/TreeViewList.d.ts +4 -4
  193. package/dist/js/components/TreeView/TreeViewList.d.ts.map +1 -1
  194. package/dist/js/components/TreeView/TreeViewListItem.d.ts +46 -39
  195. package/dist/js/components/TreeView/TreeViewListItem.d.ts.map +1 -1
  196. package/dist/js/components/TreeView/TreeViewListItem.js.map +1 -1
  197. package/dist/js/components/TreeView/TreeViewRoot.d.ts +4 -4
  198. package/dist/js/components/TreeView/TreeViewRoot.d.ts.map +1 -1
  199. package/dist/js/components/TreeView/TreeViewSearch.d.ts +11 -8
  200. package/dist/js/components/TreeView/TreeViewSearch.d.ts.map +1 -1
  201. package/dist/js/components/TreeView/TreeViewSearch.js.map +1 -1
  202. package/dist/js/helpers/Popper/Popper.js +8 -8
  203. package/dist/js/helpers/Popper/Popper.js.map +1 -1
  204. package/dist/umd/react-core.min.css +3498 -3498
  205. package/dist/umd/react-core.min.js +2 -2
  206. package/package.json +2 -2
  207. package/src/components/Alert/Alert.tsx +42 -34
  208. package/src/components/Alert/AlertActionCloseButton.tsx +9 -5
  209. package/src/components/Alert/AlertActionLink.tsx +6 -2
  210. package/src/components/Alert/AlertIcon.tsx +4 -4
  211. package/src/components/Alert/AlertToggleExpandButton.tsx +5 -5
  212. package/src/components/Badge/__tests__/Badge.test.tsx +45 -8
  213. package/src/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap +2 -12
  214. package/src/components/CalendarMonth/CalendarMonth.tsx +36 -28
  215. package/src/components/DatePicker/DatePicker.tsx +45 -36
  216. package/src/components/ExpandableSection/ExpandableSection.tsx +35 -24
  217. package/src/components/ExpandableSection/ExpandableSectionToggle.tsx +11 -5
  218. package/src/components/FileUpload/FileUpload.tsx +56 -49
  219. package/src/components/FileUpload/FileUploadField.tsx +56 -50
  220. package/src/components/Modal/Modal.tsx +57 -48
  221. package/src/components/Modal/ModalBox.tsx +12 -12
  222. package/src/components/Modal/ModalBoxBody.tsx +2 -2
  223. package/src/components/Modal/ModalBoxCloseButton.tsx +2 -2
  224. package/src/components/Modal/ModalBoxDescription.tsx +3 -3
  225. package/src/components/Modal/ModalBoxFooter.tsx +2 -2
  226. package/src/components/Modal/ModalBoxHeader.tsx +3 -3
  227. package/src/components/Modal/ModalBoxTitle.tsx +8 -9
  228. package/src/components/Modal/ModalContent.tsx +56 -48
  229. package/src/components/Modal/examples/Modal.md +1 -3
  230. package/src/components/NotificationBadge/NotificationBadge.tsx +22 -15
  231. package/src/components/NotificationBadge/__tests__/NotificationBadge.test.tsx +25 -1
  232. package/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap +5 -0
  233. package/src/components/NotificationBadge/examples/NotificationBadge.md +16 -3
  234. package/src/components/NotificationBadge/examples/NotificationBadgeBasic.tsx +26 -13
  235. package/src/components/NotificationBadge/examples/NotificationBadgeWithCount.tsx +28 -18
  236. package/src/components/NumberInput/examples/NumberInput.md +9 -448
  237. package/src/components/NumberInput/examples/NumberInputCustomStep.tsx +29 -0
  238. package/src/components/NumberInput/examples/NumberInputCustomStepAndThreshold.tsx +52 -0
  239. package/src/components/NumberInput/examples/NumberInputDefault.tsx +34 -0
  240. package/src/components/NumberInput/examples/NumberInputDisabled.tsx +40 -0
  241. package/src/components/NumberInput/examples/NumberInputUnit.tsx +57 -0
  242. package/src/components/NumberInput/examples/NumberInputUnitThreshold.tsx +55 -0
  243. package/src/components/NumberInput/examples/NumberInputVaryingSizes.tsx +80 -0
  244. package/src/components/NumberInput/examples/{WithStatus.tsx → NumberInputWithStatus.tsx} +4 -3
  245. package/src/components/Pagination/Navigation.tsx +33 -33
  246. package/src/components/Pagination/OptionsToggle.tsx +27 -26
  247. package/src/components/Pagination/Pagination.tsx +79 -65
  248. package/src/components/Pagination/PaginationOptionsMenu.tsx +22 -18
  249. package/src/components/Pagination/ToggleTemplate.tsx +4 -0
  250. package/src/components/Popover/Popover.tsx +89 -73
  251. package/src/components/SearchInput/AdvancedSearchMenu.tsx +29 -28
  252. package/src/components/SearchInput/SearchInput.tsx +76 -62
  253. package/src/components/Slider/Slider.tsx +47 -41
  254. package/src/components/Slider/SliderStep.tsx +10 -10
  255. package/src/components/TreeView/TreeView.tsx +67 -53
  256. package/src/components/TreeView/TreeViewList.tsx +4 -4
  257. package/src/components/TreeView/TreeViewListItem.tsx +46 -39
  258. package/src/components/TreeView/TreeViewRoot.tsx +4 -4
  259. package/src/components/TreeView/TreeViewSearch.tsx +12 -8
  260. package/src/demos/Masthead.md +9 -193
  261. package/src/demos/NotificationDrawer/NotificationDrawer.md +2 -0
  262. package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +305 -0
  263. package/src/helpers/Popper/Popper.tsx +8 -8
@@ -3,76 +3,90 @@ import { TreeViewList } from './TreeViewList';
3
3
  import { TreeViewCheckProps, TreeViewListItem } from './TreeViewListItem';
4
4
  import { TreeViewRoot } from './TreeViewRoot';
5
5
 
6
+ /** Properties that make up a tree view data item. These properties should be passed in as an
7
+ * object to one of the various tree view component properties which accept TreeViewDataItem as
8
+ * a type.
9
+ */
10
+
6
11
  export interface TreeViewDataItem {
7
- /** Internal content of a tree view item */
8
- name: React.ReactNode;
9
- /** Title a tree view item. Only used in Compact presentations. */
10
- title?: React.ReactNode;
11
- /** ID of a tree view item */
12
- id?: string;
13
- /** Child nodes of a tree view item */
12
+ /** Action of a tree view item, which can be either a button or dropdown component. */
13
+ action?: React.ReactNode;
14
+ /** Additional properties of the tree view item badge. */
15
+ badgeProps?: any;
16
+ /** Additional properties of the tree view item checkbox. */
17
+ checkProps?: TreeViewCheckProps;
18
+ /** Child nodes of a tree view item. */
14
19
  children?: TreeViewDataItem[];
15
- /** Flag indicating if node is expanded by default */
20
+ /** Optional prop for a custom badge. */
21
+ customBadgeContent?: React.ReactNode;
22
+ /** Flag indicating if node is expanded by default. */
16
23
  defaultExpanded?: boolean;
17
- /** Default icon of a tree view item */
18
- icon?: React.ReactNode;
19
- /** Expanded icon of a tree view item */
24
+ /** Expanded icon of a tree view item. */
20
25
  expandedIcon?: React.ReactNode;
21
- /** Flag indicating if a tree view item has a checkbox */
22
- hasCheck?: boolean;
23
- /** Additional properties of the tree view item checkbox */
24
- checkProps?: TreeViewCheckProps;
25
- /** Flag indicating if a tree view item has a badge */
26
+ /** Flag indicating if a tree view item has a badge. */
26
27
  hasBadge?: boolean;
27
- /** Optional prop for custom badge */
28
- customBadgeContent?: React.ReactNode;
29
- /** Additional properties of the tree view item badge */
30
- badgeProps?: any;
31
- /** Action of a tree view item, can be a Button or Dropdown */
32
- action?: React.ReactNode;
28
+ /** Flag indicating if a tree view item has a checkbox. */
29
+ hasCheck?: boolean;
30
+ /** Default icon of a tree view item. */
31
+ icon?: React.ReactNode;
32
+ /** ID of a tree view item. */
33
+ id?: string;
34
+ /** Internal content of a tree view item. */
35
+ name: React.ReactNode;
36
+ /** Title of a tree view item. Only used in compact presentations. */
37
+ title?: React.ReactNode;
33
38
  }
34
39
 
40
+ /** The main tree view component. */
41
+
35
42
  export interface TreeViewProps {
36
- /** Data of the tree view */
43
+ /** Active items of tree view. */
44
+ activeItems?: TreeViewDataItem[];
45
+ /** Sets the expanded state on all tree nodes, overriding default behavior and current
46
+ * internal state.
47
+ */
48
+ allExpanded?: boolean;
49
+ /** Class to add if not passed a parentItem property. */
50
+ className?: string;
51
+ /** Comparison function for determining active items. */
52
+ compareItems?: (item: TreeViewDataItem, itemToCheck: TreeViewDataItem) => boolean;
53
+ /** Data of the tree view. */
37
54
  data: TreeViewDataItem[];
38
- /** ID of the tree view */
39
- id?: string;
40
- /** Flag indicating if the tree view is nested */
41
- isNested?: boolean;
42
- /** Flag indicating if all nodes in the tree view should have checkboxes */
43
- hasChecks?: boolean;
44
- /** Flag indicating if all nodes in the tree view should have badges */
55
+ /** Sets the default expanded behavior. */
56
+ defaultAllExpanded?: boolean;
57
+ /** Icon for all expanded node items. */
58
+ expandedIcon?: React.ReactNode;
59
+ /** Flag indicating if all nodes in the tree view should have badges. */
45
60
  hasBadges?: boolean;
46
- /** Flag indicating if tree view has guide lines. */
61
+ /** Flag indicating if all nodes in the tree view should have checkboxes. */
62
+ hasChecks?: boolean;
63
+ /** Flag indicating if the tree view has guide lines. */
47
64
  hasGuides?: boolean;
48
- /** Flag indicating that tree nodes should be independently selectable, even when having children */
65
+ /** Flag indicating if the tree view is nested. */
66
+ isNested?: boolean;
67
+ /** Flag indicating that tree nodes should be independently selectable, even when having
68
+ * children.
69
+ */
49
70
  hasSelectableNodes?: boolean;
50
- /** Variant presentation styles for the tree view. */
51
- variant?: 'default' | 'compact' | 'compactNoBackground';
52
- /** Icon for all leaf or unexpanded node items */
71
+ /** Icon for all leaf or unexpanded node items. */
53
72
  icon?: React.ReactNode;
54
- /** Icon for all expanded node items */
55
- expandedIcon?: React.ReactNode;
56
- /** Sets the expanded state on all tree nodes, overriding default behavior and current internal state */
57
- allExpanded?: boolean;
58
- /** Sets the default expanded behavior */
59
- defaultAllExpanded?: boolean;
60
- /** Callback for item selection */
61
- onSelect?: (event: React.MouseEvent, item: TreeViewDataItem, parentItem: TreeViewDataItem) => void;
62
- /** Callback for item checkbox selection */
73
+ /** ID of the tree view. */
74
+ id?: string;
75
+ /** Callback for item checkbox selection. */
63
76
  onCheck?: (event: React.ChangeEvent<HTMLInputElement>, item: TreeViewDataItem, parentItem: TreeViewDataItem) => void;
64
- /** Active items of tree view */
65
- activeItems?: TreeViewDataItem[];
66
- /** Internal. Parent item of a TreeViewListItem */
77
+ /** Callback for item selection. */
78
+ onSelect?: (event: React.MouseEvent, item: TreeViewDataItem, parentItem: TreeViewDataItem) => void;
79
+ /** Internal. Parent item of a tree view list item. */
67
80
  parentItem?: TreeViewDataItem;
68
- /** Comparison function for determining active items */
69
- compareItems?: (item: TreeViewDataItem, itemToCheck: TreeViewDataItem) => boolean;
70
- /** Class to add to add if not passed a parentItem */
71
- className?: string;
72
- /** Toolbar to display above the tree view */
81
+ /** Toolbar to display above the tree view. */
73
82
  toolbar?: React.ReactNode;
74
- /** Flag indicating the TreeView should utilize memoization to help render large data sets. Setting this property requires that `activeItems` pass in an array containing every node in the selected item's path. */
83
+ /** Flag indicating the tree view should utilize memoization to help render large data sets.
84
+ * Setting this property requires that the activeItems property is passed an array containing
85
+ * every node in the selected item's path.
86
+ */
75
87
  useMemo?: boolean;
88
+ /** Variant presentation styles for the tree view. */
89
+ variant?: 'default' | 'compact' | 'compactNoBackground';
76
90
  }
77
91
 
78
92
  export const TreeView: React.FunctionComponent<TreeViewProps> = ({
@@ -3,12 +3,12 @@ import { css } from '@patternfly/react-styles';
3
3
  import { Divider } from '../Divider';
4
4
 
5
5
  export interface TreeViewListProps extends React.HTMLProps<HTMLUListElement> {
6
- /** Flag indicating if the tree view is nested under another tree view */
6
+ /** Child nodes of the current tree view. */
7
+ children: React.ReactNode;
8
+ /** Flag indicating if the tree view is nested under another tree view. */
7
9
  isNested?: boolean;
8
- /** Toolbar to display above the tree view */
10
+ /** Toolbar to display above the tree view. */
9
11
  toolbar?: React.ReactNode;
10
- /** Child nodes of the current tree view */
11
- children: React.ReactNode;
12
12
  }
13
13
 
14
14
  export const TreeViewList: React.FunctionComponent<TreeViewListProps> = ({
@@ -11,51 +11,58 @@ export interface TreeViewCheckProps extends Omit<Partial<React.InputHTMLAttribut
11
11
  }
12
12
 
13
13
  export interface TreeViewListItemProps {
14
- /** Internal content of a tree view item */
15
- name: React.ReactNode;
16
- /** Title a tree view item */
17
- title: React.ReactNode;
18
- /** ID of a tree view item */
19
- id?: string;
20
- /** Flag indicating if the node is expanded, overrides internal state */
21
- isExpanded?: boolean;
22
- /** Flag indicating if node is expanded by default */
23
- defaultExpanded?: boolean;
24
- /** Child nodes of a tree view item */
25
- children?: React.ReactNode;
26
- /** Callback for item selection. Note: calling event.preventDefault() will prevent the node from toggling. */
27
- onSelect?: (event: React.MouseEvent, item: TreeViewDataItem, parent: TreeViewDataItem) => void;
28
- /** Callback for item checkbox selection */
29
- onCheck?: (event: React.ChangeEvent<HTMLInputElement>, item: TreeViewDataItem, parent: TreeViewDataItem) => void;
30
- /** Flag indicating if a tree view item has a checkbox */
31
- hasCheck?: boolean;
32
- /** Additional properties of the tree view item checkbox */
14
+ /** Action of a tree view item, which can be either a button or dropdown component. */
15
+ action?: React.ReactNode;
16
+ /** Active items of tree view. */
17
+ activeItems?: TreeViewDataItem[];
18
+ /** Additional properties of the tree view item badge. */
19
+ badgeProps?: any;
20
+ /** Additional properties of the tree view item checkbox. */
33
21
  checkProps?: TreeViewCheckProps;
34
- /** Flag indicating if a tree view item has a badge */
35
- hasBadge?: boolean;
36
- /** Flag indicating that tree nodes should be independently selectable, even when having children */
37
- isSelectable?: boolean;
38
- /** Optional prop for custom badge */
22
+ /** Child nodes of a tree view item. */
23
+ children?: React.ReactNode;
24
+ /** Callback for item comparison function. */
25
+ compareItems?: (item: TreeViewDataItem, itemToCheck: TreeViewDataItem) => boolean;
26
+ /** Optional prop for a custom badge. */
39
27
  customBadgeContent?: React.ReactNode;
40
- /** Additional properties of the tree view item badge */
41
- badgeProps?: any;
28
+ /** Flag indicating if node is expanded by default. */
29
+ defaultExpanded?: boolean;
30
+ /** Expanded icon of a tree view item. */
31
+ expandedIcon?: React.ReactNode;
32
+ /** Flag indicating if a tree view item has a badge. */
33
+ hasBadge?: boolean;
34
+ /** Flag indicating if a tree view item has a checkbox. */
35
+ hasCheck?: boolean;
36
+ /** Default icon of a tree view item. */
37
+ icon?: React.ReactNode;
38
+ /** ID of a tree view item. */
39
+ id?: string;
42
40
  /** Flag indicating if the tree view is using a compact variation. */
43
41
  isCompact?: boolean;
44
- /** Active items of tree view */
45
- activeItems?: TreeViewDataItem[];
46
- /** Data structure of tree view item */
42
+ /** Flag indicating if the node is expanded, overrides internal state. */
43
+ isExpanded?: boolean;
44
+ /** Flag indicating that tree nodes should be independently selectable, even when having
45
+ * children.
46
+ */
47
+ isSelectable?: boolean;
48
+ /** Data structure of tree view item. */
47
49
  itemData?: TreeViewDataItem;
48
- /** Parent item of tree view item */
50
+ /** Internal content of a tree view item. */
51
+ name: React.ReactNode;
52
+ /** Callback for item checkbox selection. */
53
+ onCheck?: (event: React.ChangeEvent<HTMLInputElement>, item: TreeViewDataItem, parent: TreeViewDataItem) => void;
54
+ /** Callback for item selection. Note: calling event.preventDefault() will prevent the node
55
+ * from toggling.
56
+ */
57
+ onSelect?: (event: React.MouseEvent, item: TreeViewDataItem, parent: TreeViewDataItem) => void;
58
+ /** Parent item of tree view item. */
49
59
  parentItem?: TreeViewDataItem;
50
- /** Default icon of a tree view item */
51
- icon?: React.ReactNode;
52
- /** Expanded icon of a tree view item */
53
- expandedIcon?: React.ReactNode;
54
- /** Action of a tree view item, can be a Button or Dropdown */
55
- action?: React.ReactNode;
56
- /** Callback for item comparison function */
57
- compareItems?: (item: TreeViewDataItem, itemToCheck: TreeViewDataItem) => boolean;
58
- /** Flag indicating the TreeView should utilize memoization to help render large data sets. Setting this property requires that `activeItems` pass in an array containing every node in the selected item's path. */
60
+ /** Title of a tree view item. */
61
+ title: React.ReactNode;
62
+ /** Flag indicating the tree view should utilize memoization to help render large data sets.
63
+ * Setting this property requires that the activeItems property is passed an array containing
64
+ * every node in the selected item's path.
65
+ */
59
66
  useMemo?: boolean;
60
67
  }
61
68
 
@@ -5,16 +5,16 @@ import { canUseDOM } from '../../helpers/util';
5
5
  import { handleArrows } from '../../helpers';
6
6
 
7
7
  export interface TreeViewRootProps {
8
- /** Child nodes of the tree view */
8
+ /** Child nodes of the tree view. */
9
9
  children: React.ReactNode;
10
- /** Flag indicating if the tree view has checkboxes */
10
+ /** Class to add to add if not passed a parentItem property. */
11
+ className?: string;
12
+ /** Flag indicating if the tree view has checkboxes. */
11
13
  hasChecks?: boolean;
12
14
  /** Flag indicating if tree view has guide lines. */
13
15
  hasGuides?: boolean;
14
16
  /** Variant presentation styles for the tree view. */
15
17
  variant?: 'default' | 'compact' | 'compactNoBackground';
16
- /** Class to add to add if not passed a parentItem */
17
- className?: string;
18
18
  }
19
19
 
20
20
  export class TreeViewRoot extends React.Component<TreeViewRootProps> {
@@ -3,17 +3,21 @@ import { css } from '@patternfly/react-styles';
3
3
  import styles from '@patternfly/react-styles/css/components/TreeView/tree-view';
4
4
  import formStyles from '@patternfly/react-styles/css/components/FormControl/form-control';
5
5
 
6
+ /** Renders a search input for the tree view. This sub-component should be passed into the
7
+ * tree view component's toolbar property.
8
+ */
9
+
6
10
  export interface TreeViewSearchProps extends React.HTMLProps<HTMLInputElement> {
7
- /** Callback for search input */
8
- onSearch?: (event: React.ChangeEvent<HTMLInputElement>) => void;
9
- /** Id for the search input */
10
- id?: string;
11
- /** Name for the search input */
12
- name?: string;
13
- /** Accessible label for the search input */
11
+ /** Accessible label for the search input. */
14
12
  'aria-label'?: string;
15
- /** Classes applied to the wrapper for the search input */
13
+ /** Classes applied to the wrapper for the search input. */
16
14
  className?: string;
15
+ /** Id for the search input. */
16
+ id?: string;
17
+ /** Name for the search input. */
18
+ name?: string;
19
+ /** Callback for search input. */
20
+ onSearch?: (event: React.ChangeEvent<HTMLInputElement>) => void;
17
21
  }
18
22
 
19
23
  export const TreeViewSearch: React.FunctionComponent<TreeViewSearchProps> = ({
@@ -3,202 +3,18 @@ id: Masthead
3
3
  section: components
4
4
  ---
5
5
 
6
- import imgBrand from '@patternfly/react-core/src/demos/examples/pfColorLogo.svg';
7
- import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
8
- import CaretDownIcon from '@patternfly/react-icons/dist/js/icons/caret-down-icon';
6
+ import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
7
+ import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
8
+ import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
9
+ import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
10
+ import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
11
+ import imgAvatar from '@patternfly/react-core/src/components/Avatar/examples/avatarImg.svg';
9
12
 
10
13
  ## Demos
11
14
 
12
- ### Basic
15
+ ### Masthead with utilities and user dropdown menu
13
16
 
14
- ```ts
15
- import React from 'react';
16
- import {
17
- Masthead,
18
- MastheadToggle,
19
- MastheadMain,
20
- MastheadBrand,
21
- MastheadContent,
22
- Button,
23
- Toolbar,
24
- ToolbarContent,
25
- ToolbarGroup,
26
- ToolbarItem,
27
- ContextSelector,
28
- ContextSelectorItem,
29
- Dropdown,
30
- DropdownSeparator,
31
- DropdownToggle,
32
- KebabToggle,
33
- DropdownItem,
34
- Brand
35
- } from '@patternfly/react-core';
36
- import imgBrand from '@patternfly/react-core/src/demos/examples/pfColorLogo.svg';
37
- import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
38
- import CaretDownIcon from '@patternfly/react-icons/dist/js/icons/caret-down-icon';
17
+ Many mastheads contain utilities which collapse into a dropdown at smaller viewport widths. These utilities could include a notification badge to open and close a notification drawer, a link to app or user settings, a help icon which could launch quick starts or link to other resources, and many other utilities. In this demo, the notification badge does not collapse down into the mobile menu so that it is always visible even at narrower viewport widths.
39
18
 
40
- class BasicMasthead extends React.Component {
41
- items = [
42
- 'My Project',
43
- 'OpenShift Cluster',
44
- 'Production Ansible',
45
- 'AWS',
46
- 'Azure',
47
- 'My Project 2',
48
- 'OpenShift Cluster',
49
- 'Production Ansible 2',
50
- 'AWS 2',
51
- 'Azure 2'
52
- ];
53
-
54
- state = {
55
- isOpen: false,
56
- isDropdownOpen: false,
57
- isKebabOpen: false,
58
- selected: this.items[0],
59
- searchValue: '',
60
- filteredItems: this.items
61
- };
62
-
63
- onToggle = (event: any, isOpen: boolean) => {
64
- this.setState({
65
- isOpen
66
- });
67
- };
68
-
69
- onDropdownToggle = (isDropdownOpen: boolean) => {
70
- this.setState({
71
- isDropdownOpen
72
- });
73
- };
74
-
75
- onKebabToggle = (isKebabOpen: boolean) => {
76
- this.setState({
77
- isKebabOpen
78
- });
79
- };
80
-
81
- onSelect = (event: any, value: string) => {
82
- this.setState({
83
- selected: value,
84
- isOpen: !this.state.isOpen
85
- });
86
- };
87
-
88
- onDropdownSelect = () => {
89
- this.setState({
90
- isDropdownOpen: !this.state.isDropdownOpen
91
- });
92
- };
93
-
94
- onKebabSelect = () => {
95
- this.setState({
96
- isKebabOpen: !this.state.isKebabOpen
97
- });
98
- };
99
-
100
- onSearchInputChange = (value: string) => {
101
- this.setState({ searchValue: value });
102
- };
103
-
104
- onSearchButtonClick = () => {
105
- const filtered =
106
- this.state.searchValue === ''
107
- ? this.items
108
- : this.items.filter(str => str.toLowerCase().indexOf(this.state.searchValue.toLowerCase()) !== -1);
109
-
110
- this.setState({ filteredItems: filtered || [] });
111
- };
112
-
113
- render() {
114
- const { isOpen, isDropdownOpen, isKebabOpen, selected, searchValue, filteredItems } = this.state;
115
-
116
- const dropdownItems = [
117
- <DropdownItem key="link">Link</DropdownItem>,
118
- <DropdownItem key="action" component="button">
119
- Action
120
- </DropdownItem>,
121
- <DropdownItem key="disabled link" isDisabled href="www.google.com">
122
- Disabled Link
123
- </DropdownItem>,
124
- <DropdownItem
125
- key="disabled action"
126
- isAriaDisabled
127
- component="button"
128
- tooltip="Tooltip for disabled item"
129
- tooltipProps={{ position: 'top' }}
130
- >
131
- Disabled Action
132
- </DropdownItem>,
133
- <DropdownSeparator key="separator" />,
134
- <DropdownItem key="separated link">Separated Link</DropdownItem>,
135
- <DropdownItem key="separated action" component="button">
136
- Separated Action
137
- </DropdownItem>
138
- ];
139
-
140
- return (
141
- <Masthead id="basic-demo">
142
- <MastheadToggle>
143
- <Button variant="plain" onClick={() => {}} aria-label="Global navigation">
144
- <BarsIcon />
145
- </Button>
146
- </MastheadToggle>
147
- <MastheadMain>
148
- <MastheadBrand>
149
- <Brand src={imgBrand} alt="Patternfly logo" />
150
- </MastheadBrand>
151
- </MastheadMain>
152
- <MastheadContent>
153
- <Toolbar id="toolbar" isFullHeight isStatic>
154
- <ToolbarContent>
155
- <ToolbarItem>
156
- <ContextSelector
157
- toggleText={selected}
158
- onSearchInputChange={this.onSearchInputChange}
159
- isOpen={isOpen}
160
- searchInputValue={searchValue}
161
- onToggle={this.onToggle}
162
- onSelect={this.onSelect}
163
- onSearchButtonClick={this.onSearchButtonClick}
164
- screenReaderLabel="Selected Project:"
165
- isFullHeight
166
- >
167
- {filteredItems.map((item, index) => (
168
- <ContextSelectorItem key={index}>{item}</ContextSelectorItem>
169
- ))}
170
- </ContextSelector>
171
- </ToolbarItem>
172
- <ToolbarGroup alignment={{ default: 'alignRight' }}>
173
- <ToolbarItem visibility={{ default: 'hidden', lg: 'visible' }}>
174
- <Dropdown
175
- onSelect={this.onDropdownSelect}
176
- toggle={
177
- <DropdownToggle id="toggle-id" onToggle={this.onDropdownToggle} toggleIndicator={CaretDownIcon}>
178
- Dropdown
179
- </DropdownToggle>
180
- }
181
- isOpen={isDropdownOpen}
182
- dropdownItems={dropdownItems}
183
- isFullHeight
184
- />
185
- </ToolbarItem>
186
- <ToolbarItem>
187
- <Dropdown
188
- onSelect={this.onKebabSelect}
189
- position="right"
190
- toggle={<KebabToggle onToggle={this.onKebabToggle} id="toggle-id-kebab" />}
191
- isOpen={isKebabOpen}
192
- isPlain
193
- dropdownItems={dropdownItems}
194
- />
195
- </ToolbarItem>
196
- </ToolbarGroup>
197
- </ToolbarContent>
198
- </Toolbar>
199
- </MastheadContent>
200
- </Masthead>
201
- );
202
- }
203
- }
19
+ ```ts file='./examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx' isFullscreen
204
20
  ```
@@ -246,6 +246,7 @@ class BasicNotificationDrawer extends React.Component {
246
246
  variant={this.getNumberUnread() === 0 ? 'read' : 'unread'}
247
247
  onClick={this.onCloseNotificationDrawer}
248
248
  aria-label="Notifications"
249
+ isExpanded={isDrawerExpanded}
249
250
  >
250
251
  <BellIcon />
251
252
  </NotificationBadge>
@@ -812,6 +813,7 @@ class GroupedNotificationDrawer extends React.Component {
812
813
  variant={this.getNumberUnread() === 0 ? 'read' : 'unread'}
813
814
  onClick={this.onCloseNotificationDrawer}
814
815
  aria-label="Notifications"
816
+ isExpanded={isDrawerExpanded}
815
817
  >
816
818
  <BellIcon />
817
819
  </NotificationBadge>