@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,102 +1,134 @@
1
- const _excluded = ["children", "className", "selectedOptionIndex", "tag"];
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", "selectedOptionIndex", "tag"];
2
3
  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; }
3
4
  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; }
4
5
  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; }
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
6
  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; }
8
7
  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
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ 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); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
+ 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); }
13
+ 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); }
14
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
+ 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); }; }
16
+ 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); }
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+ 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; } }
19
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
9
20
  /* eslint-disable max-len */
10
21
  import classNames from 'classnames';
11
22
  import PropTypes from 'prop-types';
12
23
  import React from 'react';
13
24
  import { nonNegativeInteger } from '../utils/propTypes';
14
- export default class ListBox extends React.Component {
15
- constructor(props) {
16
- super(props);
17
- this.onFocus = this.onFocus.bind(this);
18
- this.onKeyDown = this.onKeyDown.bind(this);
19
- this.state = {
25
+ var ListBox = /*#__PURE__*/function (_React$Component) {
26
+ _inherits(ListBox, _React$Component);
27
+ var _super = _createSuper(ListBox);
28
+ function ListBox(props) {
29
+ var _this;
30
+ _classCallCheck(this, ListBox);
31
+ _this = _super.call(this, props);
32
+ _this.onFocus = _this.onFocus.bind(_assertThisInitialized(_this));
33
+ _this.onKeyDown = _this.onKeyDown.bind(_assertThisInitialized(_this));
34
+ _this.state = {
20
35
  selectedOptionIndex: null
21
36
  };
37
+ return _this;
22
38
  }
23
- static getDerivedStateFromProps(nextProps, prevState) {
24
- const {
25
- selectedOptionIndex
26
- } = nextProps;
27
- if (selectedOptionIndex !== prevState.selectedOptionIndex && selectedOptionIndex !== undefined) {
28
- return {
29
- selectedOptionIndex
30
- };
31
- }
32
- return null;
33
- }
34
- onFocus() {
35
- // if no ListBoxOption is selected, select first ListBoxOption on ListBox focus
36
- if (!this.state.selectedOptionIndex) {
37
- this.setState({
38
- selectedOptionIndex: 0
39
- });
39
+ _createClass(ListBox, [{
40
+ key: "onFocus",
41
+ value: function onFocus() {
42
+ // if no ListBoxOption is selected, select first ListBoxOption on ListBox focus
43
+ if (!this.state.selectedOptionIndex) {
44
+ this.setState({
45
+ selectedOptionIndex: 0
46
+ });
47
+ }
40
48
  }
41
- }
42
- onKeyDown(e) {
43
- switch (e.key) {
44
- case 'ArrowDown':
45
- {
46
- // prevent scrolling entire modal body with arrow keys
47
- e.preventDefault();
48
- if (this.state.selectedOptionIndex < React.Children.count(this.props.children) - 1) {
49
- this.setState(state => ({
50
- selectedOptionIndex: state.selectedOptionIndex + 1
51
- }));
49
+ }, {
50
+ key: "onKeyDown",
51
+ value: function onKeyDown(e) {
52
+ switch (e.key) {
53
+ case 'ArrowDown':
54
+ {
55
+ // prevent scrolling entire modal body with arrow keys
56
+ e.preventDefault();
57
+ if (this.state.selectedOptionIndex < React.Children.count(this.props.children) - 1) {
58
+ this.setState(function (state) {
59
+ return {
60
+ selectedOptionIndex: state.selectedOptionIndex + 1
61
+ };
62
+ });
63
+ }
64
+ break;
52
65
  }
53
- break;
54
- }
55
- case 'ArrowUp':
56
- {
57
- // prevent scrolling entire modal body with arrow keys
58
- e.preventDefault();
59
- if (this.state.selectedOptionIndex > 0) {
60
- this.setState(state => ({
61
- selectedOptionIndex: state.selectedOptionIndex - 1
62
- }));
66
+ case 'ArrowUp':
67
+ {
68
+ // prevent scrolling entire modal body with arrow keys
69
+ e.preventDefault();
70
+ if (this.state.selectedOptionIndex > 0) {
71
+ this.setState(function (state) {
72
+ return {
73
+ selectedOptionIndex: state.selectedOptionIndex - 1
74
+ };
75
+ });
76
+ }
77
+ break;
63
78
  }
64
- break;
65
- }
66
- default:
79
+ default:
80
+ }
67
81
  }
68
- }
69
- renderChildren() {
70
- return React.Children.map(this.props.children, (child, index) => /*#__PURE__*/React.cloneElement(child, {
71
- index,
72
- isSelected: index === this.state.selectedOptionIndex,
73
- onSelect: () => {
74
- this.setState({
75
- selectedOptionIndex: index
82
+ }, {
83
+ key: "renderChildren",
84
+ value: function renderChildren() {
85
+ var _this2 = this;
86
+ return React.Children.map(this.props.children, function (child, index) {
87
+ return /*#__PURE__*/React.cloneElement(child, {
88
+ index: index,
89
+ isSelected: index === _this2.state.selectedOptionIndex,
90
+ onSelect: function onSelect() {
91
+ _this2.setState({
92
+ selectedOptionIndex: index
93
+ });
94
+ child.props.onSelect();
95
+ }
76
96
  });
77
- child.props.onSelect();
97
+ });
98
+ }
99
+ }, {
100
+ key: "render",
101
+ value: function render() {
102
+ var _this$props = this.props,
103
+ children = _this$props.children,
104
+ className = _this$props.className,
105
+ selectedOptionIndex = _this$props.selectedOptionIndex,
106
+ tag = _this$props.tag,
107
+ other = _objectWithoutProperties(_this$props, _excluded);
108
+ return /*#__PURE__*/React.createElement(this.props.tag, _objectSpread({
109
+ 'aria-activedescendant': this.state.selectedOptionIndex === null ? null : "list-box-option-".concat(this.state.selectedOptionIndex),
110
+ className: classNames(['list-group', this.props.className]),
111
+ onFocus: this.onFocus,
112
+ onKeyDown: this.onKeyDown,
113
+ role: 'listbox',
114
+ tabIndex: 0
115
+ }, other), this.renderChildren());
116
+ }
117
+ }], [{
118
+ key: "getDerivedStateFromProps",
119
+ value: function getDerivedStateFromProps(nextProps, prevState) {
120
+ var selectedOptionIndex = nextProps.selectedOptionIndex;
121
+ if (selectedOptionIndex !== prevState.selectedOptionIndex && selectedOptionIndex !== undefined) {
122
+ return {
123
+ selectedOptionIndex: selectedOptionIndex
124
+ };
78
125
  }
79
- }));
80
- }
81
- render() {
82
- const _this$props = this.props,
83
- {
84
- children,
85
- className,
86
- selectedOptionIndex,
87
- tag
88
- } = _this$props,
89
- other = _objectWithoutProperties(_this$props, _excluded);
90
- return /*#__PURE__*/React.createElement(this.props.tag, _objectSpread({
91
- 'aria-activedescendant': this.state.selectedOptionIndex === null ? null : `list-box-option-${this.state.selectedOptionIndex}`,
92
- className: classNames(['list-group', this.props.className]),
93
- onFocus: this.onFocus,
94
- onKeyDown: this.onKeyDown,
95
- role: 'listbox',
96
- tabIndex: 0
97
- }, other), this.renderChildren());
98
- }
99
- }
126
+ return null;
127
+ }
128
+ }]);
129
+ return ListBox;
130
+ }(React.Component);
131
+ export { ListBox as default };
100
132
  ListBox.propTypes = {
101
133
  /** specifies the ListBoxOption component(s) that will be displayed within the ListBox element. You can pass in one or more ListBoxOption components.
102
134
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["classNames","PropTypes","React","nonNegativeInteger","ListBox","Component","constructor","props","onFocus","bind","onKeyDown","state","selectedOptionIndex","getDerivedStateFromProps","nextProps","prevState","undefined","setState","e","key","preventDefault","Children","count","children","renderChildren","map","child","index","cloneElement","isSelected","onSelect","render","_this$props","className","tag","other","_objectWithoutProperties","_excluded","createElement","_objectSpread","role","tabIndex","propTypes","node","isRequired","string","defaultProps"],"sources":["../../src/ListBox/index.jsx"],"sourcesContent":["/* eslint-disable max-len */\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { nonNegativeInteger } from '../utils/propTypes';\n\nexport default class ListBox extends React.Component {\n constructor(props) {\n super(props);\n\n this.onFocus = this.onFocus.bind(this);\n this.onKeyDown = this.onKeyDown.bind(this);\n\n this.state = {\n selectedOptionIndex: null,\n };\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { selectedOptionIndex } = nextProps;\n\n if (selectedOptionIndex !== prevState.selectedOptionIndex\n && selectedOptionIndex !== undefined) {\n return { selectedOptionIndex };\n }\n\n return null;\n }\n\n onFocus() {\n // if no ListBoxOption is selected, select first ListBoxOption on ListBox focus\n if (!this.state.selectedOptionIndex) {\n this.setState({\n selectedOptionIndex: 0,\n });\n }\n }\n\n onKeyDown(e) {\n switch (e.key) {\n case 'ArrowDown': {\n // prevent scrolling entire modal body with arrow keys\n e.preventDefault();\n if (this.state.selectedOptionIndex < React.Children.count(this.props.children) - 1) {\n this.setState(state => ({\n selectedOptionIndex: state.selectedOptionIndex + 1,\n }));\n }\n break;\n }\n case 'ArrowUp': {\n // prevent scrolling entire modal body with arrow keys\n e.preventDefault();\n\n if (this.state.selectedOptionIndex > 0) {\n this.setState(state => ({\n selectedOptionIndex: state.selectedOptionIndex - 1,\n }));\n }\n break;\n }\n default:\n }\n }\n\n renderChildren() {\n return React.Children.map(this.props.children, (child, index) => React.cloneElement(child, {\n index,\n isSelected: index === this.state.selectedOptionIndex,\n onSelect: () => { this.setState({ selectedOptionIndex: index }); child.props.onSelect(); },\n }));\n }\n\n render() {\n const {\n children,\n className,\n selectedOptionIndex,\n tag,\n ...other\n } = this.props;\n\n return React.createElement(\n this.props.tag,\n {\n 'aria-activedescendant': this.state.selectedOptionIndex === null ? null : `list-box-option-${this.state.selectedOptionIndex}`,\n className: classNames(['list-group', this.props.className]),\n onFocus: this.onFocus,\n onKeyDown: this.onKeyDown,\n role: 'listbox',\n tabIndex: 0,\n ...other,\n },\n this.renderChildren(),\n );\n }\n}\n\nListBox.propTypes = {\n /** specifies the ListBoxOption component(s) that will be displayed within the ListBox element. You can pass in one or more ListBoxOption components.\n */\n children: PropTypes.node.isRequired,\n /** specifies Bootstrap class names to apply to the ListBox component. The default is an empty string. */\n className: PropTypes.string,\n /** Although the ListBox component keeps track of which ListBoxOption is selected, `selectedOptionIndex` provides a mechanism for an override, if necessary. An example would be to clear the selectedOption when moving between views. Note that override is not permanent and that clicking on a ListBoxOption or interacting with the ListBox with the keyboard will change the selected ListBoxOption relative to the original override. The default is undefined. */\n selectedOptionIndex: nonNegativeInteger,\n /** used to specify the element type of the rendered ListBox component. The default is div. Example alternatives include ol, ul, span, etc. */\n tag: PropTypes.string,\n};\n\nListBox.defaultProps = {\n className: undefined,\n selectedOptionIndex: undefined,\n tag: 'div',\n};\n"],"mappings":";;;;;;;;AAAA;AACA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,kBAAkB,QAAQ,oBAAoB;AAEvD,eAAe,MAAMC,OAAO,SAASF,KAAK,CAACG,SAAS,CAAC;EACnDC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZ,IAAI,CAACC,OAAO,GAAG,IAAI,CAACA,OAAO,CAACC,IAAI,CAAC,IAAI,CAAC;IACtC,IAAI,CAACC,SAAS,GAAG,IAAI,CAACA,SAAS,CAACD,IAAI,CAAC,IAAI,CAAC;IAE1C,IAAI,CAACE,KAAK,GAAG;MACXC,mBAAmB,EAAE;IACvB,CAAC;EACH;EAEA,OAAOC,wBAAwBA,CAACC,SAAS,EAAEC,SAAS,EAAE;IACpD,MAAM;MAAEH;IAAoB,CAAC,GAAGE,SAAS;IAEzC,IAAIF,mBAAmB,KAAKG,SAAS,CAACH,mBAAmB,IACpDA,mBAAmB,KAAKI,SAAS,EAAE;MACtC,OAAO;QAAEJ;MAAoB,CAAC;IAChC;IAEA,OAAO,IAAI;EACb;EAEAJ,OAAOA,CAAA,EAAG;IACR;IACA,IAAI,CAAC,IAAI,CAACG,KAAK,CAACC,mBAA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EAC,MAAMA,CAAA,EAAG;IACP,MAAAC,WAAA,GAMI,IAAI,CAACzB,KAAK;MANR;QACJgB,QAAQ;QACRU,SAAS;QACTrB,mBAAmB;QACnBsB;MAEF,CAAC,GAAAF,WAAA;MADIG,KAAK,GAAAC,wBAAA,CAAAJ,WAAA,EAAAK,SAAA;IAGV,oBAAOnC,KAAK,CAACoC,aAAa,CACxB,IAAI,CAAC/B,KAAK,CAAC2B,GAAG,EAAAK,aAAA;MAEZ,uBAAuB,EAAE,IAAI,CAAC5B,KAAK,CAACC,mBAAmB,KAAK,IAAI,GAAG,IAAI,GAAI,mBAAkB,IAAI,CAACD,KAAK,CAACC,mBAAoB,EAAC;MAC7HqB,SAAS,EAAEjC,UAAU,CAAC,CAAC,YAAY,EAAE,IAAI,CAACO,KAAK,CAAC0B,SAAS,CAAC,CAAC;MAC3DzB,OAAO,EAAE,IAAI,CAACA,OAAO;MACrBE,SAAS,EAAE,IAAI,CAACA,SAAS;MACzB8B,IAAI,EAAE,SAAS;MACfC,QAAQ,EAAE;IAAC,GACRN,KAAK,GAEV,IAAI,CAACX,cAAc,CAAC,CACtB,CAAC;EACH;AACF;AAEApB,OAAO,CAACsC,SAAS,GAAG;EAClB;AACF;EACEnB,QAAQ,EAAEtB,SAAS,CAAC0C,IAAI,CAACC,UAAU;EACnC;EACAX,SAAS,EAAEhC,SAAS,CAAC4C,MAAM;EAC3B;EACAjC,mBAAmB,EAAET,kBAAkB;EACvC;EACA+B,GAAG,EAAEjC,SAAS,CAAC4C;AACjB,CAAC;AAEDzC,OAAO,CAAC0C,YAAY,GAAG;EACrBb,SAAS,EAAEjB,SAAS;EACpBJ,mBAAmB,EAAEI,SAAS;EAC9BkB,GAAG,EAAE;AACP,CAAC"}
1
+ {"version":3,"file":"index.js","names":["classNames","PropTypes","React","nonNegativeInteger","ListBox","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","onFocus","bind","_assertThisInitialized","onKeyDown","state","selectedOptionIndex","_createClass","key","value","setState","e","preventDefault","Children","count","children","renderChildren","_this2","map","child","index","cloneElement","isSelected","onSelect","render","_this$props","className","tag","other","_objectWithoutProperties","_excluded","createElement","_objectSpread","concat","role","tabIndex","getDerivedStateFromProps","nextProps","prevState","undefined","Component","default","propTypes","node","isRequired","string","defaultProps"],"sources":["../../src/ListBox/index.jsx"],"sourcesContent":["/* eslint-disable max-len */\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { nonNegativeInteger } from '../utils/propTypes';\n\nexport default class ListBox extends React.Component {\n constructor(props) {\n super(props);\n\n this.onFocus = this.onFocus.bind(this);\n this.onKeyDown = this.onKeyDown.bind(this);\n\n this.state = {\n selectedOptionIndex: null,\n };\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { selectedOptionIndex } = nextProps;\n\n if (selectedOptionIndex !== prevState.selectedOptionIndex\n && selectedOptionIndex !== undefined) {\n return { selectedOptionIndex };\n }\n\n return null;\n }\n\n onFocus() {\n // if no ListBoxOption is selected, select first ListBoxOption on ListBox focus\n if (!this.state.selectedOptionIndex) {\n this.setState({\n selectedOptionIndex: 0,\n });\n }\n }\n\n onKeyDown(e) {\n switch (e.key) {\n case 'ArrowDown': {\n // prevent scrolling entire modal body with arrow keys\n e.preventDefault();\n if (this.state.selectedOptionIndex < React.Children.count(this.props.children) - 1) {\n this.setState(state => ({\n selectedOptionIndex: state.selectedOptionIndex + 1,\n }));\n }\n break;\n }\n case 'ArrowUp': {\n // prevent scrolling entire modal body with arrow keys\n e.preventDefault();\n\n if (this.state.selectedOptionIndex > 0) {\n this.setState(state => ({\n selectedOptionIndex: state.selectedOptionIndex - 1,\n }));\n }\n break;\n }\n default:\n }\n }\n\n renderChildren() {\n return React.Children.map(this.props.children, (child, index) => React.cloneElement(child, {\n index,\n isSelected: index === this.state.selectedOptionIndex,\n onSelect: () => { this.setState({ selectedOptionIndex: index }); child.props.onSelect(); },\n }));\n }\n\n render() {\n const {\n children,\n className,\n selectedOptionIndex,\n tag,\n ...other\n } = this.props;\n\n return React.createElement(\n this.props.tag,\n {\n 'aria-activedescendant': this.state.selectedOptionIndex === null ? null : `list-box-option-${this.state.selectedOptionIndex}`,\n className: classNames(['list-group', this.props.className]),\n onFocus: this.onFocus,\n onKeyDown: this.onKeyDown,\n role: 'listbox',\n tabIndex: 0,\n ...other,\n },\n this.renderChildren(),\n );\n }\n}\n\nListBox.propTypes = {\n /** specifies the ListBoxOption component(s) that will be displayed within the ListBox element. You can pass in one or more ListBoxOption components.\n */\n children: PropTypes.node.isRequired,\n /** specifies Bootstrap class names to apply to the ListBox component. The default is an empty string. */\n className: PropTypes.string,\n /** Although the ListBox component keeps track of which ListBoxOption is selected, `selectedOptionIndex` provides a mechanism for an override, if necessary. An example would be to clear the selectedOption when moving between views. Note that override is not permanent and that clicking on a ListBoxOption or interacting with the ListBox with the keyboard will change the selected ListBoxOption relative to the original override. The default is undefined. */\n selectedOptionIndex: nonNegativeInteger,\n /** used to specify the element type of the rendered ListBox component. The default is div. Example alternatives include ol, ul, span, etc. */\n tag: PropTypes.string,\n};\n\nListBox.defaultProps = {\n className: undefined,\n selectedOptionIndex: undefined,\n tag: 'div',\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,kBAAkB,QAAQ,oBAAoB;AAAC,IAEnCC,OAAO,0BAAAC,gBAAA;EAAAC,SAAA,CAAAF,OAAA,EAAAC,gBAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,OAAA;EAC1B,SAAAA,QAAYK,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAP,OAAA;IACjBM,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IAEXC,KAAA,CAAKG,OAAO,GAAGH,KAAA,CAAKG,OAAO,CAACC,IAAI,CAAAC,sB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AAI,CAACA,SAAS;QACzB8B,IAAI,EAAE,SAAS;QACfC,QAAQ,EAAE;MAAC,GACRP,KAAK,GAEV,IAAI,CAACZ,cAAc,CAAC,CACtB,CAAC;IACH;EAAC;IAAAR,GAAA;IAAAC,KAAA,EA7ED,SAAA2B,yBAAgCC,SAAS,EAAEC,SAAS,EAAE;MACpD,IAAQhC,mBAAmB,GAAK+B,SAAS,CAAjC/B,mBAAmB;MAE3B,IAAIA,mBAAmB,KAAKgC,SAAS,CAAChC,mBAAmB,IACpDA,mBAAmB,KAAKiC,SAAS,EAAE;QACtC,OAAO;UAAEjC,mBAAmB,EAAnBA;QAAoB,CAAC;MAChC;MAEA,OAAO,IAAI;IACb;EAAC;EAAA,OAAAd,OAAA;AAAA,EArBkCF,KAAK,CAACkD,SAAS;AAAA,SAA/BhD,OAAO,IAAAiD,OAAA;AA4F5BjD,OAAO,CAACkD,SAAS,GAAG;EAClB;AACF;EACE3B,QAAQ,EAAE1B,SAAS,CAACsD,IAAI,CAACC,UAAU;EACnC;EACAlB,SAAS,EAAErC,SAAS,CAACwD,MAAM;EAC3B;EACAvC,mBAAmB,EAAEf,kBAAkB;EACvC;EACAoC,GAAG,EAAEtC,SAAS,CAACwD;AACjB,CAAC;AAEDrD,OAAO,CAACsD,YAAY,GAAG;EACrBpB,SAAS,EAAEa,SAAS;EACpBjC,mBAAmB,EAAEiC,SAAS;EAC9BZ,GAAG,EAAE;AACP,CAAC"}
@@ -1,58 +1,81 @@
1
- const _excluded = ["children", "className", "index", "isSelected", "tag"];
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", "index", "isSelected", "tag"];
2
3
  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; }
3
4
  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; }
4
5
  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; }
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
6
  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; }
8
7
  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
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ 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); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
+ 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); }
13
+ 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); }
14
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
+ 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); }; }
16
+ 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); }
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+ 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; } }
19
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
9
20
  import React from 'react';
10
21
  import classNames from 'classnames';
11
22
  import PropTypes from 'prop-types';
12
- export default class ListBoxOption extends React.Component {
13
- constructor(props) {
14
- super(props);
15
- this.onMouseDown = this.onMouseDown.bind(this);
23
+ var ListBoxOption = /*#__PURE__*/function (_React$Component) {
24
+ _inherits(ListBoxOption, _React$Component);
25
+ var _super = _createSuper(ListBoxOption);
26
+ function ListBoxOption(props) {
27
+ var _this;
28
+ _classCallCheck(this, ListBoxOption);
29
+ _this = _super.call(this, props);
30
+ _this.onMouseDown = _this.onMouseDown.bind(_assertThisInitialized(_this));
31
+ return _this;
16
32
  }
17
- componentDidUpdate(prevProps) {
18
- if (this.props.isSelected && !prevProps.isSelected) {
19
- this.props.onSelect();
33
+ _createClass(ListBoxOption, [{
34
+ key: "componentDidUpdate",
35
+ value: function componentDidUpdate(prevProps) {
36
+ if (this.props.isSelected && !prevProps.isSelected) {
37
+ this.props.onSelect();
38
+ }
20
39
  }
21
- }
22
40
 
23
- /**
24
- * onMouseDown is used instead of onClick because onClick triggers the focus
25
- * event before click event. This focus event bubbles up to the parent
26
- * (since onFocus bubbles in React), which triggers the ListBox's onFocus function.
27
- * This function will select the first ListBoxOption if one is not selected, and this
28
- * causes the user to see the first option selected before their desired option is selected
29
- * when the click event is fired shortly thereafter. The mouseDown event occurs before the
30
- * focus event, which prevents this behavior.
31
- */
32
- onMouseDown() {
33
- this.props.onSelect();
34
- }
35
- render() {
36
- const _this$props = this.props,
37
- {
38
- children,
39
- className,
40
- index,
41
- isSelected,
42
- tag
43
- } = _this$props,
44
- other = _objectWithoutProperties(_this$props, _excluded);
45
- return /*#__PURE__*/React.createElement(this.props.tag, _objectSpread({
46
- 'aria-selected': isSelected,
47
- className: classNames('list-group-item', 'list-group-item-action', {
48
- active: this.props.isSelected
49
- }, className),
50
- id: index === undefined ? null : `list-box-option-${index}`,
51
- onMouseDown: this.onMouseDown,
52
- role: 'option'
53
- }, other), children);
54
- }
55
- }
41
+ /**
42
+ * onMouseDown is used instead of onClick because onClick triggers the focus
43
+ * event before click event. This focus event bubbles up to the parent
44
+ * (since onFocus bubbles in React), which triggers the ListBox's onFocus function.
45
+ * This function will select the first ListBoxOption if one is not selected, and this
46
+ * causes the user to see the first option selected before their desired option is selected
47
+ * when the click event is fired shortly thereafter. The mouseDown event occurs before the
48
+ * focus event, which prevents this behavior.
49
+ */
50
+ }, {
51
+ key: "onMouseDown",
52
+ value: function onMouseDown() {
53
+ this.props.onSelect();
54
+ }
55
+ }, {
56
+ key: "render",
57
+ value: function render() {
58
+ var _this$props = this.props,
59
+ children = _this$props.children,
60
+ className = _this$props.className,
61
+ index = _this$props.index,
62
+ isSelected = _this$props.isSelected,
63
+ tag = _this$props.tag,
64
+ other = _objectWithoutProperties(_this$props, _excluded);
65
+ return /*#__PURE__*/React.createElement(this.props.tag, _objectSpread({
66
+ 'aria-selected': isSelected,
67
+ className: classNames('list-group-item', 'list-group-item-action', {
68
+ active: this.props.isSelected
69
+ }, className),
70
+ id: index === undefined ? null : "list-box-option-".concat(index),
71
+ onMouseDown: this.onMouseDown,
72
+ role: 'option'
73
+ }, other), children);
74
+ }
75
+ }]);
76
+ return ListBoxOption;
77
+ }(React.Component);
78
+ export { ListBoxOption as default };
56
79
  ListBoxOption.propTypes = {
57
80
  children: PropTypes.node.isRequired,
58
81
  className: PropTypes.string,
@@ -66,6 +89,6 @@ ListBoxOption.defaultProps = {
66
89
  index: undefined,
67
90
  isSelected: false,
68
91
  tag: 'div',
69
- onSelect: () => {}
92
+ onSelect: function onSelect() {}
70
93
  };
71
94
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","classNames","PropTypes","ListBoxOption","Component","constructor","props","onMouseDown","bind","componentDidUpdate","prevProps","isSelected","onSelect","render","_this$props","children","className","index","tag","other","_objectWithoutProperties","_excluded","createElement","_objectSpread","active","id","undefined","role","propTypes","node","isRequired","string","number","bool","func","defaultProps"],"sources":["../../src/ListBoxOption/index.jsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\n\nexport default class ListBoxOption extends React.Component {\n constructor(props) {\n super(props);\n\n this.onMouseDown = this.onMouseDown.bind(this);\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.isSelected && !prevProps.isSelected) {\n this.props.onSelect();\n }\n }\n\n /**\n * onMouseDown is used instead of onClick because onClick triggers the focus\n * event before click event. This focus event bubbles up to the parent\n * (since onFocus bubbles in React), which triggers the ListBox's onFocus function.\n * This function will select the first ListBoxOption if one is not selected, and this\n * causes the user to see the first option selected before their desired option is selected\n * when the click event is fired shortly thereafter. The mouseDown event occurs before the\n * focus event, which prevents this behavior.\n */\n onMouseDown() {\n this.props.onSelect();\n }\n\n render() {\n const {\n children,\n className,\n index,\n isSelected,\n tag,\n ...other\n } = this.props;\n\n return React.createElement(\n this.props.tag,\n {\n 'aria-selected': isSelected,\n className: classNames(\n 'list-group-item',\n 'list-group-item-action',\n {\n active: this.props.isSelected,\n },\n className,\n ),\n id: index === undefined ? null : `list-box-option-${index}`,\n onMouseDown: this.onMouseDown,\n role: 'option',\n ...other,\n },\n children,\n );\n }\n}\n\nListBoxOption.propTypes = {\n children: PropTypes.node.isRequired,\n className: PropTypes.string,\n index: PropTypes.number,\n isSelected: PropTypes.bool,\n tag: PropTypes.string,\n onSelect: PropTypes.func,\n};\n\nListBoxOption.defaultProps = {\n className: undefined,\n index: undefined,\n isSelected: false,\n tag: 'div',\n onSelect: () => { },\n};\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAElC,eAAe,MAAMC,aAAa,SAASH,KAAK,CAACI,SAAS,CAAC;EACzDC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZ,IAAI,CAACC,WAAW,GAAG,IAAI,CAACA,WAAW,CAACC,IAAI,CAAC,IAAI,CAAC;EAChD;EAEAC,kBAAkBA,CAACC,SAAS,EAAE;IAC5B,IAAI,IAAI,CAACJ,KAAK,CAACK,UAAU,IAAI,CAACD,SAAS,CAACC,UAAU,EAAE;MAClD,IAAI,CAACL,KAAK,CAACM,QAAQ,CAAC,CAAC;IACvB;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEL,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACD,KAAK,CAACM,QAAQ,CAAC,CAAC;EACvB;EAEAC,MAAMA,CAAA,EAAG;IACP,MAAAC,WAAA,GAOI,IAAI,CAACR,KAAK;MAPR;QACJS,QAAQ;QACRC,SAAS;QACTC,KAAK;QACLN,UAAU;QACVO;MAEF,CAAC,GAAAJ,WAAA;MADIK,KAAK,GAAAC,wBAAA,CAAAN,WAAA,EAAAO,SAAA;IAGV,oBAAOrB,KAAK,CAACsB,aAAa,CACxB,IAAI,CAAChB,KAAK,CAACY,GAAG,EAAAK,aAAA;MAEZ,eAAe,EAAEZ,UAAU;MAC3BK,SAAS,EAAEf,UAAU,CACnB,iBAAiB,EACjB,wBAAwB,EACxB;QACEuB,MAAM,EAAE,IAAI,CAAClB,KAAK,CAACK;MACrB,CAAC,EACDK,SACF,CAAC;MACDS,EAAE,EAAER,KAAK,KAAKS,SAAS,GAAG,IAAI,GAAI,mBAAkBT,KAAM,EAAC;MAC3DV,WAAW,EAAE,IAAI,CAACA,WAAW;MAC7BoB,IAAI,EAAE;IAAQ,GACXR,KAAK,GAEVJ,QACF,CAAC;EACH;AACF;AAEAZ,aAAa,CAACyB,SAAS,GAAG;EACxBb,QAAQ,EAAEb,SAAS,CAAC2B,IAAI,CAACC,UAAU;EACnCd,SAAS,EAAEd,SAAS,CAAC6B,MAAM;EAC3Bd,KAAK,EAAEf,SAAS,CAAC8B,MAAM;EACvBrB,UAAU,EAAET,SAAS,CAAC+B,IAAI;EAC1Bf,GAAG,EAAEhB,SAAS,CAAC6B,MAAM;EACrBnB,QAAQ,EAAEV,SAAS,CAACgC;AACtB,CAAC;AAED/B,aAAa,CAACgC,YAAY,GAAG;EAC3BnB,SAAS,EAAEU,SAAS;EACpBT,KAAK,EAAES,SAAS;EAChBf,UAAU,EAAE,KAAK;EACjBO,GAAG,EAAE,KAAK;EACVN,QAAQ,EAAEA,CAAA,KAAM,CAAE;AACpB,CAAC"}
1
+ {"version":3,"file":"index.js","names":["React","classNames","PropTypes","ListBoxOption","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","onMouseDown","bind","_assertThisInitialized","_createClass","key","value","componentDidUpdate","prevProps","isSelected","onSelect","render","_this$props","children","className","index","tag","other","_objectWithoutProperties","_excluded","createElement","_objectSpread","active","id","undefined","concat","role","Component","default","propTypes","node","isRequired","string","number","bool","func","defaultProps"],"sources":["../../src/ListBoxOption/index.jsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\n\nexport default class ListBoxOption extends React.Component {\n constructor(props) {\n super(props);\n\n this.onMouseDown = this.onMouseDown.bind(this);\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.isSelected && !prevProps.isSelected) {\n this.props.onSelect();\n }\n }\n\n /**\n * onMouseDown is used instead of onClick because onClick triggers the focus\n * event before click event. This focus event bubbles up to the parent\n * (since onFocus bubbles in React), which triggers the ListBox's onFocus function.\n * This function will select the first ListBoxOption if one is not selected, and this\n * causes the user to see the first option selected before their desired option is selected\n * when the click event is fired shortly thereafter. The mouseDown event occurs before the\n * focus event, which prevents this behavior.\n */\n onMouseDown() {\n this.props.onSelect();\n }\n\n render() {\n const {\n children,\n className,\n index,\n isSelected,\n tag,\n ...other\n } = this.props;\n\n return React.createElement(\n this.props.tag,\n {\n 'aria-selected': isSelected,\n className: classNames(\n 'list-group-item',\n 'list-group-item-action',\n {\n active: this.props.isSelected,\n },\n className,\n ),\n id: index === undefined ? null : `list-box-option-${index}`,\n onMouseDown: this.onMouseDown,\n role: 'option',\n ...other,\n },\n children,\n );\n }\n}\n\nListBoxOption.propTypes = {\n children: PropTypes.node.isRequired,\n className: PropTypes.string,\n index: PropTypes.number,\n isSelected: PropTypes.bool,\n tag: PropTypes.string,\n onSelect: PropTypes.func,\n};\n\nListBoxOption.defaultProps = {\n className: undefined,\n index: undefined,\n isSelected: false,\n tag: 'div',\n onSelect: () => { },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAAC,IAEdC,aAAa,0BAAAC,gBAAA;EAAAC,SAAA,CAAAF,aAAA,EAAAC,gBAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,aAAA;EAChC,SAAAA,cAAYK,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAP,aAAA;IACjBM,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IAEXC,KAAA,CAAKG,WAAW,GAAGH,KAAA,CAAKG,WAAW,CAACC,IAAI,CAAAC,sBAAA,CAAAL,KAAA,CAAK,CAAC;IAAC,OAAAA,KAAA;EACjD;EAACM,YAAA,CAAAZ,aAAA;IAAAa,GAAA;IAAAC,KAAA,EAED,SAAAC,mBAAmBC,SAAS,EAAE;MAC5B,IAAI,IAAI,CAACX,KAAK,CAACY,UAAU,IAAI,C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S,EAAEvB,SAAS,CAACyC,MAAM;EAC3BjB,KAAK,EAAExB,SAAS,CAAC0C,MAAM;EACvBxB,UAAU,EAAElB,SAAS,CAAC2C,IAAI;EAC1BlB,GAAG,EAAEzB,SAAS,CAACyC,MAAM;EACrBtB,QAAQ,EAAEnB,SAAS,CAAC4C;AACtB,CAAC;AAED3C,aAAa,CAAC4C,YAAY,GAAG;EAC3BtB,SAAS,EAAEU,SAAS;EACpBT,KAAK,EAAES,SAAS;EAChBf,UAAU,EAAE,KAAK;EACjBO,GAAG,EAAE,KAAK;EACVN,QAAQ,EAAE,SAAAA,SAAA,EAAM,CAAE;AACpB,CAAC"}
@@ -1,10 +1,11 @@
1
- const _excluded = ["to", "cc", "bcc", "subject", "body", "children", "target", "onClick", "externalLink", "className"];
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 = ["to", "cc", "bcc", "subject", "body", "children", "target", "onClick", "externalLink", "className"];
2
3
  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
4
  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; }
4
5
  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; }
5
6
  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; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
7
- 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 _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
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; }
9
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; }
10
11
  import React from 'react';
@@ -15,37 +16,35 @@ import mailtoLink from 'mailto-link';
15
16
  import classNames from 'classnames';
16
17
  import Hyperlink from '../Hyperlink';
17
18
  import withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';
18
- export const MAIL_TO_LINK_EXTERNAL_LINK_ALTERNATIVE_TEXT = 'Dismiss';
19
- export const MAIL_TO_LINK_EXTERNAL_LINK_TITLE = 'Opens in a new tab';
20
- const MailtoLink = /*#__PURE__*/React.forwardRef((props, ref) => {
21
- const {
22
- to,
23
- cc,
24
- bcc,
25
- subject,
26
- body,
27
- children,
28
- target,
29
- onClick,
30
- externalLink,
31
- className
32
- } = props,
19
+ export var MAIL_TO_LINK_EXTERNAL_LINK_ALTERNATIVE_TEXT = 'Dismiss';
20
+ export var MAIL_TO_LINK_EXTERNAL_LINK_TITLE = 'Opens in a new tab';
21
+ var MailtoLink = /*#__PURE__*/React.forwardRef(function (props, ref) {
22
+ var to = props.to,
23
+ cc = props.cc,
24
+ bcc = props.bcc,
25
+ subject = props.subject,
26
+ body = props.body,
27
+ children = props.children,
28
+ target = props.target,
29
+ onClick = props.onClick,
30
+ externalLink = props.externalLink,
31
+ className = props.className,
33
32
  attrs = _objectWithoutProperties(props, _excluded);
34
- const externalLinkAlternativeText = externalLink.alternativeText;
35
- const externalLinkTitle = externalLink.title;
36
- const destination = mailtoLink({
37
- to,
38
- cc,
39
- bcc,
40
- subject,
41
- body
33
+ var externalLinkAlternativeText = externalLink.alternativeText;
34
+ var externalLinkTitle = externalLink.title;
35
+ var destination = mailtoLink({
36
+ to: to,
37
+ cc: cc,
38
+ bcc: bcc,
39
+ subject: subject,
40
+ body: body
42
41
  });
43
- const hyperlinkProps = _objectSpread({
44
- destination,
45
- target,
46
- onClick,
47
- externalLinkAlternativeText,
48
- externalLinkTitle
42
+ var hyperlinkProps = _objectSpread({
43
+ destination: destination,
44
+ target: target,
45
+ onClick: onClick,
46
+ externalLinkAlternativeText: externalLinkAlternativeText,
47
+ externalLinkTitle: externalLinkTitle
49
48
  }, attrs);
50
49
  return /*#__PURE__*/React.createElement(Hyperlink, _extends({
51
50
  ref: ref,
@@ -89,8 +88,12 @@ MailtoLink.propTypes = {
89
88
  /** The object that contains the `alternativeText` and `title` fields which specify
90
89
  * the text and title for links with a `_blank` target (which loads the URL in a new browsing context). */
91
90
  externalLink: PropTypes.shape({
92
- alternativeText: isRequiredIf(PropTypes.string, props => props.target === '_blank'),
93
- title: isRequiredIf(PropTypes.string, props => props.target === '_blank')
91
+ alternativeText: isRequiredIf(PropTypes.string, function (props) {
92
+ return props.target === '_blank';
93
+ }),
94
+ title: isRequiredIf(PropTypes.string, function (props) {
95
+ return props.target === '_blank';
96
+ })
94
97
  })
95
98
  };
96
99
  export default withDeprecatedProps(MailtoLink, 'MailtoLink', {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","emailPropType","isRequiredIf","mailtoLink","classNames","Hyperlink","withDeprecatedProps","DeprTypes","MAIL_TO_LINK_EXTERNAL_LINK_ALTERNATIVE_TEXT","MAIL_TO_LINK_EXTERNAL_LINK_TITLE","MailtoLink","forwardRef","props","ref","to","cc","bcc","subject","body","children","target","onClick","externalLink","className","attrs","_objectWithoutProperties","_excluded","externalLinkAlternativeText","alternativeText","externalLinkTitle","title","destination","hyperlinkProps","_objectSpread","createElement","_extends","defaultProps","undefined","propTypes","node","isRequired","string","oneOfType","arrayOf","func","shape","content","deprType","MOVED","newName"],"sources":["../../src/MailtoLink/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport emailPropType from 'email-prop-type';\nimport isRequiredIf from 'react-proptype-conditional-require';\nimport mailtoLink from 'mailto-link';\nimport classNames from 'classnames';\n\nimport Hyperlink from '../Hyperlink';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nexport const MAIL_TO_LINK_EXTERNAL_LINK_ALTERNATIVE_TEXT = 'Dismiss';\nexport const MAIL_TO_LINK_EXTERNAL_LINK_TITLE = 'Opens in a new tab';\n\nconst MailtoLink = React.forwardRef((props, ref) => {\n const {\n to,\n cc,\n bcc,\n subject,\n body,\n children,\n target,\n onClick,\n externalLink,\n className,\n ...attrs\n } = props;\n\n const externalLinkAlternativeText = externalLink.alternativeText;\n const externalLinkTitle = externalLink.title;\n const destination = mailtoLink({\n to, cc, bcc, subject, body,\n });\n\n const hyperlinkProps = {\n destination,\n target,\n onClick,\n externalLinkAlternativeText,\n externalLinkTitle,\n ...attrs,\n };\n\n return (\n <Hyperlink\n ref={ref}\n className={classNames('pgn__mailtolink', className)}\n {...hyperlinkProps}\n >\n {children}\n </Hyperlink>\n );\n});\n\nMailtoLink.defaultProps = {\n to: [],\n cc: [],\n bcc: [],\n subject: '',\n body: '',\n target: '_self',\n onClick: null,\n externalLink: {\n alternativeText: MAIL_TO_LINK_EXTERNAL_LINK_ALTERNATIVE_TEXT,\n title: MAIL_TO_LINK_EXTERNAL_LINK_TITLE,\n },\n className: undefined,\n};\n\nMailtoLink.propTypes = {\n /** Content of the ``MailToLink`` */\n children: PropTypes.node.isRequired,\n /** Custom class names for the ``MailToLink`` */\n className: PropTypes.string,\n /** Specifies the email's recipients */\n to: PropTypes.oneOfType([PropTypes.arrayOf(emailPropType), emailPropType]),\n /** Specifies the email's carbon copy recipients */\n cc: PropTypes.oneOfType([PropTypes.arrayOf(emailPropType), emailPropType]),\n /** Specifies the email's blind carbon copy recipients */\n bcc: PropTypes.oneOfType([PropTypes.arrayOf(emailPropType), emailPropType]),\n /** Specifies the email's subject */\n subject: PropTypes.string,\n /** Specifies the email's body */\n body: PropTypes.string,\n /** Specifies where the link should open. The default behavior is `_self`,\n * which means that the URL will be loaded into the same browsing context as the current one */\n target: PropTypes.string,\n /** Specifies the callback function when the link is clicked */\n onClick: PropTypes.func,\n /** The object that contains the `alternativeText` and `title` fields which specify\n * the text and title for links with a `_blank` target (which loads the URL in a new browsing context). */\n externalLink: PropTypes.shape({\n alternativeText: isRequiredIf(PropTypes.string, props => props.target === '_blank'),\n title: isRequiredIf(PropTypes.string, props => props.target === '_blank'),\n }),\n};\n\nexport default withDeprecated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AK,QAAQ,CAAC;IACnFU,KAAK,EAAE5B,YAAY,CAACF,SAAS,CAACyC,MAAM,EAAE7B,KAAK,IAAIA,KAAK,CAACQ,MAAM,KAAK,QAAQ;EAC1E,CAAC;AACH,CAAC;AAED,eAAed,mBAAmB,CAACI,UAAU,EAAE,YAAY,EAAE;EAC3DoC,OAAO,EAAE;IACPC,QAAQ,EAAExC,SAAS,CAACyC,KAAK;IACzBC,OAAO,EAAE;EACX;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","emailPropType","isRequiredIf","mailtoLink","classNames","Hyperlink","withDeprecatedProps","DeprTypes","MAIL_TO_LINK_EXTERNAL_LINK_ALTERNATIVE_TEXT","MAIL_TO_LINK_EXTERNAL_LINK_TITLE","MailtoLink","forwardRef","props","ref","to","cc","bcc","subject","body","children","target","onClick","externalLink","className","attrs","_objectWithoutProperties","_excluded","externalLinkAlternativeText","alternativeText","externalLinkTitle","title","destination","hyperlinkProps","_objectSpread","createElement","_extends","defaultProps","undefined","propTypes","node","isRequired","string","oneOfType","arrayOf","func","shape","content","deprType","MOVED","newName"],"sources":["../../src/MailtoLink/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport emailPropType from 'email-prop-type';\nimport isRequiredIf from 'react-proptype-conditional-require';\nimport mailtoLink from 'mailto-link';\nimport classNames from 'classnames';\n\nimport Hyperlink from '../Hyperlink';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nexport const MAIL_TO_LINK_EXTERNAL_LINK_ALTERNATIVE_TEXT = 'Dismiss';\nexport const MAIL_TO_LINK_EXTERNAL_LINK_TITLE = 'Opens in a new tab';\n\nconst MailtoLink = React.forwardRef((props, ref) => {\n const {\n to,\n cc,\n bcc,\n subject,\n body,\n children,\n target,\n onClick,\n externalLink,\n className,\n ...attrs\n } = props;\n\n const externalLinkAlternativeText = externalLink.alternativeText;\n const externalLinkTitle = externalLink.title;\n const destination = mailtoLink({\n to, cc, bcc, subject, body,\n });\n\n const hyperlinkProps = {\n destination,\n target,\n onClick,\n externalLinkAlternativeText,\n externalLinkTitle,\n ...attrs,\n };\n\n return (\n <Hyperlink\n ref={ref}\n className={classNames('pgn__mailtolink', className)}\n {...hyperlinkProps}\n >\n {children}\n </Hyperlink>\n );\n});\n\nMailtoLink.defaultProps = {\n to: [],\n cc: [],\n bcc: [],\n subject: '',\n body: '',\n target: '_self',\n onClick: null,\n externalLink: {\n alternativeText: MAIL_TO_LINK_EXTERNAL_LINK_ALTERNATIVE_TEXT,\n title: MAIL_TO_LINK_EXTERNAL_LINK_TITLE,\n },\n className: undefined,\n};\n\nMailtoLink.propTypes = {\n /** Content of the ``MailToLink`` */\n children: PropTypes.node.isRequired,\n /** Custom class names for the ``MailToLink`` */\n className: PropTypes.string,\n /** Specifies the email's recipients */\n to: PropTypes.oneOfType([PropTypes.arrayOf(emailPropType), emailPropType]),\n /** Specifies the email's carbon copy recipients */\n cc: PropTypes.oneOfType([PropTypes.arrayOf(emailPropType), emailPropType]),\n /** Specifies the email's blind carbon copy recipients */\n bcc: PropTypes.oneOfType([PropTypes.arrayOf(emailPropType), emailPropType]),\n /** Specifies the email's subject */\n subject: PropTypes.string,\n /** Specifies the email's body */\n body: PropTypes.string,\n /** Specifies where the link should open. The default behavior is `_self`,\n * which means that the URL will be loaded into the same browsing context as the current one */\n target: PropTypes.string,\n /** Specifies the callback function when the link is clicked */\n onClick: PropTypes.func,\n /** The object that contains the `alternativeText` and `title` fields which specify\n * the text and title for links with a `_blank` target (which loads the URL in a new browsing context). */\n externalLink: PropTypes.shape({\n alternativeText: isRequiredIf(PropTypes.string, props => props.target === '_blank'),\n title: isRequiredIf(PropTypes.string, props => props.target === '_blank'),\n }),\n};\n\nexport default withDeprecatedProps(MailtoLink, 'MailtoLink', {\n content: {\n deprType: DeprTypes.MOVED,\n newName: 'children',\n },\n});\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAA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