@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
@@ -1 +1 @@
1
- {"version":3,"file":"BreadcrumbLink.js","names":["React","PropTypes","classNames","BreadcrumbLink","_ref","as","clickHandler","linkProps","label","url","className","props","addtlProps","console","warn","href","onClick","createElement","propTypes","elementType","isRequired","func","shape","string","defaultProps","undefined"],"sources":["../../src/Breadcrumb/BreadcrumbLink.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nexport default function BreadcrumbLink({ as, clickHandler, linkProps }) {\n const {\n label,\n url,\n className,\n ...props\n } = linkProps;\n const addtlProps = {};\n\n if (as === 'a' && url) {\n // eslint-disable-next-line no-console\n console.warn(\n '[Deprecated]: using \"url\" parameter to specify link\\'s destination in Breadcrumb component is '\n + 'deprecated. Please use \"href\" instead when rendering links as anchor tag.',\n );\n addtlProps.href = url;\n }\n\n if (clickHandler) {\n addtlProps.onClick = clickHandler;\n }\n\n return React.createElement(\n as,\n {\n ...props,\n ...addtlProps,\n className: classNames('link-muted', className),\n },\n label,\n );\n}\n\nBreadcrumbLink.propTypes = {\n as: PropTypes.elementType.isRequired,\n clickHandler: PropTypes.func,\n linkProps: PropTypes.shape({\n label: PropTypes.string.isRequired,\n url: PropTypes.string,\n className: PropTypes.string,\n }).isRequired,\n};\n\nBreadcrumbLink.defaultProps = {\n clickHandler: undefined,\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,eAAe,SAASC,cAAcA,CAAAC,IAAA,EAAkC;EAAA,IAAjC;IAAEC,EAAE;IAAEC,YAAY;IAAEC;EAAU,CAAC,GAAAH,IAAA;EACpE,MAAM;IACJI,KAAK;IACLC,GAAG;IACHC,SAAS;IACT,GAAGC;EACL,CAAC,GAAGJ,SAAS;EACb,MAAMK,UAAU,GAAG,CAAC,CAAC;EAErB,IAAIP,EAAE,KAAK,GAAG,IAAII,GAAG,EAAE;IACrB;IACAI,OAAO,CAACC,IAAI,CACV,gGAAgG,GAC9F,2EACJ,CAAC;IACDF,UAAU,CAACG,IAAI,GAAGN,GAAG;EACvB;EAEA,IAAIH,YAAY,EAAE;IAChBM,UAAU,CAACI,OAAO,GAAGV,YAAY;EACnC;EAEA,oBAAON,KAAK,CAACiB,aAAa,CACxBZ,EAAE,EACF;IACE,GAAGM,KAAK;IACR,GAAGC,UAAU;IACbF,SAAS,EAAER,UAAU,CAAC,YAAY,EAAEQ,SAAS;EAC/C,CAAC,EACDF,KACF,CAAC;AACH;AAEAL,cAAc,CAACe,SAAS,GAAG;EACzBb,EAAE,EAAEJ,SAAS,CAACkB,WAAW,CAACC,UAAU;EACpCd,YAAY,EAAEL,SAAS,CAACoB,IAAI;EAC5Bd,SAAS,EAAEN,SAAS,CAACqB,KAAK,CAAC;IACzBd,KAAK,EAAEP,SAAS,CAACsB,MAAM,CAACH,UAAU;IAClCX,GAAG,EAAER,SAAS,CAACsB,MAAM;IACrBb,SAAS,EAAET,SAAS,CAACsB;EACvB,CAAC,CAAC,CAACH;AACL,CAAC;AAEDjB,cAAc,CAACqB,YAAY,GAAG;EAC5BlB,YAAY,EAAEmB;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"BreadcrumbLink.js","names":["React","PropTypes","classNames","BreadcrumbLink","as","clickHandler","linkProps","label","url","className","props","addtlProps","console","warn","href","onClick","createElement","propTypes","elementType","isRequired","func","shape","string","defaultProps","undefined"],"sources":["../../src/Breadcrumb/BreadcrumbLink.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nexport default function BreadcrumbLink({ as, clickHandler, linkProps }) {\n const {\n label,\n url,\n className,\n ...props\n } = linkProps;\n const addtlProps = {};\n\n if (as === 'a' && url) {\n // eslint-disable-next-line no-console\n console.warn(\n '[Deprecated]: using \"url\" parameter to specify link\\'s destination in Breadcrumb component is '\n + 'deprecated. Please use \"href\" instead when rendering links as anchor tag.',\n );\n addtlProps.href = url;\n }\n\n if (clickHandler) {\n addtlProps.onClick = clickHandler;\n }\n\n return React.createElement(\n as,\n {\n ...props,\n ...addtlProps,\n className: classNames('link-muted', className),\n },\n label,\n );\n}\n\nBreadcrumbLink.propTypes = {\n as: PropTypes.elementType.isRequired,\n clickHandler: PropTypes.func,\n linkProps: PropTypes.shape({\n label: PropTypes.string.isRequired,\n url: PropTypes.string,\n className: PropTypes.string,\n }).isRequired,\n};\n\nBreadcrumbLink.defaultProps = {\n clickHandler: undefined,\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,eAAe,SAASC,cAAcA,CAAC;EAAEC,EAAE;EAAEC,YAAY;EAAEC;AAAU,CAAC,EAAE;EACtE,MAAM;IACJC,KAAK;IACLC,GAAG;IACHC,SAAS;IACT,GAAGC;EACL,CAAC,GAAGJ,SAAS;EACb,MAAMK,UAAU,GAAG,CAAC,CAAC;EAErB,IAAIP,EAAE,KAAK,GAAG,IAAII,GAAG,EAAE;IACrB;IACAI,OAAO,CAACC,IAAI,CACV,gGAAgG,GAC9F,2EACJ,CAAC;IACDF,UAAU,CAACG,IAAI,GAAGN,GAAG;EACvB;EAEA,IAAIH,YAAY,EAAE;IAChBM,UAAU,CAACI,OAAO,GAAGV,YAAY;EACnC;EAEA,oBAAOL,KAAK,CAACgB,aAAa,CACxBZ,EAAE,EACF;IACE,GAAGM,KAAK;IACR,GAAGC,UAAU;IACbF,SAAS,EAAEP,UAAU,CAAC,YAAY,EAAEO,SAAS;EAC/C,CAAC,EACDF,KACF,CAAC;AACH;AAEAJ,cAAc,CAACc,SAAS,GAAG;EACzBb,EAAE,EAAEH,SAAS,CAACiB,WAAW,CAACC,UAAU;EACpCd,YAAY,EAAEJ,SAAS,CAACmB,IAAI;EAC5Bd,SAAS,EAAEL,SAAS,CAACoB,KAAK,CAAC;IACzBd,KAAK,EAAEN,SAAS,CAACqB,MAAM,CAACH,UAAU;IAClCX,GAAG,EAAEP,SAAS,CAACqB,MAAM;IACrBb,SAAS,EAAER,SAAS,CAACqB;EACvB,CAAC,CAAC,CAACH;AACL,CAAC;AAEDhB,cAAc,CAACoB,YAAY,GAAG;EAC5BlB,YAAY,EAAEmB;AAChB,CAAC","ignoreList":[]}
@@ -4,18 +4,17 @@ import classNames from 'classnames';
4
4
  import BreadcrumbLink from './BreadcrumbLink';
5
5
  import { ChevronRight } from '../../icons';
6
6
  import Icon from '../Icon';
7
- function Breadcrumb(_ref) {
8
- let {
9
- links,
10
- activeLabel,
11
- spacer,
12
- clickHandler,
13
- variant,
14
- isMobile,
15
- ariaLabel,
16
- linkAs,
17
- ...props
18
- } = _ref;
7
+ function Breadcrumb({
8
+ links,
9
+ activeLabel,
10
+ spacer,
11
+ clickHandler,
12
+ variant,
13
+ isMobile,
14
+ ariaLabel,
15
+ linkAs,
16
+ ...props
17
+ }) {
19
18
  const linkCount = links.length;
20
19
  const displayLinks = isMobile ? [links[linkCount - 1]] : links;
21
20
  return /*#__PURE__*/React.createElement("nav", {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","classNames","BreadcrumbLink","ChevronRight","Icon","Breadcrumb","_ref","links","activeLabel","spacer","clickHandler","variant","isMobile","ariaLabel","linkAs","props","linkCount","length","displayLinks","createElement","className","map","link","i","Fragment","key","label","as","linkProps","role","src","id","propTypes","arrayOf","shape","string","isRequired","element","func","oneOf","bool","elementType","defaultProps","undefined"],"sources":["../../src/Breadcrumb/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport BreadcrumbLink from './BreadcrumbLink';\nimport { ChevronRight } from '../../icons';\nimport Icon from '../Icon';\n\nfunction Breadcrumb({\n links, activeLabel, spacer, clickHandler,\n variant, isMobile, ariaLabel, linkAs, ...props\n}) {\n const linkCount = links.length;\n const displayLinks = isMobile ? [links[linkCount - 1]] : links;\n\n return (\n <nav\n aria-label={ariaLabel}\n className={classNames('pgn__breadcrumb', `pgn__breadcrumb-${variant}`)}\n {...props}\n >\n <ol className={classNames('list-inline', { 'is-mobile': isMobile })}>\n {displayLinks.map((link, i) => (\n <React.Fragment key={link.label}>\n <li className={classNames('list-inline-item')}>\n <BreadcrumbLink as={linkAs} clickHandler={clickHandler} linkProps={link} />\n </li>\n {(activeLabel || ((i + 1) < linkCount))\n && (\n <li className=\"list-inline-item\" role=\"presentation\">\n {spacer || <Icon src={ChevronRight} id={`spacer-${i}`} />}\n </li>\n )}\n </React.Fragment>\n ))}\n {!isMobile && activeLabel && <li className=\"list-inline-item active\" key=\"active\" aria-current=\"page\">{activeLabel}</li>}\n </ol>\n </nav>\n );\n}\n\nBreadcrumb.propTypes = {\n /** An array of objects describing links to be rendered. The contents of an object depend on the value of `linkAs`\n * prop as these objects will get passed down as props to the underlying component defined by `linkAs` prop.\n */\n links: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string,\n })).isRequired,\n /** allows to add a label that is not a link to the end of the breadcrumb. */\n activeLabel: PropTypes.string,\n /** label of the element */\n ariaLabel: PropTypes.string,\n /** allows to add a custom element between the breadcrumb items.\n * Defaults to `>` rendered using the `Icon` component. */\n spacer: PropTypes.element,\n /** allows to add a custom function to be called `onClick` of a breadcrumb link.\n * The use case for this is for adding custom analytics to the component. */\n clickHandler: PropTypes.func,\n /** The `Breadcrumbs` style variant to use. */\n variant: PropTypes.oneOf(['light', 'dark']),\n /** The `Breadcrumbs` mobile variant view. */\n isMobile: PropTypes.bool,\n /** Specifies the base element to use when rendering links, you should generally use either plain 'a' or\n * [react-router's Link](https://reactrouter.com/en/main/components/link).\n */\n linkAs: PropTypes.elementType,\n};\n\nBreadcrumb.defaultProps = {\n activeLabel: undefined,\n ariaLabel: 'breadcrumb',\n spacer: undefined,\n clickHandler: undefined,\n variant: 'light',\n isMobile: false,\n linkAs: 'a',\n};\n\nexport default Breadcrumb;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAOC,IAAI,MAAM,SAAS;AAE1B,S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CAAE,CACtD,CAEQ,CACjB,CAAC,EACD,CAACX,QAAQ,IAAIJ,WAAW,iBAAIT,KAAA,CAAAoB,aAAA;IAAIC,SAAS,EAAC,yBAAyB;IAACK,GAAG,EAAC,QAAQ;IAAC,gBAAa;EAAM,GAAEjB,WAAgB,CACrH,CACD,CAAC;AAEV;AAEAH,UAAU,CAAC2B,SAAS,GAAG;EACrB;AACF;AACA;EACEzB,KAAK,EAAEP,SAAS,CAACiC,OAAO,CAACjC,SAAS,CAACkC,KAAK,CAAC;IACvCR,KAAK,EAAE1B,SAAS,CAACmC;EACnB,CAAC,CAAC,CAAC,CAACC,UAAU;EACd;EACA5B,WAAW,EAAER,SAAS,CAACmC,MAAM;EAC7B;EACAtB,SAAS,EAAEb,SAAS,CAACmC,MAAM;EAC3B;AACF;EACE1B,MAAM,EAAET,SAAS,CAACqC,OAAO;EACzB;AACF;EACE3B,YAAY,EAAEV,SAAS,CAACsC,IAAI;EAC5B;EACA3B,OAAO,EAAEX,SAAS,CAACuC,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EAC3C;EACA3B,QAAQ,EAAEZ,SAAS,CAACwC,IAAI;EACxB;AACF;AACA;EACE1B,MAAM,EAAEd,SAAS,CAACyC;AACpB,CAAC;AAEDpC,UAAU,CAACqC,YAAY,GAAG;EACxBlC,WAAW,EAAEmC,SAAS;EACtB9B,SAAS,EAAE,YAAY;EACvBJ,MAAM,EAAEkC,SAAS;EACjBjC,YAAY,EAAEiC,SAAS;EACvBhC,OAAO,EAAE,OAAO;EAChBC,QAAQ,EAAE,KAAK;EACfE,MAAM,EAAE;AACV,CAAC;AAED,eAAeT,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","classNames","BreadcrumbLink","ChevronRight","Icon","Breadcrumb","links","activeLabel","spacer","clickHandler","variant","isMobile","ariaLabel","linkAs","props","linkCount","length","displayLinks","createElement","className","map","link","i","Fragment","key","label","as","linkProps","role","src","id","propTypes","arrayOf","shape","string","isRequired","element","func","oneOf","bool","elementType","defaultProps","undefined"],"sources":["../../src/Breadcrumb/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport BreadcrumbLink from './BreadcrumbLink';\nimport { ChevronRight } from '../../icons';\nimport Icon from '../Icon';\n\nfunction Breadcrumb({\n links, activeLabel, spacer, clickHandler,\n variant, isMobile, ariaLabel, linkAs, ...props\n}) {\n const linkCount = links.length;\n const displayLinks = isMobile ? [links[linkCount - 1]] : links;\n\n return (\n <nav\n aria-label={ariaLabel}\n className={classNames('pgn__breadcrumb', `pgn__breadcrumb-${variant}`)}\n {...props}\n >\n <ol className={classNames('list-inline', { 'is-mobile': isMobile })}>\n {displayLinks.map((link, i) => (\n <React.Fragment key={link.label}>\n <li className={classNames('list-inline-item')}>\n <BreadcrumbLink as={linkAs} clickHandler={clickHandler} linkProps={link} />\n </li>\n {(activeLabel || ((i + 1) < linkCount))\n && (\n <li className=\"list-inline-item\" role=\"presentation\">\n {spacer || <Icon src={ChevronRight} id={`spacer-${i}`} />}\n </li>\n )}\n </React.Fragment>\n ))}\n {!isMobile && activeLabel && <li className=\"list-inline-item active\" key=\"active\" aria-current=\"page\">{activeLabel}</li>}\n </ol>\n </nav>\n );\n}\n\nBreadcrumb.propTypes = {\n /** An array of objects describing links to be rendered. The contents of an object depend on the value of `linkAs`\n * prop as these objects will get passed down as props to the underlying component defined by `linkAs` prop.\n */\n links: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.string,\n })).isRequired,\n /** allows to add a label that is not a link to the end of the breadcrumb. */\n activeLabel: PropTypes.string,\n /** label of the element */\n ariaLabel: PropTypes.string,\n /** allows to add a custom element between the breadcrumb items.\n * Defaults to `>` rendered using the `Icon` component. */\n spacer: PropTypes.element,\n /** allows to add a custom function to be called `onClick` of a breadcrumb link.\n * The use case for this is for adding custom analytics to the component. */\n clickHandler: PropTypes.func,\n /** The `Breadcrumbs` style variant to use. */\n variant: PropTypes.oneOf(['light', 'dark']),\n /** The `Breadcrumbs` mobile variant view. */\n isMobile: PropTypes.bool,\n /** Specifies the base element to use when rendering links, you should generally use either plain 'a' or\n * [react-router's Link](https://reactrouter.com/en/main/components/link).\n */\n linkAs: PropTypes.elementType,\n};\n\nBreadcrumb.defaultProps = {\n activeLabel: undefined,\n ariaLabel: 'breadcrumb',\n spacer: undefined,\n clickHandler: undefined,\n variant: 'light',\n isMobile: false,\n linkAs: 'a',\n};\n\nexport default Breadcrumb;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAOC,IAAI,MAAM,SAAS;AAE1B,SAASC,UAAUA,CAAC;EAClBC,KAAK;EAAEC,WAAW;EAAEC,MAAM;EAAEC,YAAY;EACxCC,OAAO;EAAEC,QAAQ;EAAEC,SAAS;EAAEC,MAAM;EAAE,GAAGC;AAC3C,CAAC,EAAE;EACD,MAAMC,SAAS,GAAGT,KAAK,CAACU,MAAM;EAC9B,MAAMC,YAAY,GAAGN,QAAQ,GAAG,CAACL,KAAK,CAACS,SAAS,GAAG,CAAC,CAAC,CAAC,GAAGT,KAAK;EAE9D,oBACEP,KAAA,CAAAmB,aAAA;IACE,cAAYN,SAAU;IACtBO,SAAS,EAAElB,UAAU,CAAC,iBAAiB,EAAE,mBAAmBS,OAAO,EAAE,CAAE;IAAA,GACnEI;EAAK,gBAETf,KAAA,CAAAmB,aAAA;IAAIC,SAAS,EAAElB,UAAU,CAAC,aAAa,EAAE;MAAE,WAAW,EAAEU;IAAS,CAAC;EAAE,GACjEM,YAAY,CAACG,GAAG,CAAC,CAACC,IAAI,EAAEC,CAAC,kBACxBvB,KAAA,CAAAmB,aAAA,CAACnB,KAAK,CAACwB,QAAQ;IAACC,GAAG,EAAEH,IAAI,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;EACE1B,MAAM,EAAEb,SAAS,CAACwC;AACpB,CAAC;AAEDnC,UAAU,CAACoC,YAAY,GAAG;EACxBlC,WAAW,EAAEmC,SAAS;EACtB9B,SAAS,EAAE,YAAY;EACvBJ,MAAM,EAAEkC,SAAS;EACjBjC,YAAY,EAAEiC,SAAS;EACvBhC,OAAO,EAAE,OAAO;EAChBC,QAAQ,EAAE,KAAK;EACfE,MAAM,EAAE;AACV,CAAC;AAED,eAAeR,UAAU","ignoreList":[]}
@@ -1,11 +1,15 @@
1
1
  import React from 'react';
2
- declare const STYLE_VARIANTS: readonly ["primary", "success", "error", "warning"];
3
- export type BubbleVariant = typeof STYLE_VARIANTS[number];
2
+ export type BubbleVariant = 'primary' | 'success' | 'error' | 'warning';
4
3
  export interface BubbleProps {
4
+ /** Specifies contents of the component. */
5
5
  children: React.ReactNode;
6
+ /** The `Bubble` style variant to use. */
6
7
  variant?: BubbleVariant;
8
+ /** Activates disabled variant. */
7
9
  disabled?: boolean;
10
+ /** Optional class name(s) to append to the base element. */
8
11
  className?: string;
12
+ /** Specifies whether to add padding to the `Bubble` or not. */
9
13
  expandable?: boolean;
10
14
  }
11
15
  declare const Bubble: React.ForwardRefExoticComponent<BubbleProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,44 +1,19 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
- const STYLE_VARIANTS = ['primary', 'success', 'error', 'warning'];
5
- const Bubble = /*#__PURE__*/React.forwardRef((_ref, ref) => {
6
- let {
7
- variant,
8
- className,
9
- children,
3
+ const Bubble = /*#__PURE__*/React.forwardRef(({
4
+ variant = 'primary',
5
+ className,
6
+ children = null,
7
+ disabled = false,
8
+ expandable = false,
9
+ ...props
10
+ }, ref) => /*#__PURE__*/React.createElement("div", {
11
+ ref: ref,
12
+ className: classNames('pgn__bubble', `pgn__bubble-${variant}`, className, {
10
13
  disabled,
11
- expandable,
12
- ...props
13
- } = _ref;
14
- return /*#__PURE__*/React.createElement("div", {
15
- ref: ref,
16
- className: classNames('pgn__bubble', `pgn__bubble-${variant}`, className, {
17
- disabled,
18
- expandable
19
- }),
20
- ...props
21
- }, children);
22
- });
23
- Bubble.propTypes = {
24
- /** Specifies contents of the component. */
25
- // @ts-ignore
26
- children: PropTypes.node,
27
- /** The `Bubble` style variant to use. */
28
- variant: PropTypes.oneOf(STYLE_VARIANTS),
29
- /** Activates disabled variant. */
30
- disabled: PropTypes.bool,
31
- /** A class name to append to the base element. */
32
- className: PropTypes.string,
33
- /** Specifies whether to add padding to the `Bubble` or not. */
34
- expandable: PropTypes.bool
35
- };
36
- Bubble.defaultProps = {
37
- children: null,
38
- variant: 'primary',
39
- disabled: false,
40
- className: undefined,
41
- expandable: false
42
- };
14
+ expandable
15
+ }),
16
+ ...props
17
+ }, children));
43
18
  export default Bubble;
44
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","classNames","STYLE_VARIANTS","Bubble","forwardRef","_ref","ref","variant","className","children","disabled","expandable","props","createElement","propTypes","node","oneOf","bool","string","defaultProps","undefined"],"sources":["../../src/Bubble/index.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst STYLE_VARIANTS = ['primary', 'success', 'error', 'warning'] as const;\n\nexport type BubbleVariant = typeof STYLE_VARIANTS[number];\n\nexport interface BubbleProps {\n children: React.ReactNode;\n variant?: BubbleVariant;\n disabled?: boolean;\n className?: string;\n expandable?: boolean;\n}\n\nconst Bubble = React.forwardRef<HTMLDivElement, BubbleProps>(({\n variant,\n className,\n children,\n disabled,\n expandable,\n ...props\n}, ref) => (\n <div\n ref={ref}\n className={classNames(\n 'pgn__bubble',\n `pgn__bubble-${variant}`,\n className,\n { disabled, expandable },\n )}\n {...props}\n >\n {children}\n </div>\n));\n\nBubble.propTypes = {\n /** Specifies contents of the component. */\n // @ts-ignore\n children: PropTypes.node,\n /** The `Bubble` style variant to use. */\n variant: PropTypes.oneOf(STYLE_VARIANTS),\n /** Activates disabled variant. */\n disabled: PropTypes.bool,\n /** A class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies whether to add padding to the `Bubble` or not. */\n expandable: PropTypes.bool,\n};\n\nBubble.defaultProps = {\n children: null,\n variant: 'primary',\n disabled: false,\n className: undefined,\n expandable: false,\n};\n\nexport default Bubble;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,MAAMC,cAAc,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAU;AAY1E,MAAMC,MAAM,gBAAGJ,KAAK,CAACK,UAAU,CAA8B,CAAAC,IAAA,EAO1DC,GAAG;EAAA,IAPwD;IAC5DC,OAAO;IACPC,SAAS;IACTC,QAAQ;IACRC,QAAQ;IACRC,UAAU;IACV,GAAGC;EACL,CAAC,GAAAP,IAAA;EAAA,oBACCN,KAAA,CAAAc,aAAA;IACEP,GAAG,EAAEA,GAAI;IACTE,SAAS,EAAEP,UAAU,CACnB,aAAa,EACb,eAAeM,OAAO,EAAE,EACxBC,SAAS,EACT;MAAEE,QAAQ;MAAEC;IAAW,CACzB,CAAE;IAAA,GACEC;EAAK,GAERH,QACE,CAAC;AAAA,CACP,CAAC;AAEFN,MAAM,CAACW,SAAS,GAAG;EACjB;EACA;EACAL,QAAQ,EAAET,SAAS,CAACe,IAAI;EACxB;EACAR,OAAO,EAAEP,SAAS,CAACgB,KAAK,CAACd,cAAc,CAAC;EACxC;EACAQ,QAAQ,EAAEV,SAAS,CAACiB,IAAI;EACxB;EACAT,SAAS,EAAER,SAAS,CAACkB,MAAM;EAC3B;EACAP,UAAU,EAAEX,SAAS,CAACiB;AACxB,CAAC;AAEDd,MAAM,CAACgB,YAAY,GAAG;EACpBV,QAAQ,EAAE,IAAI;EACdF,OAAO,EAAE,SAAS;EAClBG,QAAQ,EAAE,KAAK;EACfF,SAAS,EAAEY,SAAS;EACpBT,UAAU,EAAE;AACd,CAAC;AAED,eAAeR,MAAM","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","classNames","Bubble","forwardRef","variant","className","children","disabled","expandable","props","ref","createElement"],"sources":["../../src/Bubble/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\n\nexport type BubbleVariant = 'primary' | 'success' | 'error' | 'warning';\n\nexport interface BubbleProps {\n /** Specifies contents of the component. */\n children: React.ReactNode;\n /** The `Bubble` style variant to use. */\n variant?: BubbleVariant;\n /** Activates disabled variant. */\n disabled?: boolean;\n /** Optional class name(s) to append to the base element. */\n className?: string;\n /** Specifies whether to add padding to the `Bubble` or not. */\n expandable?: boolean;\n}\n\nconst Bubble = React.forwardRef(({\n variant = 'primary',\n className,\n children = null,\n disabled = false,\n expandable = false,\n ...props\n}: BubbleProps, ref: React.ForwardedRef<HTMLDivElement>) => (\n <div\n ref={ref}\n className={classNames(\n 'pgn__bubble',\n `pgn__bubble-${variant}`,\n className,\n { disabled, expandable },\n )}\n {...props}\n >\n {children}\n </div>\n));\n\nexport default Bubble;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AAiBnC,MAAMC,MAAM,gBAAGF,KAAK,CAACG,UAAU,CAAC,CAAC;EAC/BC,OAAO,GAAG,SAAS;EACnBC,SAAS;EACTC,QAAQ,GAAG,IAAI;EACfC,QAAQ,GAAG,KAAK;EAChBC,UAAU,GAAG,KAAK;EAClB,GAAGC;AACQ,CAAC,EAAEC,GAAuC,kBACrDV,KAAA,CAAAW,aAAA;EACED,GAAG,EAAEA,GAAI;EACTL,SAAS,EAAEJ,UAAU,CACnB,aAAa,EACb,eAAeG,OAAO,EAAE,EACxBC,SAAS,EACT;IAAEE,QAAQ;IAAEC;EAAW,CACzB,CAAE;EAAA,GACEC;AAAK,GAERH,QACE,CACN,CAAC;AAEF,eAAeJ,MAAM","ignoreList":[]}
@@ -1,9 +1,18 @@
1
1
  import React from 'react';
2
2
  import { type ButtonProps as BaseButtonProps } from 'react-bootstrap/Button';
3
3
  import { type ButtonGroupProps as BaseButtonGroupProps } from 'react-bootstrap/ButtonGroup';
4
- import { type ButtonToolbarProps } from 'react-bootstrap/ButtonToolbar';
4
+ import { type ButtonToolbarProps as BaseButtonToolbarProps } from 'react-bootstrap/ButtonToolbar';
5
5
  import type { ComponentWithAsProp } from '../utils/types/bootstrap';
6
- interface ButtonProps extends Omit<BaseButtonProps, 'size'> {
6
+ type BaseVariant = ('primary' | 'secondary' | 'tertiary' | 'brand' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'link');
7
+ /**
8
+ * This was added so these types could be added as a non-breaking change.
9
+ * @deprecated - remove in Paragon 24
10
+ */
11
+ type OtherDeprecatedValue = string & {};
12
+ export interface ButtonProps extends Omit<BaseButtonProps, 'size'> {
13
+ /** Set a custom element for this component (default: `button`, with `type="button"`). */
14
+ as?: React.ElementType;
15
+ size?: 'sm' | 'md' | 'lg' | 'inline';
7
16
  /**
8
17
  * An icon component to render. Example:
9
18
  * ```
@@ -20,16 +29,42 @@ interface ButtonProps extends Omit<BaseButtonProps, 'size'> {
20
29
  * ```
21
30
  */
22
31
  iconAfter?: React.ComponentType;
23
- size?: 'sm' | 'md' | 'lg' | 'inline';
32
+ /** Disables the Button, preventing mouse events, even if the underlying component is an `<a>` element */
33
+ disabled?: boolean;
34
+ /** Optional: Specify additional class name(s) to apply to the button */
35
+ className?: string;
36
+ /** Specifies the text that is displayed within the button. */
37
+ children: React.ReactNode;
38
+ /** Specifies variant to use.
39
+ * Can be one of the base variants: `primary`, `secondary`, `tertiary`, `brand`, `success`, `danger`, `warning`,
40
+ * `info`, `dark`, `light`, `link`,
41
+ * as well as one of the customized variants (= base variant prefixed with `inverse-`, `outline-`
42
+ * or `inverse-outline-`)
43
+ * */
44
+ variant?: BaseVariant | `inverse-${BaseVariant}` | `outline-${BaseVariant}` | `inverse-outline-${BaseVariant}` | OtherDeprecatedValue;
24
45
  }
25
- type ButtonType = ComponentWithAsProp<'button', ButtonProps> & {
26
- Deprecated?: any;
27
- };
28
- declare const Button: ButtonType;
46
+ declare const Button: ComponentWithAsProp<'button', ButtonProps>;
29
47
  interface ButtonGroupProps extends Omit<BaseButtonGroupProps, 'size'> {
48
+ /** Specifies element type for this component. */
49
+ as?: React.ElementType;
50
+ /** An ARIA role describing the button group (default: `group`). */
51
+ role?: React.AriaRole;
52
+ /** Specifies the size for all Buttons in the group (default: `md`). */
30
53
  size?: 'sm' | 'md' | 'lg' | 'inline';
54
+ /** Display as a button toggle group (default: `false`). */
55
+ toggle?: boolean;
56
+ /** Specifies if the set of Buttons should appear vertically stacked (default: `false`). */
57
+ vertical?: boolean;
58
+ /** Overrides underlying component base CSS class name (default: `btn-group`). */
59
+ bsPrefix?: string;
31
60
  }
32
61
  declare const ButtonGroup: ComponentWithAsProp<'div', ButtonGroupProps>;
62
+ interface ButtonToolbarProps extends BaseButtonToolbarProps {
63
+ /** An ARIA role describing the button group (default: `toolbar`). */
64
+ role?: React.AriaRole;
65
+ /** Overrides underlying component base CSS class name (default: `btn-toolbar`) */
66
+ bsPrefix?: string;
67
+ }
33
68
  declare const ButtonToolbar: ComponentWithAsProp<'div', ButtonToolbarProps>;
34
69
  export default Button;
35
70
  export { ButtonGroup, ButtonToolbar };
@@ -1,130 +1,58 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  import BaseButton from 'react-bootstrap/Button';
5
4
  import BaseButtonGroup from 'react-bootstrap/ButtonGroup';
6
5
  import BaseButtonToolbar from 'react-bootstrap/ButtonToolbar';
7
6
  import Icon from '../Icon';
8
- const Button = /*#__PURE__*/React.forwardRef((_ref, ref) => {
9
- let {
10
- children,
11
- iconAfter,
12
- iconBefore,
13
- size,
14
- ...props
15
- } = _ref;
16
- return /*#__PURE__*/React.createElement(BaseButton, {
17
- size: size // Bootstrap's <Button> types do not allow 'md' or 'inline', but we do.
18
- ,
19
- ...props,
20
- className: classNames(props.className),
21
- ref: ref
22
- }, iconBefore && /*#__PURE__*/React.createElement(Icon, {
23
- className: "btn-icon-before",
24
- size: size,
25
- src: iconBefore
26
- }), children, iconAfter && /*#__PURE__*/React.createElement(Icon, {
27
- className: "btn-icon-after",
28
- size: size,
29
- src: iconAfter
30
- }));
31
- });
32
- Button.propTypes = {
33
- /** Specifies class name to apply to the button */
34
- className: PropTypes.string,
35
- /** Disables the Button, preventing mouse events, even if the underlying component is an `<a>` element */
36
- disabled: PropTypes.bool,
37
- /** Specifies the text that is displayed within the button. */
38
- children: PropTypes.node.isRequired,
39
- /** A function that would specify what the button should do when the `onClick` event is triggered.
40
- * For example, the button could launch a `Modal`. The default is an empty function. */
41
- onClick: PropTypes.func,
42
- /** A function that would specify what the button should do when the `onKeyDown` event is triggered.
43
- * For example, this could handle using the `Escape` key to trigger the button's action.
44
- * The default is an empty function. */
45
- onKeyDown: PropTypes.func,
46
- /** Used to set the `type` attribute on the `button` tag. The default type is `button`. */
47
- type: PropTypes.string,
48
- /** Specifies variant to use.
49
- * Can be on of the base variants: `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `dark`,
50
- * `light`, `link`
51
- *
52
- * as well as one of the customized variants (= base variant prefixed with `inverse-`, `outline-`
53
- * or `inverse-outline-`)
54
- * */
55
- variant: PropTypes.string,
56
- /** An icon component to render.
57
- * Example import of a Paragon icon component: `import { Check } from '@openedx/paragon/icons';` */
58
- iconBefore: PropTypes.elementType,
59
- /** An icon component to render.
60
- * Example import of a Paragon icon component: `import { Check } from '@openedx/paragon/icons';` */
61
- iconAfter: PropTypes.elementType
62
- // The 'as' type casting above is required for TypeScript checking, because the 'PropTypes.elementType' type normally
63
- // allows strings as a value (for use cases like 'div') but we don't support that for <Icon />/iconBefore/iconAfter.
64
- // The React TypeScript type definitions are more specific (React.ComponentType vs React.ElementType).
65
- };
66
- Button.defaultProps = {
67
- ...Button.defaultProps,
68
- children: undefined,
69
- className: undefined,
70
- iconBefore: undefined,
71
- iconAfter: undefined,
72
- disabled: false
73
- };
74
7
 
75
- // We could just re-export 'ButtonGroup' and 'ButtonToolbar', but we currently
76
- // override them to add propTypes validation at runtime, since most Paragon
77
- // consumers aren't using TypeScript yet. We also force ButtonGroup's 'size'
78
- // prop to accept our custom values of 'md' and 'inline' which are used in
79
- // Paragon but not used in the base Bootstrap classes.
8
+ /**
9
+ * This was added so these types could be added as a non-breaking change.
10
+ * @deprecated - remove in Paragon 24
11
+ */
12
+ // Allow any other string value for now, even though it's invalid
13
+
14
+ const Button = /*#__PURE__*/React.forwardRef(({
15
+ children,
16
+ iconAfter,
17
+ iconBefore,
18
+ size,
19
+ ...props
20
+ }, ref) => /*#__PURE__*/React.createElement(BaseButton, {
21
+ size: size // Bootstrap's <Button> types do not allow 'md' or 'inline', but we do.
22
+ ,
23
+ ...props,
24
+ className: classNames(props.className),
25
+ ref: ref
26
+ }, iconBefore && /*#__PURE__*/React.createElement(Icon, {
27
+ className: "btn-icon-before",
28
+ size: size,
29
+ src: iconBefore
30
+ }), children, iconAfter && /*#__PURE__*/React.createElement(Icon, {
31
+ className: "btn-icon-after",
32
+ size: size,
33
+ src: iconAfter
34
+ })));
35
+
36
+ // We could just re-export 'ButtonGroup', but we currently override it to
37
+ // force ButtonGroup's 'size' prop to accept our custom values of 'md' and
38
+ // 'inline' which are used in Paragon but not used in the base Bootstrap classes.
39
+
40
+ const ButtonGroup = /*#__PURE__*/React.forwardRef(({
41
+ size = 'md',
42
+ ...props
43
+ }, ref) => /*#__PURE__*/React.createElement(BaseButtonGroup, {
44
+ size: size,
45
+ ...props,
46
+ ref: ref
47
+ }));
48
+
49
+ // We could just re-export 'ButtonToolbar', but we currently override it to
50
+ // narrow the type of 'role' to valid roles and to document its properties.
80
51
 
81
- const ButtonGroup = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
82
- let {
83
- size,
84
- ...props
85
- } = _ref2;
86
- return /*#__PURE__*/React.createElement(BaseButtonGroup, {
87
- size: size,
88
- ...props,
89
- ref: ref
90
- });
91
- });
92
- ButtonGroup.propTypes = {
93
- /** Specifies element type for this component. */
94
- as: PropTypes.elementType,
95
- /** An ARIA role describing the button group. */
96
- role: PropTypes.string,
97
- /** Specifies the size for all Buttons in the group. */
98
- size: PropTypes.oneOf(['sm', 'md', 'lg', 'inline']),
99
- /** Display as a button toggle group. */
100
- toggle: PropTypes.bool,
101
- /** Specifies if the set of Buttons should appear vertically stacked. */
102
- vertical: PropTypes.bool,
103
- /** Overrides underlying component base CSS class name */
104
- bsPrefix: PropTypes.string
105
- };
106
- ButtonGroup.defaultProps = {
107
- as: 'div',
108
- role: 'group',
109
- toggle: false,
110
- vertical: false,
111
- bsPrefix: 'btn-group',
112
- size: 'md'
113
- };
114
52
  const ButtonToolbar = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(BaseButtonToolbar, {
115
53
  ...props,
116
54
  ref: ref
117
55
  }));
118
- ButtonToolbar.propTypes = {
119
- /** An ARIA role describing the button group. */
120
- role: PropTypes.string,
121
- /** Overrides underlying component base CSS class name */
122
- bsPrefix: PropTypes.string
123
- };
124
- ButtonToolbar.defaultProps = {
125
- role: 'toolbar',
126
- bsPrefix: 'btn-toolbar'
127
- };
128
56
  export default Button;
129
57
  export { ButtonGroup, ButtonToolbar };
130
58
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","classNames","BaseButton","BaseButtonGroup","BaseButtonToolbar","Icon","Button","forwardRef","_ref","ref","children","iconAfter","iconBefore","size","props","createElement","className","src","propTypes","string","disabled","bool","node","isRequired","onClick","func","onKeyDown","type","variant","elementType","defaultProps","undefined","ButtonGroup","_ref2","as","role","oneOf","toggle","vertical","bsPrefix","ButtonToolbar"],"sources":["../../src/Button/index.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes, { type Requireable } from 'prop-types';\nimport classNames from 'classnames';\nimport BaseButton, { type ButtonProps as BaseButtonProps } from 'react-bootstrap/Button';\nimport BaseButtonGroup, { type ButtonGroupProps as BaseButtonGroupProps } from 'react-bootstrap/ButtonGroup';\nimport BaseButtonToolbar, { type ButtonToolbarProps } from 'react-bootstrap/ButtonToolbar';\nimport type { ComponentWithAsProp } from '../utils/types/bootstrap';\n\nimport Icon from '../Icon';\n\ninterface ButtonProps extends Omit<BaseButtonProps, 'size'> {\n /**\n * An icon component to render. Example:\n * ```\n * import { Close } from '@openedx/paragon/icons';\n * <Button iconBefore={Close}>Close</Button>\n * ```\n */\n iconBefore?: React.ComponentType;\n /**\n * An icon component to render. Example:\n * ```\n * import { Close } from '@openedx/paragon/icons';\n * <Button iconAfter={Close}>Close</Button>\n * ```\n */\n iconAfter?: React.ComponentType;\n size?: 'sm' | 'md' | 'lg' | 'inline';\n}\n\ntype ButtonType = ComponentWithAsProp<'button', ButtonProps> & { Deprecated?: any };\n\nconst Button: ButtonType = React.forwardRef<HTMLButtonElement, ButtonProps>(({\n children,\n iconAfter,\n iconBefore,\n size,\n ...props\n}, ref) => (\n <BaseButton\n size={size as 'sm' | 'lg' | undefined} // Bootstrap's <Button> types do not allow 'md' or 'inline', but we do.\n {...props}\n className={classNames(props.className)}\n ref={ref}\n >\n {iconBefore && <Icon className=\"btn-icon-before\" size={size} src={iconBefore} />}\n {children}\n {iconAfter && <Icon className=\"btn-icon-after\" size={size} src={iconAfter} />}\n </BaseButton>\n));\n\nButton.propTypes = {\n /** Specifies class name to apply to the button */\n className: PropTypes.string,\n /** Disables the Button, preventing mouse events, even if the underlying component is an `<a>` element */\n disabled: PropTypes.bool,\n /** Specifies the text that is displayed within the button. */\n children: PropTypes.node.isRequired,\n /** A function that would specify what the button should do when the `onClick` event is triggered.\n * For example, the button could launch a `Modal`. The default is an empty function. */\n onClick: PropTypes.func,\n /** A function that would specify what the button should do when the `onKeyDown` event is triggered.\n * For example, this could handle using the `Escape` key to trigger the button's action.\n * The default is an empty function. */\n onKeyDown: PropTypes.func,\n /** Used to set the `type` attribute on the `button` tag. The default type is `button`. */\n type: PropTypes.string,\n /** Specifies variant to use.\n * Can be on of the base variants: `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `dark`,\n * `light`, `link`\n *\n * as well as one of the customized variants (= base variant prefixed with `inverse-`, `outline-`\n * or `inverse-outline-`)\n * */\n variant: PropTypes.string,\n /** An icon component to render.\n * Example import of a Paragon icon component: `import { Check } from '@openedx/paragon/icons';` */\n iconBefore: PropTypes.elementType as Requireable<React.ComponentType>,\n /** An icon component to render.\n * Example import of a Paragon icon component: `import { Check } from '@openedx/paragon/icons';` */\n iconAfter: PropTypes.elementType as Requireable<React.ComponentType>,\n // The 'as' type casting above is required for TypeScript checking, because the 'PropTypes.elementType' type normally\n // allows strings as a value (for use cases like 'div') but we don't support that for <Icon />/iconBefore/iconAfter.\n // The React TypeScript type definitions are more specific (React.ComponentType vs React.ElementType).\n};\n\nButton.defaultProps = {\n ...Button.defaultProps,\n children: undefined,\n className: undefined,\n iconBefore: undefined,\n iconAfter: undefined,\n disabled: false,\n};\n\n// We could just re-export 'ButtonGroup' and 'ButtonToolbar', but we currently\n// override them to add propTypes validation at runtime, since most Paragon\n// consumers aren't using TypeScript yet. We also force ButtonGroup's 'size'\n// prop to accept our custom values of 'md' and 'inline' which are used in\n// Paragon but not used in the base Bootstrap classes.\n\ninterface ButtonGroupProps extends Omit<BaseButtonGroupProps, 'size'> {\n size?: 'sm' | 'md' | 'lg' | 'inline';\n}\n\nconst ButtonGroup: ComponentWithAsProp<'div', ButtonGroupProps> = (\n React.forwardRef<HTMLButtonElement, ButtonGroupProps>(({ size, ...props }, ref) => (\n <BaseButtonGroup size={size as 'sm' | 'lg'} {...props} ref={ref} />\n ))\n);\n\nButtonGroup.propTypes = {\n /** Specifies element type for this component. */\n as: PropTypes.elementType,\n /** An ARIA role describing the button group. */\n role: PropTypes.string,\n /** Specifies the size for all Buttons in the group. */\n size: PropTypes.oneOf(['sm', 'md', 'lg', 'inline']),\n /** Display as a button toggle group. */\n toggle: PropTypes.bool,\n /** Specifies if the set of Buttons should appear vertically stacked. */\n vertical: PropTypes.bool,\n /** Overrides underlying component base CSS class name */\n bsPrefix: PropTypes.string,\n};\n\nButtonGroup.defaultProps = {\n as: 'div',\n role: 'group',\n toggle: false,\n vertical: false,\n bsPrefix: 'btn-group',\n size: 'md',\n};\n\nconst ButtonToolbar: ComponentWithAsProp<'div', ButtonToolbarProps> = (\n React.forwardRef<HTMLButtonElement, ButtonToolbarProps>((props, ref) => (\n <BaseButtonToolbar {...props} ref={ref} />\n ))\n);\n\nButtonToolbar.propTypes = {\n /** An ARIA role describing the button group. */\n role: PropTypes.string,\n /** Overrides underlying component base CSS class name */\n bsPrefix: PropTypes.string,\n};\n\nButtonToolbar.defaultProps = {\n role: 'toolbar',\n bsPrefix: 'btn-toolbar',\n};\n\nexport default Button;\nexport { ButtonGroup, ButtonToolbar };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAA4B,YAAY;AACxD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,UAAU,MAA+C,wBAAwB;AACxF,OAAOC,eAAe,MAAyD,6BAA6B;AAC5G,OAAOC,iBAAiB,MAAmC,+BAA+B;AAG1F,OAAOC,IAAI,MAAM,SAAS;AAwB1B,MAAMC,MAAkB,gBAAGP,KAAK,CAACQ,UAAU,CAAiC,CAAAC,IAAA,EAMzEC,GAAG;EAAA,IANuE;IAC3EC,QAAQ;IACRC,SAAS;IACTC,UAAU;IACVC,IAAI;IACJ,GAAGC;EACL,CAAC,GAAAN,IAAA;EAAA,oBACCT,KAAA,CAAAgB,aAAA,CAACb,UAAU;IACTW,IAAI,EAAEA,IAAgC,CAAC;IAAA;IAAA,GACnCC,KAAK;IACTE,SAAS,EAAEf,UAAU,CAACa,KAAK,CAACE,SAAS,CAAE;IACvCP,GAAG,EAAEA;EAAI,GAERG,UAAU,iBAAIb,KAAA,CA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Group","BaseButtonToolbar","Icon","Button","forwardRef","children","iconAfter","iconBefore","size","props","ref","createElement","className","src","ButtonGroup","ButtonToolbar"],"sources":["../../src/Button/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport BaseButton, { type ButtonProps as BaseButtonProps } from 'react-bootstrap/Button';\nimport BaseButtonGroup, { type ButtonGroupProps as BaseButtonGroupProps } from 'react-bootstrap/ButtonGroup';\nimport BaseButtonToolbar, { type ButtonToolbarProps as BaseButtonToolbarProps } from 'react-bootstrap/ButtonToolbar';\nimport type { ComponentWithAsProp } from '../utils/types/bootstrap';\n\nimport Icon from '../Icon';\n\ntype BaseVariant = (\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'brand'\n | 'success'\n | 'danger'\n | 'warning'\n | 'info'\n | 'dark'\n | 'light'\n | 'link'\n);\n\n/**\n * This was added so these types could be added as a non-breaking change.\n * @deprecated - remove in Paragon 24\n */\ntype OtherDeprecatedValue = string & {}; // Allow any other string value for now, even though it's invalid\n\nexport interface ButtonProps extends Omit<BaseButtonProps, 'size'> {\n /** Set a custom element for this component (default: `button`, with `type=\"button\"`). */\n as?: React.ElementType;\n size?: 'sm' | 'md' | 'lg' | 'inline';\n /**\n * An icon component to render. Example:\n * ```\n * import { Close } from '@openedx/paragon/icons';\n * <Button iconBefore={Close}>Close</Button>\n * ```\n */\n iconBefore?: React.ComponentType;\n /**\n * An icon component to render. Example:\n * ```\n * import { Close } from '@openedx/paragon/icons';\n * <Button iconAfter={Close}>Close</Button>\n * ```\n */\n iconAfter?: React.ComponentType;\n\n // The following are the same as in BaseButtonProps, but we re-define them to add documentation.\n // The upstream type defintions do not have any comments/docs.\n\n /** Disables the Button, preventing mouse events, even if the underlying component is an `<a>` element */\n disabled?: boolean;\n /** Optional: Specify additional class name(s) to apply to the button */\n className?: string;\n /** Specifies the text that is displayed within the button. */\n children: React.ReactNode;\n /** Specifies variant to use.\n * Can be one of the base variants: `primary`, `secondary`, `tertiary`, `brand`, `success`, `danger`, `warning`,\n * `info`, `dark`, `light`, `link`,\n * as well as one of the customized variants (= base variant prefixed with `inverse-`, `outline-`\n * or `inverse-outline-`)\n * */\n variant?: BaseVariant | `inverse-${BaseVariant}` | `outline-${BaseVariant}` | `inverse-outline-${BaseVariant}` | OtherDeprecatedValue;\n}\n\nconst Button: ComponentWithAsProp<'button', ButtonProps> = React.forwardRef(({\n children,\n iconAfter,\n iconBefore,\n size,\n ...props\n}: ButtonProps, ref: React.ForwardedRef<HTMLDivElement>) => (\n <BaseButton\n size={size as 'sm' | 'lg' | undefined} // Bootstrap's <Button> types do not allow 'md' or 'inline', but we do.\n {...props}\n className={classNames(props.className)}\n ref={ref}\n >\n {iconBefore && <Icon className=\"btn-icon-before\" size={size} src={iconBefore} />}\n {children}\n {iconAfter && <Icon className=\"btn-icon-after\" size={size} src={iconAfter} />}\n </BaseButton>\n));\n\n// We could just re-export 'ButtonGroup', but we currently override it to\n// force ButtonGroup's 'size' prop to accept our custom values of 'md' and\n// 'inline' which are used in Paragon but not used in the base Bootstrap classes.\n\ninterface ButtonGroupProps extends Omit<BaseButtonGroupProps, 'size'> {\n /** Specifies element type for this component. */\n as?: React.ElementType;\n /** An ARIA role describing the button group (default: `group`). */\n role?: React.AriaRole;\n /** Specifies the size for all Buttons in the group (default: `md`). */\n size?: 'sm' | 'md' | 'lg' | 'inline';\n /** Display as a button toggle group (default: `false`). */\n toggle?: boolean;\n /** Specifies if the set of Buttons should appear vertically stacked (default: `false`). */\n vertical?: boolean;\n /** Overrides underlying component base CSS class name (default: `btn-group`). */\n bsPrefix?: string;\n}\n\nconst ButtonGroup: ComponentWithAsProp<'div', ButtonGroupProps> = (\n React.forwardRef(({ size = 'md', ...props }: ButtonGroupProps, ref: React.ForwardedRef<HTMLDivElement>) => (\n <BaseButtonGroup size={size as 'sm' | 'lg'} {...props} ref={ref} />\n ))\n);\n\n// We could just re-export 'ButtonToolbar', but we currently override it to\n// narrow the type of 'role' to valid roles and to document its properties.\n\ninterface ButtonToolbarProps extends BaseButtonToolbarProps {\n /** An ARIA role describing the button group (default: `toolbar`). */\n role?: React.AriaRole;\n /** Overrides underlying component base CSS class name (default: `btn-toolbar`) */\n bsPrefix?: string;\n}\n\nconst ButtonToolbar: ComponentWithAsProp<'div', ButtonToolbarProps> = (\n React.forwardRef((props: ButtonToolbarProps, ref: React.ForwardedRef<HTMLDivElement>) => (\n <BaseButtonToolbar {...props} ref={ref} />\n ))\n);\n\nexport default Button;\nexport { ButtonGroup, ButtonToolbar };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,UAAU,MAA+C,wBAAwB;AACxF,OAAOC,eAAe,MAAyD,6BAA6B;AAC5G,OAAOC,iBAAiB,MAA6D,+BAA+B;AAGpH,OAAOC,IAAI,MAAM,SAAS;;AAgB1B;AACA;AACA;AACA;AACyC;;AAyCzC,MAAMC,MAAkD,gBAAGN,KAAK,CAACO,UAAU,CAAC,CAAC;EAC3EC,QAAQ;EACRC,SAAS;EACTC,UAAU;EACVC,IAAI;EACJ,GAAGC;AACQ,CAAC,EAAEC,GAAuC,kBACrDb,KAAA,CAAAc,aAAA,CAACZ,UAAU;EACTS,IAAI,EAAEA,IAAgC,CAAC;EAAA;EAAA,GACnCC,KAAK;EACTG,SAAS,EAAEd,UAAU,CAACW,KAAK,CAACG,SAAS,CAAE;EACvCF,GAAG,EAAEA;AAAI,GAERH,UAAU,iBAAIV,KAAA,CAAAc,aAAA,CAACT,IAAI;EAACU,SAAS,EAAC,iBAAiB;EAACJ,IAAI,EAAEA,IAAK;EAACK,GAAG,EAAEN;AAAW,CAAE,CAAC,EAC/EF,QAAQ,EACRC,SAAS,iBAAIT,KAAA,CAAAc,aAAA,CAACT,IAAI;EAACU,SAAS,EAAC,gBAAgB;EAACJ,IAAI,EAAEA,IAAK;EAACK,GAAG,EAAEP;AAAU,CAAE,CAClE,CACb,CAAC;;AAEF;AACA;AACA;;AAiBA,MAAMQ,WAAyD,gBAC7DjB,KAAK,CAACO,UAAU,CAAC,CAAC;EAAEI,IAAI,GAAG,IAAI;EAAE,GAAGC;AAAwB,CAAC,EAAEC,GAAuC,kBACpGb,KAAA,CAAAc,aAAA,CAACX,eAAe;EAACQ,IAAI,EAAEA,IAAoB;EAAA,GAAKC,KAAK;EAAEC,GAAG,EAAEA;AAAI,CAAE,CACnE,CACF;;AAED;AACA;;AASA,MAAMK,aAA6D,gBACjElB,KAAK,CAACO,UAAU,CAAC,CAACK,KAAyB,EAAEC,GAAuC,kBAClFb,KAAA,CAAAc,aAAA,CAACV,iBAAiB;EAAA,GAAKQ,KAAK;EAAEC,GAAG,EAAEA;AAAI,CAAE,CAC1C,CACF;AAED,eAAeP,MAAM;AACrB,SAASW,WAAW,EAAEC,aAAa","ignoreList":[]}
@@ -6,18 +6,17 @@ import CardBody from './CardBody';
6
6
  const BASE_CARD_CLASSNAME = 'card';
7
7
  const colorVariants = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light'];
8
8
  const textVariants = ['white', 'muted'];
9
- const BaseCard = /*#__PURE__*/React.forwardRef((_ref, ref) => {
10
- let {
11
- prefix,
12
- className,
13
- bgColor,
14
- textColor,
15
- borderColor,
16
- hasBody = false,
17
- children,
18
- as: Component = 'div',
19
- ...props
20
- } = _ref;
9
+ const BaseCard = /*#__PURE__*/React.forwardRef(({
10
+ prefix,
11
+ className,
12
+ bgColor,
13
+ textColor,
14
+ borderColor,
15
+ hasBody = false,
16
+ children,
17
+ as: Component = 'div',
18
+ ...props
19
+ }, ref) => {
21
20
  const classes = classNames(className, prefix ? `${prefix}-${BASE_CARD_CLASSNAME}` : BASE_CARD_CLASSNAME, bgColor && `bg-${bgColor}`, textColor && `text-${textColor}`, borderColor && `border-${borderColor}`);
22
21
  return /*#__PURE__*/React.createElement(Component, {
23
22
  ref: ref,
@@ -1 +1 @@
1
- {"version":3,"file":"BaseCard.js","names":["React","PropTypes","classNames","CardBody","BASE_CARD_CLASSNAME","colorVariants","textVariants","BaseCard","forwardRef","_ref","ref","prefix","className","bgColor","textColor","borderColor","hasBody","children","as","Component","props","classes","createElement","propTypes","string","oneOf","bool","elementType","node"],"sources":["../../src/Card/BaseCard.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport type { ComponentWithAsProp, BsPropsWithAs } from '../utils/types/bootstrap';\n\n// @ts-ignore\nimport CardBody from './CardBody';\n\nconst BASE_CARD_CLASSNAME = 'card';\n\nconst colorVariants = [\n 'primary',\n 'secondary',\n 'success',\n 'danger',\n 'warning',\n 'info',\n 'dark',\n 'light',\n] as const;\n\nconst textVariants = [\n 'white',\n 'muted',\n] as const;\n\ntype ColorVariant = typeof colorVariants[number];\ntype TextVariant = typeof textVariants[number];\ninterface Props extends BsPropsWithAs {\n prefix?: string;\n bgColor?: ColorVariant;\n textColor?: ColorVariant | TextVariant;\n borderColor?: ColorVariant;\n hasBody?: boolean;\n className?: string;\n children: React.ReactNode;\n}\ntype BaseCardType = ComponentWithAsProp<'div', Props>;\n\nconst BaseCard : BaseCardType = React.forwardRef<HTMLDivElement, Props>(\n (\n {\n prefix,\n className,\n bgColor,\n textColor,\n borderColor,\n hasBody = false,\n children,\n as: Component = 'div',\n ...props\n },\n ref,\n ) => {\n const classes = classNames(\n className,\n prefix ? `${prefix}-${BASE_CARD_CLASSNAME}` : BASE_CARD_CLASSNAME,\n bgColor && `bg-${bgColor}`,\n textColor && `text-${textColor}`,\n borderColor && `border-${borderColor}`,\n );\n\n return (\n <Component ref={ref} {...props} className={classes}>\n {hasBody ? <CardBody>{children}</CardBody> : children}\n </Component>\n );\n },\n);\n\n/* eslint-disable react/require-default-props */\nBaseCard.propTypes = {\n /** Prefix for component CSS classes. */\n prefix: PropTypes.string,\n /** Background color of the card. */\n bgColor: PropTypes.oneOf(colorVariants),\n /** Text color of the card. */\n textColor: PropTypes.oneOf([...colorVariants, ...textVariants]),\n /** Border color of the card. */\n borderColor: PropTypes.oneOf(colorVariants),\n /** Determines whether the card should render its children inside a `CardBody` wrapper. */\n hasBody: PropTypes.bool,\n /** Set a custom element for this component. */\n as: PropTypes.elementType,\n /** Additional CSS class names to apply to the card element. */\n className: PropTypes.string,\n /** The content to render inside the card. */\n children: PropTypes.node,\n};\n\nexport default BaseCard;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAInC;AACA,OAAOC,QAAQ,MAAM,YAAY;AAEjC,MAAMC,mBAAmB,GAAG,MAAM;AAElC,MAAMC,aAAa,GAAG,CACpB,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,MAAM,EACN,MAAM,EACN,OAAO,CACC;AAEV,MAAMC,YAAY,GAAG,CACnB,OAAO,EACP,OAAO,CACC;AAeV,MAAMC,QAAuB,gBAAGP,KAAK,CAACQ,UAAU,CAC9C,CAAAC,IAAA,EAYEC,GAAG,KACA;EAAA,IAZH;IACEC,MAAM;IACNC,SAAS;IACTC,OAAO;IACPC,SAAS;IACTC,WAAW;IACXC,OAAO,GAAG,KAAK;IACfC,QAAQ;IACRC,EAAE,EAAEC,SAAS,GAAG,KAAK;IACrB,GAAGC;EACL,CAAC,GAAAX,IAAA;EAGD,MAAMY,OAAO,GAAGnB,UAAU,CACxBU,SAAS,EACTD,MAAM,GAAG,GAAGA,MAAM,IAAIP,mBAAmB,EAAE,GAAGA,mBAAmB,EACjES,OAAO,IAAI,MAAMA,OAAO,EAAE,EAC1BC,SAAS,IAAI,QAAQA,SAAS,EAAE,EAChCC,WAAW,IAAI,UAAUA,WAAW,EACtC,CAAC;EAED,oBACEf,KAAA,CAAAsB,aAAA,CAACH,SAAS;IAACT,GAAG,EAAEA,GAAI;IAAA,GAAKU,KAAK;IAAER,SAAS,EAAES;EAAQ,GAChDL,OAAO,gBAAGhB,KAAA,CAAAsB,aAAA,CAACnB,QAAQ,QAAEc,QAAmB,CAAC,GAAGA,QACpC,CAAC;AAEhB,CACF,CAAC;;AAED;AACAV,QAAQ,CAACgB,SAAS,GAAG;EACnB;EACAZ,MAAM,EAAEV,SAAS,CAACuB,MAAM;EACxB;EACAX,OAAO,EAAEZ,SAAS,CAACwB,KAAK,CAACpB,aAAa,CAAC;EACvC;EACAS,SAAS,EAAEb,SAAS,CAACwB,KAAK,CAAC,CAAC,GAAGpB,aAAa,EAAE,GAAGC,YAAY,CAAC,CAAC;EAC/D;EACAS,WAAW,EAAEd,SAAS,CAACwB,KAAK,CAACpB,aAAa,CAAC;EAC3C;EACAW,OAAO,EAAEf,SAAS,CAACyB,IAAI;EACvB;EACAR,EAAE,EAAEjB,SAAS,CAAC0B,WAAW;EACzB;EACAf,SAAS,EAAEX,SAAS,CAACuB,MAAM;EAC3B;EACAP,QAAQ,EAAEhB,SAAS,CAAC2B;AACtB,CAAC;AAED,eAAerB,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"BaseCard.js","names":["React","PropTypes","classNames","CardBody","BASE_CARD_CLASSNAME","colorVariants","textVariants","BaseCard","forwardRef","prefix","className","bgColor","textColor","borderColor","hasBody","children","as","Component","props","ref","classes","createElement","propTypes","string","oneOf","bool","elementType","node"],"sources":["../../src/Card/BaseCard.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport type { ComponentWithAsProp, BsPropsWithAs } from '../utils/types/bootstrap';\n\n// @ts-ignore\nimport CardBody from './CardBody';\n\nconst BASE_CARD_CLASSNAME = 'card';\n\nconst colorVariants = [\n 'primary',\n 'secondary',\n 'success',\n 'danger',\n 'warning',\n 'info',\n 'dark',\n 'light',\n] as const;\n\nconst textVariants = [\n 'white',\n 'muted',\n] as const;\n\ntype ColorVariant = typeof colorVariants[number];\ntype TextVariant = typeof textVariants[number];\ninterface Props extends BsPropsWithAs {\n prefix?: string;\n bgColor?: ColorVariant;\n textColor?: ColorVariant | TextVariant;\n borderColor?: ColorVariant;\n hasBody?: boolean;\n className?: string;\n children: React.ReactNode;\n}\ntype BaseCardType = ComponentWithAsProp<'div', Props>;\n\nconst BaseCard : BaseCardType = React.forwardRef<HTMLDivElement, Props>(\n (\n {\n prefix,\n className,\n bgColor,\n textColor,\n borderColor,\n hasBody = false,\n children,\n as: Component = 'div',\n ...props\n },\n ref,\n ) => {\n const classes = classNames(\n className,\n prefix ? `${prefix}-${BASE_CARD_CLASSNAME}` : BASE_CARD_CLASSNAME,\n bgColor && `bg-${bgColor}`,\n textColor && `text-${textColor}`,\n borderColor && `border-${borderColor}`,\n );\n\n return (\n <Component ref={ref} {...props} className={classes}>\n {hasBody ? <CardBody>{children}</CardBody> : children}\n </Component>\n );\n },\n);\n\n/* eslint-disable react/require-default-props */\nBaseCard.propTypes = {\n /** Prefix for component CSS classes. */\n prefix: PropTypes.string,\n /** Background color of the card. */\n bgColor: PropTypes.oneOf(colorVariants),\n /** Text color of the card. */\n textColor: PropTypes.oneOf([...colorVariants, ...textVariants]),\n /** Border color of the card. */\n borderColor: PropTypes.oneOf(colorVariants),\n /** Determines whether the card should render its children inside a `CardBody` wrapper. */\n hasBody: PropTypes.bool,\n /** Set a custom element for this component. */\n as: PropTypes.elementType,\n /** Additional CSS class names to apply to the card element. */\n className: PropTypes.string,\n /** The content to render inside the card. */\n children: PropTypes.node,\n};\n\nexport default BaseCard;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAInC;AACA,OAAOC,QAAQ,MAAM,YAAY;AAEjC,MAAMC,mBAAmB,GAAG,MAAM;AAElC,MAAMC,aAAa,GAAG,CACpB,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,MAAM,EACN,MAAM,EACN,OAAO,CACC;AAEV,MAAMC,YAAY,GAAG,CACnB,OAAO,EACP,OAAO,CACC;AAeV,MAAMC,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,18 +1,15 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
- const CardBody = /*#__PURE__*/React.forwardRef((_ref, ref) => {
5
- let {
6
- className,
7
- children,
8
- ...rest
9
- } = _ref;
10
- return /*#__PURE__*/React.createElement("div", {
11
- className: classNames('pgn__card-body', className),
12
- ref: ref,
13
- ...rest
14
- }, children);
15
- });
4
+ const CardBody = /*#__PURE__*/React.forwardRef(({
5
+ className,
6
+ children,
7
+ ...rest
8
+ }, ref) => /*#__PURE__*/React.createElement("div", {
9
+ className: classNames('pgn__card-body', className),
10
+ ref: ref,
11
+ ...rest
12
+ }, children));
16
13
  CardBody.propTypes = {
17
14
  /** Specifies the content of the component. */
18
15
  children: PropTypes.node,
@@ -1 +1 @@
1
- {"version":3,"file":"CardBody.js","names":["React","PropTypes","classNames","CardBody","forwardRef","_ref","ref","className","children","rest","createElement","propTypes","node","string","defaultProps","undefined"],"sources":["../../src/Card/CardBody.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst CardBody = React.forwardRef(({ className, children, ...rest }, ref) => (\n <div className={classNames('pgn__card-body', className)} ref={ref} {...rest}>\n {children}\n </div>\n));\n\nCardBody.propTypes = {\n /** Specifies the content of the component. */\n children: PropTypes.node,\n /** The class to append to the base element. */\n className: PropTypes.string,\n};\n\nCardBody.defaultProps = {\n children: undefined,\n className: undefined,\n};\n\nexport default CardBody;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,MAAMC,QAAQ,gBAAGH,KAAK,CAACI,UAAU,CAAC,CAAAC,IAAA,EAAmCC,GAAG;EAAA,IAArC;IAAEC,SAAS;IAAEC,QAAQ;IAAE,GAAGC;EAAK,CAAC,GAAAJ,IAAA;EAAA,oBACjEL,KAAA,CAAAU,aAAA;IAAKH,SAAS,EAAEL,UAAU,CAAC,gBAAgB,EAAEK,SAAS,CAAE;IAACD,GAAG,EAAEA,GAAI;IAAA,GAAKG;EAAI,GACxED,QACE,CAAC;AAAA,CACP,CAAC;AAEFL,QAAQ,CAACQ,SAAS,GAAG;EACnB;EACAH,QAAQ,EAAEP,SAAS,CAACW,IAAI;EACxB;EACAL,SAAS,EAAEN,SAAS,CAACY;AACvB,CAAC;AAEDV,QAAQ,CAACW,YAAY,GAAG;EACtBN,QAAQ,EAAEO,SAAS;EACnBR,SAAS,EAAEQ;AACb,CAAC;AAED,eAAeZ,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"CardBody.js","names":["React","PropTypes","classNames","CardBody","forwardRef","className","children","rest","ref","createElement","propTypes","node","string","defaultProps","undefined"],"sources":["../../src/Card/CardBody.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst CardBody = React.forwardRef(({ className, children, ...rest }, ref) => (\n <div className={classNames('pgn__card-body', className)} ref={ref} {...rest}>\n {children}\n </div>\n));\n\nCardBody.propTypes = {\n /** Specifies the content of the component. */\n children: PropTypes.node,\n /** The class to append to the base element. */\n className: PropTypes.string,\n};\n\nCardBody.defaultProps = {\n children: undefined,\n className: undefined,\n};\n\nexport default CardBody;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,MAAMC,QAAQ,gBAAGH,KAAK,CAACI,UAAU,CAAC,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAC,EAAEC,GAAG,kBACtER,KAAA,CAAAS,aAAA;EAAKJ,SAAS,EAAEH,UAAU,CAAC,gBAAgB,EAAEG,SAAS,CAAE;EAACG,GAAG,EAAEA,GAAI;EAAA,GAAKD;AAAI,GACxED,QACE,CACN,CAAC;AAEFH,QAAQ,CAACO,SAAS,GAAG;EACnB;EACAJ,QAAQ,EAAEL,SAAS,CAACU,IAAI;EACxB;EACAN,SAAS,EAAEJ,SAAS,CAACW;AACvB,CAAC;AAEDT,QAAQ,CAACU,YAAY,GAAG;EACtBP,QAAQ,EAAEQ,SAAS;EACnBT,SAAS,EAAES;AACb,CAAC;AAED,eAAeX,QAAQ","ignoreList":[]}
@@ -4,20 +4,19 @@ import { OverflowScroll } from '../../OverflowScroll';
4
4
  import CardCarouselProvider from './CardCarouselProvider';
5
5
  import CardCarouselHeader from './CardCarouselHeader';
6
6
  import CardCarouselItems from './CardCarouselItems';
7
- function CardCarousel(_ref) {
8
- let {
9
- ariaLabel,
10
- children,
11
- title,
12
- subtitle,
13
- columnSizes,
14
- hasInteractiveChildren,
15
- canScrollHorizontal,
16
- disableOpacityMasks,
17
- onScrollPrevious,
18
- onScrollNext,
19
- CardCarouselControls
20
- } = _ref;
7
+ function CardCarousel({
8
+ ariaLabel,
9
+ children,
10
+ title,
11
+ subtitle,
12
+ columnSizes,
13
+ hasInteractiveChildren,
14
+ canScrollHorizontal,
15
+ disableOpacityMasks,
16
+ onScrollPrevious,
17
+ onScrollNext,
18
+ CardCarouselControls
19
+ }) {
21
20
  return /*#__PURE__*/React.createElement(OverflowScroll, {
22
21
  disableScroll: !canScrollHorizontal,
23
22
  hasInteractiveChildren: hasInteractiveChildren,