@patternfly/react-core 4.243.1 → 4.244.1

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 (275) 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 +4 -0
  22. package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
  23. package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts +34 -24
  24. package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
  25. package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
  26. package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts +10 -5
  27. package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
  28. package/dist/esm/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
  29. package/dist/esm/components/FileUpload/FileUpload.d.ts +53 -47
  30. package/dist/esm/components/FileUpload/FileUpload.d.ts.map +1 -1
  31. package/dist/esm/components/FileUpload/FileUpload.js.map +1 -1
  32. package/dist/esm/components/FileUpload/FileUploadField.d.ts +51 -46
  33. package/dist/esm/components/FileUpload/FileUploadField.d.ts.map +1 -1
  34. package/dist/esm/components/FileUpload/FileUploadField.js.map +1 -1
  35. package/dist/esm/components/Modal/Modal.d.ts +57 -48
  36. package/dist/esm/components/Modal/Modal.d.ts.map +1 -1
  37. package/dist/esm/components/Modal/Modal.js.map +1 -1
  38. package/dist/esm/components/Modal/ModalBox.d.ts +12 -12
  39. package/dist/esm/components/Modal/ModalBox.d.ts.map +1 -1
  40. package/dist/esm/components/Modal/ModalBoxBody.d.ts +2 -2
  41. package/dist/esm/components/Modal/ModalBoxBody.d.ts.map +1 -1
  42. package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts +2 -2
  43. package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
  44. package/dist/esm/components/Modal/ModalBoxDescription.d.ts +3 -3
  45. package/dist/esm/components/Modal/ModalBoxDescription.d.ts.map +1 -1
  46. package/dist/esm/components/Modal/ModalBoxFooter.d.ts +2 -2
  47. package/dist/esm/components/Modal/ModalBoxFooter.d.ts.map +1 -1
  48. package/dist/esm/components/Modal/ModalBoxHeader.d.ts +3 -3
  49. package/dist/esm/components/Modal/ModalBoxHeader.d.ts.map +1 -1
  50. package/dist/esm/components/Modal/ModalBoxTitle.d.ts +8 -9
  51. package/dist/esm/components/Modal/ModalBoxTitle.d.ts.map +1 -1
  52. package/dist/esm/components/Modal/ModalBoxTitle.js.map +1 -1
  53. package/dist/esm/components/Modal/ModalContent.d.ts +56 -48
  54. package/dist/esm/components/Modal/ModalContent.d.ts.map +1 -1
  55. package/dist/esm/components/Modal/ModalContent.js.map +1 -1
  56. package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts +17 -13
  57. package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
  58. package/dist/esm/components/NotificationBadge/NotificationBadge.js +3 -3
  59. package/dist/esm/components/NotificationBadge/NotificationBadge.js.map +1 -1
  60. package/dist/esm/components/Pagination/Navigation.d.ts +33 -33
  61. package/dist/esm/components/Pagination/Navigation.d.ts.map +1 -1
  62. package/dist/esm/components/Pagination/OptionsToggle.d.ts +27 -26
  63. package/dist/esm/components/Pagination/OptionsToggle.d.ts.map +1 -1
  64. package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
  65. package/dist/esm/components/Pagination/Pagination.d.ts +76 -65
  66. package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
  67. package/dist/esm/components/Pagination/Pagination.js +1 -1
  68. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  69. package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +22 -18
  70. package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
  71. package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
  72. package/dist/esm/components/Pagination/ToggleTemplate.d.ts +3 -0
  73. package/dist/esm/components/Pagination/ToggleTemplate.d.ts.map +1 -1
  74. package/dist/esm/components/Pagination/ToggleTemplate.js.map +1 -1
  75. package/dist/esm/components/Popover/Popover.d.ts +88 -73
  76. package/dist/esm/components/Popover/Popover.d.ts.map +1 -1
  77. package/dist/esm/components/Popover/Popover.js.map +1 -1
  78. package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts +27 -26
  79. package/dist/esm/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
  80. package/dist/esm/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
  81. package/dist/esm/components/SearchInput/SearchInput.d.ts +71 -60
  82. package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
  83. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  84. package/dist/esm/components/Select/Select.d.ts +2 -0
  85. package/dist/esm/components/Select/Select.d.ts.map +1 -1
  86. package/dist/esm/components/Select/Select.js +4 -3
  87. package/dist/esm/components/Select/Select.js.map +1 -1
  88. package/dist/esm/components/Select/SelectToggle.d.ts +2 -0
  89. package/dist/esm/components/Select/SelectToggle.d.ts.map +1 -1
  90. package/dist/esm/components/Select/SelectToggle.js +3 -5
  91. package/dist/esm/components/Select/SelectToggle.js.map +1 -1
  92. package/dist/esm/components/Slider/Slider.d.ts +45 -39
  93. package/dist/esm/components/Slider/Slider.d.ts.map +1 -1
  94. package/dist/esm/components/Slider/Slider.js.map +1 -1
  95. package/dist/esm/components/Slider/SliderStep.d.ts +10 -10
  96. package/dist/esm/components/Slider/SliderStep.d.ts.map +1 -1
  97. package/dist/esm/components/TreeView/TreeView.d.ts +65 -53
  98. package/dist/esm/components/TreeView/TreeView.d.ts.map +1 -1
  99. package/dist/esm/components/TreeView/TreeView.js.map +1 -1
  100. package/dist/esm/components/TreeView/TreeViewList.d.ts +4 -4
  101. package/dist/esm/components/TreeView/TreeViewList.d.ts.map +1 -1
  102. package/dist/esm/components/TreeView/TreeViewListItem.d.ts +46 -39
  103. package/dist/esm/components/TreeView/TreeViewListItem.d.ts.map +1 -1
  104. package/dist/esm/components/TreeView/TreeViewListItem.js.map +1 -1
  105. package/dist/esm/components/TreeView/TreeViewRoot.d.ts +4 -4
  106. package/dist/esm/components/TreeView/TreeViewRoot.d.ts.map +1 -1
  107. package/dist/esm/components/TreeView/TreeViewSearch.d.ts +11 -8
  108. package/dist/esm/components/TreeView/TreeViewSearch.d.ts.map +1 -1
  109. package/dist/esm/components/TreeView/TreeViewSearch.js.map +1 -1
  110. package/dist/esm/helpers/Popper/Popper.js +8 -8
  111. package/dist/esm/helpers/Popper/Popper.js.map +1 -1
  112. package/dist/js/components/Alert/Alert.d.ts +41 -34
  113. package/dist/js/components/Alert/Alert.d.ts.map +1 -1
  114. package/dist/js/components/Alert/Alert.js.map +1 -1
  115. package/dist/js/components/Alert/AlertActionCloseButton.d.ts +8 -5
  116. package/dist/js/components/Alert/AlertActionCloseButton.d.ts.map +1 -1
  117. package/dist/js/components/Alert/AlertActionCloseButton.js.map +1 -1
  118. package/dist/js/components/Alert/AlertActionLink.d.ts +5 -2
  119. package/dist/js/components/Alert/AlertActionLink.d.ts.map +1 -1
  120. package/dist/js/components/Alert/AlertActionLink.js.map +1 -1
  121. package/dist/js/components/Alert/AlertIcon.d.ts +4 -4
  122. package/dist/js/components/Alert/AlertIcon.d.ts.map +1 -1
  123. package/dist/js/components/Alert/AlertToggleExpandButton.d.ts +5 -5
  124. package/dist/js/components/Alert/AlertToggleExpandButton.d.ts.map +1 -1
  125. package/dist/js/components/CalendarMonth/CalendarMonth.d.ts +34 -28
  126. package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
  127. package/dist/js/components/CalendarMonth/CalendarMonth.js +1 -0
  128. package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
  129. package/dist/js/components/DatePicker/DatePicker.d.ts +43 -36
  130. package/dist/js/components/DatePicker/DatePicker.d.ts.map +1 -1
  131. package/dist/js/components/DatePicker/DatePicker.js +4 -0
  132. package/dist/js/components/DatePicker/DatePicker.js.map +1 -1
  133. package/dist/js/components/ExpandableSection/ExpandableSection.d.ts +34 -24
  134. package/dist/js/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
  135. package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
  136. package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts +10 -5
  137. package/dist/js/components/ExpandableSection/ExpandableSectionToggle.d.ts.map +1 -1
  138. package/dist/js/components/ExpandableSection/ExpandableSectionToggle.js.map +1 -1
  139. package/dist/js/components/FileUpload/FileUpload.d.ts +53 -47
  140. package/dist/js/components/FileUpload/FileUpload.d.ts.map +1 -1
  141. package/dist/js/components/FileUpload/FileUpload.js.map +1 -1
  142. package/dist/js/components/FileUpload/FileUploadField.d.ts +51 -46
  143. package/dist/js/components/FileUpload/FileUploadField.d.ts.map +1 -1
  144. package/dist/js/components/FileUpload/FileUploadField.js.map +1 -1
  145. package/dist/js/components/Modal/Modal.d.ts +57 -48
  146. package/dist/js/components/Modal/Modal.d.ts.map +1 -1
  147. package/dist/js/components/Modal/Modal.js.map +1 -1
  148. package/dist/js/components/Modal/ModalBox.d.ts +12 -12
  149. package/dist/js/components/Modal/ModalBox.d.ts.map +1 -1
  150. package/dist/js/components/Modal/ModalBoxBody.d.ts +2 -2
  151. package/dist/js/components/Modal/ModalBoxBody.d.ts.map +1 -1
  152. package/dist/js/components/Modal/ModalBoxCloseButton.d.ts +2 -2
  153. package/dist/js/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
  154. package/dist/js/components/Modal/ModalBoxDescription.d.ts +3 -3
  155. package/dist/js/components/Modal/ModalBoxDescription.d.ts.map +1 -1
  156. package/dist/js/components/Modal/ModalBoxFooter.d.ts +2 -2
  157. package/dist/js/components/Modal/ModalBoxFooter.d.ts.map +1 -1
  158. package/dist/js/components/Modal/ModalBoxHeader.d.ts +3 -3
  159. package/dist/js/components/Modal/ModalBoxHeader.d.ts.map +1 -1
  160. package/dist/js/components/Modal/ModalBoxTitle.d.ts +8 -9
  161. package/dist/js/components/Modal/ModalBoxTitle.d.ts.map +1 -1
  162. package/dist/js/components/Modal/ModalBoxTitle.js.map +1 -1
  163. package/dist/js/components/Modal/ModalContent.d.ts +56 -48
  164. package/dist/js/components/Modal/ModalContent.d.ts.map +1 -1
  165. package/dist/js/components/Modal/ModalContent.js.map +1 -1
  166. package/dist/js/components/NotificationBadge/NotificationBadge.d.ts +17 -13
  167. package/dist/js/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
  168. package/dist/js/components/NotificationBadge/NotificationBadge.js +3 -3
  169. package/dist/js/components/NotificationBadge/NotificationBadge.js.map +1 -1
  170. package/dist/js/components/Pagination/Navigation.d.ts +33 -33
  171. package/dist/js/components/Pagination/Navigation.d.ts.map +1 -1
  172. package/dist/js/components/Pagination/OptionsToggle.d.ts +27 -26
  173. package/dist/js/components/Pagination/OptionsToggle.d.ts.map +1 -1
  174. package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
  175. package/dist/js/components/Pagination/Pagination.d.ts +76 -65
  176. package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
  177. package/dist/js/components/Pagination/Pagination.js +1 -1
  178. package/dist/js/components/Pagination/Pagination.js.map +1 -1
  179. package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +22 -18
  180. package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
  181. package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
  182. package/dist/js/components/Pagination/ToggleTemplate.d.ts +3 -0
  183. package/dist/js/components/Pagination/ToggleTemplate.d.ts.map +1 -1
  184. package/dist/js/components/Pagination/ToggleTemplate.js.map +1 -1
  185. package/dist/js/components/Popover/Popover.d.ts +88 -73
  186. package/dist/js/components/Popover/Popover.d.ts.map +1 -1
  187. package/dist/js/components/Popover/Popover.js.map +1 -1
  188. package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts +27 -26
  189. package/dist/js/components/SearchInput/AdvancedSearchMenu.d.ts.map +1 -1
  190. package/dist/js/components/SearchInput/AdvancedSearchMenu.js.map +1 -1
  191. package/dist/js/components/SearchInput/SearchInput.d.ts +71 -60
  192. package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
  193. package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
  194. package/dist/js/components/Select/Select.d.ts +2 -0
  195. package/dist/js/components/Select/Select.d.ts.map +1 -1
  196. package/dist/js/components/Select/Select.js +4 -3
  197. package/dist/js/components/Select/Select.js.map +1 -1
  198. package/dist/js/components/Select/SelectToggle.d.ts +2 -0
  199. package/dist/js/components/Select/SelectToggle.d.ts.map +1 -1
  200. package/dist/js/components/Select/SelectToggle.js +3 -5
  201. package/dist/js/components/Select/SelectToggle.js.map +1 -1
  202. package/dist/js/components/Slider/Slider.d.ts +45 -39
  203. package/dist/js/components/Slider/Slider.d.ts.map +1 -1
  204. package/dist/js/components/Slider/Slider.js.map +1 -1
  205. package/dist/js/components/Slider/SliderStep.d.ts +10 -10
  206. package/dist/js/components/Slider/SliderStep.d.ts.map +1 -1
  207. package/dist/js/components/TreeView/TreeView.d.ts +65 -53
  208. package/dist/js/components/TreeView/TreeView.d.ts.map +1 -1
  209. package/dist/js/components/TreeView/TreeView.js.map +1 -1
  210. package/dist/js/components/TreeView/TreeViewList.d.ts +4 -4
  211. package/dist/js/components/TreeView/TreeViewList.d.ts.map +1 -1
  212. package/dist/js/components/TreeView/TreeViewListItem.d.ts +46 -39
  213. package/dist/js/components/TreeView/TreeViewListItem.d.ts.map +1 -1
  214. package/dist/js/components/TreeView/TreeViewListItem.js.map +1 -1
  215. package/dist/js/components/TreeView/TreeViewRoot.d.ts +4 -4
  216. package/dist/js/components/TreeView/TreeViewRoot.d.ts.map +1 -1
  217. package/dist/js/components/TreeView/TreeViewSearch.d.ts +11 -8
  218. package/dist/js/components/TreeView/TreeViewSearch.d.ts.map +1 -1
  219. package/dist/js/components/TreeView/TreeViewSearch.js.map +1 -1
  220. package/dist/js/helpers/Popper/Popper.js +8 -8
  221. package/dist/js/helpers/Popper/Popper.js.map +1 -1
  222. package/dist/umd/react-core.min.css +172 -172
  223. package/dist/umd/react-core.min.js +3 -3
  224. package/package.json +2 -2
  225. package/src/components/Alert/Alert.tsx +42 -34
  226. package/src/components/Alert/AlertActionCloseButton.tsx +9 -5
  227. package/src/components/Alert/AlertActionLink.tsx +6 -2
  228. package/src/components/Alert/AlertIcon.tsx +4 -4
  229. package/src/components/Alert/AlertToggleExpandButton.tsx +5 -5
  230. package/src/components/Badge/__tests__/Badge.test.tsx +45 -8
  231. package/src/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap +2 -12
  232. package/src/components/CalendarMonth/CalendarMonth.tsx +36 -28
  233. package/src/components/DatePicker/DatePicker.tsx +49 -36
  234. package/src/components/DatePicker/__tests__/DatePicker.test.tsx +21 -0
  235. package/src/components/ExpandableSection/ExpandableSection.tsx +35 -24
  236. package/src/components/ExpandableSection/ExpandableSectionToggle.tsx +11 -5
  237. package/src/components/FileUpload/FileUpload.tsx +56 -49
  238. package/src/components/FileUpload/FileUploadField.tsx +56 -50
  239. package/src/components/Modal/Modal.tsx +57 -48
  240. package/src/components/Modal/ModalBox.tsx +12 -12
  241. package/src/components/Modal/ModalBoxBody.tsx +2 -2
  242. package/src/components/Modal/ModalBoxCloseButton.tsx +2 -2
  243. package/src/components/Modal/ModalBoxDescription.tsx +3 -3
  244. package/src/components/Modal/ModalBoxFooter.tsx +2 -2
  245. package/src/components/Modal/ModalBoxHeader.tsx +3 -3
  246. package/src/components/Modal/ModalBoxTitle.tsx +8 -9
  247. package/src/components/Modal/ModalContent.tsx +56 -48
  248. package/src/components/Modal/examples/Modal.md +1 -3
  249. package/src/components/NotificationBadge/NotificationBadge.tsx +22 -15
  250. package/src/components/NotificationBadge/__tests__/NotificationBadge.test.tsx +25 -1
  251. package/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap +5 -0
  252. package/src/components/NotificationBadge/examples/NotificationBadge.md +16 -3
  253. package/src/components/NotificationBadge/examples/NotificationBadgeBasic.tsx +26 -13
  254. package/src/components/NotificationBadge/examples/NotificationBadgeWithCount.tsx +28 -18
  255. package/src/components/Pagination/Navigation.tsx +33 -33
  256. package/src/components/Pagination/OptionsToggle.tsx +27 -26
  257. package/src/components/Pagination/Pagination.tsx +79 -65
  258. package/src/components/Pagination/PaginationOptionsMenu.tsx +22 -18
  259. package/src/components/Pagination/ToggleTemplate.tsx +4 -0
  260. package/src/components/Popover/Popover.tsx +89 -73
  261. package/src/components/SearchInput/AdvancedSearchMenu.tsx +29 -28
  262. package/src/components/SearchInput/SearchInput.tsx +76 -62
  263. package/src/components/Select/Select.tsx +5 -0
  264. package/src/components/Select/SelectToggle.tsx +5 -4
  265. package/src/components/Slider/Slider.tsx +47 -41
  266. package/src/components/Slider/SliderStep.tsx +10 -10
  267. package/src/components/TreeView/TreeView.tsx +67 -53
  268. package/src/components/TreeView/TreeViewList.tsx +4 -4
  269. package/src/components/TreeView/TreeViewListItem.tsx +46 -39
  270. package/src/components/TreeView/TreeViewRoot.tsx +4 -4
  271. package/src/components/TreeView/TreeViewSearch.tsx +12 -8
  272. package/src/demos/Masthead.md +9 -193
  273. package/src/demos/NotificationDrawer/NotificationDrawer.md +2 -0
  274. package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +305 -0
  275. package/src/helpers/Popper/Popper.tsx +8 -8
@@ -4,42 +4,52 @@ export declare enum ExpandableSectionVariant {
4
4
  default = "default",
5
5
  truncate = "truncate"
6
6
  }
7
+ /** The main expandable section component. */
7
8
  export interface ExpandableSectionProps extends React.HTMLProps<HTMLDivElement> {
8
9
  /** Content rendered inside the expandable section. */
9
10
  children?: React.ReactNode;
10
11
  /** Additional classes added to the expandable section. */
11
12
  className?: string;
12
- /** Flag to indicate if the content is expanded */
13
- isExpanded?: boolean;
14
- /** Text that appears in the attached toggle */
15
- toggleText?: string;
16
- /** Text that appears in the attached toggle when expanded (will override toggleText if both are specified; used for uncontrolled expandable with dynamic toggle text) */
17
- toggleTextExpanded?: string;
18
- /** Text that appears in the attached toggle when collapsed (will override toggleText if both are specified; used for uncontrolled expandable with dynamic toggle text) */
19
- toggleTextCollapsed?: string;
20
- /** React node that appears in the attached toggle in place of toggle text */
21
- toggleContent?: React.ReactNode;
22
- /** Callback function to toggle the expandable section. Detached expandable sections should use the onToggle property of the expandable section toggle sub-component. */
23
- onToggle?: (isExpanded: boolean) => void;
24
- /** Forces active state */
25
- isActive?: boolean;
26
- /** Indicates the expandable section has a detached toggle */
27
- isDetached?: boolean;
28
- /** ID of the content of the expandable section */
13
+ /** Id of the content of the expandable section. When passing in the isDetached property, this
14
+ * property's value should match the contenId property of the expandable section toggle sub-component.
15
+ */
29
16
  contentId?: string;
30
- /** Display size variant. Set to large for disclosure styling. */
17
+ /** Display size variant. Set to "large" for disclosure styling. */
31
18
  displaySize?: 'default' | 'large';
32
- /** Flag to indicate the width of the component is limited. Set to true for disclosure styling. */
33
- isWidthLimited?: boolean;
34
- /** Flag to indicate if the content is indented */
19
+ /** Forces active state. */
20
+ isActive?: boolean;
21
+ /** Indicates the expandable section has a detached toggle. */
22
+ isDetached?: boolean;
23
+ /** Flag to indicate if the content is expanded. */
24
+ isExpanded?: boolean;
25
+ /** Flag to indicate if the content is indented. */
35
26
  isIndented?: boolean;
27
+ /** Flag to indicate the width of the component is limited. Set to "true" for disclosure styling. */
28
+ isWidthLimited?: boolean;
29
+ /** Callback function to toggle the expandable section. Detached expandable sections should
30
+ * use the onToggle property of the expandable section toggle sub-component.
31
+ */
32
+ onToggle?: (isExpanded: boolean) => void;
33
+ /** React node that appears in the attached toggle in place of the toggleText property. */
34
+ toggleContent?: React.ReactNode;
35
+ /** Text that appears in the attached toggle. */
36
+ toggleText?: string;
37
+ /** Text that appears in the attached toggle when collapsed (will override toggleText if
38
+ * both are specified; used for uncontrolled expandable with dynamic toggle text).
39
+ */
40
+ toggleTextCollapsed?: string;
41
+ /** Text that appears in the attached toggle when expanded (will override toggleText if
42
+ * both are specified; used for uncontrolled expandable with dynamic toggle text).
43
+ */
44
+ toggleTextExpanded?: string;
45
+ /** @beta Truncates the expandable content to the specified number of lines when using the
46
+ * "truncate" variant.
47
+ */
48
+ truncateMaxLines?: number;
36
49
  /** @beta Determines the variant of the expandable section. When passing in "truncate" as the
37
50
  * variant, the expandable content will be truncated after 3 lines by default.
38
51
  */
39
52
  variant?: 'default' | 'truncate';
40
- /** @beta Truncates the expandable content to the specified number of lines when using the
41
- * "truncate" variant. */
42
- truncateMaxLines?: number;
43
53
  }
44
54
  interface ExpandableSectionState {
45
55
  isExpanded: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":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,sBAAsB;IAC9B,UAAU,EAAE,OAAO,CAAC;CACrB;AAUD,qBAAa,iBAAkB,SAAQ,KAAK,CAAC,SAAS,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IACpG,MAAM,CAAC,WAAW,SAAuB;gBAC7B,KAAK,EAAE,sBAAsB;IAQzC,oBAAoB,kCAAqC;IACzD,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,sBAAsB,CAAC,CAcvD;IAEF,OAAO,CAAC,mBAAmB;IAe3B,iBAAiB;IAOjB,kBAAkB,CAAC,SAAS,EAAE,sBAAsB;IAUpD,MAAM;CAoFP"}
1
+ {"version":3,"file":"ExpandableSection.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,oBAAY,wBAAwB;IAClC,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,6CAA6C;AAE7C,MAAM,WAAW,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAC7E,sDAAsD;IACtD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,WAAW,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAClC,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oGAAoG;IACpG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,0FAA0F;IAC1F,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CAClC;AAED,UAAU,sBAAsB;IAC9B,UAAU,EAAE,OAAO,CAAC;CACrB;AAUD,qBAAa,iBAAkB,SAAQ,KAAK,CAAC,SAAS,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IACpG,MAAM,CAAC,WAAW,SAAuB;gBAC7B,KAAK,EAAE,sBAAsB;IAQzC,oBAAoB,kCAAqC;IACzD,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,sBAAsB,CAAC,CAcvD;IAEF,OAAO,CAAC,mBAAmB;IAe3B,iBAAiB;IAOjB,kBAAkB,CAAC,SAAS,EAAE,sBAAsB;IAUpD,MAAM;CAoFP"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpandableSection.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSection.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,8IAAkG;AAClG,2DAA+C;AAC/C,qLAA6G;AAC7G,sHAAqF;AAGrF,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,+CAAmB,CAAA;IACnB,iDAAqB,CAAA;AACvB,CAAC,EAHW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAGnC;AA4CD,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,OAAuB,EAAE,EAAE;IAC9D,IAAI,CAAC,OAAO,IAAI,KAAK,GAAG,CAAC,EA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,EAAE,CAAC,SAAS;IACzC,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,SAAS;CACnB,CAAC"}
1
+ {"version":3,"file":"ExpandableSection.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSection.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,8IAAkG;AAClG,2DAA+C;AAC/C,qLAA6G;AAC7G,sHAAqF;AAGrF,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,+CAAmB,CAAA;IACnB,iDAAqB,CAAA;AACvB,CAAC,EAHW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAGnC;AAuDD,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,OAAuB,EAAE,EAAE;IAC9D,IAAI,CAAC,OAAO,IAAI,KAAK,GAAG,CAAC,EAAE;QACzB,OAAO;KACR;IAED,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,4DAAS,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAa,iBAAkB,SAAQ,KAAK,CAAC,SAAyD;IAEpG,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC;QAOf,yBAAoB,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QALvD,IAAI,CAAC,KAAK,GAAG;YACX,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CAAC;IACJ,CAAC;IAmBO,mBAAmB,CACzB,UAAkB,EAClB,kBAA0B,EAC1B,mBAA2B,EAC3B,qBAA8B;QAE9B,IAAI,qBAAqB,IAAI,kBAAkB,KAAK,EAAE,EAAE;YACtD,OAAO,kBAAkB,CAAC;SAC3B;QACD,IAAI,CAAC,qBAAqB,IAAI,mBAAmB,KAAK,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AC,SAAS,CAAC,QAAQ,EAC1E,SAAS,CACV,IACG,KAAK;YAER,OAAO,KAAK,wBAAwB,CAAC,OAAO,IAAI,gBAAgB;YACjE,6BACE,GAAG,EAAE,IAAI,CAAC,oBAAoB,EAC9B,SAAS,EAAE,kBAAG,CAAC,4BAAM,CAAC,wBAAwB,CAAC,EAC/C,MAAM,EAAE,OAAO,KAAK,wBAAwB,CAAC,QAAQ,IAAI,CAAC,qBAAqB,EAC/E,EAAE,EAAE,SAAS,IAEZ,QAAQ,CACL;YACL,OAAO,KAAK,wBAAwB,CAAC,QAAQ,IAAI,gBAAgB,CAC9D,CACP,CAAC;IACJ,CAAC;;AA9IH,8CA+IC;AA9IQ,6BAAW,GAAG,mBAAmB,CAAC;AAUlC,8BAAY,GAAyC;IAC1D,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,kBAAkB,EAAE,EAAE;IACtB,mBAAmB,EAAE,EAAE;IACvB,6DAA6D;IAC7D,QAAQ,EAAE,CAAC,UAAU,EAAQ,EAAE,CAAC,SAAS;IACzC,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,SAAS;CACnB,CAAC"}
@@ -1,19 +1,24 @@
1
1
  import * as React from 'react';
2
+ /** Acts as the toggle sub-component when the main expandable section component has the isDetached
3
+ * property passed in. Allows for more custom control over the expandable section's toggle.
4
+ */
2
5
  export interface ExpandableSectionToggleProps extends React.HTMLProps<HTMLDivElement> {
3
6
  /** Content rendered inside the expandable toggle. */
4
7
  children?: React.ReactNode;
5
8
  /** Additional classes added to the expandable toggle. */
6
9
  className?: string;
7
- /** Flag indicating if the expandable section is expanded. */
8
- isExpanded?: boolean;
9
- /** Callback function to toggle the expandable content. */
10
- onToggle?: (isExpanded: boolean) => void;
11
- /** ID of the toggle's respective expandable section content. */
10
+ /** Id of the toggle's respective expandable section content. The value passed into this
11
+ * property should match the contentId property of the main expandable section component.
12
+ */
12
13
  contentId?: string;
13
14
  /** Direction the toggle arrow should point when the expandable section is expanded. */
14
15
  direction?: 'up' | 'down';
15
16
  /** @beta Flag to determine toggle styling when the expandable content is truncated. */
16
17
  hasTruncatedContent?: boolean;
18
+ /** Flag indicating if the expandable section is expanded. */
19
+ isExpanded?: boolean;
20
+ /** Callback function to toggle the expandable content. */
21
+ onToggle?: (isExpanded: boolean) => void;
17
22
  }
18
23
  export declare const ExpandableSectionToggle: React.FunctionComponent<ExpandableSectionToggleProps>;
19
24
  //# sourceMappingURL=ExpandableSectionToggle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpandableSectionToggle.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,4BAA6B,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACnF,qDAAqD;IACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,iBAAiB,CAAC,4BAA4B,CAwCzF,CAAC"}
1
+ {"version":3,"file":"ExpandableSectionToggle.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;GAEG;AAEH,MAAM,WAAW,4BAA6B,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACnF,qDAAqD;IACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,iBAAiB,CAAC,4BAA4B,CAwCzF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpandableSectionToggle.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,8IAAkG;AAClG,2DAA+C;AAC/C,sHAAqF;AAmB9E,MAAM,uBAAuB,GAA0D,CAAC,EAShE,EAAE,EAAE;QAT4D,EAC7F,QAAQ,EACR,SAAS,GAAG,EAAE,EACd,UAAU,GAAG,KAAK,EAClB,QAAQ,EACR,SAAS,EACT,SAAS,GAAG,MAAM,EAClB,mBAAmB,GAAG,KAAK,OAEE,EAD1B,KAAK,sBARqF,oGAS9F,CADS;IAC0B,OAAA,CAClC,2CACE,SAAS,EAAE,kBAAG,CACZ,4BAAM,CAAC,iBAAiB,EACxB,UAAU,IAAI,4BAAM,CAAC,SAAS,CAAC,QAAQ,EACvC,4BAAM,CAAC,SAAS,CAAC,QAAQ,EACzB,mBAAmB,IAAI,4BAAM,CAAC,SAAS,CAAC,QAAQ,EAChD,SAAS,CACV,IACG,KAAK;QAET,gCACE,SAAS,EAAE,kBAAG,CAAC,4BAAM,CAAC,uBAAuB,CAAC,EAC9C,IAAI,EAAC,QAAQ,mBACE,UAAU,mBACV,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC;YAEnC,CAAC,mBAAmB,IAAI,CACvB,8BACE,SAAS,EAAE,kBAAG,CACZ,4BAAM,CAAC,2BAA2B,EAClC,UAAU,IAAI,SAAS,KAAK,IAAI,IAAI,4BAAM,CAAC,SAAS,CAAC,SAAS,CAC/D;gBAED,oBAAC,0BAAc,0BAAe,CACzB,CACR;YACD,8BAAM,SAAS,EAAE,kBAAG,CAAC,4BAAM,CAAC,2BAA2B,CAAC,IAAG,QAAQ,CAAQ,CACpE,CACL,CACP,CAAA;CAAA,CAAC;AAxCW,QAAA,uBAAuB,2BAwClC;AAEF,+BAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC"}
1
+ {"version":3,"file":"ExpandableSectionToggle.js","sourceRoot":"","sources":["../../../../src/components/ExpandableSection/ExpandableSectionToggle.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,8IAAkG;AAClG,2DAA+C;AAC/C,sHAAqF;AAyB9E,MAAM,uBAAuB,GAA0D,CAAC,EAShE,EAAE,EAAE;QAT4D,EAC7F,QAAQ,EACR,SAAS,GAAG,EAAE,EACd,UAAU,GAAG,KAAK,EAClB,QAAQ,EACR,SAAS,EACT,SAAS,GAAG,MAAM,EAClB,mBAAmB,GAAG,KAAK,OAEE,EAD1B,KAAK,sBARqF,oGAS9F,CADS;IAC0B,OAAA,CAClC,2CACE,SAAS,EAAE,kBAAG,CACZ,4BAAM,CAAC,iBAAiB,EACxB,UAAU,IAAI,4BAAM,CAAC,SAAS,CAAC,QAAQ,EACvC,4BAAM,CAAC,SAAS,CAAC,QAAQ,EACzB,mBAAmB,IAAI,4BAAM,CAAC,SAAS,CAAC,QAAQ,EAChD,SAAS,CACV,IACG,KAAK;QAET,gCACE,SAAS,EAAE,kBAAG,CAAC,4BAAM,CAAC,uBAAuB,CAAC,EAC9C,IAAI,EAAC,QAAQ,mBACE,UAAU,mBACV,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC;YAEnC,CAAC,mBAAmB,IAAI,CACvB,8BACE,SAAS,EAAE,kBAAG,CACZ,4BAAM,CAAC,2BAA2B,EAClC,UAAU,IAAI,SAAS,KAAK,IAAI,IAAI,4BAAM,CAAC,SAAS,CAAC,SAAS,CAC/D;gBAED,oBAAC,0BAAc,0BAAe,CACzB,CACR;YACD,8BAAM,SAAS,EAAE,kBAAG,CAAC,4BAAM,CAAC,2BAA2B,CAAC,IAAG,QAAQ,CAAQ,CACpE,CACL,CACP,CAAA;CAAA,CAAC;AAxCW,QAAA,uBAAuB,2BAwClC;AAEF,+BAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC"}
@@ -1,71 +1,77 @@
1
1
  import * as React from 'react';
2
2
  import { DropzoneProps } from 'react-dropzone';
3
3
  import { FileUploadFieldProps } from './FileUploadField';
4
+ /** The main file upload component with drag and drop functionality built in by default. */
4
5
  export interface FileUploadProps extends Omit<FileUploadFieldProps, 'children' | 'onBrowseButtonClick' | 'onClearButtonClick' | 'isDragActive' | 'containerRef'> {
5
- /** Unique id for the TextArea, also used to generate ids for accessible labels. */
6
- id: string;
7
- /** What type of file. Determines what is is passed to `onChange` and expected by `value`
8
- * (a string for 'text' and 'dataURL', or a File object otherwise. */
9
- type?: 'text' | 'dataURL';
10
- /** Value of the file's contents
11
- * (string if text file, File object otherwise) */
12
- value?: string | File;
6
+ /** Flag to allow editing of a text file's contents after it is selected from disk. */
7
+ allowEditingUploadedText?: boolean;
8
+ /** Aria-label for the text area. */
9
+ 'aria-label'?: string;
10
+ /** Text for the browse button. */
11
+ browseButtonText?: string;
12
+ /** Additional children to render after (or instead of) the file preview. */
13
+ children?: React.ReactNode;
14
+ /** Additional classes added to the file upload container element. */
15
+ className?: string;
16
+ /** Text for the clear button. */
17
+ clearButtonText?: string;
13
18
  /** Value to be shown in the read-only filename field. */
14
19
  filename?: string;
15
- /** @deprecated A callback for when the file contents change. Please instead use onFileInputChange, onTextChange, onDataChange, onClearClick individually. */
16
- onChange?: (value: string | File, filename: string, event: React.MouseEvent<HTMLButtonElement, MouseEvent> | React.DragEvent<HTMLElement> | React.ChangeEvent<HTMLElement>) => void;
17
- /** Change event emitted from the hidden \<input type="file" \> field associated with the component */
18
- onFileInputChange?: (event: React.ChangeEvent<HTMLInputElement> | React.DragEvent<HTMLElement>, file: File) => void;
19
- /** Callback for clicking on the FileUploadField text area. By default, prevents a click in the text area from opening file dialog. */
20
- onClick?: (event: React.MouseEvent) => void;
21
- /** Additional classes added to the FileUpload container element. */
22
- className?: string;
20
+ /** Aria-label for the read-only filename field. */
21
+ filenameAriaLabel?: string;
22
+ /** Placeholder string to display in the empty filename field. */
23
+ filenamePlaceholder?: string;
24
+ /** Flag to hide the built-in preview of the file (where available). If true, you can use
25
+ * the children property to render an alternate preview.
26
+ */
27
+ hideDefaultPreview?: boolean;
28
+ /** Unique id for the text area. Also used to generate ids for accessible labels. */
29
+ id: string;
23
30
  /** Flag to show if the field is disabled. */
24
31
  isDisabled?: boolean;
25
- /** Flag to show if the field is read only. */
26
- isReadOnly?: boolean;
27
32
  /** Flag to show if a file is being loaded. */
28
33
  isLoading?: boolean;
29
- /** Aria-valuetext for the loading spinner */
30
- spinnerAriaValueText?: string;
34
+ /** Flag to show if the field is read only. */
35
+ isReadOnly?: boolean;
31
36
  /** Flag to show if the field is required. */
32
37
  isRequired?: boolean;
38
+ /** @deprecated A callback for when the file contents changes. Please instead use
39
+ * onFileInputChange, onTextChange, onDataChange, and onClearClick individually.
40
+ */
41
+ onChange?: (value: string | File, filename: string, event: React.MouseEvent<HTMLButtonElement, MouseEvent> | React.DragEvent<HTMLElement> | React.ChangeEvent<HTMLElement>) => void;
42
+ /** Callback for clicking on the file upload field text area. By default, prevents a click
43
+ * in the text area from opening file dialog.
44
+ */
45
+ onClick?: (event: React.MouseEvent) => void;
46
+ /** Change event emitted from the hidden \<input type="file" \> field associated with the component */
47
+ onFileInputChange?: (event: React.ChangeEvent<HTMLInputElement> | React.DragEvent<HTMLElement>, file: File) => void;
48
+ /** Aria-valuetext for the loading spinner. */
49
+ spinnerAriaValueText?: string;
50
+ /** What type of file. Determines what is passed to the onChange property and what is
51
+ * expected by the value property (a string for 'text' and 'dataURL', or a File object otherwise.
52
+ */
53
+ type?: 'text' | 'dataURL';
33
54
  /** Value to indicate if the field is modified to show that validation state.
34
55
  * If set to success, field will be modified to indicate valid state.
35
- * If set to error, field will be modified to indicate error state.
56
+ * If set to error, field will be modified to indicate error state.
36
57
  */
37
58
  validated?: 'success' | 'error' | 'default';
38
- /** Aria-label for the TextArea. */
39
- 'aria-label'?: string;
40
- /** Placeholder string to display in the empty filename field */
41
- filenamePlaceholder?: string;
42
- /** Aria-label for the read-only filename field */
43
- filenameAriaLabel?: string;
44
- /** Text for the Browse button */
45
- browseButtonText?: string;
46
- /** Text for the Clear button */
47
- clearButtonText?: string;
48
- /** Flag to hide the built-in preview of the file (where available).
49
- * If true, you can use children to render an alternate preview. */
50
- hideDefaultPreview?: boolean;
51
- /** Flag to allow editing of a text file's contents after it is selected from disk */
52
- allowEditingUploadedText?: boolean;
53
- /** Additional children to render after (or instead of) the file preview. */
54
- children?: React.ReactNode;
55
- /** A callback for when a selected file starts loading */
56
- onReadStarted?: (fileHandle: File) => void;
57
- /** A callback for when a selected file finishes loading */
58
- onReadFinished?: (fileHandle: File) => void;
59
- /** A callback for when the FileReader API fails */
60
- onReadFailed?: (error: DOMException, fileHandle: File) => void;
59
+ /** Value of the file's contents (string if text file, File object otherwise). */
60
+ value?: string | File;
61
61
  /** Optional extra props to customize react-dropzone. */
62
62
  dropzoneProps?: DropzoneProps;
63
- /** Clear button was clicked */
63
+ /** Clear button was clicked. */
64
64
  onClearClick?: React.MouseEventHandler<HTMLButtonElement>;
65
- /** Text area text changed */
66
- onTextChange?: (text: string) => void;
67
65
  /** On data changed - if type='text' or type='dataURL' and file was loaded it will call this method */
68
66
  onDataChange?: (data: string) => void;
67
+ /** A callback for when the FileReader API fails. */
68
+ onReadFailed?: (error: DOMException, fileHandle: File) => void;
69
+ /** A callback for when a selected file finishes loading. */
70
+ onReadFinished?: (fileHandle: File) => void;
71
+ /** A callback for when a selected file starts loading. */
72
+ onReadStarted?: (fileHandle: File) => void;
73
+ /** Text area text changed. */
74
+ onTextChange?: (text: string) => void;
69
75
  }
70
76
  export declare const FileUpload: React.FunctionComponent<FileUploadProps>;
71
77
  //# sourceMappingURL=FileUpload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../../src/components/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAiB,EAAE,aAAa,EAA4C,MAAM,gBAAgB,CAAC;AACnG,OAAO,EAAmB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAQ1E,MAAM,WAAW,eACf,SAAQ,IAAI,CACV,oBAAoB,EACpB,UAAU,GAAG,qBAAqB,GAAG,oBAAoB,GAAG,cAAc,GAAG,cAAc,CAC5F;IACD,mFAAmF;IACnF,EAAE,EAAE,MAAM,CAAC;IACX;yEACqE;IACrE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;sDACkD;IAClD,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8JAA8J;IAC9J,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,EACD,K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KAAK,CAAC,cAAc,EAAE,IACxC,IACF,QAAQ,EAAE,IAAI,EACd,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,IAAI,EACzB,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAE,OAAO,EACxB,YAAY,EAAE,YAAY;YAE1B,+CAEM,UAAU,IACd,GAAG,EAAE,KAAK,CAAC,EAAE;oBACX,YAAY,CAAC,OAAO,GAAG,KAAK,CAAC;oBAC5B,UAAwC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBACvD,CAAC,IACD;YACD,QAAQ,CACO,CACnB,CAAC;IACJ,CAAC,CACQ,CACZ,CAAC;AACJ,CAAC,CAAC;AAhHW,QAAA,UAAU,cAgHrB;AACF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
@@ -1,68 +1,73 @@
1
1
  import * as React from 'react';
2
+ /** A more customizable file upload component for implementing custom logic. Drag and drop
3
+ * functionality is not built in by default.
4
+ */
2
5
  export interface FileUploadFieldProps extends Omit<React.HTMLProps<HTMLDivElement>, 'value' | 'onChange'> {
3
- /** Unique id for the TextArea, also used to generate ids for accessible labels */
4
- id: string;
5
- /** What type of file. Determines what is is expected by `value`
6
- * (a string for 'text' and 'dataURL', or a File object otherwise). */
7
- type?: 'text' | 'dataURL';
8
- /** Value of the file's contents
9
- * (string if text file, File object otherwise) */
10
- value?: string | File;
6
+ /** Flag to allow editing of a text file's contents after it is selected from disk. */
7
+ allowEditingUploadedText?: boolean;
8
+ /** Aria-label for the text area. */
9
+ 'aria-label'?: string;
10
+ /** Text for the browse button. */
11
+ browseButtonText?: string;
12
+ /** Additional children to render after (or instead of) the file preview. */
13
+ children?: React.ReactNode;
14
+ /** Additional classes added to the file upload field container element. */
15
+ className?: string;
16
+ /** Text for the clear button. */
17
+ clearButtonText?: string;
11
18
  /** Value to be shown in the read-only filename field. */
12
19
  filename?: string;
13
- /** A callback for when the TextArea value changes. */
14
- onChange?: (value: string, filename: string, event: React.ChangeEvent<HTMLTextAreaElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
15
- /** Additional classes added to the FileUploadField container element. */
16
- className?: string;
20
+ /** Aria-label for the read-only filename field. */
21
+ filenameAriaLabel?: string;
22
+ /** Placeholder string to display in the empty filename field. */
23
+ filenamePlaceholder?: string;
24
+ /** Flag to hide the built-in preview of the file (where available). If true, you can use
25
+ * the children property to render an alternate preview.
26
+ */
27
+ hideDefaultPreview?: boolean;
28
+ /** Unique id for the text area. Also used to generate ids for accessible labels. */
29
+ id: string;
30
+ /** Flag to disable the clear button. */
31
+ isClearButtonDisabled?: boolean;
17
32
  /** Flag to show if the field is disabled. */
18
33
  isDisabled?: boolean;
19
- /** Flag to show if the field is read only. */
20
- isReadOnly?: boolean;
21
34
  /** Flag to show if a file is being loaded. */
22
35
  isLoading?: boolean;
23
- /** Aria-valuetext for the loading spinner */
24
- spinnerAriaValueText?: string;
36
+ /** Flag to show if the field is read only. */
37
+ isReadOnly?: boolean;
25
38
  /** Flag to show if the field is required. */
26
39
  isRequired?: boolean;
40
+ /** A callback for when the text area value changes. */
41
+ onChange?: (value: string, filename: string, event: React.ChangeEvent<HTMLTextAreaElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
42
+ /** Aria-valuetext for the loading spinner. */
43
+ spinnerAriaValueText?: string;
44
+ /** What type of file. Determines what is is expected by the value property (a string for
45
+ * 'text' and 'dataURL', or a File object otherwise).
46
+ */
47
+ type?: 'text' | 'dataURL';
27
48
  /** Value to indicate if the field is modified to show that validation state.
28
49
  * If set to success, field will be modified to indicate valid state.
29
50
  * If set to error, field will be modified to indicate error state.
30
51
  */
31
52
  validated?: 'success' | 'error' | 'default';
32
- /** Aria-label for the TextArea. */
33
- 'aria-label'?: string;
34
- /** Placeholder string to display in the empty filename field */
35
- filenamePlaceholder?: string;
36
- /** Aria-label for the read-only filename field */
37
- filenameAriaLabel?: string;
38
- /** Text for the Browse button */
39
- browseButtonText?: string;
40
- /** Text for the Clear button */
41
- clearButtonText?: string;
42
- /** Flag to disable the Clear button */
43
- isClearButtonDisabled?: boolean;
44
- /** Flag to hide the built-in preview of the file (where available).
45
- * If true, you can use children to render an alternate preview. */
46
- hideDefaultPreview?: boolean;
47
- /** Flag to allow editing of a text file's contents after it is selected from disk */
48
- allowEditingUploadedText?: boolean;
49
- /** Additional children to render after (or instead of) the file preview. */
50
- children?: React.ReactNode;
51
- /** A callback for when the Browse button is clicked. */
53
+ /** Value of the file's contents (string if text file, File object otherwise). */
54
+ value?: string | File;
55
+ /** A reference object to attach to the file upload field container element. */
56
+ containerRef?: React.Ref<HTMLDivElement>;
57
+ /** Flag to show if a file is being dragged over the file upload field. */
58
+ isDragActive?: boolean;
59
+ /** A callback for when the browse button is clicked. */
52
60
  onBrowseButtonClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
53
- /** A callback for when the Clear button is clicked. */
61
+ /** A callback for when the clear button is clicked. */
54
62
  onClearButtonClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
55
- /** A callback from when the text area is clicked. Can also be set via the onClick property of FileUpload. */
63
+ /** Callback for when focus is lost on the text area field. */
64
+ onTextAreaBlur?: (event?: any) => void;
65
+ /** A callback for when the text area is clicked. Can also be set via the onClick property
66
+ * of the file upload component. */
56
67
  onTextAreaClick?: (event: React.MouseEvent<HTMLTextAreaElement, MouseEvent>) => void;
57
- /** Flag to show if a file is being dragged over the field */
58
- isDragActive?: boolean;
59
- /** A reference object to attach to the FileUploadField container element. */
60
- containerRef?: React.Ref<HTMLDivElement>;
61
- /** Text area text changed */
68
+ /** Text area text changed. */
62
69
  onTextChange?: (text: string) => void;
63
- /** Callback for when focus is lost on the text area field */
64
- onTextAreaBlur?: (event?: any) => void;
65
- /** Placeholder string to display in the empty text area field */
70
+ /** Placeholder string to display in the empty text area field. */
66
71
  textAreaPlaceholder?: string;
67
72
  }
68
73
  export declare const FileUploadField: React.FunctionComponent<FileUploadFieldProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploadField.d.ts","sourceRoot":"","sources":["../../../../src/components/FileUpload/FileUploadField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACvG,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX;0EACsE;IACtE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;sDACkD;IAClD,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,KAAK,EACD,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,GACtC,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAChD,IAAI,CAAC;IACV,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6CAA6C;IAC7C,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,6CAA6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAC5C,mCAAmC;IACnC,YAAY,CAAC,EAAE,MAAM,CAA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B,CAAC,oBAAoB,CAwGzE,CAAC"}
1
+ {"version":3,"file":"FileUploadField.d.ts","sourceRoot":"","sources":["../../../../src/components/FileUpload/FileUploadField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B;;GAEG;AAEH,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACvG,sFAAsF;IACtF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iEAAiE;IACjE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oFAAoF;IACpF,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,6CAA6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,KAAK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AAQ,EACpD,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,EAAE,gBACI,SAAS,EACrB,KAAK,EAAE,KAAe,EACtB,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,mBAAmB,GAChC,CACH;YACA,SAAS,IAAI,CACZ,6BAAK,SAAS,EAAE,qBAAM,CAAC,4BAA4B;gBACjD,oBAAC,iBAAO,IAAC,IAAI,EAAE,qBAAW,CAAC,EAAE,oBAAkB,oBAAoB,GAAI,CACnE,CACP,CACG;QACL,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CAAC;AAxGW,QAAA,eAAe,mBAwG1B;AACF,uBAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC"}
1
+ {"version":3,"file":"FileUploadField.js","sourceRoot":"","sources":["../../../../src/components/FileUpload/FileUploadField.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,yHAAoF;AACpF,2DAA+C;AAC/C,8CAA2C;AAC3C,4CAAyC;AACzC,sCAAkD;AAClD,0CAAiE;AACjE,wCAAkD;AAClD,uDAAyD;AAoFlD,MAAM,eAAe,GAAkD,CAAC,EAgCxD,EAAE,EAAE;QAhCoD,EAC7E,EAAE,EACF,IAAI,EACJ,KAAK,GAAG,EAAE,EACV,QAAQ,GAAG,EAAE,EACb,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,mBAAmB,GAAG,GAAG,EAAE,GAAE,CAAC,EAC9B,kBAAkB,GAAG,GAAG,EAAE,GAAE,CAAC,EAC7B,eAAe,EACf,YAAY,EACZ,cAAc,EACd,mBAAmB,GAAG,EAAE,EACxB,SAAS,GAAG,EAAE,EACd,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,oBAAoB,EACpB,UAAU,GAAG,KAAK,EAClB,YAAY,GAAG,KAAK,EACpB,SAAS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,CAAC,OAAO,EAC9B,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,UAAU,IAErB,gBAAgB,CACV;gBACT,oBAAC,eAAM,IACL,OAAO,EAAE,sBAAa,CAAC,OAAO,EAC9B,UAAU,EAAE,UAAU,IAAI,qBAAqB,EAC/C,OAAO,EAAE,kBAAkB,IAE1B,eAAe,CACT,CACE,CACT;QACN,6BAAK,SAAS,EAAE,qBAAM,CAAC,qBAAqB;YACzC,CAAC,kBAAkB,IAAI,IAAI,KAAK,0BAAc,CAAC,IAAI,IAAI,CACtD,oBAAC,mBAAQ,IACP,QAAQ,EAAE,UAAU,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,wBAAwB,CAAC,EACjE,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,mCAAwB,CAAC,QAAQ,EACpD,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,EAAE,gBACI,SAAS,EACrB,KAAK,EAAE,KAAe,EACtB,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,mBAAmB,GAChC,CACH;YACA,SAAS,IAAI,CACZ,6BAAK,SAAS,EAAE,qBAAM,CAAC,4BAA4B;gBACjD,oBAAC,iBAAO,IAAC,IAAI,EAAE,qBAAW,CAAC,EAAE,oBAAkB,oBAAoB,GAAI,CACnE,CACP,CACG;QACL,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CAAC;AAxGW,QAAA,eAAe,mBAwG1B;AACF,uBAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC"}
@@ -2,62 +2,71 @@ import * as React from 'react';
2
2
  import { PickOptional } from '../../helpers';
3
3
  import { OUIAProps } from '../../helpers';
4
4
  export interface ModalProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {
5
- /** Content rendered inside the Modal. */
5
+ /** Action buttons to add to the standard modal footer. Ignored if the footer property
6
+ * is passed in.
7
+ */
8
+ actions?: any;
9
+ /** The parent container to append the modal to. Defaults to "document.body". */
10
+ appendTo?: HTMLElement | (() => HTMLElement);
11
+ /** Id to use for the modal box descriptor. */
12
+ 'aria-describedby'?: string;
13
+ /** Accessible descriptor of the modal. */
14
+ 'aria-label'?: string;
15
+ /** Id to use for the modal box label. */
16
+ 'aria-labelledby'?: string;
17
+ /** Accessible label applied to the modal box body. This should be used to communicate
18
+ * important information about the modal box body div element if needed, such as that it
19
+ * is scrollable.
20
+ */
21
+ bodyAriaLabel?: string;
22
+ /** Accessible role applied to the modal box body. This will default to "region" if the
23
+ * bodyAriaLabel property is passed in. Set to a more appropriate role as applicable
24
+ * based on the modal content and context.
25
+ */
26
+ bodyAriaRole?: string;
27
+ /** Content rendered inside the modal. */
6
28
  children: React.ReactNode;
7
- /** Additional classes added to the Modal */
29
+ /** Additional classes added to the modal. */
8
30
  className?: string;
9
- /** Flag to show the modal */
10
- isOpen?: boolean;
11
- /** Complex header (more than just text), supersedes title for header content */
31
+ /** Description of the modal. */
32
+ description?: React.ReactNode;
33
+ /** Flag to disable focus trap. */
34
+ disableFocusTrap?: boolean;
35
+ /** Custom footer. */
36
+ footer?: React.ReactNode;
37
+ /** Flag indicating if modal content should be placed in a modal box body wrapper. */
38
+ hasNoBodyWrapper?: boolean;
39
+ /** Complex header (more than just text), supersedes the title property for header content. */
12
40
  header?: React.ReactNode;
13
- /** Optional help section for the Modal Header */
41
+ /** Optional help section for the modal header. */
14
42
  help?: React.ReactNode;
15
- /** Simple text content of the Modal Header, also used for aria-label on the body */
43
+ /** An id to use for the modal box container. */
44
+ id?: string;
45
+ /** Flag to show the modal. */
46
+ isOpen?: boolean;
47
+ /** A callback for when the close button is clicked. */
48
+ onClose?: () => void;
49
+ /** Modal handles pressing of the escape key and closes the modal. If you want to handle
50
+ * this yourself you can use this callback function. */
51
+ onEscapePress?: (event: KeyboardEvent) => void;
52
+ /** Alternate position of the modal. */
53
+ position?: 'top';
54
+ /** Offset from alternate position. Can be any valid CSS length/percentage. */
55
+ positionOffset?: string;
56
+ /** Flag to show the close button in the header area of the modal. */
57
+ showClose?: boolean;
58
+ /** Simple text content of the modal header. Also used for the aria-label on the body. */
16
59
  title?: string;
17
- /** Optional alert icon (or other) to show before the title of the Modal Header
18
- * When the predefined alert types are used the default styling
19
- * will be automatically applied */
60
+ /** Optional alert icon (or other) to show before the title of the modal header. When the
61
+ * predefined alert types are used the default styling will be automatically applied.
62
+ */
20
63
  titleIconVariant?: 'success' | 'danger' | 'warning' | 'info' | 'default' | React.ComponentType<any>;
21
- /** Optional title label text for screen readers */
64
+ /** Optional title label text for screen readers. */
22
65
  titleLabel?: string;
23
- /** Id to use for Modal Box label */
24
- 'aria-labelledby'?: string;
25
- /** Accessible descriptor of modal */
26
- 'aria-label'?: string;
27
- /** Id to use for Modal Box descriptor */
28
- 'aria-describedby'?: string;
29
- /** Accessible label applied to the modal box body. This should be used to communicate important information about the modal box body div if needed, such as that it is scrollable */
30
- bodyAriaLabel?: string;
31
- /** Accessible role applied to the modal box body. This will default to region if a body aria label is applied. Set to a more appropriate role as applicable based on the modal content and context */
32
- bodyAriaRole?: string;
33
- /** Flag to show the close button in the header area of the modal */
34
- showClose?: boolean;
35
- /** Custom footer */
36
- footer?: React.ReactNode;
37
- /** Action buttons to add to the standard Modal Footer, ignored if `footer` is given */
38
- actions?: any;
39
- /** A callback for when the close button is clicked */
40
- onClose?: () => void;
41
- /** Default width of the Modal. */
42
- width?: number | string;
43
- /** The parent container to append the modal to. Defaults to document.body */
44
- appendTo?: HTMLElement | (() => HTMLElement);
45
- /** Flag to disable focus trap */
46
- disableFocusTrap?: boolean;
47
- /** Description of the modal */
48
- description?: React.ReactNode;
49
- /** Variant of the modal */
66
+ /** Variant of the modal. */
50
67
  variant?: 'small' | 'medium' | 'large' | 'default';
51
- /** Alternate position of the modal */
52
- position?: 'top';
53
- /** Offset from alternate position. Can be any valid CSS length/percentage */
54
- positionOffset?: string;
55
- /** Flag indicating if modal content should be placed in a modal box body wrapper */
56
- hasNoBodyWrapper?: boolean;
57
- /** An ID to use for the ModalBox container */
58
- id?: string;
59
- /** Modal handles pressing of the Escape key and closes the modal. If you want to handle this yourself you can use this callback function */
60
- onEscapePress?: (event: KeyboardEvent) => void;
68
+ /** Default width of the modal. */
69
+ width?: number | string;
61
70
  }
62
71
  export declare enum ModalVariant {
63
72
  small = "small",