@openedx/paragon 23.14.1 → 23.14.3

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 (399) hide show
  1. package/README.md +80 -14
  2. package/dist/ActionRow/index.d.ts +18 -0
  3. package/dist/ActionRow/index.js +6 -24
  4. package/dist/ActionRow/index.js.map +1 -1
  5. package/dist/Alert/index.js +21 -24
  6. package/dist/Alert/index.js.map +1 -1
  7. package/dist/Annotation/index.d.ts +13 -0
  8. package/dist/Annotation/index.js +11 -30
  9. package/dist/Annotation/index.js.map +1 -1
  10. package/dist/Avatar/index.d.ts +11 -0
  11. package/dist/Avatar/index.js +7 -21
  12. package/dist/Avatar/index.js.map +1 -1
  13. package/dist/AvatarButton/index.d.ts +17 -0
  14. package/dist/AvatarButton/index.js +11 -33
  15. package/dist/AvatarButton/index.js.map +1 -1
  16. package/dist/Breadcrumb/BreadcrumbLink.js +5 -6
  17. package/dist/Breadcrumb/BreadcrumbLink.js.map +1 -1
  18. package/dist/Breadcrumb/index.js +11 -12
  19. package/dist/Breadcrumb/index.js.map +1 -1
  20. package/dist/Bubble/index.d.ts +6 -2
  21. package/dist/Bubble/index.js +14 -39
  22. package/dist/Bubble/index.js.map +1 -1
  23. package/dist/Button/index.d.ts +42 -7
  24. package/dist/Button/index.js +43 -115
  25. package/dist/Button/index.js.map +1 -1
  26. package/dist/Card/BaseCard.js +11 -12
  27. package/dist/Card/BaseCard.js.map +1 -1
  28. package/dist/Card/CardBody.js +9 -12
  29. package/dist/Card/CardBody.js.map +1 -1
  30. package/dist/Card/CardCarousel/CardCarousel.js +13 -14
  31. package/dist/Card/CardCarousel/CardCarousel.js.map +1 -1
  32. package/dist/Card/CardCarousel/CardCarouselHeader.js +4 -5
  33. package/dist/Card/CardCarousel/CardCarouselHeader.js.map +1 -1
  34. package/dist/Card/CardCarousel/CardCarouselItems.js +3 -4
  35. package/dist/Card/CardCarousel/CardCarouselItems.js.map +1 -1
  36. package/dist/Card/CardCarousel/CardCarouselProvider.js +7 -8
  37. package/dist/Card/CardCarousel/CardCarouselProvider.js.map +1 -1
  38. package/dist/Card/CardCarousel/CardCarouselSubtitle.js +5 -6
  39. package/dist/Card/CardCarousel/CardCarouselSubtitle.js.map +1 -1
  40. package/dist/Card/CardCarousel/CardCarouselTitle.js +5 -6
  41. package/dist/Card/CardCarousel/CardCarouselTitle.js.map +1 -1
  42. package/dist/Card/CardCarousel/messages.d.ts +13 -0
  43. package/dist/Card/CardCarousel/messages.js +4 -5
  44. package/dist/Card/CardCarousel/messages.js.map +1 -0
  45. package/dist/Card/CardContext.js +6 -7
  46. package/dist/Card/CardContext.js.map +1 -1
  47. package/dist/Card/CardDeck.js +9 -10
  48. package/dist/Card/CardDeck.js.map +1 -1
  49. package/dist/Card/CardDivider.js +8 -11
  50. package/dist/Card/CardDivider.js.map +1 -1
  51. package/dist/Card/CardFooter.js +9 -10
  52. package/dist/Card/CardFooter.js.map +1 -1
  53. package/dist/Card/CardGrid.js +6 -7
  54. package/dist/Card/CardGrid.js.map +1 -1
  55. package/dist/Card/CardHeader.js +9 -10
  56. package/dist/Card/CardHeader.js.map +1 -1
  57. package/dist/Card/CardImageCap.js +15 -16
  58. package/dist/Card/CardImageCap.js.map +1 -1
  59. package/dist/Card/CardSection.js +9 -10
  60. package/dist/Card/CardSection.js.map +1 -1
  61. package/dist/Card/CardStatus.js +9 -10
  62. package/dist/Card/CardStatus.js.map +1 -1
  63. package/dist/Card/index.js +9 -10
  64. package/dist/Card/index.js.map +1 -1
  65. package/dist/Chip/ChipIcon.js +8 -9
  66. package/dist/Chip/ChipIcon.js.map +1 -1
  67. package/dist/Chip/index.d.ts +22 -0
  68. package/dist/Chip/index.js +15 -70
  69. package/dist/Chip/index.js.map +1 -1
  70. package/dist/ChipCarousel/index.js +49 -53
  71. package/dist/ChipCarousel/index.js.map +1 -1
  72. package/dist/ChipCarousel/messages.d.ts +13 -0
  73. package/dist/ChipCarousel/messages.js +4 -5
  74. package/dist/ChipCarousel/messages.js.map +1 -0
  75. package/dist/CloseButton/index.js.map +1 -1
  76. package/dist/Collapse/index.js.map +1 -1
  77. package/dist/Collapsible/CollapsibleBody.js +6 -7
  78. package/dist/Collapsible/CollapsibleBody.js.map +1 -1
  79. package/dist/Collapsible/CollapsibleTrigger.js +9 -10
  80. package/dist/Collapsible/CollapsibleTrigger.js.map +1 -1
  81. package/dist/Collapsible/CollapsibleVisible.js +5 -6
  82. package/dist/Collapsible/CollapsibleVisible.js.map +1 -1
  83. package/dist/ColorPicker/index.js +6 -7
  84. package/dist/ColorPicker/index.js.map +1 -1
  85. package/dist/Container/index.js +9 -12
  86. package/dist/Container/index.js.map +1 -1
  87. package/dist/DataTable/BulkActions.js +4 -5
  88. package/dist/DataTable/BulkActions.js.map +1 -1
  89. package/dist/DataTable/CardView.js +16 -18
  90. package/dist/DataTable/CardView.js.map +1 -1
  91. package/dist/DataTable/CollapsibleButtonGroup.js +5 -6
  92. package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
  93. package/dist/DataTable/DataTableLayout.js +5 -6
  94. package/dist/DataTable/DataTableLayout.js.map +1 -1
  95. package/dist/DataTable/DropdownFilters.js +7 -2
  96. package/dist/DataTable/DropdownFilters.js.map +1 -1
  97. package/dist/DataTable/EmptyTable.js +5 -6
  98. package/dist/DataTable/EmptyTable.js.map +1 -1
  99. package/dist/DataTable/ExpandAll.js +4 -5
  100. package/dist/DataTable/ExpandAll.js.map +1 -1
  101. package/dist/DataTable/ExpandRow.js +3 -4
  102. package/dist/DataTable/ExpandRow.js.map +1 -1
  103. package/dist/DataTable/FilterStatus.js +8 -9
  104. package/dist/DataTable/FilterStatus.js.map +1 -1
  105. package/dist/DataTable/RowStatus.js +4 -5
  106. package/dist/DataTable/RowStatus.js.map +1 -1
  107. package/dist/DataTable/SidebarFilters.js +3 -4
  108. package/dist/DataTable/SidebarFilters.js.map +1 -1
  109. package/dist/DataTable/Table.js +3 -4
  110. package/dist/DataTable/Table.js.map +1 -1
  111. package/dist/DataTable/TableActions.js +3 -4
  112. package/dist/DataTable/TableActions.js.map +1 -1
  113. package/dist/DataTable/TableCell.js +5 -6
  114. package/dist/DataTable/TableCell.js.map +1 -1
  115. package/dist/DataTable/TableControlBar.js +3 -4
  116. package/dist/DataTable/TableControlBar.js.map +1 -1
  117. package/dist/DataTable/TableFilters.js +6 -7
  118. package/dist/DataTable/TableFilters.js.map +1 -1
  119. package/dist/DataTable/TableFooter.js +4 -5
  120. package/dist/DataTable/TableFooter.js.map +1 -1
  121. package/dist/DataTable/TableHeaderCell.js +13 -15
  122. package/dist/DataTable/TableHeaderCell.js.map +1 -1
  123. package/dist/DataTable/TableHeaderRow.js +3 -4
  124. package/dist/DataTable/TableHeaderRow.js.map +1 -1
  125. package/dist/DataTable/TableRow.js +3 -4
  126. package/dist/DataTable/TableRow.js.map +1 -1
  127. package/dist/DataTable/filters/CheckboxFilter.js +25 -29
  128. package/dist/DataTable/filters/CheckboxFilter.js.map +1 -1
  129. package/dist/DataTable/filters/DropdownFilter.js +16 -20
  130. package/dist/DataTable/filters/DropdownFilter.js.map +1 -1
  131. package/dist/DataTable/filters/MultiSelectDropdownFilter.js +25 -29
  132. package/dist/DataTable/filters/MultiSelectDropdownFilter.js.map +1 -1
  133. package/dist/DataTable/filters/TextFilter.js +8 -9
  134. package/dist/DataTable/filters/TextFilter.js.map +1 -1
  135. package/dist/DataTable/hooks.js +11 -13
  136. package/dist/DataTable/hooks.js.map +1 -1
  137. package/dist/DataTable/index.js +42 -36
  138. package/dist/DataTable/index.js.map +1 -1
  139. package/dist/DataTable/messages.d.ts +13 -0
  140. package/dist/DataTable/messages.js +7 -3
  141. package/dist/DataTable/messages.js.map +1 -0
  142. package/dist/DataTable/selection/BaseSelectionStatus.js +11 -12
  143. package/dist/DataTable/selection/BaseSelectionStatus.js.map +1 -1
  144. package/dist/DataTable/selection/ControlledSelect.js +3 -4
  145. package/dist/DataTable/selection/ControlledSelect.js.map +1 -1
  146. package/dist/DataTable/selection/ControlledSelectHeader.js +3 -4
  147. package/dist/DataTable/selection/ControlledSelectHeader.js.map +1 -1
  148. package/dist/DataTable/selection/ControlledSelectionStatus.js +4 -5
  149. package/dist/DataTable/selection/ControlledSelectionStatus.js.map +1 -1
  150. package/dist/DataTable/selection/SelectionStatus.js +4 -5
  151. package/dist/DataTable/selection/SelectionStatus.js.map +1 -1
  152. package/dist/DataTable/utils/getVisibleColumns.js +9 -13
  153. package/dist/DataTable/utils/getVisibleColumns.js.map +1 -1
  154. package/dist/Dropdown/index.js +17 -20
  155. package/dist/Dropdown/index.js.map +1 -1
  156. package/dist/Dropzone/DefaultContent.js +5 -6
  157. package/dist/Dropzone/DefaultContent.js.map +1 -1
  158. package/dist/Dropzone/DragError.js +3 -4
  159. package/dist/Dropzone/DragError.js.map +1 -1
  160. package/dist/Dropzone/GenericError.js +4 -5
  161. package/dist/Dropzone/GenericError.js.map +1 -1
  162. package/dist/Dropzone/UploadProgress.js +6 -7
  163. package/dist/Dropzone/UploadProgress.js.map +1 -1
  164. package/dist/Dropzone/index.js +14 -15
  165. package/dist/Dropzone/index.js.map +1 -1
  166. package/dist/Dropzone/messages.d.ts +53 -0
  167. package/dist/Dropzone/messages.js +12 -13
  168. package/dist/Dropzone/messages.js.map +1 -0
  169. package/dist/Fade/index.js.map +1 -1
  170. package/dist/Form/FormAutosuggest.js +18 -20
  171. package/dist/Form/FormAutosuggest.js.map +1 -1
  172. package/dist/Form/FormAutosuggestOption.js +6 -7
  173. package/dist/Form/FormAutosuggestOption.js.map +1 -1
  174. package/dist/Form/FormCheckbox.js +16 -18
  175. package/dist/Form/FormCheckbox.js.map +1 -1
  176. package/dist/Form/FormCheckboxSet.js +11 -12
  177. package/dist/Form/FormCheckboxSet.js.map +1 -1
  178. package/dist/Form/FormCheckboxSetContext.js +9 -10
  179. package/dist/Form/FormCheckboxSetContext.js.map +1 -1
  180. package/dist/Form/FormControl.js +12 -13
  181. package/dist/Form/FormControl.js.map +1 -1
  182. package/dist/Form/FormControlDecorator.js +4 -5
  183. package/dist/Form/FormControlDecorator.js.map +1 -1
  184. package/dist/Form/FormControlDecoratorGroup.js +8 -9
  185. package/dist/Form/FormControlDecoratorGroup.js.map +1 -1
  186. package/dist/Form/FormControlFeedback.js +4 -5
  187. package/dist/Form/FormControlFeedback.js.map +1 -1
  188. package/dist/Form/FormControlFloatingLabel.js +3 -4
  189. package/dist/Form/FormControlFloatingLabel.js.map +1 -1
  190. package/dist/Form/FormControlSet.js +7 -8
  191. package/dist/Form/FormControlSet.js.map +1 -1
  192. package/dist/Form/FormGroup.js +9 -10
  193. package/dist/Form/FormGroup.js.map +1 -1
  194. package/dist/Form/FormGroupContext.js +7 -8
  195. package/dist/Form/FormGroupContext.js.map +1 -1
  196. package/dist/Form/FormLabel.d.ts +2 -11
  197. package/dist/Form/FormLabel.js +5 -15
  198. package/dist/Form/FormLabel.js.map +1 -1
  199. package/dist/Form/FormRadio.js +28 -31
  200. package/dist/Form/FormRadio.js.map +1 -1
  201. package/dist/Form/FormRadioSet.js +11 -12
  202. package/dist/Form/FormRadioSet.js.map +1 -1
  203. package/dist/Form/FormRadioSetContext.js +9 -10
  204. package/dist/Form/FormRadioSetContext.js.map +1 -1
  205. package/dist/Form/FormSwitch.js +25 -29
  206. package/dist/Form/FormSwitch.js.map +1 -1
  207. package/dist/Form/FormText.js +16 -19
  208. package/dist/Form/FormText.js.map +1 -1
  209. package/dist/Form/fieldUtils.js +11 -22
  210. package/dist/Form/fieldUtils.js.map +1 -1
  211. package/dist/Form/useCheckboxSetValues.js +1 -2
  212. package/dist/Form/useCheckboxSetValues.js.map +1 -1
  213. package/dist/Hyperlink/index.js +17 -21
  214. package/dist/Hyperlink/index.js.map +1 -1
  215. package/dist/Icon/index.js +10 -11
  216. package/dist/Icon/index.js.map +1 -1
  217. package/dist/IconButton/index.d.ts +8 -304
  218. package/dist/IconButton/index.js +21 -84
  219. package/dist/IconButton/index.js.map +1 -1
  220. package/dist/IconButtonToggle/index.js +5 -6
  221. package/dist/IconButtonToggle/index.js.map +1 -1
  222. package/dist/Image/index.js.map +1 -1
  223. package/dist/Layout/index.js +4 -5
  224. package/dist/Layout/index.js.map +1 -1
  225. package/dist/Media/index.js.map +1 -1
  226. package/dist/Menu/MenuItem.js +8 -9
  227. package/dist/Menu/MenuItem.js.map +1 -1
  228. package/dist/Menu/SelectMenu.js +8 -9
  229. package/dist/Menu/SelectMenu.js.map +1 -1
  230. package/dist/Menu/index.js +6 -7
  231. package/dist/Menu/index.js.map +1 -1
  232. package/dist/Modal/AlertModal.js +6 -7
  233. package/dist/Modal/AlertModal.js.map +1 -1
  234. package/dist/Modal/FullscreenModal.js +7 -8
  235. package/dist/Modal/FullscreenModal.js.map +1 -1
  236. package/dist/Modal/MarketingModal.js +9 -10
  237. package/dist/Modal/MarketingModal.js.map +1 -1
  238. package/dist/Modal/ModalCloseButton.js +5 -6
  239. package/dist/Modal/ModalCloseButton.js.map +1 -1
  240. package/dist/Modal/ModalContext.js +6 -7
  241. package/dist/Modal/ModalContext.js.map +1 -1
  242. package/dist/Modal/ModalDialog.d.ts +6 -65
  243. package/dist/Modal/ModalDialog.js +16 -81
  244. package/dist/Modal/ModalDialog.js.map +1 -1
  245. package/dist/Modal/ModalDialogBody.js +5 -6
  246. package/dist/Modal/ModalDialogBody.js.map +1 -1
  247. package/dist/Modal/ModalDialogFooter.js +5 -6
  248. package/dist/Modal/ModalDialogFooter.js.map +1 -1
  249. package/dist/Modal/ModalDialogHeader.js +9 -12
  250. package/dist/Modal/ModalDialogHeader.js.map +1 -1
  251. package/dist/Modal/ModalDialogHero.js +5 -6
  252. package/dist/Modal/ModalDialogHero.js.map +1 -1
  253. package/dist/Modal/ModalDialogHeroBackground.js +6 -7
  254. package/dist/Modal/ModalDialogHeroBackground.js.map +1 -1
  255. package/dist/Modal/ModalDialogHeroContent.js +5 -6
  256. package/dist/Modal/ModalDialogHeroContent.js.map +1 -1
  257. package/dist/Modal/ModalDialogTitle.js +5 -6
  258. package/dist/Modal/ModalDialogTitle.js.map +1 -1
  259. package/dist/Modal/ModalLayer.d.ts +0 -25
  260. package/dist/Modal/ModalLayer.js +13 -35
  261. package/dist/Modal/ModalLayer.js.map +1 -1
  262. package/dist/Modal/ModalPopup.js +11 -12
  263. package/dist/Modal/ModalPopup.js.map +1 -1
  264. package/dist/Modal/PopperElement.js +7 -8
  265. package/dist/Modal/PopperElement.js.map +1 -1
  266. package/dist/Modal/StandardModal.js +7 -8
  267. package/dist/Modal/StandardModal.js.map +1 -1
  268. package/dist/OverflowScroll/OverflowScroll.js +12 -13
  269. package/dist/OverflowScroll/OverflowScroll.js.map +1 -1
  270. package/dist/OverflowScroll/OverflowScrollItems.js +3 -4
  271. package/dist/OverflowScroll/OverflowScrollItems.js.map +1 -1
  272. package/dist/Overlay/index.d.ts +2 -2
  273. package/dist/PageBanner/index.js +9 -10
  274. package/dist/PageBanner/index.js.map +1 -1
  275. package/dist/Pagination/PaginationContext.js +12 -13
  276. package/dist/Pagination/PaginationContext.js.map +1 -1
  277. package/dist/Pagination/subcomponents/PageButton.js +3 -4
  278. package/dist/Pagination/subcomponents/PageButton.js.map +1 -1
  279. package/dist/Popover/index.js +11 -14
  280. package/dist/Popover/index.js.map +1 -1
  281. package/dist/ProductTour/Checkpoint.js +12 -13
  282. package/dist/ProductTour/Checkpoint.js.map +1 -1
  283. package/dist/ProductTour/CheckpointActionRow.js +10 -11
  284. package/dist/ProductTour/CheckpointActionRow.js.map +1 -1
  285. package/dist/ProductTour/CheckpointBody.js +3 -4
  286. package/dist/ProductTour/CheckpointBody.js.map +1 -1
  287. package/dist/ProductTour/CheckpointHeader.js +7 -8
  288. package/dist/ProductTour/CheckpointHeader.js.map +1 -1
  289. package/dist/ProductTour/CheckpointTitle.js +6 -9
  290. package/dist/ProductTour/CheckpointTitle.js.map +1 -1
  291. package/dist/ProductTour/index.js +3 -4
  292. package/dist/ProductTour/index.js.map +1 -1
  293. package/dist/ProductTour/messages.d.ts +23 -0
  294. package/dist/ProductTour/messages.js +6 -7
  295. package/dist/ProductTour/messages.js.map +1 -0
  296. package/dist/ProgressBar/index.js +11 -12
  297. package/dist/ProgressBar/index.js.map +1 -1
  298. package/dist/ResponsiveEmbed/index.js.map +1 -1
  299. package/dist/Scrollable/index.js +4 -5
  300. package/dist/Scrollable/index.js.map +1 -1
  301. package/dist/SearchField/SearchFieldLabel.js +4 -5
  302. package/dist/SearchField/SearchFieldLabel.js.map +1 -1
  303. package/dist/SelectableBox/SelectableBoxSet.js +13 -14
  304. package/dist/SelectableBox/SelectableBoxSet.js.map +1 -1
  305. package/dist/SelectableBox/index.js +14 -15
  306. package/dist/SelectableBox/index.js.map +1 -1
  307. package/dist/Skeleton/index.js.map +1 -1
  308. package/dist/Spinner/index.d.ts +11 -0
  309. package/dist/Spinner/index.js +6 -17
  310. package/dist/Spinner/index.js.map +1 -1
  311. package/dist/Stack/index.js +12 -15
  312. package/dist/Stack/index.js.map +1 -1
  313. package/dist/StatefulButton/index.js +9 -10
  314. package/dist/StatefulButton/index.js.map +1 -1
  315. package/dist/Stepper/Stepper.js +4 -5
  316. package/dist/Stepper/Stepper.js.map +1 -1
  317. package/dist/Stepper/StepperActionRow.js +6 -7
  318. package/dist/Stepper/StepperActionRow.js.map +1 -1
  319. package/dist/Stepper/StepperContext.js +4 -5
  320. package/dist/Stepper/StepperContext.js.map +1 -1
  321. package/dist/Stepper/StepperHeader.js +23 -31
  322. package/dist/Stepper/StepperHeader.js.map +1 -1
  323. package/dist/Stepper/StepperHeaderStep.js +8 -9
  324. package/dist/Stepper/StepperHeaderStep.js.map +1 -1
  325. package/dist/Stepper/StepperStep.js +10 -11
  326. package/dist/Stepper/StepperStep.js.map +1 -1
  327. package/dist/Sticky/index.js +8 -12
  328. package/dist/Sticky/index.js.map +1 -1
  329. package/dist/Tabs/index.js +8 -9
  330. package/dist/Tabs/index.js.map +1 -1
  331. package/dist/Toast/ToastContainer.js +3 -4
  332. package/dist/Toast/ToastContainer.js.map +1 -1
  333. package/dist/Toast/index.d.ts +20 -41
  334. package/dist/Toast/index.js +11 -48
  335. package/dist/Toast/index.js.map +1 -1
  336. package/dist/ToggleButton/index.js.map +1 -1
  337. package/dist/Tooltip/index.js +11 -14
  338. package/dist/Tooltip/index.js.map +1 -1
  339. package/dist/Truncate/index.js +9 -10
  340. package/dist/Truncate/index.js.map +1 -1
  341. package/dist/asInput/index.js +9 -13
  342. package/dist/asInput/index.js.map +1 -1
  343. package/dist/hooks/useArrowKeyNavigationHook.js +17 -21
  344. package/dist/hooks/useArrowKeyNavigationHook.js.map +1 -1
  345. package/dist/hooks/useIsVisibleHook.js +4 -6
  346. package/dist/hooks/useIsVisibleHook.js.map +1 -1
  347. package/dist/hooks/useToggleHook.js +1 -3
  348. package/dist/hooks/useToggleHook.js.map +1 -1
  349. package/dist/index.d.ts +5 -5
  350. package/dist/index.js +5 -10
  351. package/dist/index.js.map +1 -1
  352. package/dist/theme-urls.json +6 -6
  353. package/dist/utils/newId.js +1 -2
  354. package/dist/utils/newId.js.map +1 -1
  355. package/package.json +2 -2
  356. package/src/ActionRow/{index.jsx → index.tsx} +14 -22
  357. package/src/Annotation/{index.jsx → index.tsx} +15 -22
  358. package/src/Avatar/{index.jsx → index.tsx} +13 -19
  359. package/src/AvatarButton/{index.jsx → index.tsx} +23 -31
  360. package/src/Bubble/index.tsx +12 -32
  361. package/src/Button/index.tsx +68 -93
  362. package/src/Chip/index.tsx +26 -59
  363. package/src/CloseButton/index.tsx +1 -0
  364. package/src/Collapse/index.tsx +1 -0
  365. package/src/DataTable/DropdownFilters.jsx +9 -2
  366. package/src/DataTable/README.md +19 -18
  367. package/src/DataTable/index.jsx +6 -1
  368. package/src/DataTable/{messages.js → messages.ts} +5 -0
  369. package/src/DataTable/tests/DataTable.test.jsx +51 -1
  370. package/src/DataTable/tests/DropdownFilters.test.jsx +11 -7
  371. package/src/Fade/index.tsx +1 -0
  372. package/src/Form/FormLabel.tsx +2 -10
  373. package/src/IconButton/index.tsx +17 -81
  374. package/src/Image/index.tsx +2 -0
  375. package/src/Media/index.tsx +1 -0
  376. package/src/Modal/ModalDialog.tsx +6 -66
  377. package/src/Modal/ModalLayer.tsx +0 -22
  378. package/src/Modal/modal-popup.mdx +1 -1
  379. package/src/ProductTour/ProductTour.test.jsx +0 -1
  380. package/src/ResponsiveEmbed/index.tsx +1 -0
  381. package/src/Skeleton/index.tsx +1 -0
  382. package/src/Spinner/{index.jsx → index.tsx} +10 -15
  383. package/src/Toast/index.tsx +21 -40
  384. package/src/ToggleButton/index.tsx +2 -0
  385. package/src/index.ts +5 -10
  386. /package/{src/CloseButton/index.jsx → dist/CloseButton/index.d.ts} +0 -0
  387. /package/{src/Collapse/index.jsx → dist/Collapse/index.d.ts} +0 -0
  388. /package/{src/Fade/index.jsx → dist/Fade/index.d.ts} +0 -0
  389. /package/{src/Image/index.jsx → dist/Image/index.d.ts} +0 -0
  390. /package/{src/Media/index.jsx → dist/Media/index.d.ts} +0 -0
  391. /package/{src/ResponsiveEmbed/index.jsx → dist/ResponsiveEmbed/index.d.ts} +0 -0
  392. /package/{src/Skeleton/index.jsx → dist/Skeleton/index.d.ts} +0 -0
  393. /package/{src/ToggleButton/index.jsx → dist/ToggleButton/index.d.ts} +0 -0
  394. /package/src/Card/CardCarousel/{messages.js → messages.ts} +0 -0
  395. /package/src/ChipCarousel/{messages.js → messages.ts} +0 -0
  396. /package/src/Dropzone/{messages.js → messages.ts} +0 -0
  397. /package/src/ProductTour/{messages.js → messages.ts} +0 -0
  398. /package/src/Spinner/{Spinner.test.jsx → Spinner.test.tsx} +0 -0
  399. /package/src/Spinner/__snapshots__/{Spinner.test.jsx.snap → Spinner.test.tsx.snap} +0 -0
@@ -49,6 +49,7 @@ function DataTable({
49
49
  EmptyTableComponent,
50
50
  manualSelectColumn,
51
51
  showFiltersInSidebar,
52
+ filtersTitle,
52
53
  dataViewToggleOptions,
53
54
  disableElevation,
54
55
  isLoading,
@@ -215,6 +216,7 @@ function DataTable({
215
216
  manualSelectColumn,
216
217
  maxSelectedRows,
217
218
  onMaxSelectedRows,
219
+ filtersTitle,
218
220
  ...selectionProps,
219
221
  ...selectionActions,
220
222
  ...props,
@@ -222,7 +224,7 @@ function DataTable({
222
224
 
223
225
  return (
224
226
  <DataTableContext.Provider value={enhancedInstance}>
225
- <DataTableLayout>
227
+ <DataTableLayout filtersTitle={filtersTitle}>
226
228
  <div className={classNames('pgn__data-table-wrapper', {
227
229
  'hide-shadow': !!disableElevation,
228
230
  })}
@@ -264,6 +266,7 @@ DataTable.defaultProps = {
264
266
  FilterStatusComponent: FilterStatus,
265
267
  RowStatusComponent: RowStatus,
266
268
  showFiltersInSidebar: false,
269
+ filtersTitle: undefined,
267
270
  dataViewToggleOptions: {
268
271
  isDataViewToggleEnabled: false,
269
272
  onDataViewToggle: () => {},
@@ -425,6 +428,8 @@ DataTable.propTypes = {
425
428
  children: PropTypes.node,
426
429
  /** If true filters will be shown on sidebar instead */
427
430
  showFiltersInSidebar: PropTypes.bool,
431
+ /** Title of the filters section */
432
+ filtersTitle: PropTypes.string,
428
433
  /** options for data view toggle */
429
434
  dataViewToggleOptions: PropTypes.shape({
430
435
  /** Whether to show a toggle button group which allows view switching between card and table views */
@@ -6,6 +6,11 @@ const messages = defineMessages({
6
6
  defaultMessage: 'table pagination',
7
7
  description: 'Accessibile name for the navigation element of a pagination component',
8
8
  },
9
+ filtersDropdownTitle: {
10
+ id: 'pgn.DataTable.filtersDropdownTitle',
11
+ defaultMessage: 'Filters',
12
+ description: 'Title of the filters dropdown',
13
+ },
9
14
  });
10
15
 
11
16
  export default messages;
@@ -8,6 +8,7 @@ import DataTable from '..';
8
8
  import DataTableContext from '../DataTableContext';
9
9
  import { TextFilter } from '../..';
10
10
  import { SELECT_ALL_TEST_ID } from '../selection/data/constants';
11
+ import messages from '../messages';
11
12
 
12
13
  const additionalColumns = [
13
14
  {
@@ -162,6 +163,55 @@ describe('<DataTable />', () => {
162
163
  expect(screen.getByText('Action')).toBeInTheDocument();
163
164
  expect(screen.getByText('More')).toBeInTheDocument();
164
165
  });
166
+
167
+ it('displays the custom filters title in the sidebar', () => {
168
+ render(
169
+ <DataTableWrapper
170
+ showFiltersInSidebar
171
+ filtersTitle="Refine Your Search"
172
+ isFilterable
173
+ defaultColumnValues={{ Filter: TextFilter }}
174
+ {...props}
175
+ />,
176
+ );
177
+ expect(screen.getByRole('heading', { name: 'Refine Your Search' })).toBeInTheDocument();
178
+ });
179
+
180
+ it('displays the default filters title in the sidebar', () => {
181
+ render(
182
+ <DataTableWrapper
183
+ showFiltersInSidebar
184
+ isFilterable
185
+ defaultColumnValues={{ Filter: TextFilter }}
186
+ {...props}
187
+ />,
188
+ );
189
+ expect(screen.getByRole('heading', { name: messages.filtersDropdownTitle.defaultMessage })).toBeInTheDocument();
190
+ });
191
+
192
+ it('displays the custom filters title in the filters dropdown', () => {
193
+ render(
194
+ <DataTableWrapper
195
+ filtersTitle="Refine Your Search"
196
+ isFilterable
197
+ defaultColumnValues={{ Filter: TextFilter }}
198
+ {...props}
199
+ />,
200
+ );
201
+ expect(screen.getByRole('button', { name: 'Refine Your Search' })).toBeInTheDocument();
202
+ });
203
+
204
+ it('displays the default filters title in the filters dropdown', () => {
205
+ render(
206
+ <DataTableWrapper
207
+ isFilterable
208
+ defaultColumnValues={{ Filter: TextFilter }}
209
+ {...props}
210
+ />,
211
+ );
212
+ expect(screen.getByRole('button', { name: messages.filtersDropdownTitle.defaultMessage })).toBeInTheDocument();
213
+ });
214
+
165
215
  it('calls useTable with the data and columns', () => {
166
216
  const spy = jest.spyOn(reactTable, 'useTable');
167
217
  render(<DataTableWrapper {...props} />);
@@ -213,7 +263,7 @@ describe('<DataTable />', () => {
213
263
  fetchData: jest.fn(),
214
264
  };
215
265
  render(<DataTableWrapper {...propsWithSelection} />);
216
- const filtersButton = screen.getByRole('button', { name: 'Filters' });
266
+ const filtersButton = screen.getByRole('button', { name: messages.filtersDropdownTitle.defaultMessage });
217
267
 
218
268
  await userEvent.click(filtersButton);
219
269
 
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import userEvent from '@testing-library/user-event';
4
+ import { IntlProvider } from 'react-intl';
4
5
 
5
6
  import DropdownFilters from '../DropdownFilters';
6
7
  import { useWindowSize } from '../..';
7
8
  import DataTableContext from '../DataTableContext';
9
+ import messages from '../messages';
8
10
 
9
11
  jest.mock('../../hooks/useWindowSizeHook');
10
12
 
@@ -31,9 +33,11 @@ const instance = {
31
33
  // eslint-disable-next-line react/prop-types
32
34
  function DropdownFiltersWrapper({ value = instance, props }) {
33
35
  return (
34
- <DataTableContext.Provider value={value}>
35
- <DropdownFilters {...props} />
36
- </DataTableContext.Provider>
36
+ <IntlProvider locale="en">
37
+ <DataTableContext.Provider value={value}>
38
+ <DropdownFilters {...props} />
39
+ </DataTableContext.Provider>
40
+ </IntlProvider>
37
41
  );
38
42
  }
39
43
 
@@ -56,7 +60,7 @@ describe('<DropdownFilters />', () => {
56
60
  // filter should be rendered in the dropdown, so should not be present before
57
61
  // clicking the button.
58
62
  expect(screen.queryByText('Occupation filter')).toBeNull();
59
- const filtersButton = screen.getByRole('button', { name: /Filters/i });
63
+ const filtersButton = screen.getByRole('button', { name: messages.filtersDropdownTitle.defaultMessage });
60
64
  await userEvent.click(filtersButton);
61
65
  expect(screen.getByText('Occupation filter')).toBeInTheDocument();
62
66
  });
@@ -65,7 +69,7 @@ describe('<DropdownFilters />', () => {
65
69
  useWindowSize.mockReturnValue({ width: 800 });
66
70
  render(<DropdownFiltersWrapper />);
67
71
  expect(screen.queryByText('DOB filter')).toBeNull();
68
- const filtersButton = screen.getByRole('button', { name: /Filters/i });
72
+ const filtersButton = screen.getByRole('button', { name: messages.filtersDropdownTitle.defaultMessage });
69
73
  await userEvent.click(filtersButton);
70
74
  expect(screen.queryByText('DOB filter')).toBeNull();
71
75
  });
@@ -74,7 +78,7 @@ describe('<DropdownFilters />', () => {
74
78
  useWindowSize.mockReturnValue({ width: 800 });
75
79
  render(<DropdownFiltersWrapper value={{ columns: [instance.columns[1]] }} />);
76
80
  expect(screen.getByText('Occupation filter')).toBeInTheDocument();
77
- expect(screen.queryByRole('button', { name: /Filters/i })).toBeNull();
81
+ expect(screen.queryByRole('button', { name: messages.filtersDropdownTitle.defaultMessage })).toBeNull();
78
82
  });
79
83
  });
80
84
 
@@ -88,7 +92,7 @@ describe('<DropdownFilters />', () => {
88
92
  it('renders all filters in the dropdown', async () => {
89
93
  useWindowSize.mockReturnValue({ width: 500 });
90
94
  render(<DropdownFiltersWrapper />);
91
- const filtersButton = screen.getByRole('button', { name: /Filters/i });
95
+ const filtersButton = screen.getByRole('button', { name: messages.filtersDropdownTitle.defaultMessage });
92
96
  await userEvent.click(filtersButton);
93
97
  expect(screen.getByText('Bears filter')).toBeInTheDocument();
94
98
  expect(screen.getByText('Occupation filter')).toBeInTheDocument();
@@ -0,0 +1 @@
1
+ export { default } from 'react-bootstrap/Fade';
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  import { useFormGroupContext } from './FormGroupContext';
5
4
  import { FORM_CONTROL_SIZES } from './constants';
@@ -9,6 +8,8 @@ interface Props {
9
8
  children: React.ReactNode;
10
9
  /** Specifies whether the component should be displayed with inline styling. */
11
10
  isInline?: boolean;
11
+ /** Specifies an additional `className` to add to the base element. */
12
+ className?: string;
12
13
  }
13
14
 
14
15
  function FormLabel({ children, isInline = false, ...props }: Props & React.ComponentPropsWithoutRef<'label'>) {
@@ -27,13 +28,4 @@ function FormLabel({ children, isInline = false, ...props }: Props & React.Compo
27
28
  return React.createElement(componentType, labelProps, children);
28
29
  }
29
30
 
30
- FormLabel.propTypes = {
31
- /** Specifies class name to append to the base element. */
32
- className: PropTypes.string,
33
- /** Specifies contents of the component. */
34
- children: PropTypes.node.isRequired,
35
- /** Specifies whether the component should be displayed with inline styling. */
36
- isInline: PropTypes.bool,
37
- };
38
-
39
31
  export default FormLabel;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  import { type Placement } from 'react-bootstrap/Overlay';
5
4
  import { OverlayTrigger } from '../Overlay';
@@ -7,6 +6,7 @@ import Tooltip from '../Tooltip';
7
6
  import Icon from '../Icon';
8
7
 
9
8
  interface Props extends React.HTMLAttributes<HTMLButtonElement> {
9
+ /** Component that renders the icon, currently defaults to `Icon` */
10
10
  iconAs?: React.ComponentType<any>,
11
11
  /** Additional CSS class[es] to apply to this button */
12
12
  className?: string;
@@ -26,33 +26,33 @@ interface Props extends React.HTMLAttributes<HTMLButtonElement> {
26
26
  iconClassNames?: string;
27
27
  /** Click handler for the button */
28
28
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
29
- /** whether to show the `IconButton` in an active state, whose styling is distinct from default state */
29
+ /** Whether to show the `IconButton` in an active state, whose styling is distinct from default state */
30
30
  isActive?: boolean;
31
31
  /** @deprecated Using FontAwesome icons is deprecated. Instead, pass iconAs={Icon} src={...} */
32
32
  icon?: { prefix?: string; iconName?: string, icon?: any[] },
33
- /** Type of button (uses Bootstrap options) */
33
+ /** Type of button (uses Bootstrap options). */
34
34
  variant?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'light' | 'dark' | 'black' | 'brand';
35
- /** size of button to render */
35
+ /** Size of button to render */
36
36
  size?: 'sm' | 'md' | 'inline';
37
- /** no children */
37
+ /** No children */
38
38
  children?: never;
39
39
  }
40
40
 
41
- const IconButton = React.forwardRef<HTMLButtonElement, Props>(({
41
+ const IconButton = React.forwardRef(({
42
42
  className,
43
43
  alt,
44
- invertColors,
44
+ invertColors = false,
45
45
  icon,
46
46
  src,
47
47
  iconClassNames,
48
- onClick,
49
- size,
50
- variant,
51
- iconAs,
52
- isActive,
48
+ onClick = () => {},
49
+ size = 'md',
50
+ variant = 'primary',
51
+ iconAs = Icon,
52
+ isActive = false,
53
53
  children, // unused, just here because we don't want it to be part of 'attrs'
54
54
  ...attrs
55
- }, ref) => {
55
+ } : Props, ref: React.ForwardedRef<HTMLButtonElement>) => {
56
56
  const invert = invertColors ? 'inverse-' : '';
57
57
  const activeStyle = isActive ? `${variant}-` : '';
58
58
  const IconComponent = iconAs;
@@ -87,58 +87,10 @@ const IconButton = React.forwardRef<HTMLButtonElement, Props>(({
87
87
  );
88
88
  });
89
89
 
90
- IconButton.defaultProps = {
91
- iconAs: Icon,
92
- src: undefined,
93
- icon: undefined,
94
- iconClassNames: undefined,
95
- className: undefined,
96
- invertColors: false,
97
- variant: 'primary',
98
- size: 'md',
99
- onClick: () => {},
100
- isActive: false,
101
- children: undefined,
102
- };
103
-
104
- IconButton.propTypes = {
105
- /** A custom class name. */
106
- className: PropTypes.string,
107
- /** Component that renders the icon, currently defaults to `Icon` */
108
- iconAs: PropTypes.elementType as any,
109
- /** An icon component to render. Example import of a Paragon icon component:
110
- * `import { Check } from '@openedx/paragon/icons';`
111
- * */
112
- src: PropTypes.elementType as any,
113
- /** Alt text for your icon. For best practice, avoid using alt text to describe
114
- * the image in the `IconButton`. Instead, we recommend describing the function
115
- * of the button. */
116
- alt: PropTypes.string.isRequired,
117
- /** Changes icon styles for dark background */
118
- invertColors: PropTypes.bool,
119
- /** Accepts a [Paragon icon](https://paragon-openedx.netlify.app/foundations/icons) */
120
- icon: PropTypes.shape({
121
- prefix: PropTypes.string,
122
- iconName: PropTypes.string,
123
- // eslint-disable-next-line react/forbid-prop-types
124
- icon: PropTypes.array,
125
- }) as any,
126
- /** Extra class names that will be added to the icon */
127
- iconClassNames: PropTypes.string,
128
- /** Click handler for the button */
129
- onClick: PropTypes.func,
130
- /** Type of button (uses Bootstrap options) */
131
- variant: PropTypes.oneOf(['primary', 'secondary', 'success', 'warning', 'danger', 'light', 'dark', 'black', 'brand']),
132
- /** size of button to render */
133
- size: PropTypes.oneOf(['sm', 'md', 'inline']),
134
- /** whether to show the `IconButton` in an active state, whose styling is distinct from default state */
135
- isActive: PropTypes.bool,
136
- };
137
-
138
90
  interface PropsWithTooltip extends Props {
139
- /** choose from https://popper.js.org/docs/v2/constructors/#options */
140
- tooltipPlacement: Placement,
141
- /** any content to pass to tooltip content area */
91
+ /** Tooltip placement can be top, left, right etc, choose from https://popper.js.org/docs/v2/constructors/#options */
92
+ tooltipPlacement?: Placement,
93
+ /** Any content to pass to tooltip content area */
142
94
  tooltipContent: React.ReactNode,
143
95
  }
144
96
 
@@ -146,7 +98,7 @@ interface PropsWithTooltip extends Props {
146
98
  * An icon button wrapped in overlaytrigger to display a tooltip.
147
99
  */
148
100
  function IconButtonWithTooltip({
149
- tooltipPlacement, tooltipContent, ...props
101
+ tooltipPlacement = 'top', tooltipContent, ...props
150
102
  }: PropsWithTooltip) {
151
103
  const invert = props.invertColors ? 'inverse-' : '';
152
104
  return (
@@ -166,22 +118,6 @@ function IconButtonWithTooltip({
166
118
  );
167
119
  }
168
120
 
169
- IconButtonWithTooltip.defaultProps = {
170
- ...IconButton.defaultProps,
171
- tooltipPlacement: 'top',
172
- };
173
-
174
- IconButtonWithTooltip.propTypes = {
175
- /** tooltip placement can be top, left, right etc, per https://popper.js.org/docs/v2/constructors/#options */
176
- tooltipPlacement: PropTypes.string,
177
- /** any valid JSX or text to be rendered as tooltip contents */
178
- tooltipContent: PropTypes.node.isRequired,
179
- /** Type of button (uses Bootstrap options) */
180
- variant: PropTypes.oneOf(['primary', 'secondary', 'success', 'warning', 'danger', 'light', 'dark', 'black', 'brand']),
181
- /** Changes icon styles for dark background */
182
- invertColors: PropTypes.bool,
183
- };
184
-
185
121
  (IconButton as any).IconButtonWithTooltip = IconButtonWithTooltip;
186
122
 
187
123
  export default IconButton as typeof IconButton & {
@@ -0,0 +1,2 @@
1
+ export { default } from 'react-bootstrap/Image';
2
+ export { default as Figure } from 'react-bootstrap/Figure';
@@ -0,0 +1 @@
1
+ export { default } from 'react-bootstrap/Media';
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  import { useMediaQuery } from 'react-responsive';
5
4
  import { useIntl } from 'react-intl';
@@ -52,7 +51,12 @@ interface Props {
52
51
  isBlocking?: boolean;
53
52
  /** Specifies the z-index of the modal */
54
53
  zIndex?: number;
55
- /** Specifies whether overflow is visible in the modal */
54
+ /**
55
+ * Specifies whether overflow content inside the modal should be visible.
56
+ * - `true` - content that exceeds the modal boundaries will remain visible outside the modal's main viewport,
57
+ * rather than being clipped or hidden.
58
+ * - `false` - any overflow content will be clipped to fit within the modal's dimensions.
59
+ */
56
60
  isOverflowVisible: boolean;
57
61
  }
58
62
 
@@ -109,70 +113,6 @@ function ModalDialog({
109
113
  );
110
114
  }
111
115
 
112
- ModalDialog.propTypes = {
113
- /**
114
- * Specifies the content of the dialog
115
- */
116
- children: PropTypes.node.isRequired,
117
- /**
118
- * The aria-label of the dialog
119
- */
120
- title: PropTypes.string.isRequired,
121
- /**
122
- * A callback to close the modal dialog
123
- */
124
- onClose: PropTypes.func.isRequired,
125
- /**
126
- * Is the modal dialog open or closed
127
- */
128
- isOpen: PropTypes.bool,
129
- /**
130
- * The close 'x' icon button in the top right of the dialog box
131
- */
132
- hasCloseButton: PropTypes.bool,
133
- /**
134
- * Sizes determine the maximum width of the dialog box
135
- */
136
- size: PropTypes.oneOf(['sm', 'md', 'lg', 'xl', 'fullscreen']),
137
- /**
138
- * The visual style of the dialog box
139
- */
140
- variant: PropTypes.oneOf(['default', 'warning', 'danger', 'success', 'dark']),
141
- /**
142
- * The label supplied to the close icon button if one is rendered
143
- */
144
- closeLabel: PropTypes.string,
145
- /**
146
- * Specifies class name to append to the base element
147
- */
148
- className: PropTypes.string,
149
- /**
150
- * Determines where a scrollbar should appear if a modal is too large for the
151
- * viewport. When false, the ``ModalDialog``. Body receives a scrollbar, when true
152
- * the browser window itself receives the scrollbar.
153
- */
154
- isFullscreenScroll: PropTypes.bool,
155
- /**
156
- * To show full screen view on mobile screens
157
- */
158
- isFullscreenOnMobile: PropTypes.bool,
159
- /**
160
- * Prevent clicking on the backdrop or pressing Esc to close the modal
161
- */
162
- isBlocking: PropTypes.bool,
163
- /**
164
- * Specifies the z-index of the modal
165
- */
166
- zIndex: PropTypes.number,
167
- /**
168
- * Specifies whether overflow content inside the modal should be visible.
169
- * - `true` - content that exceeds the modal boundaries will remain visible outside the modal's main viewport,
170
- * rather than being clipped or hidden.
171
- * - `false` - any overflow content will be clipped to fit within the modal's dimensions.
172
- */
173
- isOverflowVisible: PropTypes.bool.isRequired,
174
- };
175
-
176
116
  ModalDialog.Header = ModalDialogHeader;
177
117
  ModalDialog.Title = ModalDialogTitle;
178
118
  ModalDialog.Footer = ModalDialogFooter;
@@ -1,6 +1,5 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import classNames from 'classnames';
3
- import PropTypes from 'prop-types';
4
3
  import { FocusOn } from 'react-focus-on';
5
4
  import Portal from './Portal';
6
5
  import { ModalContextProvider } from './ModalContext';
@@ -18,19 +17,11 @@ function ModalBackdrop({ onClick }: { onClick?: () => void }) {
18
17
  );
19
18
  }
20
19
 
21
- ModalBackdrop.propTypes = {
22
- onClick: PropTypes.func,
23
- };
24
-
25
20
  // istanbul ignore next
26
21
  function ModalContentContainer({ children = null }: { children?: React.ReactNode }) {
27
22
  return <div className="pgn__modal-content-container">{children}</div>;
28
23
  }
29
24
 
30
- ModalContentContainer.propTypes = {
31
- children: PropTypes.node,
32
- };
33
-
34
25
  interface Props {
35
26
  /** Specifies the contents of the modal */
36
27
  children: React.ReactNode;
@@ -94,18 +85,5 @@ function ModalLayer({
94
85
  );
95
86
  }
96
87
 
97
- ModalLayer.propTypes = {
98
- /** Specifies the contents of the modal */
99
- children: PropTypes.node.isRequired,
100
- /** A callback function for when the modal is dismissed */
101
- onClose: PropTypes.func.isRequired,
102
- /** Is the modal dialog open or closed */
103
- isOpen: PropTypes.bool.isRequired,
104
- /** Prevent clicking on the backdrop or pressing Esc to close the modal */
105
- isBlocking: PropTypes.bool,
106
- /** Specifies the z-index of the modal */
107
- zIndex: PropTypes.number,
108
- };
109
-
110
88
  export { ModalBackdrop, ModalContentContainer };
111
89
  export default ModalLayer;
@@ -16,7 +16,7 @@ notes: |
16
16
  A generic component for creating accessible modal popup objects.
17
17
 
18
18
  Note that `ModalPopup` expects DOM node, not ref, in order to be able to update when the node changes.
19
- A proper way to implement this is to use [callback refs](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) with `useState` hook as in the example below.
19
+ A proper way to implement this is to use [callback refs](https://react.dev/reference/react-dom/components/common#ref-callback) with `useState` hook as in the example below.
20
20
 
21
21
  ## Basic Usage
22
22
 
@@ -231,7 +231,6 @@ describe('<ProductTour />', () => {
231
231
 
232
232
  // Verify no Checkpoints have rendered
233
233
  expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
234
- expect(handleEnd).toHaveBeenCalledTimes(1);
235
234
  expect(customOnEnd).not.toHaveBeenCalled();
236
235
  });
237
236
 
@@ -0,0 +1 @@
1
+ export { default } from 'react-bootstrap/ResponsiveEmbed';
@@ -0,0 +1 @@
1
+ export { default, SkeletonTheme } from 'react-loading-skeleton';
@@ -1,13 +1,20 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
- import BaseSpinner from 'react-bootstrap/Spinner';
3
+ import BaseSpinner, { type SpinnerProps as BaseSpinnerProps } from 'react-bootstrap/Spinner';
5
4
 
5
+ interface SpinnerProps extends BaseSpinnerProps {
6
+ /** Optionally specify additional CSS classes to give this spinner's `<div>`. */
7
+ className?: string;
8
+ /** Specifies the screen reader content for a11y. */
9
+ screenReaderText?: React.ReactNode;
10
+ }
11
+
12
+ /** A spinning animation that indicates loading. */
6
13
  const Spinner = React.forwardRef(({
7
14
  className,
8
15
  screenReaderText,
9
16
  ...attrs
10
- }, ref) => {
17
+ }: SpinnerProps, ref: React.ForwardedRef<HTMLDivElement>) => {
11
18
  const spinnerProps = {
12
19
  ...attrs,
13
20
  className: classNames('pgn__spinner', className),
@@ -20,16 +27,4 @@ const Spinner = React.forwardRef(({
20
27
  );
21
28
  });
22
29
 
23
- Spinner.propTypes = {
24
- /** Specifies the class name for the component. */
25
- className: PropTypes.string,
26
- /** Specifies the screen reader content for a11y. */
27
- screenReaderText: PropTypes.node,
28
- };
29
-
30
- Spinner.defaultProps = {
31
- className: undefined,
32
- screenReaderText: undefined,
33
- };
34
-
35
30
  export default Spinner;
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from 'react';
2
2
  import classNames from 'classnames';
3
- import PropTypes from 'prop-types';
4
3
  import BaseToast from 'react-bootstrap/Toast';
5
4
  import { useIntl } from 'react-intl';
6
5
 
@@ -20,12 +19,31 @@ interface ToastAction {
20
19
  }
21
20
 
22
21
  interface ToastProps {
22
+ /** A string or an element that is rendered inside the main body of the `Toast`. */
23
23
  children: string;
24
+ /**
25
+ * A function that is called on close. It can be used to perform
26
+ * actions upon closing of the `Toast`, such as setting the "show"
27
+ * element to false.
28
+ * */
24
29
  onClose: () => void;
30
+ /** Boolean used to control whether the `Toast` shows. */
25
31
  show: boolean;
32
+ /**
33
+ * Fields used to build optional action button.
34
+ * `label` is a string rendered inside the button.
35
+ * `href` is a link that will render the action button as an anchor tag.
36
+ * `onClick` is a function that is called when the button is clicked.
37
+ * The full type definition can be seen [here](https://github.com/openedx/paragon/blob/release-23.x/src/Toast/index.tsx#L16)
38
+ */
26
39
  action?: ToastAction;
40
+ /**
41
+ * Alt text for the `Toast`'s dismiss button. Defaults to 'Close'.
42
+ */
27
43
  closeLabel?: string;
44
+ /** Time in milliseconds for which the `Toast` will display. */
28
45
  delay?: number;
46
+ /** Class names for the `BaseToast` component. */
29
47
  className?: string;
30
48
  }
31
49
 
@@ -36,6 +54,7 @@ function Toast({
36
54
  closeLabel,
37
55
  onClose,
38
56
  show,
57
+ delay = TOAST_DELAY,
39
58
  ...rest
40
59
  }: ToastProps) {
41
60
  const intl = useIntl();
@@ -58,6 +77,7 @@ function Toast({
58
77
  onMouseOut={() => setAutoHide(true)}
59
78
  onMouseOver={() => setAutoHide(false)}
60
79
  show={show}
80
+ delay={delay}
61
81
  {...rest}
62
82
  >
63
83
  <div className="toast-header">
@@ -90,43 +110,4 @@ function Toast({
90
110
  );
91
111
  }
92
112
 
93
- Toast.defaultProps = {
94
- action: null,
95
- closeLabel: undefined,
96
- delay: TOAST_DELAY,
97
- className: undefined,
98
- };
99
-
100
- Toast.propTypes = {
101
- /** A string or an element that is rendered inside the main body of the `Toast`. */
102
- children: PropTypes.string.isRequired,
103
- /**
104
- * A function that is called on close. It can be used to perform
105
- * actions upon closing of the `Toast`, such as setting the "show"
106
- * element to false.
107
- * */
108
- onClose: PropTypes.func.isRequired,
109
- /** Boolean used to control whether the `Toast` shows */
110
- show: PropTypes.bool.isRequired,
111
- /**
112
- * Fields used to build optional action button.
113
- * `label` is a string rendered inside the button.
114
- * `href` is a link that will render the action button as an anchor tag.
115
- * `onClick` is a function that is called when the button is clicked.
116
- */
117
- action: PropTypes.shape({
118
- label: PropTypes.string.isRequired,
119
- href: PropTypes.string,
120
- onClick: PropTypes.func,
121
- }),
122
- /**
123
- * Alt text for the `Toast`'s dismiss button. Defaults to 'Close'.
124
- */
125
- closeLabel: PropTypes.string,
126
- /** Time in milliseconds for which the `Toast` will display. */
127
- delay: PropTypes.number,
128
- /** Class names for the `BaseToast` component */
129
- className: PropTypes.string,
130
- };
131
-
132
113
  export default Toast;