@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
@@ -34,51 +34,63 @@ export enum PopoverPosition {
34
34
  rightEnd = 'right-end'
35
35
  }
36
36
 
37
+ /** The main popover component. The following properties can also be passed into another component
38
+ * that has a property specifically for passing in popover properties.
39
+ */
40
+
37
41
  export interface PopoverProps {
38
- /** Accessible label, required when header is not present */
39
- 'aria-label'?: string;
40
- /** The element to append the popover to, defaults to body */
42
+ /** @beta Text announced by screen reader when alert severity variant is set to indicate
43
+ * severity level.
44
+ */
45
+ alertSeverityScreenReaderText?: string;
46
+ /** @beta Severity variants for an alert popover. This modifies the color of the header to
47
+ * match the severity.
48
+ */
49
+ alertSeverityVariant?: 'default' | 'info' | 'warning' | 'success' | 'danger';
50
+ /** The duration of the CSS fade transition animation. */
51
+ animationDuration?: number;
52
+ /** The element to append the popover to. Defaults to "document.body". */
41
53
  appendTo?: HTMLElement | ((ref?: HTMLElement) => HTMLElement);
54
+ /** Accessible label for the popover, required when header is not present. */
55
+ 'aria-label'?: string;
42
56
  /**
43
- * Body content
44
- * If you want to close the popover after an action within the bodyContent, you can use the isVisible prop for manual control,
45
- * or you can provide a function which will receive a callback as an argument to hide the popover
46
- * i.e. bodyContent={hide => <Button onClick={() => hide()}>Close</Button>}
57
+ * Body content of the popover. If you want to close the popover after an action within the
58
+ * body content, you can use the isVisible prop for manual control, or you can provide a
59
+ * function which will receive a callback as an argument to hide the popover, i.e.
60
+ * bodyContent={hide => <Button onClick={() => hide()}>Close</Button>}
47
61
  */
48
62
  bodyContent: React.ReactNode | ((hide: () => void) => React.ReactNode);
63
+ /** @deprecated - no longer used. if you want to constrain the popper to a specific element
64
+ * use the appendTo prop instead.
65
+ */
66
+ boundary?: 'scrollParent' | 'window' | 'viewport' | HTMLElement;
49
67
  /**
50
- * The reference element to which the Popover is relatively placed to.
51
- * If you cannot wrap the reference with the Popover, you can use the reference prop instead.
68
+ * The reference element to which the popover is relatively placed to. If you cannot wrap
69
+ * the reference with the Popover, you can use the reference prop instead.
52
70
  * Usage: <Popover><Button>Reference</Button></Popover>
53
71
  */
54
72
  children?: ReactElement<any>;
55
- /**
56
- * The reference element to which the Popover is relatively placed to.
57
- * If you can wrap the reference with the Popover, you can use the children prop instead.
58
- * Usage: <Popover reference={() => document.getElementById('reference-element')} />
59
- */
60
- reference?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;
61
- /** Popover additional class */
73
+ /** Additional classes added to the popover. */
62
74
  className?: string;
63
- /** Aria label for the Close button */
75
+ /** Accessible label for the close button. */
64
76
  closeBtnAriaLabel?: string;
65
- /** Whether to show the close button */
66
- showClose?: boolean;
67
- /** Distance of the popover to its target, defaults to 25 */
77
+ /** Distance of the popover to its target. Defaults to 25. */
68
78
  distance?: number;
69
79
  /**
70
80
  * If true, tries to keep the popover in view by flipping it if necessary.
71
- * If the position is set to 'auto', this prop is ignored
81
+ * If the position is set to 'auto', this prop is ignored.
72
82
  */
73
83
  enableFlip?: boolean;
74
84
  /**
75
85
  * The desired position to flip the popover to if the initial position is not possible.
76
- * By setting this prop to 'flip' it attempts to flip the popover to the opposite side if there is no space.
77
- * You can also pass an array of positions that determines the flip order. It should contain the initial position
78
- * followed by alternative positions if that position is unavailable.
79
- * Example: Initial position is 'top'. Button with popover is in the top right corner. 'flipBehavior' is set to
80
- * ['top', 'right', 'left']. Since there is no space to the top, it checks if right is available. There's also no
81
- * space to the right, so it finally shows the popover on the left.
86
+ * By setting this prop to 'flip' it attempts to flip the popover to the opposite side if
87
+ * there is no space.
88
+ * You can also pass an array of positions that determines the flip order. It should contain
89
+ * the initial position followed by alternative positions if that position is unavailable.
90
+ * Example: Initial position is 'top'. Button with popover is in the top right corner.
91
+ * 'flipBehavior' is set to ['top', 'right', 'left']. Since there is no space to the top, it
92
+ * checks if right is available. There's also no space to the right, so it finally shows the
93
+ * popover on the left.
82
94
  */
83
95
  flipBehavior?:
84
96
  | 'flip'
@@ -97,40 +109,46 @@ export interface PopoverProps {
97
109
  | 'right-end'
98
110
  )[];
99
111
  /**
100
- * Footer content
101
- * If you want to close the popover after an action within the bodyContent, you can use the isVisible prop for manual control,
102
- * or you can provide a function which will receive a callback as an argument to hide the popover
103
- * i.e. footerContent={hide => <Button onClick={() => hide()}>Close</Button>}
112
+ * Footer content of the popover. If you want to close the popover after an action within the
113
+ * footer content, you can use the isVisible prop for manual control, or you can provide a
114
+ * function which will receive a callback as an argument to hide the popover, i.e.
115
+ * footerContent={hide => <Button onClick={() => hide()}>Close</Button>}
104
116
  */
105
117
  footerContent?: React.ReactNode | ((hide: () => void) => React.ReactNode);
118
+ /** Removes fixed-width and allows width to be defined by contents. */
119
+ hasAutoWidth?: boolean;
120
+ /** Allows content to touch edges of popover container. */
121
+ hasNoPadding?: boolean;
122
+ /** Sets the heading level to use for the popover header. Defaults to h6. */
123
+ headerComponent?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
106
124
  /**
107
- * Simple header content to be placed within a title.
108
- * If you want to close the popover after an action within the bodyContent, you can use the isVisible prop for manual control,
109
- * or you can provide a function which will receive a callback as an argument to hide the popover
110
- * i.e. headerContent={hide => <Button onClick={() => hide()}>Close</Button>}
125
+ * Simple header content to be placed within a title. If you want to close the popover after
126
+ * an action within the header content, you can use the isVisible prop for manual control,
127
+ * or you can provide a function which will receive a callback as an argument to hide the
128
+ * popover, i.e. headerContent={hide => <Button onClick={() => hide()}>Close</Button>}
111
129
  */
112
130
  headerContent?: React.ReactNode | ((hide: () => void) => React.ReactNode);
113
- /** Sets the heading level to use for the popover header. Default is h6. */
114
- headerComponent?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
115
- /** @beta Icon to be displayed in the popover header **/
131
+ /** @beta Icon to be displayed in the popover header. **/
116
132
  headerIcon?: React.ReactNode;
117
- /** @beta Severity variants for an alert popover. This modifies the color of the header to match the severity. */
118
- alertSeverityVariant?: 'default' | 'info' | 'warning' | 'success' | 'danger';
119
- /** @beta Text announced by screen reader when alert severity variant is set to indicate severity level */
120
- alertSeverityScreenReaderText?: string;
121
- /** Hides the popover when a click occurs outside (only works if isVisible is not controlled by the user) */
133
+ /** Hides the popover when a click occurs outside (only works if isVisible is not controlled
134
+ * by the user).
135
+ */
122
136
  hideOnOutsideClick?: boolean;
137
+ /** Id used as part of the various popover elements (popover-${id}-header/body/footer). */
138
+ id?: string;
123
139
  /**
124
140
  * True to show the popover programmatically. Used in conjunction with the shouldClose prop.
125
- * By default, the popover child element handles click events automatically. If you want to control this programmatically,
126
- * the popover will not auto-close if the Close button is clicked, ESC key is used, or if a click occurs outside the popover.
127
- * Instead, the consumer is responsible for closing the popover themselves by adding a callback listener for the shouldClose prop.
141
+ * By default, the popover child element handles click events automatically. If you want to
142
+ * control this programmatically, the popover will not auto-close if the close button is
143
+ * clicked, the escape key is used, or if a click occurs outside the popover. Instead, the
144
+ * consumer is responsible for closing the popover themselves by adding a callback listener
145
+ * for the shouldClose prop.
128
146
  */
129
147
  isVisible?: boolean;
130
- /** Minimum width of the popover (default 6.25rem) */
131
- minWidth?: string;
132
- /** Maximum width of the popover (default 18.75rem) */
148
+ /** Maximum width of the popover (default 18.75rem). */
133
149
  maxWidth?: string;
150
+ /** Minimum width of the popover (default 6.25rem). */
151
+ minWidth?: string;
134
152
  /**
135
153
  * Lifecycle function invoked when the popover has fully transitioned out.
136
154
  * Note: The tip argument is no longer passed and has been deprecated.
@@ -157,9 +175,9 @@ export interface PopoverProps {
157
175
  */
158
176
  onShown?: (tip?: TippyInstance) => void;
159
177
  /**
160
- * Popover position. Note: With 'enableFlip' set to true,
161
- * it will change the position if there is not enough space for the starting position.
162
- * The behavior of where it flips to can be controlled through the flipBehavior prop.
178
+ * Popover position. Note: With the enableFlip property set to true, it will change the
179
+ * position if there is not enough space for the starting position. The behavior of where it
180
+ * flips to can be controlled through the flipBehavior property.
163
181
  */
164
182
  position?:
165
183
  | PopoverPosition
@@ -177,34 +195,32 @@ export interface PopoverProps {
177
195
  | 'right-start'
178
196
  | 'right-end';
179
197
  /**
180
- * Callback function that is only invoked when isVisible is also controlled. Called when the popover Close button is
181
- * clicked, Enter key was used on it, or the ESC key is used.
198
+ * The reference element to which the popover is relatively placed to. If you can wrap the
199
+ * reference with the popover, you can use the children prop instead.
200
+ * Usage: <Popover reference={() => document.getElementById('reference-element')} />
201
+ */
202
+ reference?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;
203
+ /** @beta Opt-in for updated popper that does not use findDOMNode. */
204
+ removeFindDomNode?: boolean;
205
+ /**
206
+ * Callback function that is only invoked when isVisible is also controlled. Called when the
207
+ * popover close button is clicked, the enter key was used on it, or the escape key is used.
182
208
  * Note: The tip argument is no longer passed and has been deprecated.
183
209
  */
184
210
  shouldClose?: (tip?: TippyInstance, hideFunction?: () => void, event?: MouseEvent | KeyboardEvent) => void;
185
211
  /**
186
- * Callback function that is only invoked when isVisible is also controlled. Called when the Enter key is
187
- * used on the focused trigger
212
+ * Callback function that is only invoked when isVisible is also controlled. Called when the
213
+ * enter key is used on the focused trigger.
188
214
  */
189
215
  shouldOpen?: (showFunction?: () => void, event?: MouseEvent | KeyboardEvent) => void;
190
- /** z-index of the popover */
191
- zIndex?: number;
192
- /** CSS fade transition animation duration */
193
- animationDuration?: number;
194
- /** id used as part of the various popover elements (popover-${id}-header/body/footer) */
195
- id?: string;
196
- /** Whether to trap focus in the popover */
197
- withFocusTrap?: boolean;
198
- /** Removes fixed-width and allows width to be defined by contents */
199
- hasAutoWidth?: boolean;
200
- /** Allows content to touch edges of popover container */
201
- hasNoPadding?: boolean;
202
- /** @deprecated - no longer used. if you want to constrain the popper to a specific element use the appendTo prop instead */
203
- boundary?: 'scrollParent' | 'window' | 'viewport' | HTMLElement;
204
- /** @deprecated - no longer used */
216
+ /** Flag indicating whether the close button should be shown. */
217
+ showClose?: boolean;
218
+ /** @deprecated - no longer used. */
205
219
  tippyProps?: Partial<TippyProps>;
206
- /** @beta Opt-in for updated popper that does not use findDOMNode. */
207
- removeFindDomNode?: boolean;
220
+ /** Whether to trap focus in the popover. */
221
+ withFocusTrap?: boolean;
222
+ /** The z-index of the popover. */
223
+ zIndex?: number;
208
224
  }
209
225
 
210
226
  const alertStyle = {
@@ -8,44 +8,45 @@ import { Panel, PanelMain, PanelMainBody } from '../Panel';
8
8
  import { css } from '@patternfly/react-styles';
9
9
 
10
10
  export interface AdvancedSearchMenuProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange'> {
11
- /** Additional classes added to the Advanced search menu */
11
+ /** Delimiter in the query string for pairing attributes with search values.
12
+ * Required whenever attributes are passed as props.
13
+ */
14
+ advancedSearchDelimiter?: string;
15
+ /** Array of attribute values used for dynamically generated advanced search. */
16
+ attributes?: string[] | SearchAttribute[];
17
+ /** Additional classes added to the advanced search menu. */
12
18
  className?: string;
13
- /** Value of the search input */
14
- value?: string;
15
- /** Ref of the div wrapping the whole search input **/
16
- parentRef?: React.RefObject<any>;
17
- /** Ref of the input element within the search input**/
18
- parentInputRef?: React.RefObject<any>;
19
- /** Function which builds an attribute-value map by parsing the value in the search input */
19
+ /* Additional elements added after the attributes in the form.
20
+ * The new form elements can be wrapped in a form group component for automatic formatting. */
21
+ formAdditionalItems?: React.ReactNode;
22
+ /** Function which builds an attribute-value map by parsing the value in the search input. */
20
23
  getAttrValueMap?: () => { [key: string]: string };
21
- /** A callback for when the search button clicked changes */
24
+ /** Attribute label for strings unassociated with one of the provided listed attributes. */
25
+ hasWordsAttrLabel?: React.ReactNode;
26
+ /** Flag for toggling the open/close state of the advanced search menu. */
27
+ isSearchMenuOpen?: boolean;
28
+ /** A callback for when the input value changes. */
29
+ onChange?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
30
+ /** A callback for when the user clicks the clear button. */
31
+ onClear?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
32
+ /** A callback for when the search button is clicked. */
22
33
  onSearch?: (
23
34
  value: string,
24
35
  event: React.SyntheticEvent<HTMLButtonElement>,
25
36
  attrValueMap: { [key: string]: string }
26
37
  ) => void;
27
- /** A callback for when the user clicks the clear button */
28
- onClear?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
29
- /** A callback for when the input value changes */
30
- onChange?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
31
- /** Function called to toggle the advanced search menu */
38
+ /** A callback for when the open advanced search button is clicked. */
32
39
  onToggleAdvancedMenu?: (e: React.SyntheticEvent<HTMLButtonElement>) => void;
33
- /** Flag for toggling the open/close state of the advanced search menu */
34
- isSearchMenuOpen?: boolean;
35
- /** Label for the buttons which reset the advanced search form and clear the search input */
40
+ /** Ref of the input element within the search input. */
41
+ parentInputRef?: React.RefObject<any>;
42
+ /** Ref of the div wrapping the whole search input. */
43
+ parentRef?: React.RefObject<any>;
44
+ /** Label for the button which resets the advanced search form and clears the search input. */
36
45
  resetButtonLabel?: string;
37
- /** Label for the buttons which called the onSearch event handler */
46
+ /** Label for the button which calls the onSearch event handler. */
38
47
  submitSearchButtonLabel?: string;
39
- /** Array of attribute values used for dynamically generated advanced search */
40
- attributes?: string[] | SearchAttribute[];
41
- /* Additional elements added after the attributes in the form.
42
- * The new form elements can be wrapped in a FormGroup component for automatic formatting */
43
- formAdditionalItems?: React.ReactNode;
44
- /** Attribute label for strings unassociated with one of the provided listed attributes */
45
- hasWordsAttrLabel?: React.ReactNode;
46
- /** Delimiter in the query string for pairing attributes with search values.
47
- * Required whenever attributes are passed as props */
48
- advancedSearchDelimiter?: string;
48
+ /** Value of the search input. */
49
+ value?: string;
49
50
  }
50
51
 
51
52
  export const AdvancedSearchMenu: React.FunctionComponent<AdvancedSearchMenuProps> = ({
@@ -13,94 +13,108 @@ import { TextInputGroup, TextInputGroupMain, TextInputGroupUtilities } from '../
13
13
  import { InputGroup } from '../InputGroup';
14
14
  import { Popper } from '../../helpers';
15
15
 
16
+ /** Properties for adding search attributes to an advanced search input. These properties must
17
+ * be passed in as an object within an array to the search input component's attribute properrty.
18
+ */
19
+
16
20
  export interface SearchAttribute {
17
21
  /** The search attribute's value to be provided in the search input's query string.
18
- * It should have no spaces and be unique for every attribute */
22
+ * It should have no spaces and be unique for every attribute.
23
+ */
19
24
  attr: string;
20
- /** The search attribute's display name. It is used to label the field in the advanced search menu */
25
+ /** The search attribute's display name. It is used to label the field in the advanced
26
+ * search menu.
27
+ */
21
28
  display: React.ReactNode;
22
29
  }
23
30
 
31
+ /** Properties for creating an expandable search input. These properties should be passed into
32
+ * the search input component's expandableInput property.
33
+ */
34
+
24
35
  export interface ExpandableInput {
25
- /** Flag to indicate if the search input is expanded */
36
+ /** Flag to indicate if the search input is expanded. */
26
37
  isExpanded: boolean;
27
- /** Callback function to toggle the expandable search input */
38
+ /** Callback function to toggle the expandable search input. */
28
39
  onToggleExpand: (isExpanded: boolean, event: React.SyntheticEvent<HTMLButtonElement>) => void;
29
- /** An accessible label for the expandable search input toggle */
40
+ /** An accessible label for the expandable search input toggle. */
30
41
  toggleAriaLabel: string;
31
42
  }
32
43
 
44
+ /** The main search input component. */
45
+
33
46
  export interface SearchInputProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange' | 'results' | 'ref'> {
34
- /** Additional classes added to the banner */
35
- className?: string;
36
- /** Value of the search input */
37
- value?: string;
38
- /** Flag indicating if search input is disabled */
39
- isDisabled?: boolean;
40
- /** An accessible label for the search input */
47
+ /** Delimiter in the query string for pairing attributes with search values.
48
+ * Required whenever attributes are passed as props.
49
+ */
50
+ advancedSearchDelimiter?: string;
51
+ /** The container to append the menu to.
52
+ * If your menu is being cut off you can append it to an element higher up the DOM tree.
53
+ * Some examples:
54
+ * appendTo={() => document.body}
55
+ * appendTo={document.getElementById('target')}
56
+ */
57
+ appendTo?: HTMLElement | (() => HTMLElement) | 'inline';
58
+ /** An accessible label for the search input. */
41
59
  'aria-label'?: string;
42
- /** placeholder text of the search input */
43
- placeholder?: string;
44
- /** @hide A reference object to attach to the input box */
60
+ /** Array of attribute values used for dynamically generated advanced search. */
61
+ attributes?: string[] | SearchAttribute[];
62
+ /** Additional classes added to the search input. */
63
+ className?: string;
64
+ /** Object that makes the search input expandable/collapsible. */
65
+ expandableInput?: ExpandableInput;
66
+ /* Additional elements added after the attributes in the form.
67
+ * The new form elements can be wrapped in a form group component for automatic formatting. */
68
+ formAdditionalItems?: React.ReactNode;
69
+ /** Attribute label for strings unassociated with one of the provided listed attributes. */
70
+ hasWordsAttrLabel?: React.ReactNode;
71
+ /** A suggestion for autocompleting. */
72
+ hint?: string;
73
+ /** @hide A reference object to attach to the input box. */
45
74
  innerRef?: React.RefObject<any>;
46
- /** A callback for when the input value changes */
75
+ /** A flag for controlling the open state of a custom advanced search implementation. */
76
+ isAdvancedSearchOpen?: boolean;
77
+ /** Flag indicating if search input is disabled. */
78
+ isDisabled?: boolean;
79
+ /** Flag indicating if the next navigation button is disabled. */
80
+ isNextNavigationButtonDisabled?: boolean;
81
+ /** Flag indicating if the previous navigation button is disabled. */
82
+ isPreviousNavigationButtonDisabled?: boolean;
83
+ /** Accessible label for the button to navigate to next result. */
84
+ nextNavigationButtonAriaLabel?: string;
85
+ /** A callback for when the input value changes. */
47
86
  onChange?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
48
- /** A suggestion for autocompleting */
49
- hint?: string;
50
- /** Object that makes the search input expandable/collapsible */
51
- expandableInput?: ExpandableInput;
52
- /** A callback for when the search button clicked changes */
87
+ /** A callback for when the user clicks the clear button. */
88
+ onClear?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
89
+ /** A callback for when the user clicks to navigate to next result. */
90
+ onNextClick?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
91
+ /** A callback for when the user clicks to navigate to previous result. */
92
+ onPreviousClick?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
93
+ /** A callback for when the search button is clicked. */
53
94
  onSearch?: (
54
95
  value: string,
55
96
  event: React.SyntheticEvent<HTMLButtonElement>,
56
97
  attrValueMap: { [key: string]: string }
57
98
  ) => void;
58
- /** A callback for when the user clicks the clear button */
59
- onClear?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
60
- /** Label for the buttons which reset the advanced search form and clear the search input */
61
- resetButtonLabel?: string;
62
- /** Label for the buttons which called the onSearch event handler */
63
- submitSearchButtonLabel?: string;
64
- /** A callback for when the open advanced search button is clicked */
99
+ /** A callback for when the open advanced search button is clicked. */
65
100
  onToggleAdvancedSearch?: (event: React.SyntheticEvent<HTMLButtonElement>, isOpen?: boolean) => void;
66
- /** A flag for controlling the open state of a custom advanced search implementation */
67
- isAdvancedSearchOpen?: boolean;
68
- /** Label for the button which opens the advanced search form menu */
101
+ /** Accessible label for the button which opens the advanced search form menu. */
69
102
  openMenuButtonAriaLabel?: string;
70
- /** Label for the button to navigate to previous result */
103
+ /** Placeholder text of the search input. */
104
+ placeholder?: string;
105
+ /** Accessible label for the button to navigate to previous result. */
71
106
  previousNavigationButtonAriaLabel?: string;
72
- /** Flag indicating if the previous navigation button is disabled */
73
- isPreviousNavigationButtonDisabled?: boolean;
74
- /** Label for the button to navigate to next result */
75
- nextNavigationButtonAriaLabel?: string;
76
- /** Flag indicating if the next navigation button is disabled */
77
- isNextNavigationButtonDisabled?: boolean;
78
- /** Function called when user clicks to navigate to next result */
79
- onNextClick?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
80
- /** Function called when user clicks to navigate to previous result */
81
- onPreviousClick?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
82
- /** The number of search results returned. Either a total number of results,
83
- * or a string representing the current result over the total number of results. i.e. "1 / 5" */
84
- resultsCount?: number | string;
85
- /** Array of attribute values used for dynamically generated advanced search */
86
- attributes?: string[] | SearchAttribute[];
87
- /* Additional elements added after the attributes in the form.
88
- * The new form elements can be wrapped in a FormGroup component for automatic formatting */
89
- formAdditionalItems?: React.ReactNode;
90
- /** Attribute label for strings unassociated with one of the provided listed attributes */
91
- hasWordsAttrLabel?: React.ReactNode;
92
- /** Delimiter in the query string for pairing attributes with search values.
93
- * Required whenever attributes are passed as props */
94
- advancedSearchDelimiter?: string;
95
- /** The container to append the menu to.
96
- * If your menu is being cut off you can append it to an element higher up the DOM tree.
97
- * Some examples:
98
- * appendTo={() => document.body}
99
- * appendTo={document.getElementById('target')}
100
- */
101
- appendTo?: HTMLElement | (() => HTMLElement) | 'inline';
102
107
  /** @beta Opt-in for updated popper that does not use findDOMNode. */
103
108
  removeFindDomNode?: boolean;
109
+ /** Label for the button which resets the advanced search form and clears the search input. */
110
+ resetButtonLabel?: string;
111
+ /** The number of search results returned. Either a total number of results,
112
+ * or a string representing the current result over the total number of results. i.e. "1 / 5". */
113
+ resultsCount?: number | string;
114
+ /** Label for the button which calls the onSearch event handler. */
115
+ submitSearchButtonLabel?: string;
116
+ /** Value of the search input. */
117
+ value?: string;
104
118
  }
105
119
 
106
120
  const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
@@ -7,64 +7,70 @@ import { InputGroup, InputGroupText } from '../InputGroup';
7
7
  import { TextInput } from '../TextInput';
8
8
  import { Tooltip } from '../Tooltip';
9
9
 
10
+ /** Properties for creating custom steps in a slider. These properties should be passed in as
11
+ * an object within an array to the slider component's customSteps property.
12
+ */
10
13
  export interface SliderStepObject {
11
- /** Value of the step. This value is a percentage of the slider where the tick is drawn. */
12
- value: number;
13
- /** The display label for the step value. This is also used for the aria-valuetext */
14
- label: string;
15
- /** Flag to hide the label */
14
+ /** Flag to hide the label. */
16
15
  isLabelHidden?: boolean;
16
+ /** The display label for the step value. This is also used for the aria-valuetext attribute. */
17
+ label: string;
18
+ /** Value of the step. This value is a percentage of the slider where the tick is drawn. */
19
+ value: number;
17
20
  }
18
21
 
22
+ /** The main slider component. */
19
23
  export interface SliderProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange'> {
20
- /** Additional classes added to the spinner. */
21
- className?: string;
22
- /** Current value */
23
- value?: number;
24
- /** Flag indicating if the slider is is discrete for custom steps. This will cause the slider to snap to the closest value. */
24
+ /** Flag indicating if the slider is discrete for custom steps. This will cause the slider
25
+ * to snap to the closest value.
26
+ */
25
27
  areCustomStepsContinuous?: boolean;
26
- /** Adds disabled styling and disables the slider and the input component is present */
27
- isDisabled?: boolean;
28
- /** The step interval*/
29
- step?: number;
30
- /** Minimum permitted value */
31
- min?: number;
32
- /** The maximum permitted value */
33
- max?: number;
34
- /** Flag to indicate if boundaries should be shown for slider that does not have custom steps */
35
- showBoundaries?: boolean;
36
- /** Flag to indicate if ticks should be shown for slider that does not have custom steps */
37
- showTicks?: boolean;
28
+ /** One or more id's to use for the slider thumb's accessible description. */
29
+ 'aria-describedby'?: string;
30
+ /** One or more id's to use for the slider thumb's accessible label. */
31
+ 'aria-labelledby'?: string;
32
+ /** Additional classes added to the slider. */
33
+ className?: string;
38
34
  /** Array of custom slider step objects (value and label of each step) for the slider. */
39
35
  customSteps?: SliderStepObject[];
40
- /** Flag to show value input field */
41
- isInputVisible?: boolean;
42
- /** Value displayed in the input field */
43
- inputValue?: number;
44
- /** Aria label for the input field */
45
- inputAriaLabel?: string;
46
- /* Aria label for the thumb */
47
- thumbAriaLabel?: string;
48
- /* Adds a tooltip over the thumb containing the current value */
36
+ /* Adds a tooltip over the slider thumb containing the current value. */
49
37
  hasTooltipOverThumb?: boolean;
50
- /** Label that is place after the input field */
38
+ /** Accessible label for the input field. */
39
+ inputAriaLabel?: string;
40
+ /** Text label that is place after the input field. */
51
41
  inputLabel?: string | number;
52
- /** Position of the input */
42
+ /** Position of the input. */
53
43
  inputPosition?: 'aboveThumb' | 'right';
54
- /** Value change callback. This is called when the slider value changes */
44
+ /** Value displayed in the input field. */
45
+ inputValue?: number;
46
+ /** Adds disabled styling, and disables the slider and the input component if present. */
47
+ isDisabled?: boolean;
48
+ /** Flag to show value input field. */
49
+ isInputVisible?: boolean;
50
+ /** Actions placed to the left of the slider. */
51
+ leftActions?: React.ReactNode;
52
+ /** The maximum permitted value. */
53
+ max?: number;
54
+ /** The minimum permitted value. */
55
+ min?: number;
56
+ /** Value change callback. This is called when the slider value changes. */
55
57
  onChange?: (
56
58
  value: number,
57
59
  inputValue?: number,
58
60
  setLocalInputValue?: React.Dispatch<React.SetStateAction<number>>
59
61
  ) => void;
60
- /** Actions placed to the left of the slider */
61
- leftActions?: React.ReactNode;
62
- /** Actions placed to the right of the slider */
62
+ /** Actions placed to the right of the slider. */
63
63
  rightActions?: React.ReactNode;
64
- /** One or more id's to use for the slider thumb description */
65
- 'aria-describedby'?: string;
66
- /** One or more id's to use for the slider thumb label */
67
- 'aria-labelledby'?: string;
64
+ /** Flag to indicate if boundaries should be shown for slider that does not have custom steps. */
65
+ showBoundaries?: boolean;
66
+ /** Flag to indicate if ticks should be shown for slider that does not have custom steps. */
67
+ showTicks?: boolean;
68
+ /** The step interval. */
69
+ step?: number;
70
+ /* Accessible label for the slider thumb. */
71
+ thumbAriaLabel?: string;
72
+ /** Current value of the slider. */
73
+ value?: number;
68
74
  }
69
75
 
70
76
  const getPercentage = (current: number, max: number) => (100 * current) / max;
@@ -3,18 +3,18 @@ import styles from '@patternfly/react-styles/css/components/Slider/slider';
3
3
  import { css } from '@patternfly/react-styles';
4
4
 
5
5
  export interface SliderStepProps extends Omit<React.HTMLProps<HTMLDivElement>, 'label'> {
6
- /** Additional classes added to the slider steps. */
6
+ /** Additional classes added to the slider step. */
7
7
  className?: string;
8
- /** Step value **/
9
- value?: number;
10
- /** Step label **/
11
- label?: string;
12
- /** Flag indicating that the tick should be hidden */
13
- isTickHidden?: boolean;
14
- /** Flag indicating that the label should be hidden */
15
- isLabelHidden?: boolean;
16
- /** Flag indicating the step is active */
8
+ /** Flag indicating the step is active. */
17
9
  isActive?: boolean;
10
+ /** Flag indicating that the label should be hidden. */
11
+ isLabelHidden?: boolean;
12
+ /** Flag indicating that the tick should be hidden. */
13
+ isTickHidden?: boolean;
14
+ /** Step label. **/
15
+ label?: string;
16
+ /** Step value. **/
17
+ value?: number;
18
18
  }
19
19
 
20
20
  export const SliderStep: React.FunctionComponent<SliderStepProps> = ({