@openedx/paragon 21.12.1 → 21.12.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 (416) hide show
  1. package/dist/ActionRow/index.js +7 -8
  2. package/dist/ActionRow/index.js.map +1 -1
  3. package/dist/Alert/index.js +33 -25
  4. package/dist/Alert/index.js.map +1 -1
  5. package/dist/Annotation/index.js +7 -9
  6. package/dist/Annotation/index.js.map +1 -1
  7. package/dist/Avatar/index.js +5 -7
  8. package/dist/Avatar/index.js.map +1 -1
  9. package/dist/AvatarButton/index.js +10 -12
  10. package/dist/AvatarButton/index.js.map +1 -1
  11. package/dist/Badge/index.js +6 -4
  12. package/dist/Badge/index.js.map +1 -1
  13. package/dist/Breadcrumb/BreadcrumbLink.js +11 -14
  14. package/dist/Breadcrumb/BreadcrumbLink.js.map +1 -1
  15. package/dist/Breadcrumb/index.js +29 -29
  16. package/dist/Breadcrumb/index.js.map +1 -1
  17. package/dist/Bubble/index.js +11 -13
  18. package/dist/Bubble/index.js.map +1 -1
  19. package/dist/Button/deprecated/index.js +87 -66
  20. package/dist/Button/deprecated/index.js.map +1 -1
  21. package/dist/Button/index.js +10 -11
  22. package/dist/Button/index.js.map +1 -1
  23. package/dist/Card/CardBody.js +4 -6
  24. package/dist/Card/CardBody.js.map +1 -1
  25. package/dist/Card/CardCarousel/CardCarousel.js +11 -13
  26. package/dist/Card/CardCarousel/CardCarousel.js.map +1 -1
  27. package/dist/Card/CardCarousel/CardCarouselControls.js +6 -7
  28. package/dist/Card/CardCarousel/CardCarouselControls.js.map +1 -1
  29. package/dist/Card/CardCarousel/CardCarouselHeader.js +9 -12
  30. package/dist/Card/CardCarousel/CardCarouselHeader.js.map +1 -1
  31. package/dist/Card/CardCarousel/CardCarouselItems.js +6 -9
  32. package/dist/Card/CardCarousel/CardCarouselItems.js.map +1 -1
  33. package/dist/Card/CardCarousel/CardCarouselProvider.js +27 -28
  34. package/dist/Card/CardCarousel/CardCarouselProvider.js.map +1 -1
  35. package/dist/Card/CardCarousel/CardCarouselSubtitle.js +4 -6
  36. package/dist/Card/CardCarousel/CardCarouselSubtitle.js.map +1 -1
  37. package/dist/Card/CardCarousel/CardCarouselTitle.js +4 -6
  38. package/dist/Card/CardCarousel/CardCarouselTitle.js.map +1 -1
  39. package/dist/Card/CardContext.js +8 -10
  40. package/dist/Card/CardContext.js.map +1 -1
  41. package/dist/Card/CardDeck.js +19 -17
  42. package/dist/Card/CardDeck.js.map +1 -1
  43. package/dist/Card/CardDivider.js +3 -5
  44. package/dist/Card/CardDivider.js.map +1 -1
  45. package/dist/Card/CardFooter.js +15 -18
  46. package/dist/Card/CardFooter.js.map +1 -1
  47. package/dist/Card/CardGrid.js +13 -11
  48. package/dist/Card/CardGrid.js.map +1 -1
  49. package/dist/Card/CardHeader.js +17 -22
  50. package/dist/Card/CardHeader.js.map +1 -1
  51. package/dist/Card/CardImageCap.js +48 -33
  52. package/dist/Card/CardImageCap.js.map +1 -1
  53. package/dist/Card/CardSection.js +11 -14
  54. package/dist/Card/CardSection.js.map +1 -1
  55. package/dist/Card/CardStatus.js +11 -14
  56. package/dist/Card/CardStatus.js.map +1 -1
  57. package/dist/Card/index.js +18 -20
  58. package/dist/Card/index.js.map +1 -1
  59. package/dist/Carousel/index.js +17 -11
  60. package/dist/Carousel/index.js.map +1 -1
  61. package/dist/CheckBox/index.js +66 -36
  62. package/dist/CheckBox/index.js.map +1 -1
  63. package/dist/Chip/index.js +14 -16
  64. package/dist/Chip/index.js.map +1 -1
  65. package/dist/ChipCarousel/index.js +29 -30
  66. package/dist/ChipCarousel/index.js.map +1 -1
  67. package/dist/Collapsible/CollapsibleAdvanced.js +82 -62
  68. package/dist/Collapsible/CollapsibleAdvanced.js.map +1 -1
  69. package/dist/Collapsible/CollapsibleBody.js +13 -15
  70. package/dist/Collapsible/CollapsibleBody.js.map +1 -1
  71. package/dist/Collapsible/CollapsibleTrigger.js +18 -20
  72. package/dist/Collapsible/CollapsibleTrigger.js.map +1 -1
  73. package/dist/Collapsible/CollapsibleVisible.js +6 -9
  74. package/dist/Collapsible/CollapsibleVisible.js.map +1 -1
  75. package/dist/Collapsible/index.js +17 -18
  76. package/dist/Collapsible/index.js.map +1 -1
  77. package/dist/ColorPicker/index.js +58 -33
  78. package/dist/ColorPicker/index.js.map +1 -1
  79. package/dist/Container/index.js +8 -9
  80. package/dist/Container/index.js.map +1 -1
  81. package/dist/DataTable/ActionDisplay.js +8 -9
  82. package/dist/DataTable/ActionDisplay.js.map +1 -1
  83. package/dist/DataTable/BulkActions.js +23 -20
  84. package/dist/DataTable/BulkActions.js.map +1 -1
  85. package/dist/DataTable/CardView.js +46 -43
  86. package/dist/DataTable/CardView.js.map +1 -1
  87. package/dist/DataTable/CollapsibleButtonGroup.js +57 -39
  88. package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
  89. package/dist/DataTable/DataTableContext.js +1 -1
  90. package/dist/DataTable/DataTableContext.js.map +1 -1
  91. package/dist/DataTable/DataTableLayout.js +6 -9
  92. package/dist/DataTable/DataTableLayout.js.map +1 -1
  93. package/dist/DataTable/DataViewToggle.js +25 -20
  94. package/dist/DataTable/DataViewToggle.js.map +1 -1
  95. package/dist/DataTable/DropdownFilters.js +41 -28
  96. package/dist/DataTable/DropdownFilters.js.map +1 -1
  97. package/dist/DataTable/EmptyTable.js +6 -9
  98. package/dist/DataTable/EmptyTable.js.map +1 -1
  99. package/dist/DataTable/ExpandAll.js +2 -4
  100. package/dist/DataTable/ExpandAll.js.map +1 -1
  101. package/dist/DataTable/ExpandRow.js +2 -4
  102. package/dist/DataTable/ExpandRow.js.map +1 -1
  103. package/dist/DataTable/FilterStatus.js +18 -17
  104. package/dist/DataTable/FilterStatus.js.map +1 -1
  105. package/dist/DataTable/RowStatus.js +15 -18
  106. package/dist/DataTable/RowStatus.js.map +1 -1
  107. package/dist/DataTable/SidebarFilters.js +16 -13
  108. package/dist/DataTable/SidebarFilters.js.map +1 -1
  109. package/dist/DataTable/SmartStatus.js +14 -16
  110. package/dist/DataTable/SmartStatus.js.map +1 -1
  111. package/dist/DataTable/Table.js +17 -19
  112. package/dist/DataTable/Table.js.map +1 -1
  113. package/dist/DataTable/TableActions.js +11 -13
  114. package/dist/DataTable/TableActions.js.map +1 -1
  115. package/dist/DataTable/TableCell.js +6 -10
  116. package/dist/DataTable/TableCell.js.map +1 -1
  117. package/dist/DataTable/TableControlBar.js +7 -12
  118. package/dist/DataTable/TableControlBar.js.map +1 -1
  119. package/dist/DataTable/TableFilters.js +14 -12
  120. package/dist/DataTable/TableFilters.js.map +1 -1
  121. package/dist/DataTable/TableFooter.js +5 -8
  122. package/dist/DataTable/TableFooter.js.map +1 -1
  123. package/dist/DataTable/TableHeaderCell.js +11 -15
  124. package/dist/DataTable/TableHeaderCell.js.map +1 -1
  125. package/dist/DataTable/TableHeaderRow.js +6 -4
  126. package/dist/DataTable/TableHeaderRow.js.map +1 -1
  127. package/dist/DataTable/TablePagination.js +8 -7
  128. package/dist/DataTable/TablePagination.js.map +1 -1
  129. package/dist/DataTable/TablePaginationMinimal.js +9 -8
  130. package/dist/DataTable/TablePaginationMinimal.js.map +1 -1
  131. package/dist/DataTable/TableRow.js +15 -18
  132. package/dist/DataTable/TableRow.js.map +1 -1
  133. package/dist/DataTable/_variables.scss +1 -1
  134. package/dist/DataTable/filters/CheckboxFilter.js +23 -22
  135. package/dist/DataTable/filters/CheckboxFilter.js.map +1 -1
  136. package/dist/DataTable/filters/DropdownFilter.js +14 -19
  137. package/dist/DataTable/filters/DropdownFilter.js.map +1 -1
  138. package/dist/DataTable/filters/MultiSelectDropdownFilter.js +19 -20
  139. package/dist/DataTable/filters/MultiSelectDropdownFilter.js.map +1 -1
  140. package/dist/DataTable/filters/TextFilter.js +10 -13
  141. package/dist/DataTable/filters/TextFilter.js.map +1 -1
  142. package/dist/DataTable/hooks.js +29 -25
  143. package/dist/DataTable/hooks.js.map +1 -1
  144. package/dist/DataTable/index.js +120 -104
  145. package/dist/DataTable/index.js.map +1 -1
  146. package/dist/DataTable/selection/BaseSelectionStatus.js +29 -31
  147. package/dist/DataTable/selection/BaseSelectionStatus.js.map +1 -1
  148. package/dist/DataTable/selection/ControlledSelect.js +13 -9
  149. package/dist/DataTable/selection/ControlledSelect.js.map +1 -1
  150. package/dist/DataTable/selection/ControlledSelectHeader.js +19 -15
  151. package/dist/DataTable/selection/ControlledSelectHeader.js.map +1 -1
  152. package/dist/DataTable/selection/ControlledSelectionStatus.js +34 -24
  153. package/dist/DataTable/selection/ControlledSelectionStatus.js.map +1 -1
  154. package/dist/DataTable/selection/SelectionStatus.js +23 -23
  155. package/dist/DataTable/selection/SelectionStatus.js.map +1 -1
  156. package/dist/DataTable/utils/getVisibleColumns.js +36 -44
  157. package/dist/DataTable/utils/getVisibleColumns.js.map +1 -1
  158. package/dist/Dropdown/deprecated/DropdownButton.js +9 -13
  159. package/dist/Dropdown/deprecated/DropdownButton.js.map +1 -1
  160. package/dist/Dropdown/deprecated/DropdownItem.js +7 -8
  161. package/dist/Dropdown/deprecated/DropdownItem.js.map +1 -1
  162. package/dist/Dropdown/deprecated/DropdownMenu.js +8 -12
  163. package/dist/Dropdown/deprecated/DropdownMenu.js.map +1 -1
  164. package/dist/Dropdown/deprecated/index.js +136 -103
  165. package/dist/Dropdown/deprecated/index.js.map +1 -1
  166. package/dist/Dropdown/index.js +32 -29
  167. package/dist/Dropdown/index.js.map +1 -1
  168. package/dist/Dropzone/DefaultContent.js +13 -13
  169. package/dist/Dropzone/DefaultContent.js.map +1 -1
  170. package/dist/Dropzone/DragError.js +1 -3
  171. package/dist/Dropzone/DragError.js.map +1 -1
  172. package/dist/Dropzone/GenericError.js +7 -7
  173. package/dist/Dropzone/GenericError.js.map +1 -1
  174. package/dist/Dropzone/UploadProgress.js +6 -8
  175. package/dist/Dropzone/UploadProgress.js.map +1 -1
  176. package/dist/Dropzone/index.js +145 -86
  177. package/dist/Dropzone/index.js.map +1 -1
  178. package/dist/Fieldset/index.js +82 -57
  179. package/dist/Fieldset/index.js.map +1 -1
  180. package/dist/Form/FormAutosuggest.js +137 -95
  181. package/dist/Form/FormAutosuggest.js.map +1 -1
  182. package/dist/Form/FormAutosuggestOption.js +4 -6
  183. package/dist/Form/FormAutosuggestOption.js.map +1 -1
  184. package/dist/Form/FormCheckbox.js +35 -42
  185. package/dist/Form/FormCheckbox.js.map +1 -1
  186. package/dist/Form/FormCheckboxSet.js +13 -16
  187. package/dist/Form/FormCheckboxSet.js.map +1 -1
  188. package/dist/Form/FormCheckboxSetContext.js +39 -34
  189. package/dist/Form/FormCheckboxSetContext.js.map +1 -1
  190. package/dist/Form/FormControl.js +41 -35
  191. package/dist/Form/FormControl.js.map +1 -1
  192. package/dist/Form/FormControlDecorator.js +3 -5
  193. package/dist/Form/FormControlDecorator.js.map +1 -1
  194. package/dist/Form/FormControlDecoratorGroup.js +8 -10
  195. package/dist/Form/FormControlDecoratorGroup.js.map +1 -1
  196. package/dist/Form/FormControlFeedback.js +12 -15
  197. package/dist/Form/FormControlFeedback.js.map +1 -1
  198. package/dist/Form/FormControlFloatingLabel.js +3 -6
  199. package/dist/Form/FormControlFloatingLabel.js.map +1 -1
  200. package/dist/Form/FormControlSet.js +8 -9
  201. package/dist/Form/FormControlSet.js.map +1 -1
  202. package/dist/Form/FormGroup.js +11 -12
  203. package/dist/Form/FormGroup.js.map +1 -1
  204. package/dist/Form/FormGroupContext.js +64 -39
  205. package/dist/Form/FormGroupContext.js.map +1 -1
  206. package/dist/Form/FormLabel.js +15 -17
  207. package/dist/Form/FormLabel.js.map +1 -1
  208. package/dist/Form/FormRadio.js +19 -22
  209. package/dist/Form/FormRadio.js.map +1 -1
  210. package/dist/Form/FormRadioSet.js +13 -16
  211. package/dist/Form/FormRadioSet.js.map +1 -1
  212. package/dist/Form/FormRadioSetContext.js +39 -34
  213. package/dist/Form/FormRadioSetContext.js.map +1 -1
  214. package/dist/Form/FormSwitch.js +16 -20
  215. package/dist/Form/FormSwitch.js.map +1 -1
  216. package/dist/Form/FormText.js +20 -29
  217. package/dist/Form/FormText.js.map +1 -1
  218. package/dist/Form/useCheckboxSetValues.js +46 -23
  219. package/dist/Form/useCheckboxSetValues.js.map +1 -1
  220. package/dist/Hyperlink/index.js +25 -25
  221. package/dist/Hyperlink/index.js.map +1 -1
  222. package/dist/Hyperlink/index.scss +2 -2
  223. package/dist/Icon/index.js +21 -20
  224. package/dist/Icon/index.js.map +1 -1
  225. package/dist/IconButton/index.js +30 -32
  226. package/dist/IconButton/index.js.map +1 -1
  227. package/dist/IconButtonToggle/index.js +16 -16
  228. package/dist/IconButtonToggle/index.js.map +1 -1
  229. package/dist/Input/index.js +122 -92
  230. package/dist/Input/index.js.map +1 -1
  231. package/dist/InputSelect/index.js +78 -51
  232. package/dist/InputSelect/index.js.map +1 -1
  233. package/dist/InputText/index.js +11 -9
  234. package/dist/InputText/index.js.map +1 -1
  235. package/dist/Layout/index.js +33 -29
  236. package/dist/Layout/index.js.map +1 -1
  237. package/dist/ListBox/index.js +112 -80
  238. package/dist/ListBox/index.js.map +1 -1
  239. package/dist/ListBoxOption/index.js +68 -45
  240. package/dist/ListBoxOption/index.js.map +1 -1
  241. package/dist/MailtoLink/index.js +37 -34
  242. package/dist/MailtoLink/index.js.map +1 -1
  243. package/dist/Menu/MenuItem.js +13 -14
  244. package/dist/Menu/MenuItem.js.map +1 -1
  245. package/dist/Menu/SelectMenu.js +68 -44
  246. package/dist/Menu/SelectMenu.js.map +1 -1
  247. package/dist/Menu/index.js +10 -11
  248. package/dist/Menu/index.js.map +1 -1
  249. package/dist/Modal/AlertModal.js +5 -7
  250. package/dist/Modal/AlertModal.js.map +1 -1
  251. package/dist/Modal/FullscreenModal.js +6 -8
  252. package/dist/Modal/FullscreenModal.js.map +1 -1
  253. package/dist/Modal/MarketingModal.js +8 -10
  254. package/dist/Modal/MarketingModal.js.map +1 -1
  255. package/dist/Modal/ModalCloseButton.js +13 -15
  256. package/dist/Modal/ModalCloseButton.js.map +1 -1
  257. package/dist/Modal/ModalContext.js +13 -13
  258. package/dist/Modal/ModalContext.js.map +1 -1
  259. package/dist/Modal/ModalDialog.js +22 -23
  260. package/dist/Modal/ModalDialog.js.map +1 -1
  261. package/dist/Modal/ModalDialogBody.js +22 -11
  262. package/dist/Modal/ModalDialogBody.js.map +1 -1
  263. package/dist/Modal/ModalDialogFooter.js +6 -7
  264. package/dist/Modal/ModalDialogFooter.js.map +1 -1
  265. package/dist/Modal/ModalDialogHeader.js +6 -7
  266. package/dist/Modal/ModalDialogHeader.js.map +1 -1
  267. package/dist/Modal/ModalDialogHero.js +6 -7
  268. package/dist/Modal/ModalDialogHero.js.map +1 -1
  269. package/dist/Modal/ModalDialogHeroBackground.js +8 -9
  270. package/dist/Modal/ModalDialogHeroBackground.js.map +1 -1
  271. package/dist/Modal/ModalDialogHeroContent.js +6 -7
  272. package/dist/Modal/ModalDialogHeroContent.js.map +1 -1
  273. package/dist/Modal/ModalDialogTitle.js +6 -7
  274. package/dist/Modal/ModalDialogTitle.js.map +1 -1
  275. package/dist/Modal/ModalLayer.js +11 -17
  276. package/dist/Modal/ModalLayer.js.map +1 -1
  277. package/dist/Modal/ModalPopup.js +17 -17
  278. package/dist/Modal/ModalPopup.js.map +1 -1
  279. package/dist/Modal/PopperElement.js +25 -18
  280. package/dist/Modal/PopperElement.js.map +1 -1
  281. package/dist/Modal/Portal.js +40 -18
  282. package/dist/Modal/Portal.js.map +1 -1
  283. package/dist/Modal/StandardModal.js +6 -8
  284. package/dist/Modal/StandardModal.js.map +1 -1
  285. package/dist/Modal/index.js +215 -187
  286. package/dist/Modal/index.js.map +1 -1
  287. package/dist/Nav/index.js +3 -2
  288. package/dist/Nav/index.js.map +1 -1
  289. package/dist/Navbar/index.js +7 -6
  290. package/dist/Navbar/index.js.map +1 -1
  291. package/dist/OverflowScroll/OverflowScroll.js +45 -37
  292. package/dist/OverflowScroll/OverflowScroll.js.map +1 -1
  293. package/dist/OverflowScroll/OverflowScrollContext.js +1 -1
  294. package/dist/OverflowScroll/OverflowScrollContext.js.map +1 -1
  295. package/dist/OverflowScroll/OverflowScrollItems.js +2 -4
  296. package/dist/OverflowScroll/OverflowScrollItems.js.map +1 -1
  297. package/dist/Overlay/index.js +4 -4
  298. package/dist/Overlay/index.js.map +1 -1
  299. package/dist/PageBanner/index.js +11 -13
  300. package/dist/PageBanner/index.js.map +1 -1
  301. package/dist/Pagination/index.js +331 -296
  302. package/dist/Pagination/index.js.map +1 -1
  303. package/dist/Pagination/index.scss +1 -0
  304. package/dist/Popover/index.js +11 -14
  305. package/dist/Popover/index.js.map +1 -1
  306. package/dist/ProductTour/Checkpoint.js +29 -22
  307. package/dist/ProductTour/Checkpoint.js.map +1 -1
  308. package/dist/ProductTour/CheckpointActionRow.js +18 -16
  309. package/dist/ProductTour/CheckpointActionRow.js.map +1 -1
  310. package/dist/ProductTour/CheckpointBody.js +2 -4
  311. package/dist/ProductTour/CheckpointBody.js.map +1 -1
  312. package/dist/ProductTour/CheckpointBreadcrumbs.js +16 -16
  313. package/dist/ProductTour/CheckpointBreadcrumbs.js.map +1 -1
  314. package/dist/ProductTour/CheckpointTitle.js +2 -4
  315. package/dist/ProductTour/CheckpointTitle.js.map +1 -1
  316. package/dist/ProductTour/index.js +66 -47
  317. package/dist/ProductTour/index.js.map +1 -1
  318. package/dist/ProgressBar/index.js +37 -35
  319. package/dist/ProgressBar/index.js.map +1 -1
  320. package/dist/RadioButtonGroup/index.js +133 -102
  321. package/dist/RadioButtonGroup/index.js.map +1 -1
  322. package/dist/Scrollable/index.js +30 -15
  323. package/dist/Scrollable/index.js.map +1 -1
  324. package/dist/SearchField/SearchFieldAdvanced.js +54 -44
  325. package/dist/SearchField/SearchFieldAdvanced.js.map +1 -1
  326. package/dist/SearchField/SearchFieldClearButton.js +7 -8
  327. package/dist/SearchField/SearchFieldClearButton.js.map +1 -1
  328. package/dist/SearchField/SearchFieldInput.js +8 -9
  329. package/dist/SearchField/SearchFieldInput.js.map +1 -1
  330. package/dist/SearchField/SearchFieldLabel.js +5 -8
  331. package/dist/SearchField/SearchFieldLabel.js.map +1 -1
  332. package/dist/SearchField/SearchFieldSubmitButton.js +12 -15
  333. package/dist/SearchField/SearchFieldSubmitButton.js.map +1 -1
  334. package/dist/SearchField/index.js +22 -22
  335. package/dist/SearchField/index.js.map +1 -1
  336. package/dist/SelectableBox/SelectableBoxSet.js +25 -26
  337. package/dist/SelectableBox/SelectableBoxSet.js.map +1 -1
  338. package/dist/SelectableBox/index.js +42 -38
  339. package/dist/SelectableBox/index.js.map +1 -1
  340. package/dist/Sheet/SheetContainer.js +38 -16
  341. package/dist/Sheet/SheetContainer.js.map +1 -1
  342. package/dist/Sheet/index.js +65 -43
  343. package/dist/Sheet/index.js.map +1 -1
  344. package/dist/Spinner/index.js +8 -9
  345. package/dist/Spinner/index.js.map +1 -1
  346. package/dist/Stack/index.js +9 -11
  347. package/dist/Stack/index.js.map +1 -1
  348. package/dist/StatefulButton/index.js +15 -17
  349. package/dist/StatefulButton/index.js.map +1 -1
  350. package/dist/StatusAlert/index.js +120 -82
  351. package/dist/StatusAlert/index.js.map +1 -1
  352. package/dist/Stepper/Stepper.js +2 -4
  353. package/dist/Stepper/Stepper.js.map +1 -1
  354. package/dist/Stepper/StepperActionRow.js +7 -10
  355. package/dist/Stepper/StepperActionRow.js.map +1 -1
  356. package/dist/Stepper/StepperContext.js +64 -32
  357. package/dist/Stepper/StepperContext.js.map +1 -1
  358. package/dist/Stepper/StepperHeader.js +23 -30
  359. package/dist/Stepper/StepperHeader.js.map +1 -1
  360. package/dist/Stepper/StepperHeaderStep.js +14 -17
  361. package/dist/Stepper/StepperHeaderStep.js.map +1 -1
  362. package/dist/Stepper/StepperStep.js +23 -24
  363. package/dist/Stepper/StepperStep.js.map +1 -1
  364. package/dist/Sticky/index.js +30 -22
  365. package/dist/Sticky/index.js.map +1 -1
  366. package/dist/Table/index.js +178 -109
  367. package/dist/Table/index.js.map +1 -1
  368. package/dist/Tabs/deprecated/index.js +99 -66
  369. package/dist/Tabs/deprecated/index.js.map +1 -1
  370. package/dist/Tabs/index.js +65 -49
  371. package/dist/Tabs/index.js.map +1 -1
  372. package/dist/TextArea/index.js +10 -8
  373. package/dist/TextArea/index.js.map +1 -1
  374. package/dist/Toast/ToastContainer.js +38 -16
  375. package/dist/Toast/ToastContainer.js.map +1 -1
  376. package/dist/Toast/index.js +33 -18
  377. package/dist/Toast/index.js.map +1 -1
  378. package/dist/Tooltip/index.js +8 -9
  379. package/dist/Tooltip/index.js.map +1 -1
  380. package/dist/TransitionReplace/DemoTransitionReplace.js +12 -3
  381. package/dist/TransitionReplace/DemoTransitionReplace.js.map +1 -1
  382. package/dist/TransitionReplace/index.js +136 -100
  383. package/dist/TransitionReplace/index.js.map +1 -1
  384. package/dist/Truncate/index.js +30 -24
  385. package/dist/Truncate/index.js.map +1 -1
  386. package/dist/ValidationFormGroup/index.js +38 -37
  387. package/dist/ValidationFormGroup/index.js.map +1 -1
  388. package/dist/ValidationMessage/index.js +76 -51
  389. package/dist/ValidationMessage/index.js.map +1 -1
  390. package/dist/asInput/index.js +251 -202
  391. package/dist/asInput/index.js.map +1 -1
  392. package/dist/hooks/useArrowKeyNavigation.js +46 -43
  393. package/dist/hooks/useArrowKeyNavigation.js.map +1 -1
  394. package/dist/hooks/useIndexOfLastVisibleChild.js +40 -26
  395. package/dist/hooks/useIndexOfLastVisibleChild.js.map +1 -1
  396. package/dist/hooks/useIsVisible.js +20 -13
  397. package/dist/hooks/useIsVisible.js.map +1 -1
  398. package/dist/hooks/useToggle.js +18 -11
  399. package/dist/hooks/useToggle.js.map +1 -1
  400. package/dist/hooks/useWindowSize.js +17 -6
  401. package/dist/hooks/useWindowSize.js.map +1 -1
  402. package/dist/paragon.css +1 -1
  403. package/dist/withDeprecatedProps.js +79 -58
  404. package/dist/withDeprecatedProps.js.map +1 -1
  405. package/package.json +1 -5
  406. package/src/Button/index.jsx +2 -2
  407. package/src/DataTable/_variables.scss +1 -1
  408. package/src/Dropzone/index.jsx +1 -1
  409. package/src/Hyperlink/index.scss +2 -2
  410. package/src/Icon/index.jsx +1 -1
  411. package/src/IconButton/__snapshots__/IconButton.test.jsx.snap +12 -10
  412. package/src/IconButton/index.jsx +1 -1
  413. package/src/Menu/MenuItem.jsx +2 -2
  414. package/src/Overlay/README.md +1 -1
  415. package/src/Overlay/index.jsx +1 -1
  416. package/src/Pagination/index.scss +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","classNames","PropTypes","newId","Tabs","Component","constructor","props","toggle","bind","state","activeTab","uuid","tab","setState","genLabelId","index","genPanelId","buildLabels","labels","map","label","i","selected","labelId","createElement","key","role","id","onClick","className","active","buildPanels","children","panel","panelId","render","panels","propTypes","arrayOf","node","isRequired","element"],"sources":["../../../src/Tabs/deprecated/index.jsx"],"sourcesContent":["// TODO: @jaebradley fix these eslint errors\n/* eslint-disable jsx-a11y/click-events-have-key-events */\n/* eslint-disable jsx-a11y/anchor-is-valid */\n/* eslint-disable max-len */\nimport React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\n\nimport newId from '../../utils/newId';\n\nclass Tabs extends React.Component {\n constructor(props) {\n super(props);\n\n this.toggle = this.toggle.bind(this);\n this.state = {\n activeTab: 0,\n uuid: newId('tabInterface'),\n };\n }\n\n toggle(tab) {\n if (this.state.activeTab !== tab) {\n this.setState({\n activeTab: tab,\n });\n }\n }\n\n genLabelId(index) {\n return `tab-label-${this.state.uuid}-${index}`;\n }\n\n genPanelId(index) {\n return `tab-panel-${this.state.uuid}-${index}`;\n }\n\n buildLabels() {\n return this.props.labels.map((label, i) => {\n const selected = this.state.activeTab === i;\n const labelId = this.genLabelId(i);\n\n return (\n <li key={labelId}>\n {/* eslint-disable-next-line react/button-has-type */}\n <button\n role=\"tab\"\n aria-selected={selected}\n aria-controls={this.genPanelId(i)}\n id={labelId}\n onClick={() => { this.toggle(i); }}\n className={classNames('nav-link nav-item', {\n active: selected,\n })}\n >\n {label}\n </button>\n </li>\n );\n });\n }\n\n buildPanels() {\n return this.props.children.map((panel, i) => {\n const selected = this.state.activeTab === i;\n const panelId = this.genPanelId(i);\n\n return (\n <div\n aria-hidden={!selected}\n aria-labelledby={this.genLabelId(i)}\n className={classNames(\n 'tab-pane',\n { active: selected },\n )}\n id={panelId}\n key={panelId}\n role=\"tabpanel\"\n >\n {panel}\n </div>\n );\n });\n }\n\n render() {\n const labels = this.buildLabels();\n const panels = this.buildPanels();\n\n return (\n <div className=\"tabs\">\n <ul\n role=\"tablist\"\n className={classNames([\n 'nav',\n 'nav-tabs',\n ])}\n >\n {labels}\n </ul>\n <div role=\"tabpanel\" className=\"tab-content\">\n {panels}\n </div>\n </div>\n );\n }\n}\n// TODO: custom validator that ensures labels and panels are the same length\nTabs.propTypes = {\n /** specifies the list of elements that will be displayed within each of the tabbed views. It is the content relevant to each label. Children should not be passed as Props, but should instead be nested between the opening and closing `<Tabs> </Tabs>` tags. */\n labels: PropTypes.arrayOf(PropTypes.node).isRequired,\n /** specifies the list of headings that will appear on all of the tabs that will be created.\n */\n children: PropTypes.arrayOf(PropTypes.element).isRequired,\n};\n\nexport default Tabs;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,KAAK,MAAM,mBAAmB;AAErC,MAAMC,IAAI,SAASJ,KAAK,CAACK,SAAS,CAAC;EACjCC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZ,IAAI,CAACC,MAAM,GAAG,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC,IAAI,CAAC;IACpC,IAAI,CAACC,KAAK,GAAG;MACXC,SAAS,EAAE,CAAC;MACZC,IAAI,EAAET,KAAK,CAAC,cAAc;IAC5B,CAAC;EACH;EAEAK,MAAMA,CAACK,GAAG,EAAE;IACV,IAAI,IAAI,CAACH,KAAK,CAACC,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ClB,UAAU,CAACK,CAAC,CAAC;MAElC,oBACEtB,KAAA,CAAAyB,aAAA;QACE,eAAa,CAACF,QAAS;QACvB,mBAAiB,IAAI,CAACR,UAAU,CAACO,CAAC,CAAE;QACpCQ,SAAS,EAAE7B,UAAU,CACnB,UAAU,EACV;UAAE8B,MAAM,EAAER;QAAS,CACrB,CAAE;QACFK,EAAE,EAAEO,OAAQ;QACZT,GAAG,EAAES,OAAQ;QACbR,IAAI,EAAC;MAAU,GAEdO,KACE,CAAC;IAEV,CAAC,CAAC;EACJ;EAEAE,MAAMA,CAAA,EAAG;IACP,MAAMjB,MAAM,GAAG,IAAI,CAACD,WAAW,CAAC,CAAC;IACjC,MAAMmB,MAAM,GAAG,IAAI,CAACL,WAAW,CAAC,CAAC;IAEjC,oBACEhC,KAAA,CAAAyB,aAAA;MAAKK,SAAS,EAAC;IAAM,gBACnB9B,KAAA,CAAAyB,aAAA;MACEE,IAAI,EAAC,SAAS;MACdG,SAAS,EAAE7B,UAAU,CAAC,CACpB,KAAK,EACL,UAAU,CACX;IAAE,GAEFkB,MACC,CAAC,eACLnB,KAAA,CAAAyB,aAAA;MAAKE,IAAI,EAAC,UAAU;MAACG,SAAS,EAAC;IAAa,GACzCO,MACE,CACF,CAAC;EAEV;AACF;AACA;AACAjC,IAAI,CAACkC,SAAS,GAAG;EACf;EACAnB,MAAM,EAAEjB,SAAS,CAACqC,OAAO,CAACrC,SAAS,CAACsC,IAAI,CAAC,CAACC,UAAU;EACpD;AACF;EACER,QAAQ,EAAE/B,SAAS,CAACqC,OAAO,CAACrC,SAAS,CAACwC,OAAO,CAAC,CAACD;AACjD,CAAC;AAED,eAAerC,IAAI"}
1
+ {"version":3,"file":"index.js","names":["React","classNames","PropTypes","newId","Tabs","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","toggle","bind","_assertThisInitialized","state","activeTab","uuid","_createClass","key","value","tab","setState","genLabelId","index","concat","genPanelId","buildLabels","_this2","labels","map","label","i","selected","labelId","createElement","role","id","onClick","className","active","buildPanels","_this3","children","panel","panelId","render","panels","Component","propTypes","arrayOf","node","isRequired","element"],"sources":["../../../src/Tabs/deprecated/index.jsx"],"sourcesContent":["// TODO: @jaebradley fix these eslint errors\n/* eslint-disable jsx-a11y/click-events-have-key-events */\n/* eslint-disable jsx-a11y/anchor-is-valid */\n/* eslint-disable max-len */\nimport React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\n\nimport newId from '../../utils/newId';\n\nclass Tabs extends React.Component {\n constructor(props) {\n super(props);\n\n this.toggle = this.toggle.bind(this);\n this.state = {\n activeTab: 0,\n uuid: newId('tabInterface'),\n };\n }\n\n toggle(tab) {\n if (this.state.activeTab !== tab) {\n this.setState({\n activeTab: tab,\n });\n }\n }\n\n genLabelId(index) {\n return `tab-label-${this.state.uuid}-${index}`;\n }\n\n genPanelId(index) {\n return `tab-panel-${this.state.uuid}-${index}`;\n }\n\n buildLabels() {\n return this.props.labels.map((label, i) => {\n const selected = this.state.activeTab === i;\n const labelId = this.genLabelId(i);\n\n return (\n <li key={labelId}>\n {/* eslint-disable-next-line react/button-has-type */}\n <button\n role=\"tab\"\n aria-selected={selected}\n aria-controls={this.genPanelId(i)}\n id={labelId}\n onClick={() => { this.toggle(i); }}\n className={classNames('nav-link nav-item', {\n active: selected,\n })}\n >\n {label}\n </button>\n </li>\n );\n });\n }\n\n buildPanels() {\n return this.props.children.map((panel, i) => {\n const selected = this.state.activeTab === i;\n const panelId = this.genPanelId(i);\n\n return (\n <div\n aria-hidden={!selected}\n aria-labelledby={this.genLabelId(i)}\n className={classNames(\n 'tab-pane',\n { active: selected },\n )}\n id={panelId}\n key={panelId}\n role=\"tabpanel\"\n >\n {panel}\n </div>\n );\n });\n }\n\n render() {\n const labels = this.buildLabels();\n const panels = this.buildPanels();\n\n return (\n <div className=\"tabs\">\n <ul\n role=\"tablist\"\n className={classNames([\n 'nav',\n 'nav-tabs',\n ])}\n >\n {labels}\n </ul>\n <div role=\"tabpanel\" className=\"tab-content\">\n {panels}\n </div>\n </div>\n );\n }\n}\n// TODO: custom validator that ensures labels and panels are the same length\nTabs.propTypes = {\n /** specifies the list of elements that will be displayed within each of the tabbed views. It is the content relevant to each label. Children should not be passed as Props, but should instead be nested between the opening and closing `<Tabs> </Tabs>` tags. */\n labels: PropTypes.arrayOf(PropTypes.node).isRequired,\n /** specifies the list of headings that will appear on all of the tabs that will be created.\n */\n children: PropTypes.arrayOf(PropTypes.element).isRequired,\n};\n\nexport default Tabs;\n"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,KAAK,MAAM,mBAAmB;AAAC,IAEhCC,IAAI,0BAAAC,gBAAA;EAAAC,SAAA,CAAAF,IAAA,EAAAC,gBAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,IAAA;EACR,SAAAA,KAAYK,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAP,IAAA;IACjBM,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IAEXC,KAAA,CAAKG,MAAM,GAAGH,KAAA,CAAKG,MAAM,CAACC,IAAI,CAAAC,sBAAA,CAAAL,KAAA,CAAK,CAAC;IACpCA,KAAA,CAAKM,KAAK,GAAG;MACXC,SAAS,EAAE,CAAC;MACZC,IAAI,EAAEf,KAAK,CAAC,cAAc;IAC5B,CAAC;IAAC,OAAAO,KAAA;EACJ;EAACS,YAAA,CAAAf,IAAA;IAAAgB,GAAA;IAAAC,KAAA,EAED,SAAAR,OAAOS,GAAG,EAAE;MACV,IAAI,IAAI,CAACN,KAAK,CAACC,SAAS,KAAKK,GAAG,EAAE;QAChC,IAAI,CAACC,QAAQ,CAAC;UACZN,SAAS,EAAEK;QACb,CAAC,CAAC;MACJ;IACF;EAAC;IAAAF,GAAA;IAAAC,KAAA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 +1,18 @@
1
- const _excluded = ["children", "className", "moreTabText", "defaultActiveKey", "activeKey"],
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _excluded = ["children", "className", "moreTabText", "defaultActiveKey", "activeKey"],
2
3
  _excluded2 = ["title", "notification", "tabClassName"];
3
4
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
7
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
8
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
15
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
16
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
17
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
18
  import React, { useEffect, useMemo, useRef, useState, useCallback } from 'react';
@@ -17,33 +24,36 @@ import Bubble from '../Bubble';
17
24
  import Dropdown from '../Dropdown';
18
25
  import useIndexOfLastVisibleChild from '../hooks/useIndexOfLastVisibleChild';
19
26
  import Tab from './Tab';
20
- export const MORE_TAB_TEXT = 'More...';
27
+ export var MORE_TAB_TEXT = 'More...';
21
28
  function Tabs(_ref) {
22
- let {
23
- children,
24
- className,
25
- moreTabText = MORE_TAB_TEXT,
26
- defaultActiveKey,
27
- activeKey
28
- } = _ref,
29
+ var _overflowElementRef$c, _overflowElementRef$c3;
30
+ var children = _ref.children,
31
+ className = _ref.className,
32
+ _ref$moreTabText = _ref.moreTabText,
33
+ moreTabText = _ref$moreTabText === void 0 ? MORE_TAB_TEXT : _ref$moreTabText,
34
+ defaultActiveKey = _ref.defaultActiveKey,
35
+ activeKey = _ref.activeKey,
29
36
  props = _objectWithoutProperties(_ref, _excluded);
30
- const [containerElementRef, setContainerElementRef] = useState(null);
31
- const overflowElementRef = useRef(null);
32
- const indexOfLastVisibleChild = useIndexOfLastVisibleChild(containerElementRef?.firstChild, overflowElementRef.current?.parentNode);
33
- useEffect(() => {
37
+ var _useState = useState(null),
38
+ _useState2 = _slicedToArray(_useState, 2),
39
+ containerElementRef = _useState2[0],
40
+ setContainerElementRef = _useState2[1];
41
+ var overflowElementRef = useRef(null);
42
+ var indexOfLastVisibleChild = useIndexOfLastVisibleChild(containerElementRef === null || containerElementRef === void 0 ? void 0 : containerElementRef.firstChild, (_overflowElementRef$c = overflowElementRef.current) === null || _overflowElementRef$c === void 0 ? void 0 : _overflowElementRef$c.parentNode);
43
+ useEffect(function () {
34
44
  if (containerElementRef) {
35
- const observer = new MutationObserver(mutations => {
36
- mutations.forEach(mutation => {
45
+ var observer = new MutationObserver(function (mutations) {
46
+ mutations.forEach(function (mutation) {
37
47
  // React-Bootstrap attribute 'data-rb-event-key' is responsible for the tab identification
38
- const eventKey = mutation.target.getAttribute('data-rb-event-key');
48
+ var eventKey = mutation.target.getAttribute('data-rb-event-key');
39
49
  // React-Bootstrap attribute 'aria-selected' is responsible for selected/unselected state
40
- const isActive = mutation.target.getAttribute('aria-selected') === 'true';
50
+ var isActive = mutation.target.getAttribute('aria-selected') === 'true';
41
51
  // datakey attribute is added manually to the dropdown
42
52
  // elements so that they correspond to the native tabs' eventKey
43
- const element = containerElementRef.querySelector(`[datakey='${eventKey}']`);
44
- const moreTab = containerElementRef.querySelector('.pgn__tab_more');
53
+ var element = containerElementRef.querySelector("[datakey='".concat(eventKey, "']"));
54
+ var moreTab = containerElementRef.querySelector('.pgn__tab_more');
45
55
  if (isActive) {
46
- element?.classList.add('active');
56
+ element === null || element === void 0 ? void 0 : element.classList.add('active');
47
57
  // Here we add active class to the 'More Tab' if element exists in the dropdown
48
58
  if (element) {
49
59
  moreTab.classList.add('active');
@@ -51,7 +61,7 @@ function Tabs(_ref) {
51
61
  moreTab.classList.remove('active');
52
62
  }
53
63
  } else {
54
- element?.classList.remove('active');
64
+ element === null || element === void 0 ? void 0 : element.classList.remove('active');
55
65
  }
56
66
  });
57
67
  });
@@ -60,42 +70,44 @@ function Tabs(_ref) {
60
70
  subtree: true,
61
71
  attributeFilter: ['aria-selected']
62
72
  });
63
- return () => observer.disconnect();
73
+ return function () {
74
+ return observer.disconnect();
75
+ };
64
76
  }
65
77
  return undefined;
66
78
  }, [containerElementRef]);
67
- useEffect(() => {
68
- if (overflowElementRef.current?.parentNode) {
79
+ useEffect(function () {
80
+ var _overflowElementRef$c2;
81
+ if ((_overflowElementRef$c2 = overflowElementRef.current) !== null && _overflowElementRef$c2 !== void 0 && _overflowElementRef$c2.parentNode) {
69
82
  overflowElementRef.current.parentNode.tabIndex = -1;
70
83
  }
71
- }, [overflowElementRef.current?.parentNode]);
72
- const handleDropdownTabClick = useCallback(eventKey => {
73
- const hiddenTab = containerElementRef.querySelector(`[data-rb-event-key='${eventKey}']`);
84
+ }, [(_overflowElementRef$c3 = overflowElementRef.current) === null || _overflowElementRef$c3 === void 0 ? void 0 : _overflowElementRef$c3.parentNode]);
85
+ var handleDropdownTabClick = useCallback(function (eventKey) {
86
+ var hiddenTab = containerElementRef.querySelector("[data-rb-event-key='".concat(eventKey, "']"));
74
87
  hiddenTab.click();
75
88
  }, [containerElementRef]);
76
- const tabsChildren = useMemo(() => {
77
- const indexOfOverflowStart = indexOfLastVisibleChild + 1;
78
- const handleDropdownKeyPress = (e, eventKey) => {
89
+ var tabsChildren = useMemo(function () {
90
+ var indexOfOverflowStart = indexOfLastVisibleChild + 1;
91
+ var handleDropdownKeyPress = function handleDropdownKeyPress(e, eventKey) {
79
92
  if (e.key === 'Enter') {
80
93
  handleDropdownTabClick(eventKey);
81
94
  }
82
95
  };
83
- const childrenList = React.Children.map(children, (child, index) => {
84
- if (child?.type?.name !== 'Tab' && process.env.NODE_ENV === 'development') {
96
+ var childrenList = React.Children.map(children, function (child, index) {
97
+ var _child$type;
98
+ if ((child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name) !== 'Tab' && process.env.NODE_ENV === 'development') {
85
99
  // eslint-disable-next-line no-console
86
- console.error(`Tabs children can only be of type Tab. ${children[index]} was passed instead.`);
100
+ console.error("Tabs children can only be of type Tab. ".concat(children[index], " was passed instead."));
87
101
  }
88
102
  if (! /*#__PURE__*/React.isValidElement(child)) {
89
103
  return child;
90
104
  }
91
- const _child$props = child.props,
92
- {
93
- title,
94
- notification,
95
- tabClassName
96
- } = _child$props,
105
+ var _child$props = child.props,
106
+ title = _child$props.title,
107
+ notification = _child$props.notification,
108
+ tabClassName = _child$props.tabClassName,
97
109
  rest = _objectWithoutProperties(_child$props, _excluded2);
98
- let newTitle;
110
+ var newTitle;
99
111
  if (notification) {
100
112
  newTitle = /*#__PURE__*/React.createElement(React.Fragment, null, title, /*#__PURE__*/React.createElement(Bubble, {
101
113
  variant: "error",
@@ -107,24 +119,28 @@ function Tabs(_ref) {
107
119
  } else {
108
120
  newTitle = title;
109
121
  }
110
- const tabClass = index > indexOfLastVisibleChild ? 'pgn__tab_invisible' : '';
111
- const modifiedTab = /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, rest), {}, {
122
+ var tabClass = index > indexOfLastVisibleChild ? 'pgn__tab_invisible' : '';
123
+ var modifiedTab = /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, rest), {}, {
112
124
  title: newTitle,
113
125
  tabClassName: classNames(tabClass, tabClassName)
114
126
  }));
115
127
  return modifiedTab;
116
128
  });
117
- let moreTabHasNotification = false;
118
- const overflowChildren = childrenList.slice(indexOfOverflowStart).map(overflowChild => {
129
+ var moreTabHasNotification = false;
130
+ var overflowChildren = childrenList.slice(indexOfOverflowStart).map(function (overflowChild) {
119
131
  if (!moreTabHasNotification && overflowChild.props.notification) {
120
132
  moreTabHasNotification = true;
121
133
  }
122
134
  return /*#__PURE__*/React.createElement(Dropdown.Item, {
123
135
  as: "li",
124
136
  tabIndex: "0",
125
- key: `${overflowChild.props.eventKey}overflow`,
126
- onClick: () => handleDropdownTabClick(overflowChild.props.eventKey),
127
- onKeyPress: e => handleDropdownKeyPress(e, overflowChild.props.eventKey),
137
+ key: "".concat(overflowChild.props.eventKey, "overflow"),
138
+ onClick: function onClick() {
139
+ return handleDropdownTabClick(overflowChild.props.eventKey);
140
+ },
141
+ onKeyPress: function onKeyPress(e) {
142
+ return handleDropdownKeyPress(e, overflowChild.props.eventKey);
143
+ },
128
144
  disabled: overflowChild.props.disabled,
129
145
  datakey: overflowChild.props.eventKey,
130
146
  className: classNames({
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useEffect","useMemo","useRef","useState","useCallback","classNames","PropTypes","BaseTabs","TabsDeprecated","Bubble","Dropdown","useIndexOfLastVisibleChild","Tab","MORE_TAB_TEXT","Tabs","_ref","children","className","moreTabText","defaultActiveKey","activeKey","props","_objectWithoutProperties","_excluded","containerElementRef","setContainerElementRef","overflowElementRef","indexOfLastVisibleChild","firstChild","current","parentNode","observer","MutationObserver","mutations","forEach","mutation","eventKey","target","getAttribute","isActive","element","querySelector","moreTab","classList","add","remove","observe","attributes","subtree","attributeFilter","disconnect","undefined","tabIndex","handleDropdownTabClick","hiddenTab","click","tabsChildren","indexOfOverflowStart","handleDropdownKeyPress","e","key","childrenList","Children","map","child","index","type","name","process","env","NODE_ENV","console","error","isValidElement","_child$props","title","notification","tabClassName","rest","_excluded2","newTitle","createElement","Fragment","variant","role","expandable","tabClass","modifiedTab","cloneElement","_objectSpread","moreTabHasNotification","overflowChildren","slice","overflowChild","Item","as","onClick","onKeyPress","disabled","datakey","active","splice","length","ref","Toggle","id","Menu","_extends","propTypes","oneOf","node","isRequired","string","defaultProps","Deprecated","default","TabContainer","TabContent","TabPane"],"sources":["../../src/Tabs/index.jsx"],"sourcesContent":["import React, {\n useEffect,\n useMemo,\n useRef,\n useState,\n useCallback,\n} from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport BaseTabs from 'react-bootstrap/Tabs';\nimport TabsDeprecated from './deprecated';\nimport Bubble from '../Bubble';\nimport Dropdown from '../Dropdown';\nimport useIndexOfLastVisibleChild from '../hooks/useIndexOfLastVisibleChild';\nimport Tab from './Tab';\n\nexport const MORE_TAB_TEXT = 'More...';\n\nfunction Tabs({\n children,\n className,\n moreTabText = MORE_TAB_TEXT,\n defaultActiveKey,\n activeKey,\n ...props\n}) {\n const [containerElementRef, setContainerElementRef] = useState(null);\n const overflowElementRef = useRef(null);\n const indexOfLastVisibleChild = useIndexOfLastVisibleChild(\n containerElementRef?.firstChild,\n overflowElementRef.current?.parentNode,\n );\n\n useEffect(() => {\n if (containerElementRef) {\n const observer = new MutationObserver((mutations => {\n mutations.forEach(mutation => {\n // React-Bootstrap attribute 'data-rb-event-key' is responsible for the tab identification\n const eventKey = mutation.target.getAttribute('data-rb-event-key');\n // React-Bootstrap attribute 'aria-selected' is responsible for selected/unselected state\n const isActive = mutation.target.getAttribute('aria-selected') === 'true';\n // datakey attribute is added manually to the dropdown\n // elements so that they correspond to the native tabs' eventKey\n const element = containerElementRef.querySelector(`[datakey='${eventKey}']`);\n const moreTab = containerElementRef.querySelector('.pgn__tab_more');\n if (isActive) {\n element?.classList.add('active');\n // Here we add active class to the 'More Tab' if element exists in the dropdown\n if (element) {\n moreTab.classList.add('active');\n } else {\n moreTab.classList.remove('active');\n }\n } else {\n element?.classList.remove('active');\n }\n });\n }));\n observer.observe(containerElementRef, {\n attributes: true, subtree: true, attributeFilter: ['aria-selected'],\n });\n return () => observer.disconnect();\n }\n return undefined;\n }, [containerElementRef]);\n\n useEffect(() => {\n if (overflowElementRef.current?.parentNode) {\n overflowElementRef.current.parentNode.tabIndex = -1;\n }\n }, [overflowElementRef.current?.parentNode]);\n\n const handleDropdownTabClick = useCallback((eventKey) => {\n const hiddenTab = containerElementRef.querySelector(`[data-rb-event-key='${eventKey}']`);\n hiddenTab.click();\n }, [containerElementRef]);\n\n const tabsChildren = useMemo(() => {\n const indexOfOverflowStart = indexOfLastVisibleChild + 1;\n const handleDropdownKeyPress = (e, eventKey) => {\n if (e.key === 'Enter') {\n handleDropdownTabClick(eventKey);\n }\n };\n const childrenList = React.Children.map(children, (child, index) => {\n if (child?.type?.name !== 'Tab' && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.error(\n `Tabs children can only be of type Tab. ${children[index]} was passed instead.`,\n );\n }\n if (!React.isValidElement(child)) {\n return child;\n }\n const {\n title, notification, tabClassName, ...rest\n } = child.props;\n let newTitle;\n if (notification) {\n newTitle = (\n <>\n {title}\n <Bubble\n variant=\"error\"\n role=\"status\"\n className=\"pgn__tab-notification\"\n aria-live=\"polite\"\n expandable\n >\n {notification}\n </Bubble>\n </>\n );\n } else {\n newTitle = title;\n }\n const tabClass = index > indexOfLastVisibleChild ? 'pgn__tab_invisible' : '';\n const modifiedTab = React.cloneElement(child, {\n ...rest,\n title: newTitle,\n tabClassName: classNames(tabClass, tabClassName),\n });\n return modifiedTab;\n });\n let moreTabHasNotification = false;\n const overflowChildren = childrenList.slice(indexOfOverflowStart)\n .map(overflowChild => {\n if (!moreTabHasNotification && overflowChild.props.notification) {\n moreTabHasNotification = true;\n }\n return (\n <Dropdown.Item\n as=\"li\"\n tabIndex=\"0\"\n key={`${overflowChild.props.eventKey}overflow`}\n onClick={() => handleDropdownTabClick(overflowChild.props.eventKey)}\n onKeyPress={(e) => handleDropdownKeyPress(e, overflowChild.props.eventKey)}\n disabled={overflowChild.props.disabled}\n datakey={overflowChild.props.eventKey}\n className={classNames({\n active: overflowChild.props.eventKey === defaultActiveKey || overflowChild.props.eventKey === activeKey,\n }, 'pgn__tabs__dropdown-item')}\n >\n {overflowChild.props.title}\n </Dropdown.Item>\n );\n });\n\n childrenList.splice(indexOfOverflowStart, 0, (<Tab\n key=\"moreTabKey\"\n tabClassName={classNames(!overflowChildren.length && 'pgn__tab_invisible', 'pgn__tab_more')}\n title={(\n <Dropdown ref={overflowElementRef}>\n <Dropdown.Toggle\n variant=\"link\"\n className=\"nav-link\"\n id=\"pgn__tab-toggle\"\n >\n {moreTabText}\n {moreTabHasNotification && (\n <Bubble\n variant=\"error\"\n role=\"status\"\n className=\"pgn__tab-notification\"\n />\n )}\n </Dropdown.Toggle>\n <Dropdown.Menu as=\"ul\" className=\"dropdown-menu-right\">{overflowChildren}</Dropdown.Menu>\n </Dropdown>\n )}\n />\n ));\n return childrenList;\n }, [activeKey, children, defaultActiveKey, indexOfLastVisibleChild, moreTabText, handleDropdownTabClick]);\n\n return (\n <div ref={setContainerElementRef}>\n <BaseTabs\n defaultActiveKey={defaultActiveKey}\n activeKey={activeKey}\n {...props}\n className={classNames(className, 'pgn__tabs')}\n >\n {tabsChildren}\n </BaseTabs>\n </div>\n );\n}\n\nTabs.propTypes = {\n /** Specifies variant to use. */\n variant: PropTypes.oneOf(['tabs', 'pills', 'inverse-tabs', 'inverse-pills', 'button-group']),\n /** Specifies elements that is processed to create tabs. */\n children: PropTypes.node.isRequired,\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies text for the 'More' tab. */\n moreTabText: PropTypes.string,\n /** Specifies default active tab (uncontrolled usage). */\n defaultActiveKey: PropTypes.string,\n /** Specifies active tab (controlled usage). */\n activeKey: PropTypes.string,\n};\n\nTabs.defaultProps = {\n variant: 'tabs',\n className: undefined,\n moreTabText: MORE_TAB_TEXT,\n defaultActiveKey: undefined,\n activeKey: undefined,\n};\n\nTabs.Deprecated = TabsDeprecated;\n\nexport default Tabs;\nexport { Tab };\nexport { default as TabContainer } from 'react-bootstrap/TabContainer';\nexport { default as TabContent } from 'react-bootstrap/TabContent';\nexport { default as TabPane } from 'react-bootstrap/TabPane';\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,IACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,WAAW,QACN,OAAO;AACd,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,cAAc,MAAM,cAAc;AACzC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,0BAA0B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7F,gBAAgB,EAAEb,SAAS,CAAC0G,MAAM;EAClC;EACA5F,SAAS,EAAEd,SAAS,CAAC0G;AACvB,CAAC;AAEDlG,IAAI,CAACmG,YAAY,GAAG;EAClB9B,OAAO,EAAE,MAAM;EACflE,SAAS,EAAEkC,SAAS;EACpBjC,WAAW,EAAEL,aAAa;EAC1BM,gBAAgB,EAAEgC,SAAS;EAC3B/B,SAAS,EAAE+B;AACb,CAAC;AAEDrC,IAAI,CAACoG,UAAU,GAAG1G,cAAc;AAEhC,eAAeM,IAAI;AACnB,SAASF,GAAG;AACZ,SAASuG,OAAO,IAAIC,YAAY,QAAQ,8BAA8B;AACtE,SAASD,OAAO,IAAIE,UAAU,QAAQ,4BAA4B;AAClE,SAASF,OAAO,IAAIG,OAAO,QAAQ,yBAAyB"}
1
+ {"version":3,"file":"index.js","names":["React","useEffect","useMemo","useRef","useState","useCallback","classNames","PropTypes","BaseTabs","TabsDeprecated","Bubble","Dropdown","useIndexOfLastVisibleChild","Tab","MORE_TAB_TEXT","Tabs","_ref","_overflowElementRef$c","_overflowElementRef$c3","children","className","_ref$moreTabText","moreTabText","defaultActiveKey","activeKey","props","_objectWithoutProperties","_excluded","_useState","_useState2","_slicedToArray","containerElementRef","setContainerElementRef","overflowElementRef","indexOfLastVisibleChild","firstChild","current","parentNode","observer","MutationObserver","mutations","forEach","mutation","eventKey","target","getAttribute","isActive","element","querySelector","concat","moreTab","classList","add","remove","observe","attributes","subtree","attributeFilter","disconnect","undefined","_overflowElementRef$c2","tabIndex","handleDropdownTabClick","hiddenTab","click","tabsChildren","indexOfOverflowStart","handleDropdownKeyPress","e","key","childrenList","Children","map","child","index","_child$type","type","name","process","env","NODE_ENV","console","error","isValidElement","_child$props","title","notification","tabClassName","rest","_excluded2","newTitle","createElement","Fragment","variant","role","expandable","tabClass","modifiedTab","cloneElement","_objectSpread","moreTabHasNotification","overflowChildren","slice","overflowChild","Item","as","onClick","onKeyPress","disabled","datakey","active","splice","length","ref","Toggle","id","Menu","_extends","propTypes","oneOf","node","isRequired","string","defaultProps","Deprecated","default","TabContainer","TabContent","TabPane"],"sources":["../../src/Tabs/index.jsx"],"sourcesContent":["import React, {\n useEffect,\n useMemo,\n useRef,\n useState,\n useCallback,\n} from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport BaseTabs from 'react-bootstrap/Tabs';\nimport TabsDeprecated from './deprecated';\nimport Bubble from '../Bubble';\nimport Dropdown from '../Dropdown';\nimport useIndexOfLastVisibleChild from '../hooks/useIndexOfLastVisibleChild';\nimport Tab from './Tab';\n\nexport const MORE_TAB_TEXT = 'More...';\n\nfunction Tabs({\n children,\n className,\n moreTabText = MORE_TAB_TEXT,\n defaultActiveKey,\n activeKey,\n ...props\n}) {\n const [containerElementRef, setContainerElementRef] = useState(null);\n const overflowElementRef = useRef(null);\n const indexOfLastVisibleChild = useIndexOfLastVisibleChild(\n containerElementRef?.firstChild,\n overflowElementRef.current?.parentNode,\n );\n\n useEffect(() => {\n if (containerElementRef) {\n const observer = new MutationObserver((mutations => {\n mutations.forEach(mutation => {\n // React-Bootstrap attribute 'data-rb-event-key' is responsible for the tab identification\n const eventKey = mutation.target.getAttribute('data-rb-event-key');\n // React-Bootstrap attribute 'aria-selected' is responsible for selected/unselected state\n const isActive = mutation.target.getAttribute('aria-selected') === 'true';\n // datakey attribute is added manually to the dropdown\n // elements so that they correspond to the native tabs' eventKey\n const element = containerElementRef.querySelector(`[datakey='${eventKey}']`);\n const moreTab = containerElementRef.querySelector('.pgn__tab_more');\n if (isActive) {\n element?.classList.add('active');\n // Here we add active class to the 'More Tab' if element exists in the dropdown\n if (element) {\n moreTab.classList.add('active');\n } else {\n moreTab.classList.remove('active');\n }\n } else {\n element?.classList.remove('active');\n }\n });\n }));\n observer.observe(containerElementRef, {\n attributes: true, subtree: true, attributeFilter: ['aria-selected'],\n });\n return () => observer.disconnect();\n }\n return undefined;\n }, [containerElementRef]);\n\n useEffect(() => {\n if (overflowElementRef.current?.parentNode) {\n overflowElementRef.current.parentNode.tabIndex = -1;\n }\n }, [overflowElementRef.current?.parentNode]);\n\n const handleDropdownTabClick = useCallback((eventKey) => {\n const hiddenTab = containerElementRef.querySelector(`[data-rb-event-key='${eventKey}']`);\n hiddenTab.click();\n }, [containerElementRef]);\n\n const tabsChildren = useMemo(() => {\n const indexOfOverflowStart = indexOfLastVisibleChild + 1;\n const handleDropdownKeyPress = (e, eventKey) => {\n if (e.key === 'Enter') {\n handleDropdownTabClick(eventKey);\n }\n };\n const childrenList = React.Children.map(children, (child, index) => {\n if (child?.type?.name !== 'Tab' && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.error(\n `Tabs children can only be of type Tab. ${children[index]} was passed instead.`,\n );\n }\n if (!React.isValidElement(child)) {\n return child;\n }\n const {\n title, notification, tabClassName, ...rest\n } = child.props;\n let newTitle;\n if (notification) {\n newTitle = (\n <>\n {title}\n <Bubble\n variant=\"error\"\n role=\"status\"\n className=\"pgn__tab-notification\"\n aria-live=\"polite\"\n expandable\n >\n {notification}\n </Bubble>\n </>\n );\n } else {\n newTitle = title;\n }\n const tabClass = index > indexOfLastVisibleChild ? 'pgn__tab_invisible' : '';\n const modifiedTab = React.cloneElement(child, {\n ...rest,\n title: newTitle,\n tabClassName: classNames(tabClass, tabClassName),\n });\n return modifiedTab;\n });\n let moreTabHasNotification = false;\n const overflowChildren = childrenList.slice(indexOfOverflowStart)\n .map(overflowChild => {\n if (!moreTabHasNotification && overflowChild.props.notification) {\n moreTabHasNotification = true;\n }\n return (\n <Dropdown.Item\n as=\"li\"\n tabIndex=\"0\"\n key={`${overflowChild.props.eventKey}overflow`}\n onClick={() => handleDropdownTabClick(overflowChild.props.eventKey)}\n onKeyPress={(e) => handleDropdownKeyPress(e, overflowChild.props.eventKey)}\n disabled={overflowChild.props.disabled}\n datakey={overflowChild.props.eventKey}\n className={classNames({\n active: overflowChild.props.eventKey === defaultActiveKey || overflowChild.props.eventKey === activeKey,\n }, 'pgn__tabs__dropdown-item')}\n >\n {overflowChild.props.title}\n </Dropdown.Item>\n );\n });\n\n childrenList.splice(indexOfOverflowStart, 0, (<Tab\n key=\"moreTabKey\"\n tabClassName={classNames(!overflowChildren.length && 'pgn__tab_invisible', 'pgn__tab_more')}\n title={(\n <Dropdown ref={overflowElementRef}>\n <Dropdown.Toggle\n variant=\"link\"\n className=\"nav-link\"\n id=\"pgn__tab-toggle\"\n >\n {moreTabText}\n {moreTabHasNotification && (\n <Bubble\n variant=\"error\"\n role=\"status\"\n className=\"pgn__tab-notification\"\n />\n )}\n </Dropdown.Toggle>\n <Dropdown.Menu as=\"ul\" className=\"dropdown-menu-right\">{overflowChildren}</Dropdown.Menu>\n </Dropdown>\n )}\n />\n ));\n return childrenList;\n }, [activeKey, children, defaultActiveKey, indexOfLastVisibleChild, moreTabText, handleDropdownTabClick]);\n\n return (\n <div ref={setContainerElementRef}>\n <BaseTabs\n defaultActiveKey={defaultActiveKey}\n activeKey={activeKey}\n {...props}\n className={classNames(className, 'pgn__tabs')}\n >\n {tabsChildren}\n </BaseTabs>\n </div>\n );\n}\n\nTabs.propTypes = {\n /** Specifies variant to use. */\n variant: PropTypes.oneOf(['tabs', 'pills', 'inverse-tabs', 'inverse-pills', 'button-group']),\n /** Specifies elements that is processed to create tabs. */\n children: PropTypes.node.isRequired,\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies text for the 'More' tab. */\n moreTabText: PropTypes.string,\n /** Specifies default active tab (uncontrolled usage). */\n defaultActiveKey: PropTypes.string,\n /** Specifies active tab (controlled usage). */\n activeKey: PropTypes.string,\n};\n\nTabs.defaultProps = {\n variant: 'tabs',\n className: undefined,\n moreTabText: MORE_TAB_TEXT,\n defaultActiveKey: undefined,\n activeKey: undefined,\n};\n\nTabs.Deprecated = TabsDeprecated;\n\nexport default Tabs;\nexport { Tab };\nexport { default as TabContainer } from 'react-bootstrap/TabContainer';\nexport { default as TabContent } from 'react-bootstrap/TabContent';\nexport { default as TabPane } from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AEjB,SAAS,CAACmH;AACvB,CAAC;AAED3G,IAAI,CAAC4G,YAAY,GAAG;EAClB9B,OAAO,EAAE,MAAM;EACfzE,SAAS,EAAEuC,SAAS;EACpBrC,WAAW,EAAER,aAAa;EAC1BS,gBAAgB,EAAEoC,SAAS;EAC3BnC,SAAS,EAAEmC;AACb,CAAC;AAED5C,IAAI,CAAC6G,UAAU,GAAGnH,cAAc;AAEhC,eAAeM,IAAI;AACnB,SAASF,GAAG;AACZ,SAASgH,OAAO,IAAIC,YAAY,QAAQ,8BAA8B;AACtE,SAASD,OAAO,IAAIE,UAAU,QAAQ,4BAA4B;AAClE,SAASF,OAAO,IAAIG,OAAO,QAAQ,yBAAyB"}
@@ -1,4 +1,4 @@
1
- const _excluded = ["className", "inputRef"];
1
+ var _excluded = ["className", "inputRef"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -8,10 +8,8 @@ import PropTypes from 'prop-types';
8
8
  import asInput from '../asInput';
9
9
  import withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';
10
10
  function Text(props) {
11
- const {
12
- className,
13
- inputRef
14
- } = props,
11
+ var className = props.className,
12
+ inputRef = props.inputRef,
15
13
  others = _objectWithoutProperties(props, _excluded);
16
14
  return /*#__PURE__*/React.createElement("textarea", _extends({}, others, {
17
15
  className: className,
@@ -30,11 +28,15 @@ Text.defaultProps = {
30
28
  className: undefined,
31
29
  inputRef: undefined
32
30
  };
33
- const TextArea = asInput(withDeprecatedProps(Text, 'TextArea', {
31
+ var TextArea = asInput(withDeprecatedProps(Text, 'TextArea', {
34
32
  className: {
35
33
  deprType: DeprTypes.FORMAT,
36
- expect: value => typeof value === 'string',
37
- transform: value => Array.isArray(value) ? value.join(' ') : value,
34
+ expect: function expect(value) {
35
+ return typeof value === 'string';
36
+ },
37
+ transform: function transform(value) {
38
+ return Array.isArray(value) ? value.join(' ') : value;
39
+ },
38
40
  message: 'It should be a string.'
39
41
  }
40
42
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","asInput","withDeprecatedProps","DeprTypes","Text","props","className","inputRef","others","_objectWithoutProperties","_excluded","createElement","_extends","ref","propTypes","string","oneOfType","func","shape","current","instanceOf","element","defaultProps","undefined","TextArea","deprType","FORMAT","expect","value","transform","Array","isArray","join","message"],"sources":["../../src/TextArea/index.jsx"],"sourcesContent":["/* eslint-disable max-len */\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport asInput from '../asInput';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nfunction Text(props) {\n const {\n className,\n inputRef,\n ...others\n } = props;\n\n return (\n <textarea\n {...others}\n className={className}\n ref={inputRef}\n />\n );\n}\n\nText.propTypes = {\n className: PropTypes.string,\n /** specifies all of the properties that are necessary from the included `asInput` component. Please see details for input requirements within that component.\n */\n inputRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.instanceOf(PropTypes.element) }),\n ]),\n};\n\nText.defaultProps = {\n className: undefined,\n inputRef: undefined,\n};\n\nconst TextArea = asInput(withDeprecatedProps(Text, 'TextArea', {\n className: {\n deprType: DeprTypes.FORMAT,\n expect: value => typeof value === 'string',\n transform: value => (Array.isArray(value) ? value.join(' ') : value),\n message: 'It should be a string.',\n },\n}));\n\nexport default TextArea;\n"],"mappings":";;;;AAAA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;AAEvE,SAASC,IAAIA,CAACC,KAAK,EAAE;EACnB,MAAM;MACJC,SAAS;MACTC;IAEF,CAAC,GAAGF,KAAK;IADJG,MAAM,GAAAC,wBAAA,CACPJ,KAAK,EAAAK,SAAA;EAET,oBACEX,KAAA,CAAAY,aAAA,aAAAC,QAAA,KACMJ,MAAM;IACVF,SAAS,EAAEA,SAAU;IACrBO,GAAG,EAAEN;EAAS,EACf,CAAC;AAEN;AAEAH,IAAI,CAACU,SAAS,GAAG;EACfR,SAAS,EAAEN,SAAS,CAACe,MAAM;EAC3B;AACF;EACER,QAAQ,EAAEP,SAAS,CAACgB,SAAS,CAAC,CAC5BhB,SAAS,CAACiB,IAAI,EACdjB,SAAS,CAACkB,KAAK,CAAC;IAAEC,OAAO,EAAEnB,SAAS,CAACoB,UAAU,CAACpB,SAAS,CAACqB,OAAO;EAAE,CAAC,CAAC,CACtE;AACH,CAAC;AAEDjB,IAAI,CAACkB,YAAY,GAAG;EAClBhB,SAAS,EAAEiB,SAAS;EACpBhB,QAAQ,EAAEgB;AACZ,CAAC;AAED,MAAMC,QAAQ,GAAGvB,OAAO,CAACC,mBAAmB,CAACE,IAAI,EAAE,UAAU,EAAE;EAC7DE,SAAS,EAAE;IACTmB,QAAQ,EAAEtB,SAAS,CAACuB,MAAM;IAC1BC,MAAM,EAAEC,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ;IAC1CC,SAAS,EAAED,KAAK,IAAKE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,GAAGA,KAAK,CAACI,IAAI,CAAC,GAAG,CAAC,GAAGJ,KAAM;IACpEK,OAAO,EAAE;EACX;AACF,CAAC,CAAC,CAAC;AAEH,eAAeT,QAAQ"}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","asInput","withDeprecatedProps","DeprTypes","Text","props","className","inputRef","others","_objectWithoutProperties","_excluded","createElement","_extends","ref","propTypes","string","oneOfType","func","shape","current","instanceOf","element","defaultProps","undefined","TextArea","deprType","FORMAT","expect","value","transform","Array","isArray","join","message"],"sources":["../../src/TextArea/index.jsx"],"sourcesContent":["/* eslint-disable max-len */\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport asInput from '../asInput';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nfunction Text(props) {\n const {\n className,\n inputRef,\n ...others\n } = props;\n\n return (\n <textarea\n {...others}\n className={className}\n ref={inputRef}\n />\n );\n}\n\nText.propTypes = {\n className: PropTypes.string,\n /** specifies all of the properties that are necessary from the included `asInput` component. Please see details for input requirements within that component.\n */\n inputRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.instanceOf(PropTypes.element) }),\n ]),\n};\n\nText.defaultProps = {\n className: undefined,\n inputRef: undefined,\n};\n\nconst TextArea = asInput(withDeprecatedProps(Text, 'TextArea', {\n className: {\n deprType: DeprTypes.FORMAT,\n expect: value => typeof value === 'string',\n transform: value => (Array.isArray(value) ? value.join(' ') : value),\n message: 'It should be a string.',\n },\n}));\n\nexport default TextArea;\n"],"mappings":";;;;AAAA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;AAEvE,SAASC,IAAIA,CAACC,KAAK,EAAE;EACnB,IACEC,SAAS,GAGPD,KAAK,CAHPC,SAAS;IACTC,QAAQ,GAENF,KAAK,CAFPE,QAAQ;IACLC,MAAM,GAAAC,wBAAA,CACPJ,KAAK,EAAAK,SAAA;EAET,oBACEX,KAAA,CAAAY,aAAA,aAAAC,QAAA,KACMJ,MAAM;IACVF,SAAS,EAAEA,SAAU;IACrBO,GAAG,EAAEN;EAAS,EACf,CAAC;AAEN;AAEAH,IAAI,CAACU,SAAS,GAAG;EACfR,SAAS,EAAEN,SAAS,CAACe,MAAM;EAC3B;AACF;EACER,QAAQ,EAAEP,SAAS,CAACgB,SAAS,CAAC,CAC5BhB,SAAS,CAACiB,IAAI,EACdjB,SAAS,CAACkB,KAAK,CAAC;IAAEC,OAAO,EAAEnB,SAAS,CAACoB,UAAU,CAACpB,SAAS,CAACqB,OAAO;EAAE,CAAC,CAAC,CACtE;AACH,CAAC;AAEDjB,IAAI,CAACkB,YAAY,GAAG;EAClBhB,SAAS,EAAEiB,SAAS;EACpBhB,QAAQ,EAAEgB;AACZ,CAAC;AAED,IAAMC,QAAQ,GAAGvB,OAAO,CAACC,mBAAmB,CAACE,IAAI,EAAE,UAAU,EAAE;EAC7DE,SAAS,EAAE;IACTmB,QAAQ,EAAEtB,SAAS,CAACuB,MAAM;IAC1BC,MAAM,EAAE,SAAAA,OAAAC,KAAK;MAAA,OAAI,OAAOA,KAAK,KAAK,QAAQ;IAAA;IAC1CC,SAAS,EAAE,SAAAA,UAAAD,KAAK;MAAA,OAAKE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,GAAGA,KAAK,CAACI,IAAI,CAAC,GAAG,CAAC,GAAGJ,KAAK;IAAA,CAAC;IACpEK,OAAO,EAAE;EACX;AACF,CAAC,CAAC,CAAC;AAEH,eAAeT,QAAQ"}
@@ -1,31 +1,53 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
8
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
9
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
11
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
12
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1
14
  import React from 'react';
2
15
  import ReactDOM from 'react-dom';
3
16
  import PropTypes from 'prop-types';
4
- class ToastContainer extends React.Component {
5
- constructor(props) {
6
- super(props);
7
- this.toastRootName = 'toast-root';
17
+ var ToastContainer = /*#__PURE__*/function (_React$Component) {
18
+ _inherits(ToastContainer, _React$Component);
19
+ var _super = _createSuper(ToastContainer);
20
+ function ToastContainer(props) {
21
+ var _this;
22
+ _classCallCheck(this, ToastContainer);
23
+ _this = _super.call(this, props);
24
+ _this.toastRootName = 'toast-root';
8
25
  if (typeof document === 'undefined') {
9
- this.rootElement = null;
10
- } else if (document.getElementById(this.toastRootName)) {
11
- this.rootElement = document.getElementById(this.toastRootName);
26
+ _this.rootElement = null;
27
+ } else if (document.getElementById(_this.toastRootName)) {
28
+ _this.rootElement = document.getElementById(_this.toastRootName);
12
29
  } else {
13
- const rootElement = document.createElement('div');
14
- rootElement.setAttribute('id', this.toastRootName);
30
+ var rootElement = document.createElement('div');
31
+ rootElement.setAttribute('id', _this.toastRootName);
15
32
  rootElement.setAttribute('class', 'toast-container');
16
33
  rootElement.setAttribute('role', 'alert');
17
34
  rootElement.setAttribute('aria-live', 'polite');
18
35
  rootElement.setAttribute('aria-atomic', 'true');
19
- this.rootElement = document.body.appendChild(rootElement);
36
+ _this.rootElement = document.body.appendChild(rootElement);
20
37
  }
38
+ return _this;
21
39
  }
22
- render() {
23
- if (this.rootElement) {
24
- return /*#__PURE__*/ReactDOM.createPortal(this.props.children, this.rootElement);
40
+ _createClass(ToastContainer, [{
41
+ key: "render",
42
+ value: function render() {
43
+ if (this.rootElement) {
44
+ return /*#__PURE__*/ReactDOM.createPortal(this.props.children, this.rootElement);
45
+ }
46
+ return null;
25
47
  }
26
- return null;
27
- }
28
- }
48
+ }]);
49
+ return ToastContainer;
50
+ }(React.Component);
29
51
  ToastContainer.propTypes = {
30
52
  /** Specifies contents of the component. */
31
53
  children: PropTypes.node.isRequired
@@ -1 +1 @@
1
- {"version":3,"file":"ToastContainer.js","names":["React","ReactDOM","PropTypes","ToastContainer","Component","constructor","props","toastRootName","document","rootElement","getElementById","createElement","setAttribute","body","appendChild","render","createPortal","children","propTypes","node","isRequired"],"sources":["../../src/Toast/ToastContainer.jsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\n\nclass ToastContainer extends React.Component {\n constructor(props) {\n super(props);\n this.toastRootName = 'toast-root';\n if (typeof document === 'undefined') {\n this.rootElement = null;\n } else if (document.getElementById(this.toastRootName)) {\n this.rootElement = document.getElementById(this.toastRootName);\n } else {\n const rootElement = document.createElement('div');\n rootElement.setAttribute('id', this.toastRootName);\n rootElement.setAttribute('class', 'toast-container');\n rootElement.setAttribute('role', 'alert');\n rootElement.setAttribute('aria-live', 'polite');\n rootElement.setAttribute('aria-atomic', 'true');\n this.rootElement = document.body.appendChild(rootElement);\n }\n }\n\n render() {\n if (this.rootElement) {\n return ReactDOM.createPortal(\n this.props.children,\n this.rootElement,\n );\n }\n return null;\n }\n}\n\nToastContainer.propTypes = {\n /** Specifies contents of the component. */\n children: PropTypes.node.isRequired,\n};\n\nexport default ToastContainer;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,WAAW;AAChC,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,cAAc,SAASH,KAAK,CAACI,SAAS,CAAC;EAC3CC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,aAAa,GAAG,YAAY;IACjC,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;MACnC,IAAI,CAACC,WAAW,GAAG,IAAI;IACzB,CAAC,MAAM,IAAID,QAAQ,CAACE,cAAc,CAAC,IAAI,CAACH,aAAa,CAAC,EAAE;MACtD,IAAI,CAACE,WAAW,GAAGD,QAAQ,CAACE,cAAc,CAAC,IAAI,CAACH,aAAa,CAAC;IAChE,CAAC,MAAM;MACL,MAAME,WAAW,GAAGD,QAAQ,CAACG,aAAa,CAAC,KAAK,CAAC;MACjDF,WAAW,CAACG,YAAY,CAAC,IAAI,EAAE,IAAI,CAACL,aAAa,CAAC;MAClDE,WAAW,CAACG,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC;MACpDH,WAAW,CAACG,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC;MACzCH,WAAW,CAACG,YAAY,CAAC,WAAW,EAAE,QAAQ,CAAC;MAC/CH,WAAW,CAACG,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC;MAC/C,IAAI,CAACH,WAAW,GAAGD,QAAQ,CAACK,IAAI,CAACC,WAAW,CAACL,WAAW,CAAC;IAC3D;EACF;EAEAM,MAAMA,CAAA,EAAG;IACP,IAAI,IAAI,CAACN,WAAW,EAAE;MACpB,oBAAOR,QAAQ,CAACe,YAAY,CAC1B,IAAI,CAACV,KAAK,CAACW,QAAQ,EACnB,IAAI,CAACR,WACP,CAAC;IACH;IACA,OAAO,IAAI;EACb;AACF;AAEAN,cAAc,CAACe,SAAS,GAAG;EACzB;EACAD,QAAQ,EAAEf,SAAS,CAACiB,IAAI,CAACC;AAC3B,CAAC;AAED,eAAejB,cAAc"}
1
+ {"version":3,"file":"ToastContainer.js","names":["React","ReactDOM","PropTypes","ToastContainer","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","toastRootName","document","rootElement","getElementById","createElement","setAttribute","body","appendChild","_createClass","key","value","render","createPortal","children","Component","propTypes","node","isRequired"],"sources":["../../src/Toast/ToastContainer.jsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\n\nclass ToastContainer extends React.Component {\n constructor(props) {\n super(props);\n this.toastRootName = 'toast-root';\n if (typeof document === 'undefined') {\n this.rootElement = null;\n } else if (document.getElementById(this.toastRootName)) {\n this.rootElement = document.getElementById(this.toastRootName);\n } else {\n const rootElement = document.createElement('div');\n rootElement.setAttribute('id', this.toastRootName);\n rootElement.setAttribute('class', 'toast-container');\n rootElement.setAttribute('role', 'alert');\n rootElement.setAttribute('aria-live', 'polite');\n rootElement.setAttribute('aria-atomic', 'true');\n this.rootElement = document.body.appendChild(rootElement);\n }\n }\n\n render() {\n if (this.rootElement) {\n return ReactDOM.createPortal(\n this.props.children,\n this.rootElement,\n );\n }\n return null;\n }\n}\n\nToastContainer.propTypes = {\n /** Specifies contents of the component. */\n children: PropTypes.node.isRequired,\n};\n\nexport default ToastContainer;\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,WAAW;AAChC,OAAOC,SAAS,MAAM,YAAY;AAAC,IAE7BC,cAAc,0BAAAC,gBAAA;EAAAC,SAAA,CAAAF,cAAA,EAAAC,gBAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,cAAA;EAClB,SAAAA,eAAYK,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAP,cAAA;IACjBM,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IACXC,KAAA,CAAKG,aAAa,GAAG,YAAY;IACjC,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;MACnCJ,KAAA,CAAKK,WAAW,GAAG,IAAI;IACzB,CAAC,MAAM,IAAID,QAAQ,CAACE,cAAc,CAACN,KAAA,CAAKG,aAAa,CAAC,EAAE;MACtDH,KAAA,CAAKK,WAAW,GAAGD,QAAQ,CAACE,cAAc,CAACN,KAAA,CAAKG,aAAa,CAAC;IAChE,CAAC,MAAM;MACL,IAAME,WAAW,GAAGD,QAAQ,CAACG,aAAa,CAAC,KAAK,CAAC;MACjDF,WAAW,CAACG,YAAY,CAAC,IAAI,EAAER,KAAA,CAAKG,aAAa,CAAC;MAClDE,WAAW,CAACG,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC;MACpDH,WAAW,CAACG,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC;MACzCH,WAAW,CAACG,YAAY,CAAC,WAAW,EAAE,QAAQ,CAAC;MAC/CH,WAAW,CAACG,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC;MAC/CR,KAAA,CAAKK,WAAW,GAAGD,QAAQ,CAACK,IAAI,CAACC,WAAW,CAACL,WAAW,CAAC;IAC3D;IAAC,OAAAL,KAAA;EACH;EAACW,YAAA,CAAAjB,cAAA;IAAAkB,GAAA;IAAAC,KAAA,EAED,SAAAC,OAAA,EAAS;MACP,IAAI,IAAI,CAACT,WAAW,EAAE;QACpB,oBAAOb,QAAQ,CAACuB,YAAY,CAC1B,IAAI,CAAChB,KAAK,CAACiB,QAAQ,EACnB,IAAI,CAACX,WACP,CAAC;MACH;MACA,OAAO,IAAI;IACb;EAAC;EAAA,OAAAX,cAAA;AAAA,EA3B0BH,KAAK,CAAC0B,SAAS;AA8B5CvB,cAAc,CAACwB,SAAS,GAAG;EACzB;EACAF,QAAQ,EAAEvB,SAAS,CAAC0B,IAAI,CAACC;AAC3B,CAAC;AAED,eAAe1B,cAAc"}
@@ -1,5 +1,11 @@
1
- const _excluded = ["action", "children", "className", "closeLabel", "onClose", "show"];
1
+ var _excluded = ["action", "children", "className", "closeLabel", "onClose", "show"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
8
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
3
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
11
  import React, { useState } from 'react';
@@ -12,21 +18,22 @@ import ToastContainer from './ToastContainer';
12
18
  import Button from '../Button';
13
19
  import Icon from '../Icon';
14
20
  import IconButton from '../IconButton';
15
- export const TOAST_CLOSE_LABEL_TEXT = 'Close';
16
- export const TOAST_DELAY = 5000;
21
+ export var TOAST_CLOSE_LABEL_TEXT = 'Close';
22
+ export var TOAST_DELAY = 5000;
17
23
  function Toast(_ref) {
18
- let {
19
- action,
20
- children,
21
- className,
22
- closeLabel,
23
- onClose,
24
- show
25
- } = _ref,
24
+ var action = _ref.action,
25
+ children = _ref.children,
26
+ className = _ref.className,
27
+ closeLabel = _ref.closeLabel,
28
+ onClose = _ref.onClose,
29
+ show = _ref.show,
26
30
  rest = _objectWithoutProperties(_ref, _excluded);
27
- const intl = useIntl();
28
- const [autoHide, setAutoHide] = useState(true);
29
- const intlCloseLabel = closeLabel || intl.formatMessage({
31
+ var intl = useIntl();
32
+ var _useState = useState(true),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ autoHide = _useState2[0],
35
+ setAutoHide = _useState2[1];
36
+ var intlCloseLabel = closeLabel || intl.formatMessage({
30
37
  id: 'pgn.Toast.closeLabel',
31
38
  defaultMessage: 'Close',
32
39
  description: 'Close label for Toast component'
@@ -35,10 +42,18 @@ function Toast(_ref) {
35
42
  autohide: autoHide,
36
43
  className: classNames('pgn__toast', className),
37
44
  onClose: onClose,
38
- onBlur: () => setAutoHide(true),
39
- onFocus: () => setAutoHide(false),
40
- onMouseOut: () => setAutoHide(true),
41
- onMouseOver: () => setAutoHide(false),
45
+ onBlur: function onBlur() {
46
+ return setAutoHide(true);
47
+ },
48
+ onFocus: function onFocus() {
49
+ return setAutoHide(false);
50
+ },
51
+ onMouseOut: function onMouseOut() {
52
+ return setAutoHide(true);
53
+ },
54
+ onMouseOver: function onMouseOver() {
55
+ return setAutoHide(false);
56
+ },
42
57
  show: show
43
58
  }, rest), /*#__PURE__*/React.createElement("div", {
44
59
  className: "toast-header"
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useState","classNames","PropTypes","BaseToast","useIntl","Close","ToastContainer","Button","Icon","IconButton","TOAST_CLOSE_LABEL_TEXT","TOAST_DELAY","Toast","_ref","action","children","className","closeLabel","onClose","show","rest","_objectWithoutProperties","_excluded","intl","autoHide","setAutoHide","intlCloseLabel","formatMessage","id","defaultMessage","description","createElement","_extends","autohide","onBlur","onFocus","onMouseOut","onMouseOver","iconAs","alt","src","onClick","variant","invertColors","as","href","size","label","defaultProps","undefined","delay","propTypes","string","isRequired","func","bool","shape","number"],"sources":["../../src/Toast/index.jsx"],"sourcesContent":["import React, { useState } from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\n\nimport BaseToast from 'react-bootstrap/Toast';\nimport { useIntl } from 'react-intl';\n\nimport { Close } from '../../icons';\nimport ToastContainer from './ToastContainer';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport IconButton from '../IconButton';\n\nexport const TOAST_CLOSE_LABEL_TEXT = 'Close';\nexport const TOAST_DELAY = 5000;\n\nfunction Toast({\n action, children, className, closeLabel, onClose, show, ...rest\n}) {\n const intl = useIntl();\n const [autoHide, setAutoHide] = useState(true);\n const intlCloseLabel = closeLabel || intl.formatMessage({\n id: 'pgn.Toast.closeLabel',\n defaultMessage: 'Close',\n description: 'Close label for Toast component',\n });\n return (\n <ToastContainer>\n <BaseToast\n autohide={autoHide}\n className={classNames('pgn__toast', className)}\n onClose={onClose}\n onBlur={() => setAutoHide(true)}\n onFocus={() => setAutoHide(false)}\n onMouseOut={() => setAutoHide(true)}\n onMouseOver={() => setAutoHide(false)}\n show={show}\n {...rest}\n >\n <div\n className=\"toast-header\"\n >\n <p className=\"small\">{children}</p>\n <div className=\"toast-header-btn-container\">\n <IconButton\n iconAs={Icon}\n alt={intlCloseLabel}\n className=\"align-self-start\"\n src={Close}\n onClick={onClose}\n variant=\"primary\"\n invertColors\n />\n </div>\n </div>\n {action && (\n <Button\n as={action.href ? 'a' : 'button'}\n href={action.href}\n onClick={action.onClick}\n size=\"sm\"\n variant=\"inverse-outline-primary\"\n >\n {action.label}\n </Button>\n )}\n </BaseToast>\n </ToastContainer>\n );\n}\n\nToast.defaultProps = {\n action: null,\n closeLabel: undefined,\n delay: TOAST_DELAY,\n className: undefined,\n};\n\nToast.propTypes = {\n /** A string or an element that is rendered inside the main body of the `Toast`. */\n children: PropTypes.string.isRequired,\n /**\n * A function that is called on close. It can be used to perform\n * actions upon closing of the `Toast`, such as setting the \"show\"\n * element to false.\n * */\n onClose: PropTypes.func.isRequired,\n /** Boolean used to control whether the `Toast` shows */\n show: PropTypes.bool.isRequired,\n /**\n * Fields used to build optional action button.\n * `label` is a string rendered inside the button.\n * `href` is a link that will render the action button as an anchor tag.\n * `onClick` is a function that is called when the button is clicked.\n */\n action: PropTypes.shape({\n label: PropTypes.string.isRequired,\n href: PropTypes.string,\n onClick: PropTypes.func,\n }),\n /**\n * Alt text for the `Toast`'s dismiss button. Defaults to 'Close'.\n */\n closeLabel: PropTypes.string,\n /** Time in milliseconds for which the `Toast` will display. */\n delay: PropTypes.number,\n /** Class names for the `BaseToast` component */\n className: PropTypes.string,\n};\n\nexport default Toast;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,SAASC,OAAO,QAAQ,YAAY;AAEpC,SAASC,KAAK,QAAQ,aAAa;AACnC,OAAO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tBX,OAAO,EAAEvC,SAAS,CAACoD;EACrB,CAAC,CAAC;EACF;AACF;AACA;EACErC,UAAU,EAAEf,SAAS,CAACkD,MAAM;EAC5B;EACAF,KAAK,EAAEhD,SAAS,CAACuD,MAAM;EACvB;EACAzC,SAAS,EAAEd,SAAS,CAACkD;AACvB,CAAC;AAED,eAAexC,KAAK"}
1
+ {"version":3,"file":"index.js","names":["React","useState","classNames","PropTypes","BaseToast","useIntl","Close","ToastContainer","Button","Icon","IconButton","TOAST_CLOSE_LABEL_TEXT","TOAST_DELAY","Toast","_ref","action","children","className","closeLabel","onClose","show","rest","_objectWithoutProperties","_excluded","intl","_useState","_useState2","_slicedToArray","autoHide","setAutoHide","intlCloseLabel","formatMessage","id","defaultMessage","description","createElement","_extends","autohide","onBlur","onFocus","onMouseOut","onMouseOver","iconAs","alt","src","onClick","variant","invertColors","as","href","size","label","defaultProps","undefined","delay","propTypes","string","isRequired","func","bool","shape","number"],"sources":["../../src/Toast/index.jsx"],"sourcesContent":["import React, { useState } from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\n\nimport BaseToast from 'react-bootstrap/Toast';\nimport { useIntl } from 'react-intl';\n\nimport { Close } from '../../icons';\nimport ToastContainer from './ToastContainer';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport IconButton from '../IconButton';\n\nexport const TOAST_CLOSE_LABEL_TEXT = 'Close';\nexport const TOAST_DELAY = 5000;\n\nfunction Toast({\n action, children, className, closeLabel, onClose, show, ...rest\n}) {\n const intl = useIntl();\n const [autoHide, setAutoHide] = useState(true);\n const intlCloseLabel = closeLabel || intl.formatMessage({\n id: 'pgn.Toast.closeLabel',\n defaultMessage: 'Close',\n description: 'Close label for Toast component',\n });\n return (\n <ToastContainer>\n <BaseToast\n autohide={autoHide}\n className={classNames('pgn__toast', className)}\n onClose={onClose}\n onBlur={() => setAutoHide(true)}\n onFocus={() => setAutoHide(false)}\n onMouseOut={() => setAutoHide(true)}\n onMouseOver={() => setAutoHide(false)}\n show={show}\n {...rest}\n >\n <div\n className=\"toast-header\"\n >\n <p className=\"small\">{children}</p>\n <div className=\"toast-header-btn-container\">\n <IconButton\n iconAs={Icon}\n alt={intlCloseLabel}\n className=\"align-self-start\"\n src={Close}\n onClick={onClose}\n variant=\"primary\"\n invertColors\n />\n </div>\n </div>\n {action && (\n <Button\n as={action.href ? 'a' : 'button'}\n href={action.href}\n onClick={action.onClick}\n size=\"sm\"\n variant=\"inverse-outline-primary\"\n >\n {action.label}\n </Button>\n )}\n </BaseToast>\n </ToastContainer>\n );\n}\n\nToast.defaultProps = {\n action: null,\n closeLabel: undefined,\n delay: TOAST_DELAY,\n className: undefined,\n};\n\nToast.propTypes = {\n /** A string or an element that is rendered inside the main body of the `Toast`. */\n children: PropTypes.string.isRequired,\n /**\n * A function that is called on close. It can be used to perform\n * actions upon closing of the `Toast`, such as setting the \"show\"\n * element to false.\n * */\n onClose: PropTypes.func.isRequired,\n /** Boolean used to control whether the `Toast` shows */\n show: PropTypes.bool.isRequired,\n /**\n * Fields used to build optional action button.\n * `label` is a string rendered inside the button.\n * `href` is a link that will render the action button as an anchor tag.\n * `onClick` is a function that is called when the button is clicked.\n */\n action: PropTypes.shape({\n label: PropTypes.string.isRequired,\n href: PropTypes.string,\n onClick: PropTypes.func,\n }),\n /**\n * Alt text for the `Toast`'s dismiss button. Defaults to 'Close'.\n */\n closeLabel: PropTypes.string,\n /** Time in milliseconds for which the `Toast` will display. */\n delay: PropTypes.number,\n /** Class names for the `BaseToast` component */\n className: PropTypes.string,\n};\n\nexport default Toast;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,SAASC,OAAO,QAAQ,YAAY;AAEpC,SAASC,KAAK,QAAQ,aAAa;AACnC,OAAOC,cAAc,MAAM,kBAAk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