@databiosphere/findable-ui 23.0.0 → 25.0.0

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 (478) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/.storybook/preview.js +4 -37
  3. package/CHANGELOG.md +64 -0
  4. package/jest.config.js +1 -0
  5. package/lib/common/entities.d.ts +1 -0
  6. package/lib/components/DataDictionary/components/Entities/constants.d.ts +2 -2
  7. package/lib/components/DataDictionary/components/Entities/constants.js +1 -1
  8. package/lib/components/DataDictionary/components/Entities/entities.js +3 -3
  9. package/lib/components/DataDictionary/components/Entity/constants.d.ts +2 -2
  10. package/lib/components/DataDictionary/components/Entity/constants.js +1 -1
  11. package/lib/components/DataDictionary/components/Entity/entity.js +4 -4
  12. package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +8 -0
  13. package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +36 -0
  14. package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.js +1 -1
  15. package/lib/components/Filter/components/FilterLabel/filterLabel.js +2 -2
  16. package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +1 -1
  17. package/lib/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.js +2 -2
  18. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.d.ts +2 -0
  19. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.js +17 -0
  20. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.d.ts +13 -0
  21. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.js +12 -0
  22. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.d.ts +9 -0
  23. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.js +9 -0
  24. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.d.ts +3 -0
  25. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.js +86 -0
  26. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.d.ts +105 -0
  27. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.js +196 -0
  28. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.d.ts +2 -0
  29. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.js +7 -0
  30. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.d.ts +3 -0
  31. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.js +29 -0
  32. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.d.ts +1 -0
  33. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.js +1 -0
  34. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.d.ts +4 -0
  35. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.js +70 -0
  36. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.d.ts +7 -0
  37. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.js +19 -0
  38. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.d.ts +6 -0
  39. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.js +1 -0
  40. package/lib/components/Index/components/EntitiesView/components/ChartView/constants.d.ts +1 -0
  41. package/lib/components/Index/components/EntitiesView/components/ChartView/constants.js +1 -0
  42. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.d.ts +7 -0
  43. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.js +1 -0
  44. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.d.ts +3 -0
  45. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.js +11 -0
  46. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.d.ts +3 -0
  47. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.js +96 -0
  48. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.d.ts +6 -0
  49. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.js +16 -0
  50. package/lib/components/Index/components/EntitiesView/components/ChartView/types.d.ts +6 -0
  51. package/lib/components/Index/components/EntitiesView/components/ChartView/types.js +1 -0
  52. package/lib/components/Index/components/EntitiesView/components/ChartView/utils.d.ts +14 -0
  53. package/lib/components/Index/components/EntitiesView/components/ChartView/utils.js +21 -0
  54. package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.d.ts +2 -0
  55. package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.js +16 -0
  56. package/lib/components/Index/components/EntitiesView/components/EntityList/types.d.ts +3 -0
  57. package/lib/components/Index/components/EntitiesView/components/EntityList/types.js +1 -0
  58. package/lib/components/Index/components/EntitiesView/constants.d.ts +1 -0
  59. package/lib/components/Index/components/EntitiesView/constants.js +1 -0
  60. package/lib/components/Index/components/EntitiesView/entitiesView.d.ts +2 -0
  61. package/lib/components/Index/components/EntitiesView/entitiesView.js +14 -0
  62. package/lib/components/Index/components/EntitiesView/entitiesView.styles.d.ts +3 -0
  63. package/lib/components/Index/components/EntitiesView/entitiesView.styles.js +20 -0
  64. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.d.ts +2 -0
  65. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.js +14 -0
  66. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.d.ts +13 -0
  67. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.js +5 -0
  68. package/lib/components/Index/components/EntitiesView/stories/entitiesView.stories.d.ts +8 -0
  69. package/lib/components/Index/components/EntitiesView/stories/entitiesView.stories.js +50 -0
  70. package/lib/components/Index/components/EntitiesView/types.d.ts +8 -0
  71. package/lib/components/Index/components/EntitiesView/types.js +1 -0
  72. package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +5 -16
  73. package/lib/components/Index/components/NTagCell/nTagCell.stories.js +8 -8
  74. package/lib/components/Index/components/TitleCell/titleCell.d.ts +6 -0
  75. package/lib/components/Index/components/TitleCell/titleCell.js +10 -0
  76. package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +3 -0
  77. package/lib/components/Index/components/TitleCell/titleCell.styles.js +6 -0
  78. package/lib/components/Index/index.d.ts +2 -13
  79. package/lib/components/Index/index.js +6 -2
  80. package/lib/components/Index/index.stories.js +3 -2
  81. package/lib/components/Index/types.d.ts +12 -0
  82. package/lib/components/Index/types.js +1 -0
  83. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.d.ts +1 -1
  84. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.js +5 -4
  85. package/lib/components/Layout/components/BackPage/components/BackPageHero/stories/backPageHero.stories.d.ts +6 -0
  86. package/lib/components/Layout/components/BackPage/components/BackPageHero/stories/backPageHero.stories.js +18 -0
  87. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.js +3 -3
  88. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.d.ts +5 -0
  89. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.js +29 -0
  90. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +2 -2
  91. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/Button/button.styles.d.ts +1 -1
  92. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +6 -0
  93. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +13 -0
  94. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +36 -0
  95. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +9 -0
  96. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Menu/components/Toolbar/toolbar.js +2 -2
  97. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Menu/menu.js +2 -2
  98. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/Button/button.styles.d.ts +1 -1
  99. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.js +5 -3
  100. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.d.ts +5 -1
  101. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.js +4 -3
  102. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +5 -0
  103. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +10 -0
  104. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +36 -0
  105. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +9 -0
  106. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.js +2 -2
  107. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.js +2 -2
  108. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +5 -0
  109. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +19 -0
  110. package/lib/components/Layout/components/Outline/common/constants.d.ts +2 -0
  111. package/lib/components/Layout/components/Outline/common/constants.js +1 -0
  112. package/lib/components/Layout/components/Outline/outline.styles.d.ts +1 -1
  113. package/lib/components/Layout/components/Sidebar/components/SidebarButton/sidebarButton.js +2 -2
  114. package/lib/components/Loading/loading.d.ts +2 -1
  115. package/lib/components/Loading/loading.js +2 -2
  116. package/lib/components/Loading/loading.stories.d.ts +3 -31
  117. package/lib/components/Login/components/Button/button.styles.d.ts +1 -1
  118. package/lib/components/Login/components/Section/components/Consent/consent.js +3 -3
  119. package/lib/components/Login/components/Section/components/Consent/consent.styles.d.ts +1 -1
  120. package/lib/components/Login/components/Section/components/Consent/consent.styles.js +2 -2
  121. package/lib/components/Login/components/Section/components/Consent/types.d.ts +2 -2
  122. package/lib/components/Login/login.stories.d.ts +6 -0
  123. package/lib/components/Login/login.stories.js +31 -0
  124. package/lib/components/NoResults/noResults.d.ts +1 -8
  125. package/lib/components/NoResults/noResults.js +9 -8
  126. package/lib/components/NoResults/noResults.styles.d.ts +2 -2
  127. package/lib/components/NoResults/noResults.styles.js +4 -2
  128. package/lib/components/NoResults/types.d.ts +8 -0
  129. package/lib/components/NoResults/types.js +1 -0
  130. package/lib/components/Plot/components/BarX/barX.d.ts +2 -0
  131. package/lib/components/Plot/components/BarX/barX.js +13 -0
  132. package/lib/components/Plot/components/BarX/types.d.ts +5 -0
  133. package/lib/components/Plot/components/BarX/types.js +1 -0
  134. package/lib/components/Stepper/components/Step/components/StepContent/stepContent.d.ts +3 -0
  135. package/lib/components/Stepper/components/Step/components/StepContent/stepContent.js +7 -0
  136. package/lib/components/Stepper/components/Step/components/StepContent/stepContent.styles.d.ts +3 -0
  137. package/lib/components/Stepper/components/Step/components/StepContent/stepContent.styles.js +17 -0
  138. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.d.ts +2 -0
  139. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.js +8 -0
  140. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.d.ts +5 -0
  141. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.js +15 -0
  142. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.d.ts +2 -0
  143. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.js +4 -0
  144. package/lib/components/Stepper/components/Step/components/StepIcon/constants.d.ts +1 -0
  145. package/lib/components/Stepper/components/Step/components/StepIcon/constants.js +1 -0
  146. package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.d.ts +3 -0
  147. package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.js +6 -0
  148. package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.d.ts +3 -0
  149. package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.js +27 -0
  150. package/lib/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.d.ts +9 -0
  151. package/lib/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.js +38 -0
  152. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.d.ts +3 -0
  153. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.js +11 -0
  154. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.d.ts +2 -0
  155. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.js +9 -0
  156. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.d.ts +3 -0
  157. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.js +3 -0
  158. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.d.ts +6 -0
  159. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.js +20 -0
  160. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.d.ts +7 -0
  161. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.js +1 -0
  162. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/constants.d.ts +2 -0
  163. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/constants.js +6 -0
  164. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.d.ts +2 -0
  165. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.js +6 -0
  166. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.d.ts +5 -0
  167. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.js +7 -0
  168. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.d.ts +7 -0
  169. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.js +21 -0
  170. package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.d.ts +2 -0
  171. package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.js +5 -0
  172. package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.d.ts +2 -0
  173. package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.js +6 -0
  174. package/lib/components/Stepper/components/Step/components/StepLabel/constants.d.ts +2 -0
  175. package/lib/components/Stepper/components/Step/components/StepLabel/constants.js +8 -0
  176. package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.d.ts +2 -0
  177. package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.js +6 -0
  178. package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.d.ts +3 -0
  179. package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.js +12 -0
  180. package/lib/components/Stepper/components/Step/components/StepLabel/stories/contants.d.ts +4 -0
  181. package/lib/components/Stepper/components/Step/components/StepLabel/stories/contants.js +15 -0
  182. package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.d.ts +8 -0
  183. package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.js +37 -0
  184. package/lib/components/Stepper/components/Step/constants.d.ts +2 -0
  185. package/lib/components/Stepper/components/Step/constants.js +4 -0
  186. package/lib/components/Stepper/components/Step/step.d.ts +3 -0
  187. package/lib/components/Stepper/components/Step/step.js +6 -0
  188. package/lib/components/Stepper/components/Step/step.styles.d.ts +5 -0
  189. package/lib/components/Stepper/components/Step/step.styles.js +31 -0
  190. package/lib/components/Stepper/components/Step/stories/contants.d.ts +4 -0
  191. package/lib/components/Stepper/components/Step/stories/contants.js +14 -0
  192. package/lib/components/Stepper/components/Step/stories/step.stories.d.ts +8 -0
  193. package/lib/components/Stepper/components/Step/stories/step.stories.js +62 -0
  194. package/lib/components/Support/components/SupportRequest/components/Dialog/dialog.js +2 -2
  195. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.d.ts +16 -0
  196. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +28 -0
  197. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.d.ts +5 -0
  198. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.js +46 -0
  199. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +3 -0
  200. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +21 -0
  201. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +2 -0
  202. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +37 -0
  203. package/lib/components/Table/components/Pagination/pagination.js +3 -4
  204. package/lib/components/Table/components/TableHead/tableHead.js +2 -2
  205. package/lib/components/Table/table.js +11 -11
  206. package/lib/components/TableCreator/common/constants.d.ts +6 -0
  207. package/lib/components/TableCreator/common/constants.js +19 -0
  208. package/lib/components/TableCreator/common/entities.d.ts +5 -0
  209. package/lib/components/TableCreator/common/entities.js +1 -0
  210. package/lib/components/TableCreator/tableCreator.js +1 -6
  211. package/lib/components/common/Alert/alert.stories.d.ts +6 -0
  212. package/lib/components/common/Alert/alert.stories.js +36 -0
  213. package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +4 -0
  214. package/lib/components/common/Alert/components/AlertText/alertText.styles.js +19 -0
  215. package/lib/components/common/AnchorLink/anchorLink.js +2 -2
  216. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +7 -0
  217. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +5 -0
  218. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +3 -0
  219. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +19 -0
  220. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +10 -0
  221. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +16 -0
  222. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +3 -0
  223. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +21 -0
  224. package/lib/components/common/Breadcrumbs/breadcrumbs.js +2 -2
  225. package/lib/components/common/Breadcrumbs/typeGuard.d.ts +13 -0
  226. package/lib/components/common/Breadcrumbs/typeGuard.js +23 -0
  227. package/lib/components/common/Button/components/DropdownButton/dropdownButton.js +2 -2
  228. package/lib/components/common/Button/components/LoginButton/loginButton.d.ts +3 -0
  229. package/lib/components/common/Button/components/LoginButton/loginButton.js +6 -0
  230. package/lib/components/common/Button/components/LoginButton/loginButton.styles.d.ts +7 -0
  231. package/lib/components/common/Button/components/LoginButton/loginButton.styles.js +11 -0
  232. package/lib/components/common/Button/components/NavigationButton/navigationButton.js +2 -2
  233. package/lib/components/common/CopyToClipboard/copyToClipboard.js +2 -2
  234. package/lib/components/common/Dialog/components/DialogTitle/dialogTitle.js +2 -2
  235. package/lib/components/common/Drawer/components/DrawerTitle/drawerTitle.js +2 -2
  236. package/lib/components/common/Form/components/Select/components/DropDownIcon/dropDownIcon.d.ts +2 -3
  237. package/lib/components/common/Form/components/Select/components/DropDownIcon/dropDownIcon.js +3 -3
  238. package/lib/components/common/Form/components/UploadFile/uploadFile.js +2 -2
  239. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +5 -0
  240. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +10 -0
  241. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +3 -0
  242. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +9 -0
  243. package/lib/components/common/IconButton/iconButton.styles.d.ts +1 -1
  244. package/lib/components/common/KeyValuePairs/components/KeyElType/keyElType.d.ts +2 -5
  245. package/lib/components/common/KeyValuePairs/components/KeyElType/keyElType.js +6 -2
  246. package/lib/components/common/KeyValuePairs/components/ValueElType/valueElType.d.ts +2 -5
  247. package/lib/components/common/KeyValuePairs/components/ValueElType/valueElType.js +6 -2
  248. package/lib/components/common/LoginDialog/loginDialog.styles.js +1 -1
  249. package/lib/components/common/Paper/paper.d.ts +2 -1
  250. package/lib/components/common/Paper/paper.js +2 -2
  251. package/lib/components/common/Section/components/CollapsableSection/collapsableSection.js +2 -3
  252. package/lib/components/common/ToggleButtonGroup/hooks/UseToggleButtonGroup/hook.d.ts +2 -0
  253. package/lib/components/common/ToggleButtonGroup/hooks/UseToggleButtonGroup/hook.js +10 -0
  254. package/lib/components/types.d.ts +3 -0
  255. package/lib/config/entities.d.ts +2 -0
  256. package/lib/hooks/useAuthentication/common/constants.d.ts +4 -0
  257. package/lib/hooks/useAuthentication/common/constants.js +19 -0
  258. package/lib/hooks/useAuthentication/common/entities.d.ts +25 -0
  259. package/lib/hooks/useAuthentication/common/entities.js +11 -0
  260. package/lib/hooks/useAuthentication/common/utils.d.ts +15 -0
  261. package/lib/hooks/useAuthentication/common/utils.js +25 -0
  262. package/lib/hooks/useAuthentication/useAuthentication.d.ts +6 -0
  263. package/lib/hooks/useAuthentication/useAuthentication.js +9 -0
  264. package/lib/hooks/useAuthentication/useAuthenticationComplete.d.ts +6 -0
  265. package/lib/hooks/useAuthentication/useAuthenticationComplete.js +55 -0
  266. package/lib/hooks/useAuthentication/useAuthenticationForm.d.ts +20 -0
  267. package/lib/hooks/useAuthentication/useAuthenticationForm.js +88 -0
  268. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.d.ts +18 -0
  269. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.js +50 -0
  270. package/lib/hooks/useAuthentication/useAuthenticationStatus.d.ts +20 -0
  271. package/lib/hooks/useAuthentication/useAuthenticationStatus.js +32 -0
  272. package/lib/hooks/useAuthentication/useFetchGoogleProfile.d.ts +21 -0
  273. package/lib/hooks/useAuthentication/useFetchGoogleProfile.js +41 -0
  274. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.d.ts +18 -0
  275. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.js +62 -0
  276. package/lib/hooks/useAuthentication/useFetchTerraProfile.d.ts +24 -0
  277. package/lib/hooks/useAuthentication/useFetchTerraProfile.js +62 -0
  278. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.d.ts +15 -0
  279. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.js +62 -0
  280. package/lib/hooks/useAuthentication/useTokenClient.d.ts +11 -0
  281. package/lib/hooks/useAuthentication/useTokenClient.js +29 -0
  282. package/lib/hooks/useAuthenticationConfig.d.ts +6 -0
  283. package/lib/hooks/useAuthenticationConfig.js +14 -0
  284. package/lib/hooks/useCategoryConfigs.d.ts +6 -0
  285. package/lib/hooks/useCategoryConfigs.js +17 -0
  286. package/lib/hooks/useCategoryFilter.js +1 -0
  287. package/lib/hooks/useEntityListRelatedView.d.ts +15 -0
  288. package/lib/hooks/useEntityListRelatedView.js +62 -0
  289. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +15 -0
  290. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +27 -0
  291. package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +5 -0
  292. package/lib/hooks/useFileManifest/useFileManifestURL.js +11 -0
  293. package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +9 -0
  294. package/lib/hooks/useFileManifest/useRequestFileManifest.js +37 -0
  295. package/lib/hooks/useLayoutState.d.ts +6 -0
  296. package/lib/hooks/useLayoutState.js +9 -0
  297. package/lib/hooks/useMenu.d.ts +10 -0
  298. package/lib/hooks/useMenu.js +17 -0
  299. package/lib/hooks/useMenuWithPosition.d.ts +14 -0
  300. package/lib/hooks/useMenuWithPosition.js +33 -0
  301. package/lib/hooks/useResizeObserver.d.ts +2 -1
  302. package/lib/hooks/useResizeObserver.js +5 -2
  303. package/lib/hooks/useSessionTimeout.d.ts +11 -0
  304. package/lib/hooks/useSessionTimeout.js +28 -0
  305. package/lib/providers/authentication.d.ts +51 -0
  306. package/lib/providers/authentication.js +110 -0
  307. package/lib/providers/layoutState.d.ts +40 -0
  308. package/lib/providers/layoutState.js +47 -0
  309. package/lib/storybook/controls/constants.d.ts +4 -0
  310. package/lib/storybook/controls/constants.js +6 -0
  311. package/lib/storybook/controls/types.d.ts +4 -0
  312. package/lib/storybook/controls/types.js +5 -0
  313. package/lib/storybook/controls/utils.d.ts +9 -0
  314. package/lib/storybook/controls/utils.js +10 -0
  315. package/lib/storybook/decorators.d.ts +2 -0
  316. package/lib/storybook/decorators.js +11 -0
  317. package/lib/storybook/loremIpsum.d.ts +4 -0
  318. package/lib/storybook/loremIpsum.js +4 -0
  319. package/lib/storybook/parameters.d.ts +2 -0
  320. package/lib/storybook/parameters.js +12 -0
  321. package/lib/styles/common/mui/palette.d.ts +47 -0
  322. package/lib/styles/common/mui/palette.js +47 -0
  323. package/lib/styles/common/mui/stepper.d.ts +7 -0
  324. package/lib/styles/common/mui/stepper.js +7 -0
  325. package/lib/styles/common/mui/svgIcon.d.ts +9 -0
  326. package/lib/styles/common/mui/svgIcon.js +26 -0
  327. package/lib/styles/common/mui/typography.js +1 -0
  328. package/lib/tests/mui/constants.d.ts +4 -0
  329. package/lib/tests/mui/constants.js +4 -0
  330. package/lib/theme/common/typography.d.ts +6 -2
  331. package/lib/theme/common/typography.js +10 -1
  332. package/lib/theme/theme.js +2 -0
  333. package/lib/utils/tests.d.ts +12 -0
  334. package/lib/utils/tests.js +20 -0
  335. package/lib/views/ExploreView/exploreView.js +4 -24
  336. package/package.json +6 -4
  337. package/src/common/entities.ts +1 -0
  338. package/src/components/DataDictionary/components/Entities/constants.ts +2 -2
  339. package/src/components/DataDictionary/components/Entities/entities.tsx +4 -4
  340. package/src/components/DataDictionary/components/Entity/constants.ts +2 -2
  341. package/src/components/DataDictionary/components/Entity/entity.tsx +6 -6
  342. package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.tsx +1 -1
  343. package/src/components/Filter/components/FilterLabel/filterLabel.tsx +2 -2
  344. package/src/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.tsx +2 -2
  345. package/src/components/Index/components/EntitiesView/components/ChartView/chartView.styles.ts +14 -0
  346. package/src/components/Index/components/EntitiesView/components/ChartView/chartView.tsx +38 -0
  347. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.ts +13 -0
  348. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.ts +104 -0
  349. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.ts +229 -0
  350. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.ts +30 -0
  351. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.tsx +16 -0
  352. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.ts +1 -0
  353. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.ts +74 -0
  354. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.tsx +29 -0
  355. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.ts +9 -0
  356. package/src/components/Index/components/EntitiesView/components/ChartView/constants.ts +1 -0
  357. package/src/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.ts +8 -0
  358. package/src/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.ts +29 -0
  359. package/src/components/Index/components/EntitiesView/components/ChartView/stories/args.ts +99 -0
  360. package/src/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.tsx +25 -0
  361. package/src/components/Index/components/EntitiesView/components/ChartView/types.ts +7 -0
  362. package/src/components/Index/components/EntitiesView/components/ChartView/utils.ts +26 -0
  363. package/src/components/Index/components/EntitiesView/components/EntityList/entityList.tsx +29 -0
  364. package/src/components/Index/components/EntitiesView/components/EntityList/types.ts +3 -0
  365. package/src/components/Index/components/EntitiesView/constants.ts +1 -0
  366. package/src/components/Index/components/EntitiesView/entitiesView.styles.ts +21 -0
  367. package/src/components/Index/components/EntitiesView/entitiesView.tsx +30 -0
  368. package/src/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.ts +15 -0
  369. package/src/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.ts +16 -0
  370. package/src/components/Index/components/EntitiesView/stories/entitiesView.stories.tsx +76 -0
  371. package/src/components/Index/components/EntitiesView/types.ts +9 -0
  372. package/src/components/Index/index.stories.tsx +3 -2
  373. package/src/components/Index/index.tsx +15 -15
  374. package/src/components/Index/types.ts +13 -0
  375. package/src/components/Layout/components/BackPage/components/BackPageHero/backPageHero.tsx +19 -14
  376. package/src/components/Layout/components/BackPage/components/BackPageHero/stories/backPageHero.stories.tsx +24 -0
  377. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.tsx +3 -3
  378. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Menu/components/Toolbar/toolbar.tsx +2 -2
  379. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Menu/menu.tsx +2 -2
  380. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.ts +8 -3
  381. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.tsx +5 -2
  382. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.tsx +2 -2
  383. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.tsx +2 -2
  384. package/src/components/Layout/components/Sidebar/components/SidebarButton/sidebarButton.tsx +2 -2
  385. package/src/components/Loading/loading.stories.tsx +2 -2
  386. package/src/components/Loading/loading.tsx +11 -3
  387. package/src/components/Login/components/Section/components/Consent/consent.styles.ts +2 -2
  388. package/src/components/Login/components/Section/components/Consent/consent.tsx +4 -4
  389. package/src/components/Login/components/Section/components/Consent/types.ts +2 -2
  390. package/src/components/NoResults/noResults.styles.ts +4 -2
  391. package/src/components/NoResults/noResults.tsx +16 -22
  392. package/src/components/NoResults/types.ts +13 -0
  393. package/src/components/Plot/components/BarX/barX.tsx +20 -0
  394. package/src/components/Plot/components/BarX/types.ts +6 -0
  395. package/src/components/Stepper/components/Step/components/StepContent/stepContent.styles.ts +18 -0
  396. package/src/components/Stepper/components/Step/components/StepContent/stepContent.tsx +16 -0
  397. package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.ts +19 -0
  398. package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.tsx +20 -0
  399. package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.ts +6 -0
  400. package/src/components/Stepper/components/Step/components/StepIcon/constants.ts +1 -0
  401. package/src/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.ts +32 -0
  402. package/src/components/Stepper/components/Step/components/StepIcon/stepIcon.tsx +21 -0
  403. package/src/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.tsx +52 -0
  404. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.ts +14 -0
  405. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.tsx +13 -0
  406. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.ts +6 -0
  407. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.tsx +30 -0
  408. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.ts +8 -0
  409. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/constants.ts +8 -0
  410. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.ts +8 -0
  411. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/label.tsx +10 -0
  412. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.tsx +31 -0
  413. package/src/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.ts +7 -0
  414. package/src/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.tsx +9 -0
  415. package/src/components/Stepper/components/Step/components/StepLabel/constants.ts +10 -0
  416. package/src/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.ts +13 -0
  417. package/src/components/Stepper/components/Step/components/StepLabel/stepLabel.tsx +10 -0
  418. package/src/components/Stepper/components/Step/components/StepLabel/stories/contants.ts +19 -0
  419. package/src/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.tsx +48 -0
  420. package/src/components/Stepper/components/Step/constants.ts +6 -0
  421. package/src/components/Stepper/components/Step/step.styles.ts +33 -0
  422. package/src/components/Stepper/components/Step/step.tsx +12 -0
  423. package/src/components/Stepper/components/Step/stories/contants.ts +18 -0
  424. package/src/components/Stepper/components/Step/stories/step.stories.tsx +87 -0
  425. package/src/components/Support/components/SupportRequest/components/Dialog/dialog.tsx +2 -2
  426. package/src/components/Table/components/Pagination/pagination.tsx +3 -4
  427. package/src/components/Table/components/TableHead/tableHead.tsx +2 -2
  428. package/src/components/Table/table.tsx +42 -38
  429. package/src/components/TableCreator/tableCreator.tsx +8 -18
  430. package/src/components/common/AnchorLink/anchorLink.tsx +2 -2
  431. package/src/components/common/Breadcrumbs/breadcrumbs.tsx +2 -2
  432. package/src/components/common/Breadcrumbs/typeGuard.ts +24 -0
  433. package/src/components/common/Button/components/DropdownButton/dropdownButton.tsx +2 -2
  434. package/src/components/common/Button/components/NavigationButton/navigationButton.tsx +2 -2
  435. package/src/components/common/CopyToClipboard/copyToClipboard.tsx +2 -2
  436. package/src/components/common/Dialog/components/DialogTitle/dialogTitle.tsx +2 -2
  437. package/src/components/common/Drawer/components/DrawerTitle/drawerTitle.tsx +2 -2
  438. package/src/components/common/Form/components/Select/components/DropDownIcon/dropDownIcon.tsx +5 -6
  439. package/src/components/common/Form/components/UploadFile/uploadFile.tsx +2 -2
  440. package/src/components/common/KeyValuePairs/components/KeyElType/keyElType.tsx +14 -9
  441. package/src/components/common/KeyValuePairs/components/ValueElType/valueElType.tsx +8 -9
  442. package/src/components/common/LoginDialog/loginDialog.styles.ts +1 -1
  443. package/src/components/common/Paper/paper.tsx +9 -3
  444. package/src/components/common/Section/components/CollapsableSection/collapsableSection.tsx +2 -3
  445. package/src/components/common/ToggleButtonGroup/hooks/UseToggleButtonGroup/hook.ts +17 -0
  446. package/src/components/types.ts +4 -0
  447. package/src/config/entities.ts +2 -0
  448. package/src/hooks/useCategoryFilter.ts +1 -0
  449. package/src/hooks/useResizeObserver.ts +5 -2
  450. package/src/storybook/controls/constants.ts +12 -0
  451. package/src/storybook/controls/types.ts +4 -0
  452. package/src/storybook/controls/utils.ts +18 -0
  453. package/src/storybook/decorators.tsx +17 -0
  454. package/src/storybook/loremIpsum.ts +5 -0
  455. package/src/storybook/parameters.ts +14 -0
  456. package/src/styles/common/mui/palette.ts +47 -0
  457. package/src/styles/common/mui/stepper.ts +14 -0
  458. package/src/styles/common/mui/svgIcon.ts +35 -0
  459. package/src/styles/common/mui/typography.ts +1 -0
  460. package/src/tests/mui/constants.ts +4 -0
  461. package/src/theme/common/typography.ts +12 -1
  462. package/src/theme/theme.ts +2 -0
  463. package/src/utils/tests.ts +20 -0
  464. package/src/views/ExploreView/exploreView.tsx +8 -42
  465. package/tests/chart.test.tsx +170 -0
  466. package/tests/chartView.test.tsx +36 -0
  467. package/tests/entitiesView.test.tsx +36 -0
  468. package/tests/setup.ts +19 -0
  469. package/tests/stepIcon.test.tsx +42 -0
  470. package/types/data-explorer-ui.d.ts +39 -80
  471. package/src/components/Index/components/Cell/cell.tsx +0 -22
  472. package/src/components/Index/components/NTag/components/Tooltip/tooltip.styles.ts +0 -11
  473. package/src/components/Index/components/NTag/components/Tooltip/tooltip.tsx +0 -90
  474. package/src/components/Index/components/NTag/nTag.tsx +0 -25
  475. package/src/components/Index/components/NTagCell/nTagCell.stories.tsx +0 -22
  476. package/src/components/Index/components/NTagCell/nTagCell.tsx +0 -74
  477. package/src/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.tsx +0 -16
  478. package/src/components/TableCreator/tableCreator.styles.ts +0 -5
@@ -0,0 +1,62 @@
1
+ import { useCallback, useEffect, useState } from "react";
2
+ import { useAuthenticationConfig } from "../useAuthenticationConfig";
3
+ import { LOGIN_STATUS_FAILED } from "./common/constants";
4
+ import { REQUEST_STATUS, } from "./common/entities";
5
+ import { getAuthenticationRequestOptions, initLoginStatus, } from "./common/utils";
6
+ /**
7
+ * Returns Terra NIH login status from configured endpoint.
8
+ * @param token - Token.
9
+ * @returns Terra NIH login status.
10
+ */
11
+ export const useFetchTerraNIHProfile = (token) => {
12
+ const authenticationConfig = useAuthenticationConfig();
13
+ const { terraAuthConfig: { terraNIHProfileEndpoint: endpoint } = {} } = authenticationConfig;
14
+ const [loginStatus, setLoginStatus] = useState(initLoginStatus(endpoint));
15
+ // Fetch Terra NIH account profile.
16
+ const fetchEndpointData = useCallback((endpoint, accessToken) => {
17
+ fetch(endpoint, getAuthenticationRequestOptions(accessToken))
18
+ .then((response) => response.json())
19
+ .then((response) => {
20
+ if (isResponseError(response)) {
21
+ setLoginStatus(LOGIN_STATUS_FAILED);
22
+ }
23
+ else {
24
+ setLoginStatus((prevStatus) => ({
25
+ ...prevStatus,
26
+ isSuccess: isResponseSuccess(response),
27
+ requestStatus: REQUEST_STATUS.COMPLETED,
28
+ response,
29
+ }));
30
+ }
31
+ })
32
+ .catch((err) => {
33
+ console.log(err); // TODO handle error.
34
+ setLoginStatus(LOGIN_STATUS_FAILED);
35
+ });
36
+ }, []);
37
+ // Fetches Terra NIH account profile.
38
+ useEffect(() => {
39
+ if (!token)
40
+ return;
41
+ if (!endpoint)
42
+ return;
43
+ fetchEndpointData(endpoint, token);
44
+ }, [endpoint, fetchEndpointData, token]);
45
+ return loginStatus;
46
+ };
47
+ /**
48
+ * Returns true if response is an error response.
49
+ * @param response - Response.
50
+ * @returns true if response is an error response.
51
+ */
52
+ function isResponseError(response) {
53
+ return Boolean(response.statusCode);
54
+ }
55
+ /**
56
+ * Returns true if the user accepted terms of service version is current.
57
+ * @param response - Response.
58
+ * @returns true if response is successful.
59
+ */
60
+ function isResponseSuccess(response) {
61
+ return Boolean(response.linkedNihUsername);
62
+ }
@@ -0,0 +1,24 @@
1
+ import { LoginStatus } from "./common/entities";
2
+ type Status = LoginStatus<TerraResponse>;
3
+ export interface TerraResponse {
4
+ enabled: TerraResponseEnabled;
5
+ userInfo: TerraResponseUserInfo;
6
+ }
7
+ interface TerraResponseEnabled {
8
+ adminEnabled: boolean;
9
+ allUsersGroup: boolean;
10
+ google: boolean;
11
+ ldap: boolean;
12
+ tosAccepted: boolean;
13
+ }
14
+ interface TerraResponseUserInfo {
15
+ userEmail: string;
16
+ userSubjectId: string;
17
+ }
18
+ /**
19
+ * Returns Terra profile login status from configured endpoint.
20
+ * @param token - Token.
21
+ * @returns Terra profile login status.
22
+ */
23
+ export declare const useFetchTerraProfile: (token?: string) => Status;
24
+ export {};
@@ -0,0 +1,62 @@
1
+ import { useCallback, useEffect, useState } from "react";
2
+ import { useAuthenticationConfig } from "../useAuthenticationConfig";
3
+ import { LOGIN_STATUS_FAILED } from "./common/constants";
4
+ import { REQUEST_STATUS, } from "./common/entities";
5
+ import { getAuthenticationRequestOptions, initLoginStatus, } from "./common/utils";
6
+ /**
7
+ * Returns Terra profile login status from configured endpoint.
8
+ * @param token - Token.
9
+ * @returns Terra profile login status.
10
+ */
11
+ export const useFetchTerraProfile = (token) => {
12
+ const authenticationConfig = useAuthenticationConfig();
13
+ const { terraAuthConfig: { terraProfileEndpoint: endpoint } = {} } = authenticationConfig;
14
+ const [loginStatus, setLoginStatus] = useState(initLoginStatus(endpoint));
15
+ // Fetch Terra profile.
16
+ const fetchEndpointData = useCallback((endpoint, accessToken) => {
17
+ fetch(endpoint, getAuthenticationRequestOptions(accessToken))
18
+ .then((response) => response.json())
19
+ .then((response) => {
20
+ if (isResponseError(response)) {
21
+ setLoginStatus(LOGIN_STATUS_FAILED);
22
+ }
23
+ else {
24
+ setLoginStatus((prevStatus) => ({
25
+ ...prevStatus,
26
+ isSuccess: isResponseSuccess(response),
27
+ requestStatus: REQUEST_STATUS.COMPLETED,
28
+ response: response,
29
+ }));
30
+ }
31
+ })
32
+ .catch((err) => {
33
+ console.log(err); // TODO handle error.
34
+ setLoginStatus(LOGIN_STATUS_FAILED);
35
+ });
36
+ }, []);
37
+ // Fetches Terra profile.
38
+ useEffect(() => {
39
+ if (!token)
40
+ return;
41
+ if (!endpoint)
42
+ return;
43
+ fetchEndpointData(endpoint, token);
44
+ }, [endpoint, fetchEndpointData, token]);
45
+ return loginStatus;
46
+ };
47
+ /**
48
+ * Returns true if response is an error response.
49
+ * @param response - Response.
50
+ * @returns true if response is an error response.
51
+ */
52
+ function isResponseError(response) {
53
+ return Boolean(response.statusCode);
54
+ }
55
+ /**
56
+ * Returns true if response is enabled.
57
+ * @param response - Response.
58
+ * @returns true if response is successful.
59
+ */
60
+ function isResponseSuccess(response) {
61
+ return Boolean(response.enabled?.google);
62
+ }
@@ -0,0 +1,15 @@
1
+ import { LoginStatus } from "./common/entities";
2
+ type Status = LoginStatus<TerraTermsOfServiceResponse>;
3
+ export interface TerraTermsOfServiceResponse {
4
+ currentVersion: string;
5
+ isEnabled: boolean;
6
+ isGracePeriodEnabled: boolean;
7
+ userAcceptedVersion?: string;
8
+ }
9
+ /**
10
+ * Returns Terra terms of service login status from configured endpoint.
11
+ * @param token - Token.
12
+ * @returns Terra terms of service login status.
13
+ */
14
+ export declare const useFetchTerraTermsOfService: (token?: string) => Status;
15
+ export {};
@@ -0,0 +1,62 @@
1
+ import { useCallback, useEffect, useState } from "react";
2
+ import { useAuthenticationConfig } from "../useAuthenticationConfig";
3
+ import { LOGIN_STATUS_FAILED } from "./common/constants";
4
+ import { REQUEST_STATUS, } from "./common/entities";
5
+ import { getAuthenticationRequestOptions, initLoginStatus, } from "./common/utils";
6
+ /**
7
+ * Returns Terra terms of service login status from configured endpoint.
8
+ * @param token - Token.
9
+ * @returns Terra terms of service login status.
10
+ */
11
+ export const useFetchTerraTermsOfService = (token) => {
12
+ const authenticationConfig = useAuthenticationConfig();
13
+ const { terraAuthConfig: { termsOfServiceEndpoint: endpoint } = {} } = authenticationConfig;
14
+ const [loginStatus, setLoginStatus] = useState(initLoginStatus(endpoint));
15
+ // Fetch Terra terms of service.
16
+ const fetchEndpointData = useCallback((endpoint, accessToken) => {
17
+ fetch(endpoint, getAuthenticationRequestOptions(accessToken))
18
+ .then((response) => response.json())
19
+ .then((response) => {
20
+ if (isResponseError(response)) {
21
+ setLoginStatus(LOGIN_STATUS_FAILED);
22
+ }
23
+ else {
24
+ setLoginStatus((prevStatus) => ({
25
+ ...prevStatus,
26
+ isSuccess: isResponseSuccess(response),
27
+ requestStatus: REQUEST_STATUS.COMPLETED,
28
+ response,
29
+ }));
30
+ }
31
+ })
32
+ .catch((err) => {
33
+ console.log(err); // TODO handle error.
34
+ setLoginStatus(LOGIN_STATUS_FAILED);
35
+ });
36
+ }, []);
37
+ // Fetches Terra terms of service.
38
+ useEffect(() => {
39
+ if (!token)
40
+ return;
41
+ if (!endpoint)
42
+ return;
43
+ fetchEndpointData(endpoint, token);
44
+ }, [endpoint, fetchEndpointData, token]);
45
+ return loginStatus;
46
+ };
47
+ /**
48
+ * Returns true if response is an error response.
49
+ * @param response - Response.
50
+ * @returns true if response is an error response.
51
+ */
52
+ function isResponseError(response) {
53
+ return Boolean(response.statusCode);
54
+ }
55
+ /**
56
+ * Returns true if the user accepted terms of service version is current.
57
+ * @param response - Response.
58
+ * @returns true if response is successful.
59
+ */
60
+ function isResponseSuccess(response) {
61
+ return Boolean(response.currentVersion === response.userAcceptedVersion);
62
+ }
@@ -0,0 +1,11 @@
1
+ type TokenClient = any;
2
+ export interface UseTokenClient {
3
+ token: string | undefined;
4
+ tokenClient: TokenClient | undefined;
5
+ }
6
+ /**
7
+ * Initializes the token client, sets token from token client callback.
8
+ * @returns initialized token client.
9
+ */
10
+ export declare const useTokenClient: () => UseTokenClient;
11
+ export {};
@@ -0,0 +1,29 @@
1
+ import { useEffect, useState } from "react";
2
+ import { useAuthenticationConfig } from "../useAuthenticationConfig";
3
+ /**
4
+ * Initializes the token client, sets token from token client callback.
5
+ * @returns initialized token client.
6
+ */
7
+ export const useTokenClient = () => {
8
+ const [token, setToken] = useState();
9
+ const [tokenClient, setTokenClient] = useState();
10
+ const authenticationConfig = useAuthenticationConfig();
11
+ const { googleGISAuthConfig: { clientId, scope } = {} } = authenticationConfig;
12
+ // Initializes token client - (authorization client id must be configured).
13
+ useEffect(() => {
14
+ if (clientId) {
15
+ setTokenClient(google.accounts.oauth2.initTokenClient({
16
+ callback: (tokenResponse) => {
17
+ const access_token = tokenResponse.access_token;
18
+ setToken(access_token);
19
+ },
20
+ client_id: clientId,
21
+ scope,
22
+ }));
23
+ }
24
+ }, [clientId, scope]);
25
+ return {
26
+ token,
27
+ tokenClient,
28
+ };
29
+ };
@@ -0,0 +1,6 @@
1
+ import { AuthenticationConfig } from "../config/entities";
2
+ /**
3
+ * Hook to get the authentication config
4
+ * @returns @see AuthenticationConfig used in the current config.
5
+ */
6
+ export declare const useAuthenticationConfig: () => AuthenticationConfig;
@@ -0,0 +1,14 @@
1
+ import { useConfig } from "./useConfig";
2
+ /**
3
+ * Hook to get the authentication config
4
+ * @returns @see AuthenticationConfig used in the current config.
5
+ */
6
+ export const useAuthenticationConfig = () => {
7
+ const { config } = useConfig();
8
+ if (!config.authentication) {
9
+ return {
10
+ title: "",
11
+ };
12
+ }
13
+ return config.authentication;
14
+ };
@@ -0,0 +1,6 @@
1
+ import { CategoryConfig } from "../config/entities";
2
+ /**
3
+ * Returns configured grouped configured categories as a list of configured categories.
4
+ * @returns a list of configured categories.
5
+ */
6
+ export declare const useCategoryConfigs: () => CategoryConfig[] | undefined;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useCategoryConfigs = void 0;
4
+ const react_1 = require("react");
5
+ const useConfig_1 = require("./useConfig");
6
+ /**
7
+ * Returns configured grouped configured categories as a list of configured categories.
8
+ * @returns a list of configured categories.
9
+ */
10
+ const useCategoryConfigs = () => {
11
+ const { config } = (0, useConfig_1.useConfig)();
12
+ const { categoryGroupConfigs } = config;
13
+ return (0, react_1.useMemo)(() => {
14
+ return categoryGroupConfigs === null || categoryGroupConfigs === void 0 ? void 0 : categoryGroupConfigs.flatMap(({ categoryConfigs }) => categoryConfigs);
15
+ }, [categoryGroupConfigs]);
16
+ };
17
+ exports.useCategoryConfigs = useCategoryConfigs;
@@ -28,6 +28,7 @@ function buildCategoryView(category, categoryValueViews, categoryConfigs) {
28
28
  const mapSelectCategoryValue = categoryConfig?.mapSelectCategoryValue || getSelectCategoryValue;
29
29
  return {
30
30
  annotation: categoryConfig?.annotation,
31
+ enableChartView: categoryConfig?.enableChartView,
31
32
  isDisabled: false,
32
33
  key: category.key,
33
34
  label: getCategoryLabel(category.key, categoryConfig),
@@ -0,0 +1,15 @@
1
+ import { SelectedFilterValue } from "../common/entities";
2
+ import { RelatedSearchResult } from "../config/entities";
3
+ import { ListItems, RelatedListItems } from "../providers/exploreState";
4
+ /**
5
+ * Returns related entity lists filtered by related search results.
6
+ * @param listItems - Entity list items.
7
+ * @param relatedSearchResult - Related search result.
8
+ * @param excludedValues - Selected category values to be excluded from related entity lists.
9
+ * @returns related entities.
10
+ */
11
+ export declare function buildRelatedEntityList(listItems: ListItems, relatedSearchResult: RelatedSearchResult | undefined, excludedValues: SelectedFilterValue | undefined): RelatedListItems;
12
+ /**
13
+ * Updates related entity list.
14
+ */
15
+ export declare const useEntityListRelatedView: () => void;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useEntityListRelatedView = exports.buildRelatedEntityList = void 0;
4
+ const react_1 = require("react");
5
+ const exploreState_1 = require("../providers/exploreState");
6
+ const useAsync_1 = require("./useAsync");
7
+ const useConfig_1 = require("./useConfig");
8
+ const useExploreState_1 = require("./useExploreState");
9
+ /**
10
+ * Returns related entity lists filtered by related search results.
11
+ * @param listItems - Entity list items.
12
+ * @param relatedSearchResult - Related search result.
13
+ * @param excludedValues - Selected category values to be excluded from related entity lists.
14
+ * @returns related entities.
15
+ */
16
+ function buildRelatedEntityList(listItems, relatedSearchResult, excludedValues) {
17
+ if (relatedSearchResult) {
18
+ const { resultKey, searchKey, values } = relatedSearchResult;
19
+ return listItems === null || listItems === void 0 ? void 0 : listItems.filter((listItem) => {
20
+ if (values.includes(listItem[resultKey].toLowerCase())) {
21
+ return !(excludedValues === null || excludedValues === void 0 ? void 0 : excludedValues.includes(listItem[searchKey])); // Exclude any row where any of the selected category values matches the corresponding row value.
22
+ }
23
+ });
24
+ }
25
+ }
26
+ exports.buildRelatedEntityList = buildRelatedEntityList;
27
+ /**
28
+ * Updates related entity list.
29
+ */
30
+ const useEntityListRelatedView = () => {
31
+ var _a;
32
+ const { entityConfig } = (0, useConfig_1.useConfig)();
33
+ const { exploreDispatch, exploreState } = (0, useExploreState_1.useExploreState)();
34
+ const { filterState, listItems } = exploreState;
35
+ const { listView } = entityConfig;
36
+ const relatedView = listView === null || listView === void 0 ? void 0 : listView.relatedView;
37
+ const { relatedSearchFn, resultKey, searchKey } = relatedView || {};
38
+ const { data: relatedSearchResult, run } = (0, useAsync_1.useAsync)();
39
+ const selectedCategoryValues = (_a = filterState.find(({ categoryKey }) => categoryKey === searchKey)) === null || _a === void 0 ? void 0 : _a.value;
40
+ (0, react_1.useEffect)(() => {
41
+ if (relatedSearchFn) {
42
+ run(relatedSearchFn(searchKey, resultKey, selectedCategoryValues));
43
+ }
44
+ }, [relatedSearchFn, resultKey, run, searchKey, selectedCategoryValues]);
45
+ (0, react_1.useEffect)(() => {
46
+ if (relatedSearchFn) {
47
+ exploreDispatch({
48
+ payload: {
49
+ relatedListItems: buildRelatedEntityList(listItems, relatedSearchResult, selectedCategoryValues),
50
+ },
51
+ type: exploreState_1.ExploreActionKind.ProcessRelatedResponse,
52
+ });
53
+ }
54
+ }, [
55
+ exploreDispatch,
56
+ listItems,
57
+ relatedSearchFn,
58
+ relatedSearchResult,
59
+ selectedCategoryValues,
60
+ ]);
61
+ };
62
+ exports.useEntityListRelatedView = useEntityListRelatedView;
@@ -0,0 +1,15 @@
1
+ import { ManifestDownloadFormat } from "../../../apis/azul/common/entities";
2
+ import { Filters } from "../../../common/entities";
3
+ export interface FileManifestRequestURL {
4
+ requestParams: URLSearchParams;
5
+ requestURL: string;
6
+ }
7
+ /**
8
+ * Build up file manifest request params and URL query string for the given search results, catalog and format.
9
+ * @param url - Data URL.
10
+ * @param filters - Selected filters.
11
+ * @param catalog - Configured catalog.
12
+ * @param manifestFormat - Manifest format.
13
+ * @returns file manifest request params and URL query string.
14
+ */
15
+ export declare const buildFileManifestRequestURL: (url: string, filters: Filters, catalog: string, manifestFormat: ManifestDownloadFormat | undefined) => FileManifestRequestURL | undefined;
@@ -0,0 +1,27 @@
1
+ import { AZUL_PARAM, } from "../../../apis/azul/common/entities";
2
+ import { transformFilters } from "../../../apis/azul/common/filterTransformer";
3
+ /**
4
+ * Build up file manifest request params and URL query string for the given search results, catalog and format.
5
+ * @param url - Data URL.
6
+ * @param filters - Selected filters.
7
+ * @param catalog - Configured catalog.
8
+ * @param manifestFormat - Manifest format.
9
+ * @returns file manifest request params and URL query string.
10
+ */
11
+ export const buildFileManifestRequestURL = (url, filters, catalog, manifestFormat) => {
12
+ if (!manifestFormat) {
13
+ return;
14
+ }
15
+ // Build request params.
16
+ const requestParams = new URLSearchParams({
17
+ [AZUL_PARAM.CATALOG]: catalog,
18
+ [AZUL_PARAM.FILTERS]: transformFilters(filters),
19
+ format: manifestFormat,
20
+ });
21
+ // Build file manifest URL
22
+ const requestURL = `${url}fetch/manifest/files?${requestParams.toString()}`;
23
+ return {
24
+ requestParams,
25
+ requestURL,
26
+ };
27
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns data URL for the integrations end point.
3
+ * @returns data URL for the integrations end point.
4
+ */
5
+ export declare const useFileManifestURL: () => string;
@@ -0,0 +1,11 @@
1
+ import { useConfig } from "../useConfig";
2
+ /**
3
+ * Returns data URL for the integrations end point.
4
+ * @returns data URL for the integrations end point.
5
+ */
6
+ export const useFileManifestURL = () => {
7
+ const { config } = useConfig();
8
+ const { dataSource } = config;
9
+ const { url } = dataSource;
10
+ return url;
11
+ };
@@ -0,0 +1,9 @@
1
+ import { ManifestDownloadFormat } from "../../apis/azul/common/entities";
2
+ import { Filters } from "../../common/entities";
3
+ /**
4
+ * Initializes and fetches file manifest comprising file facets and summary for the given file manifest format.
5
+ * @param fileManifestFormat - File manifest format.
6
+ * @param initialFilters - Filters to initialize file manifest request.
7
+ * @param fileSummaryFacetName - File summary facet name.
8
+ */
9
+ export declare const useRequestFileManifest: (fileManifestFormat: ManifestDownloadFormat | undefined, initialFilters?: Filters | undefined, fileSummaryFacetName?: string) => void;
@@ -0,0 +1,37 @@
1
+ import { useEffect, useState } from "react";
2
+ import { FileManifestActionKind } from "../../providers/fileManifestState";
3
+ import { useFileManifestState } from "../useFileManifestState";
4
+ /**
5
+ * Initializes and fetches file manifest comprising file facets and summary for the given file manifest format.
6
+ * @param fileManifestFormat - File manifest format.
7
+ * @param initialFilters - Filters to initialize file manifest request.
8
+ * @param fileSummaryFacetName - File summary facet name.
9
+ */
10
+ export const useRequestFileManifest = (fileManifestFormat, initialFilters = [], fileSummaryFacetName) => {
11
+ // Initial file manifest filter.
12
+ const [initFilters] = useState(() => initialFilters);
13
+ // File manifest state.
14
+ const { fileManifestDispatch } = useFileManifestState();
15
+ // Fetches file manifest with the given file manifest filters, format.
16
+ useEffect(() => {
17
+ fileManifestDispatch({
18
+ payload: {
19
+ fileManifestFormat,
20
+ fileSummaryFacetName,
21
+ filters: initFilters,
22
+ },
23
+ type: FileManifestActionKind.FetchFileManifest,
24
+ });
25
+ return () => {
26
+ fileManifestDispatch({
27
+ payload: undefined,
28
+ type: FileManifestActionKind.ClearFileManifest,
29
+ });
30
+ };
31
+ }, [
32
+ fileManifestDispatch,
33
+ fileManifestFormat,
34
+ fileSummaryFacetName,
35
+ initFilters,
36
+ ]);
37
+ };
@@ -0,0 +1,6 @@
1
+ import { LayoutStateContextProps } from "../providers/layoutState";
2
+ /**
3
+ * Returns layout state context.
4
+ * @returns layout state context.
5
+ */
6
+ export declare const useLayoutState: () => LayoutStateContextProps;
@@ -0,0 +1,9 @@
1
+ import { useContext } from "react";
2
+ import { LayoutStateContext, } from "../providers/layoutState";
3
+ /**
4
+ * Returns layout state context.
5
+ * @returns layout state context.
6
+ */
7
+ export const useLayoutState = () => {
8
+ return useContext(LayoutStateContext);
9
+ };
@@ -0,0 +1,10 @@
1
+ export interface UseMenu {
2
+ onClose: () => void;
3
+ onOpen: () => void;
4
+ open: boolean;
5
+ }
6
+ /**
7
+ * Menu functionality for menu dropdown.
8
+ * @returns menu functionality.
9
+ */
10
+ export declare const useMenu: () => UseMenu;
@@ -0,0 +1,17 @@
1
+ import { useCallback, useState } from "react";
2
+ /**
3
+ * Menu functionality for menu dropdown.
4
+ * @returns menu functionality.
5
+ */
6
+ export const useMenu = () => {
7
+ const [open, setOpen] = useState(false);
8
+ // Closes header menu.
9
+ const onClose = useCallback(() => {
10
+ setOpen(false);
11
+ }, []);
12
+ // Opens header menu.
13
+ const onOpen = useCallback(() => {
14
+ setOpen(true);
15
+ }, []);
16
+ return { onClose, onOpen, open };
17
+ };
@@ -0,0 +1,14 @@
1
+ import { MenuProps as MMenuProps } from "@mui/material";
2
+ import { MouseEvent } from "react";
3
+ export interface UseMenuWithPosition {
4
+ anchorEl: MMenuProps["anchorEl"];
5
+ onClose: () => void;
6
+ onOpen: (event: MouseEvent<HTMLElement>) => void;
7
+ onToggleOpen: (event: MouseEvent<HTMLElement>) => void;
8
+ open: boolean;
9
+ }
10
+ /**
11
+ * Menu functionality for menu dropdown, with menu position.
12
+ * @returns menu functionality.
13
+ */
14
+ export declare const useMenuWithPosition: () => UseMenuWithPosition;
@@ -0,0 +1,33 @@
1
+ import { useCallback, useMemo, useState } from "react";
2
+ /**
3
+ * Menu functionality for menu dropdown, with menu position.
4
+ * @returns menu functionality.
5
+ */
6
+ export const useMenuWithPosition = () => {
7
+ const [anchorEl, setAnchorEl] = useState(null);
8
+ const open = useMemo(() => Boolean(anchorEl), [anchorEl]);
9
+ // Closes header menu.
10
+ const onClose = useCallback(() => {
11
+ setAnchorEl(null);
12
+ }, []);
13
+ // Opens header menu.
14
+ const onOpen = useCallback((event) => {
15
+ setAnchorEl(event.currentTarget);
16
+ }, []);
17
+ // Toggles menu open/close.
18
+ const onToggleOpen = useCallback((event) => {
19
+ if (open) {
20
+ setAnchorEl(null);
21
+ }
22
+ else {
23
+ setAnchorEl(event.currentTarget);
24
+ }
25
+ }, [open]);
26
+ return {
27
+ anchorEl,
28
+ onClose,
29
+ onOpen,
30
+ onToggleOpen,
31
+ open,
32
+ };
33
+ };
@@ -13,9 +13,10 @@ export type ElementRect = {
13
13
  * Element resizing and repositioning observer.
14
14
  * @param ref - element to be observed for changes to its size or position.
15
15
  * @param onResizeFn - action to be performed when the observed element is resized or repositioned.
16
+ * @param shouldObserve - boolean flag to determine if the observer should be active.
16
17
  * @returns Element size and position properties for the given element.
17
18
  */
18
- export declare function useResizeObserver(ref: RefObject<HTMLElement>, onResizeFn: (entries: ResizeObserverEntry[]) => Partial<ElementRect>): Partial<ElementRect> | undefined;
19
+ export declare function useResizeObserver(ref: RefObject<HTMLElement>, onResizeFn: (entries: ResizeObserverEntry[]) => Partial<ElementRect>, shouldObserve?: boolean): Partial<ElementRect> | undefined;
19
20
  /**
20
21
  * Return's the observed element's border box size.
21
22
  * @param entries - Resize observer entries.