@databiosphere/findable-ui 46.1.2 → 47.0.2

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 (288) hide show
  1. package/.eslintrc.json +2 -1
  2. package/.github/copilot-instructions.md +176 -0
  3. package/.github/workflows/release-please.yml +8 -4
  4. package/.github/workflows/run-checks.yml +2 -2
  5. package/.release-please-manifest.json +1 -1
  6. package/CHANGELOG.md +33 -0
  7. package/README.md +4 -10
  8. package/docs/TRUSTED_PUBLISHING.md +133 -0
  9. package/lib/common/utils.js +1 -1
  10. package/lib/components/DataDictionary/components/Table/columns/columnDef.d.ts +6 -0
  11. package/lib/components/DataDictionary/components/Table/columns/columnDef.js +33 -0
  12. package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.d.ts +5 -0
  13. package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.js +5 -0
  14. package/lib/components/DataDictionary/components/Table/columns/types.d.ts +2 -0
  15. package/lib/components/DataDictionary/components/Table/columns/types.js +1 -0
  16. package/lib/components/DataDictionary/components/Table/components/BasicCell/types.d.ts +4 -0
  17. package/lib/components/DataDictionary/components/Table/components/BasicCell/types.js +1 -0
  18. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +4 -0
  19. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +23 -0
  20. package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +8 -0
  21. package/lib/components/DataDictionary/hooks/UseDataDictionary/types.js +1 -0
  22. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/hook.d.ts +2 -0
  23. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/hook.js +10 -0
  24. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/types.d.ts +7 -0
  25. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/types.js +1 -0
  26. package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +8 -0
  27. package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +36 -0
  28. package/lib/components/Filter/components/Filter/filter.stories.d.ts +25 -0
  29. package/lib/components/Filter/components/Filter/filter.stories.js +42 -0
  30. package/lib/components/Filter/components/FilterTag/filterTag.stories.d.ts +16 -0
  31. package/lib/components/Filter/components/FilterTag/filterTag.stories.js +17 -0
  32. package/lib/components/Filter/components/Filters/filters.stories.d.ts +6 -0
  33. package/lib/components/Filter/components/Filters/filters.stories.js +91 -0
  34. package/lib/components/Filter/components/SearchAllFilters/components/AutocompletePopper/autocompletePopper.styles.d.ts +3 -0
  35. package/lib/components/Filter/components/SearchAllFilters/components/AutocompletePopper/autocompletePopper.styles.js +15 -0
  36. package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.stories.d.ts +6 -0
  37. package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.stories.js +82 -0
  38. package/lib/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.d.ts +1 -0
  39. package/lib/components/Filter/components/SearchAllFiltersSearch/components/SearchCloseButton/searchCloseButton.js +14 -0
  40. package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.d.ts +2 -0
  41. package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.js +12 -0
  42. package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.d.ts +5 -0
  43. package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.js +34 -0
  44. package/lib/components/Index/components/Cell/cell.d.ts +7 -0
  45. package/lib/components/Index/components/Cell/cell.js +10 -0
  46. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.d.ts +2 -0
  47. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.js +20 -0
  48. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.d.ts +13 -0
  49. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.js +12 -0
  50. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.d.ts +10 -0
  51. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.js +10 -0
  52. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.d.ts +3 -0
  53. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.js +91 -0
  54. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.d.ts +132 -0
  55. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.js +230 -0
  56. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.d.ts +2 -0
  57. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.js +7 -0
  58. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.d.ts +3 -0
  59. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/chart.styles.js +29 -0
  60. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.d.ts +1 -0
  61. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants.js +1 -0
  62. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.d.ts +4 -0
  63. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/args.js +70 -0
  64. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.d.ts +7 -0
  65. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.js +18 -0
  66. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.d.ts +6 -0
  67. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/types.js +1 -0
  68. package/lib/components/Index/components/EntitiesView/components/ChartView/constants.d.ts +1 -0
  69. package/lib/components/Index/components/EntitiesView/components/ChartView/constants.js +1 -0
  70. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.d.ts +7 -0
  71. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/types.js +1 -0
  72. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.d.ts +3 -0
  73. package/lib/components/Index/components/EntitiesView/components/ChartView/hooks/UseChartView/useChartView.js +11 -0
  74. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.d.ts +3 -0
  75. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.js +97 -0
  76. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.d.ts +6 -0
  77. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.js +15 -0
  78. package/lib/components/Index/components/EntitiesView/components/ChartView/types.d.ts +8 -0
  79. package/lib/components/Index/components/EntitiesView/components/ChartView/types.js +1 -0
  80. package/lib/components/Index/components/EntitiesView/components/ChartView/utils.d.ts +14 -0
  81. package/lib/components/Index/components/EntitiesView/components/ChartView/utils.js +23 -0
  82. package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.d.ts +3 -0
  83. package/lib/components/Index/components/EntitiesView/components/EntityList/entityList.js +14 -0
  84. package/lib/components/Index/components/EntitiesView/components/EntityList/types.d.ts +6 -0
  85. package/lib/components/Index/components/EntitiesView/components/EntityList/types.js +1 -0
  86. package/lib/components/Index/components/EntitiesView/constants.d.ts +1 -0
  87. package/lib/components/Index/components/EntitiesView/constants.js +1 -0
  88. package/lib/components/Index/components/EntitiesView/entitiesView.d.ts +2 -0
  89. package/lib/components/Index/components/EntitiesView/entitiesView.js +15 -0
  90. package/lib/components/Index/components/EntitiesView/entitiesView.styles.d.ts +3 -0
  91. package/lib/components/Index/components/EntitiesView/entitiesView.styles.js +20 -0
  92. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.d.ts +2 -0
  93. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/hook.js +14 -0
  94. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.d.ts +13 -0
  95. package/lib/components/Index/components/EntitiesView/hooks/UseEntitiesView/types.js +5 -0
  96. package/lib/components/Index/components/EntitiesView/stories/entitiesView.stories.d.ts +8 -0
  97. package/lib/components/Index/components/EntitiesView/stories/entitiesView.stories.js +50 -0
  98. package/lib/components/Index/components/EntitiesView/types.d.ts +8 -0
  99. package/lib/components/Index/components/EntitiesView/types.js +1 -0
  100. package/lib/components/Index/components/Hero/components/ExportButton/exportButton.d.ts +1 -0
  101. package/lib/components/Index/components/Hero/components/ExportButton/exportButton.js +13 -0
  102. package/lib/components/Index/components/Hero/components/ExportButton/exportButton.styles.d.ts +3 -0
  103. package/lib/components/Index/components/Hero/components/ExportButton/exportButton.styles.js +13 -0
  104. package/lib/components/Index/components/Hero/components/Summaries/stories/summaries.stories.d.ts +6 -0
  105. package/lib/components/Index/components/Hero/components/Summaries/stories/summaries.stories.js +14 -0
  106. package/lib/components/Index/components/Hero/components/Summaries/summaries.d.ts +9 -0
  107. package/lib/components/Index/components/Hero/components/Summaries/summaries.js +12 -0
  108. package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.d.ts +13 -0
  109. package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.js +18 -0
  110. package/lib/components/Index/components/Hero/components/Summaries/summaries.styles.d.ts +7 -0
  111. package/lib/components/Index/components/Hero/components/Summaries/summaries.styles.js +26 -0
  112. package/lib/components/Index/components/Hero/hero.d.ts +11 -0
  113. package/lib/components/Index/components/Hero/hero.js +12 -0
  114. package/lib/components/Index/components/Hero/hero.stories.d.ts +23 -0
  115. package/lib/components/Index/components/Hero/hero.stories.js +22 -0
  116. package/lib/components/Index/components/Hero/hero.styles.d.ts +16 -0
  117. package/lib/components/Index/components/Hero/hero.styles.js +44 -0
  118. package/lib/components/Index/components/Hero/stories/hero.stories.d.ts +6 -0
  119. package/lib/components/Index/components/Hero/stories/hero.stories.js +16 -0
  120. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.d.ts +8 -0
  121. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.js +57 -0
  122. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.d.ts +4 -0
  123. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.js +10 -0
  124. package/lib/components/Index/components/NTag/nTag.d.ts +10 -0
  125. package/lib/components/Index/components/NTag/nTag.js +8 -0
  126. package/lib/components/Index/components/NTagCell/nTagCell.d.ts +11 -0
  127. package/lib/components/Index/components/NTagCell/nTagCell.js +29 -0
  128. package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +5 -0
  129. package/lib/components/Index/components/NTagCell/nTagCell.stories.js +16 -0
  130. package/lib/components/Index/components/Tabs/common/utils.d.ts +8 -0
  131. package/lib/components/Index/components/Tabs/common/utils.js +19 -0
  132. package/lib/components/Index/components/Tabs/tabs.d.ts +1 -0
  133. package/lib/components/Index/components/Tabs/tabs.js +20 -0
  134. package/lib/components/Index/components/TitleCell/titleCell.d.ts +6 -0
  135. package/lib/components/Index/components/TitleCell/titleCell.js +10 -0
  136. package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +3 -0
  137. package/lib/components/Index/components/TitleCell/titleCell.styles.js +6 -0
  138. package/lib/components/Index/index.stories.d.ts +6 -0
  139. package/lib/components/Index/index.stories.js +26 -0
  140. package/lib/components/Index/stories/index.stories.d.ts +6 -0
  141. package/lib/components/Index/stories/index.stories.js +17 -0
  142. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.d.ts +6 -0
  143. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.js +10 -0
  144. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.d.ts +5 -0
  145. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.js +29 -0
  146. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +6 -0
  147. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +13 -0
  148. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +36 -0
  149. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +9 -0
  150. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +5 -0
  151. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +10 -0
  152. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +36 -0
  153. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +9 -0
  154. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +5 -0
  155. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +19 -0
  156. package/lib/components/Layout/components/Outline/common/constants.d.ts +2 -0
  157. package/lib/components/Layout/components/Outline/common/constants.js +1 -0
  158. package/lib/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.js +1 -1
  159. package/lib/components/Login/login.stories.d.ts +6 -0
  160. package/lib/components/Login/login.stories.js +31 -0
  161. package/lib/components/Redirect/redirect.js +6 -1
  162. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.d.ts +16 -0
  163. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +28 -0
  164. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.d.ts +5 -0
  165. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.js +46 -0
  166. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +3 -0
  167. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +21 -0
  168. package/lib/components/Table/components/DownloadEntityResults/downloadEntityResults.d.ts +6 -0
  169. package/lib/components/Table/components/DownloadEntityResults/downloadEntityResults.js +17 -0
  170. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +2 -0
  171. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +37 -0
  172. package/lib/components/Table/components/Pagination/pagination.d.ts +9 -0
  173. package/lib/components/Table/components/Pagination/pagination.js +19 -0
  174. package/lib/components/Table/components/Pagination/pagination.stories.d.ts +28 -0
  175. package/lib/components/Table/components/Pagination/pagination.stories.js +24 -0
  176. package/lib/components/Table/components/Pagination/pagination.styles.d.ts +4 -0
  177. package/lib/components/Table/components/Pagination/pagination.styles.js +15 -0
  178. package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.d.ts +3 -0
  179. package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.js +3 -0
  180. package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.d.ts +8 -0
  181. package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.js +18 -0
  182. package/lib/components/Table/components/TableBody/hooks/virtualizer/types.d.ts +4 -0
  183. package/lib/components/Table/components/TableBody/hooks/virtualizer/types.js +1 -0
  184. package/lib/components/Table/components/TableBody/utils.d.ts +12 -0
  185. package/lib/components/Table/components/TableBody/utils.js +17 -0
  186. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.d.ts +3 -0
  187. package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.js +1 -0
  188. package/lib/components/Table/components/TableCell/components/MarkdownCell/types.d.ts +3 -0
  189. package/lib/components/Table/components/TableCell/components/MarkdownCell/types.js +1 -0
  190. package/lib/components/TableCreator/common/constants.d.ts +6 -0
  191. package/lib/components/TableCreator/common/constants.js +19 -0
  192. package/lib/components/TableCreator/common/entities.d.ts +5 -0
  193. package/lib/components/TableCreator/common/entities.js +1 -0
  194. package/lib/components/TableCreator/tableCreator.styles.d.ts +4 -0
  195. package/lib/components/TableCreator/tableCreator.styles.js +4 -0
  196. package/lib/components/common/Alert/alert.stories.d.ts +6 -0
  197. package/lib/components/common/Alert/alert.stories.js +36 -0
  198. package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +4 -0
  199. package/lib/components/common/Alert/components/AlertText/alertText.styles.js +19 -0
  200. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +7 -0
  201. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +5 -0
  202. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +3 -0
  203. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +19 -0
  204. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +10 -0
  205. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +16 -0
  206. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +3 -0
  207. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +21 -0
  208. package/lib/components/common/Button/components/LoginButton/loginButton.d.ts +3 -0
  209. package/lib/components/common/Button/components/LoginButton/loginButton.js +6 -0
  210. package/lib/components/common/Button/components/LoginButton/loginButton.styles.d.ts +7 -0
  211. package/lib/components/common/Button/components/LoginButton/loginButton.styles.js +11 -0
  212. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +5 -0
  213. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +10 -0
  214. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +3 -0
  215. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +9 -0
  216. package/lib/components/common/ToggleButtonGroup/toggleButtonGroup.js +2 -1
  217. package/lib/hooks/useAuthentication/common/constants.d.ts +4 -0
  218. package/lib/hooks/useAuthentication/common/constants.js +19 -0
  219. package/lib/hooks/useAuthentication/common/entities.d.ts +25 -0
  220. package/lib/hooks/useAuthentication/common/entities.js +11 -0
  221. package/lib/hooks/useAuthentication/common/utils.d.ts +15 -0
  222. package/lib/hooks/useAuthentication/common/utils.js +25 -0
  223. package/lib/hooks/useAuthentication/useAuthentication.d.ts +6 -0
  224. package/lib/hooks/useAuthentication/useAuthentication.js +9 -0
  225. package/lib/hooks/useAuthentication/useAuthenticationComplete.d.ts +6 -0
  226. package/lib/hooks/useAuthentication/useAuthenticationComplete.js +55 -0
  227. package/lib/hooks/useAuthentication/useAuthenticationForm.d.ts +20 -0
  228. package/lib/hooks/useAuthentication/useAuthenticationForm.js +88 -0
  229. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.d.ts +18 -0
  230. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.js +50 -0
  231. package/lib/hooks/useAuthentication/useAuthenticationStatus.d.ts +20 -0
  232. package/lib/hooks/useAuthentication/useAuthenticationStatus.js +32 -0
  233. package/lib/hooks/useAuthentication/useFetchGoogleProfile.d.ts +21 -0
  234. package/lib/hooks/useAuthentication/useFetchGoogleProfile.js +41 -0
  235. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.d.ts +18 -0
  236. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.js +62 -0
  237. package/lib/hooks/useAuthentication/useFetchTerraProfile.d.ts +24 -0
  238. package/lib/hooks/useAuthentication/useFetchTerraProfile.js +62 -0
  239. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.d.ts +15 -0
  240. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.js +62 -0
  241. package/lib/hooks/useAuthentication/useTokenClient.d.ts +11 -0
  242. package/lib/hooks/useAuthentication/useTokenClient.js +29 -0
  243. package/lib/hooks/useAuthenticationConfig.d.ts +6 -0
  244. package/lib/hooks/useAuthenticationConfig.js +14 -0
  245. package/lib/hooks/useCategoryConfigs.d.ts +6 -0
  246. package/lib/hooks/useCategoryConfigs.js +17 -0
  247. package/lib/hooks/useEntityListRelatedView.d.ts +15 -0
  248. package/lib/hooks/useEntityListRelatedView.js +62 -0
  249. package/lib/hooks/useExploreMode.d.ts +14 -0
  250. package/lib/hooks/useExploreMode.js +20 -0
  251. package/lib/hooks/useFileLocation.js +1 -1
  252. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +15 -0
  253. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +27 -0
  254. package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +5 -0
  255. package/lib/hooks/useFileManifest/useFileManifestURL.js +11 -0
  256. package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +9 -0
  257. package/lib/hooks/useFileManifest/useRequestFileManifest.js +37 -0
  258. package/lib/hooks/useLayoutState.d.ts +6 -0
  259. package/lib/hooks/useLayoutState.js +9 -0
  260. package/lib/hooks/useMenu.d.ts +10 -0
  261. package/lib/hooks/useMenu.js +17 -0
  262. package/lib/hooks/useMenuWithPosition.d.ts +14 -0
  263. package/lib/hooks/useMenuWithPosition.js +33 -0
  264. package/lib/hooks/useScroll.d.ts +10 -0
  265. package/lib/hooks/useScroll.js +12 -0
  266. package/lib/hooks/useSessionTimeout.d.ts +11 -0
  267. package/lib/hooks/useSessionTimeout.js +28 -0
  268. package/lib/providers/authentication.d.ts +51 -0
  269. package/lib/providers/authentication.js +110 -0
  270. package/lib/providers/layoutState.d.ts +40 -0
  271. package/lib/providers/layoutState.js +47 -0
  272. package/lib/styles/common/mixins/colors.d.ts +25 -0
  273. package/lib/styles/common/mixins/colors.js +32 -0
  274. package/lib/styles/common/mixins/fonts.d.ts +16 -0
  275. package/lib/styles/common/mixins/fonts.js +30 -0
  276. package/lib/styles/common/mixins/shadows.d.ts +3 -0
  277. package/lib/styles/common/mixins/shadows.js +4 -0
  278. package/lib/styles/common/mui/palette.d.ts +47 -0
  279. package/lib/styles/common/mui/palette.js +47 -0
  280. package/lib/theme/common/entities.d.ts +6 -0
  281. package/lib/theme/common/entities.js +1 -0
  282. package/package.json +15 -13
  283. package/src/common/utils.ts +1 -1
  284. package/src/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.tsx +1 -1
  285. package/src/components/Redirect/redirect.tsx +5 -1
  286. package/src/components/common/ToggleButtonGroup/toggleButtonGroup.tsx +1 -1
  287. package/src/hooks/useFileLocation.ts +1 -1
  288. package/types/data-explorer-ui.d.ts +7 -6
package/.eslintrc.json CHANGED
@@ -71,7 +71,8 @@
71
71
  {
72
72
  "files": "**/*.test.ts",
73
73
  "rules": {
74
- "@typescript-eslint/no-explicit-any": "off"
74
+ "@typescript-eslint/no-explicit-any": "off",
75
+ "sonarjs/no-duplicate-string": "off"
75
76
  }
76
77
  }
77
78
  ]
@@ -0,0 +1,176 @@
1
+ # Copilot Instructions for findable-ui
2
+
3
+ ## Repository Purpose
4
+
5
+ This is a TypeScript library package (`@databiosphere/findable-ui`) that provides reusable UI components and utilities for Data Biosphere applications, particularly the Data Browser. It's designed as an npm package that exports compiled JavaScript from the `lib` directory.
6
+
7
+ ## Key Project Information
8
+
9
+ - **Language**: TypeScript with strict mode enabled
10
+ - **Node Version**: 20.10.0 (enforced)
11
+ - **UI Framework**: React 18 with Material-UI (MUI) v7
12
+ - **Build System**: TypeScript compiler (tsc)
13
+ - **Testing**: Jest with React Testing Library
14
+ - **Package Type**: Library package that compiles to `lib/` directory
15
+
16
+ ## Repository Structure
17
+
18
+ - `/src` - TypeScript source files (compiles to `/lib`)
19
+ - `/components` - React UI components
20
+ - `/hooks` - Custom React hooks
21
+ - `/providers` - React context providers
22
+ - `/utils` - Utility functions
23
+ - `/theme` - MUI theme configuration
24
+ - `/config` - Configuration files
25
+ - `/apis` - API client code
26
+ - `/services` - Business logic services
27
+ - `/types` - TypeScript type definitions
28
+ - `/views` - Page-level components
29
+ - `/tests` - Jest test files (separate from src)
30
+ - `/lib` - Compiled JavaScript output (git-ignored)
31
+ - `/.storybook` - Storybook configuration
32
+
33
+ ## Code Style and Standards
34
+
35
+ ### TypeScript Requirements
36
+
37
+ - **Strict mode enabled**: All TypeScript strict checks are enforced
38
+ - **Explicit return types required**: All functions must have explicit return type annotations (except in `.styles.ts(x)` files)
39
+ - **No implicit any**: Avoid `any` type; use proper typing (exceptions allowed in test files)
40
+ - **Null safety**: Strict null checks are enforced
41
+
42
+ ### Code Organization
43
+
44
+ - **Sort keys**: Object keys, destructured keys, interface properties, and string enums must be sorted alphabetically (enforced by ESLint)
45
+ - **Import organization**: Imports are auto-organized with prettier-plugin-organize-imports
46
+ - **File naming**: Use kebab-case for file names (e.g., `my-component.tsx`)
47
+
48
+ ### Documentation Requirements
49
+
50
+ All code must include JSDoc comments with:
51
+
52
+ - **Function descriptions**: Required for all functions
53
+ - **Parameter documentation**: `@param` tags with descriptions for all parameters
54
+ - **Return value documentation**: `@returns` tag with description
55
+ - **Hyphen before param descriptions**: Required format
56
+
57
+ Example:
58
+
59
+ ```typescript
60
+ /**
61
+ * Transforms a route by removing inactivity parameters.
62
+ * @param routes - Array of route strings to transform.
63
+ * @returns The first non-login route without inactivity param, or undefined.
64
+ */
65
+ function transformRoute(routes: string[]): string | undefined {
66
+ // implementation
67
+ }
68
+ ```
69
+
70
+ ### React Patterns
71
+
72
+ - **Hooks dependencies**: The `react-hooks/exhaustive-deps` rule is enforced - always include all dependencies in useEffect, useCallback, etc.
73
+ - **Component structure**: Use functional components with hooks
74
+ - **Styling**: Use Emotion styled components (`.styles.ts` or `.styles.tsx` files)
75
+
76
+ ## Build, Test, and Validation Steps
77
+
78
+ ### Before Making Changes
79
+
80
+ 1. Install dependencies: `npm ci`
81
+ 2. Run all checks to verify baseline:
82
+ ```bash
83
+ npm run check-format
84
+ npm run lint
85
+ npm run test
86
+ npm run test-compile
87
+ ```
88
+
89
+ ### During Development
90
+
91
+ 1. **Check formatting**: `npm run check-format` (Prettier)
92
+ 2. **Lint code**: `npm run lint` (ESLint with TypeScript, SonarJS, and other plugins)
93
+ 3. **Run tests**: `npm run test` (Jest with jsdom environment)
94
+ 4. **Type check**: `npm run test-compile` (TypeScript compiler without emit)
95
+ 5. **Compile library**: `npx tsc` (when making changes that need to be tested in consuming apps)
96
+
97
+ ### All PRs Must Pass
98
+
99
+ - Prettier formatting check
100
+ - ESLint with no errors
101
+ - All Jest tests passing
102
+ - TypeScript compilation without errors
103
+
104
+ ## Testing Guidelines
105
+
106
+ - **Test location**: Tests live in the `/tests` directory (not co-located with source files)
107
+ - **Test framework**: Jest with `@testing-library/react` for component tests
108
+ - **Test naming**: Use `.test.ts` or `.test.tsx` extension
109
+ - **Setup**: Tests use Storybook decorators and parameters (see `tests/setup.ts`)
110
+ - **Mocking**: Global mocks for ResizeObserver, TextEncoder, and TextDecoder are pre-configured
111
+ - **Test structure**: Follow the existing pattern of describe/it blocks with clear descriptions
112
+
113
+ Example test structure:
114
+
115
+ ```typescript
116
+ describe("ComponentName", () => {
117
+ it("should do something specific", () => {
118
+ // Arrange
119
+ const input = "test";
120
+
121
+ // Act
122
+ const result = functionUnderTest(input);
123
+
124
+ // Assert
125
+ expect(result).toBe("expected");
126
+ });
127
+ });
128
+ ```
129
+
130
+ ## Contribution Workflow
131
+
132
+ 1. **Make minimal changes**: This is a library package - changes impact all consumers
133
+ 2. **Maintain backward compatibility**: Breaking changes require major version bumps
134
+ 3. **Update documentation**: Keep README and inline docs current
135
+ 4. **No breaking test changes**: Don't remove or modify existing tests unless fixing bugs
136
+ 5. **Test compilation**: Always run `npm run test-compile` to ensure TypeScript compilation succeeds
137
+
138
+ ## Peer Dependencies
139
+
140
+ This package has extensive peer dependencies that consuming applications must provide:
141
+
142
+ - React 18.3+
143
+ - Material-UI (@mui/material, @mui/icons-material) v7
144
+ - Next.js 14.2+ and next-auth
145
+ - Emotion (@emotion/react, @emotion/styled)
146
+ - TanStack Table and Virtual (@tanstack/react-table, @tanstack/react-virtual)
147
+ - Various utilities (ky, uuid, yup, etc.)
148
+
149
+ **Do not add these as direct dependencies** - they must remain as peer dependencies.
150
+
151
+ ## Common Pitfalls to Avoid
152
+
153
+ 1. **Don't import from lib/**: Always import from src/ during development
154
+ 2. **Don't add dependencies to dependencies**: New packages should go in peerDependencies or devDependencies
155
+ 3. **Don't disable ESLint rules without justification**: The strict rules maintain code quality
156
+ 4. **Don't skip JSDoc**: All public functions require documentation
157
+ 5. **Don't modify package-lock.json manually**: Use npm commands
158
+ 6. **Don't commit lib/ directory**: It's build output and git-ignored
159
+
160
+ ## Special Notes
161
+
162
+ - **Storybook**: Available for component development (`npm run storybook`)
163
+ - **Husky hooks**: Pre-commit hooks are configured via `.husky`
164
+ - **Release management**: Uses release-please for automated versioning and changelog
165
+ - **Link for local development**: Use `npm link` to test changes in Data Browser locally (see README)
166
+
167
+ ## Development with Data Browser
168
+
169
+ When developing findable-ui alongside the Data Browser:
170
+
171
+ 1. Clone both repos in the same parent directory
172
+ 2. In findable-ui: Run `npm ci`, bump version, run `npx tsc`
173
+ 3. In data-browser/explorer: Run `npm link ../../findable-ui`
174
+ 4. May need to comment out certain packages in next.config.mjs webpack config
175
+
176
+ See README.md for complete local development workflow.
@@ -7,6 +7,7 @@ on:
7
7
  permissions:
8
8
  contents: write
9
9
  pull-requests: write
10
+ id-token: write # Required for trusted publishing to npm
10
11
 
11
12
  name: release-please
12
13
 
@@ -27,8 +28,13 @@ jobs:
27
28
  - uses: actions/setup-node@v4
28
29
  if: ${{ steps.release.outputs.release_created }}
29
30
  with:
30
- node-version: 20
31
+ node-version: "22.12.0"
31
32
  registry-url: "https://registry.npmjs.org"
33
+ always-auth: true # Enable authentication for trusted publishing
34
+
35
+ - name: Upgrade npm for trusted publishing
36
+ if: ${{ steps.release.outputs.release_created }}
37
+ run: npm install -g npm@^11.5.1
32
38
 
33
39
  - name: Install dependencies
34
40
  if: ${{ steps.release.outputs.release_created }}
@@ -40,6 +46,4 @@ jobs:
40
46
 
41
47
  - name: Publish to NPM
42
48
  if: ${{ steps.release.outputs.release_created }}
43
- run: npm publish
44
- env:
45
- NODE_AUTH_TOKEN: ${{ secrets.DATABIOSPHERE_FINDABLE_UI_NPM_PUBLISH_TOKEN }} # Ensure this token is scoped to only the permissions required for npm publication to limit security risks.
49
+ run: npm publish --provenance --access public
@@ -14,7 +14,7 @@ jobs:
14
14
  - name: Set up Node.js
15
15
  uses: actions/setup-node@v4
16
16
  with:
17
- node-version: "20.10.0"
17
+ node-version: "22.12.0"
18
18
  cache: "npm"
19
19
 
20
20
  - name: Install dependencies
@@ -41,7 +41,7 @@ jobs:
41
41
  - name: Set up Node.js
42
42
  uses: actions/setup-node@v4
43
43
  with:
44
- node-version: "20.10.0"
44
+ node-version: "22.12.0"
45
45
  cache: "npm"
46
46
 
47
47
  - name: Remove package lock
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "46.1.2"
2
+ ".": "47.0.2"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## [47.0.2](https://github.com/DataBiosphere/findable-ui/compare/v47.0.1...v47.0.2) (2025-12-11)
4
+
5
+
6
+ ### Chores
7
+
8
+ * remove trailing whitespace from README to trigger release ([#728](https://github.com/DataBiosphere/findable-ui/issues/728)) ([5f24174](https://github.com/DataBiosphere/findable-ui/commit/5f24174aed98fc54429e939d9b63c542f1cce0b8))
9
+
10
+ ## [47.0.1](https://github.com/DataBiosphere/findable-ui/compare/v47.0.0...v47.0.1) (2025-12-11)
11
+
12
+
13
+ ### Chores
14
+
15
+ * add GitHub Copilot instructions for repository ([#709](https://github.com/DataBiosphere/findable-ui/issues/709)) ([#710](https://github.com/DataBiosphere/findable-ui/issues/710)) ([e2bf4fb](https://github.com/DataBiosphere/findable-ui/commit/e2bf4fb81b46fc1376c7797141fc41a8a6029c9f))
16
+
17
+ ## [47.0.0](https://github.com/DataBiosphere/findable-ui/compare/v46.1.3...v47.0.0) (2025-12-11)
18
+
19
+
20
+ ### ⚠ BREAKING CHANGES
21
+
22
+ * upgrade Node.js from 20.10.0 to 22.12.0 ([#713](https://github.com/DataBiosphere/findable-ui/issues/713)) (#716)
23
+
24
+ ### Chores
25
+
26
+ * update the package-lock ([#720](https://github.com/DataBiosphere/findable-ui/issues/720)) ([#721](https://github.com/DataBiosphere/findable-ui/issues/721)) ([6cf79a9](https://github.com/DataBiosphere/findable-ui/commit/6cf79a9b18ac39365b92ae041df1ab67fe825434))
27
+ * upgrade Node.js from 20.10.0 to 22.12.0 ([#713](https://github.com/DataBiosphere/findable-ui/issues/713)) ([#716](https://github.com/DataBiosphere/findable-ui/issues/716)) ([26d97dd](https://github.com/DataBiosphere/findable-ui/commit/26d97dd951c65099b5e868ead0b03205eb15235a))
28
+
29
+ ## [46.1.3](https://github.com/DataBiosphere/findable-ui/compare/v46.1.2...v46.1.3) (2025-12-01)
30
+
31
+
32
+ ### Chores
33
+
34
+ * bump nextjs version to fix vulnerabilities ([#704](https://github.com/DataBiosphere/findable-ui/issues/704)) ([#705](https://github.com/DataBiosphere/findable-ui/issues/705)) ([096ba35](https://github.com/DataBiosphere/findable-ui/commit/096ba35d926fe8b40b1c0b981770076355cae8ab))
35
+
3
36
  ## [46.1.2](https://github.com/DataBiosphere/findable-ui/compare/v46.1.1...v46.1.2) (2025-11-21)
4
37
 
5
38
 
package/README.md CHANGED
@@ -12,24 +12,18 @@
12
12
 
13
13
  1. Clone this repository into the same parent folder as
14
14
  the [Data Biosphere Data Browser](https://github.com/DataBiosphere/data-browser).
15
- 2. Set `node` version to `20.10.0` (this is also the version used by the Data Browser).
15
+ 2. Set `node` version to `22.12.0` (this is also the version used by the Data Browser).
16
16
  3. In the `findable-ui` repository directory:
17
- - Run `npm ci`.
18
- - [Bump the version number](https://docs.npmjs.com/cli/v6/commands/npm-version) in `package.json`
19
- e.g. `npm version <update_type>`.
17
+ - Run `npm update`.
20
18
  - Run `npx tsc` (this should be run when this repository is first downloaded and when any changes are made to the
21
19
  source files; one way this can be done more efficiently is
22
20
  by [setting the default build task](https://code.visualstudio.com/docs/typescript/typescript-compiling#_step-3-make-the-typescript-build-the-default)
23
21
  in VS Code so that it can be done with a keyboard shortcut).
24
22
  4. In the Data Browser `explorer` directory (e.g. `data-browser/explorer`):
25
- - Run `npm ci`.
26
- - Update the `@databiosphere/findable-ui` dependency in the `package.json` file to use the new version
27
- of Findable UI.
28
- - Run `npm link ../../findable-ui`, which will create a symlink in node_modules pointing
23
+ - Run `npm update`.
24
+ - Run `npm link ../findable-ui`, which will create a symlink in node_modules pointing
29
25
  to findable-ui.
30
26
  - If any packages are later installed or uninstalled, the symlink will need to be created again, which can be done
31
27
  with the same command or by running `npm link @databiosphere/findable-ui`.
32
28
  - To successfully link to findable-ui, you may need to comment out the following packages from the `next.config.mjs` webpack configuration:
33
29
  - `@tanstack/react-table`
34
- - `axios`
35
-
@@ -0,0 +1,133 @@
1
+ # Trusted Publishing Setup for NPM
2
+
3
+ This repository uses GitHub's trusted publishing workflow to securely publish packages to npm without using long-lived access tokens.
4
+
5
+ ## What is Trusted Publishing?
6
+
7
+ Trusted publishing is a security feature that allows GitHub Actions to publish packages to npm using short-lived, automatically generated tokens via OpenID Connect (OIDC). This eliminates the need to store long-lived npm tokens as repository secrets, reducing the attack surface and improving supply chain security.
8
+
9
+ ## Configuration
10
+
11
+ ### GitHub Actions Workflow
12
+
13
+ The `.github/workflows/release-please.yml` workflow is configured with the following settings for trusted publishing:
14
+
15
+ #### Required Permissions
16
+
17
+ ```yaml
18
+ permissions:
19
+ contents: write # Required for release-please to create releases
20
+ pull-requests: write # Required for release-please to create PRs
21
+ id-token: write # Required for trusted publishing to npm
22
+ ```
23
+
24
+ The `id-token: write` permission enables the workflow to request OIDC tokens from GitHub's OIDC provider.
25
+
26
+ #### Node.js Setup
27
+
28
+ ```yaml
29
+ - uses: actions/setup-node@v4
30
+ with:
31
+ node-version: "22.12.0"
32
+ registry-url: "https://registry.npmjs.org"
33
+ always-auth: true # Enable authentication for trusted publishing
34
+ ```
35
+
36
+ The `always-auth: true` setting ensures that authentication is enabled when publishing packages.
37
+
38
+ #### Publishing with Provenance
39
+
40
+ ```yaml
41
+ - name: Publish to NPM
42
+ run: npm publish --provenance --access public
43
+ ```
44
+
45
+ The `--provenance` flag enables build provenance, which creates a publicly verifiable link between the package and its source code and build. The `--access public` flag ensures the package is published as public.
46
+
47
+ ## NPM Setup Requirements
48
+
49
+ To enable trusted publishing for this package on npm, you need to:
50
+
51
+ 1. **Log in to npm** and navigate to the package settings for `@databiosphere/findable-ui`
52
+ 2. **Add a GitHub Actions Publishing Workflow**:
53
+
54
+ - Go to the package's publishing settings
55
+ - Click "Add GitHub Actions Publishing Workflow"
56
+ - Configure the trusted publisher with:
57
+ - **Repository**: `DataBiosphere/findable-ui`
58
+ - **Workflow**: `.github/workflows/release-please.yml`
59
+ - **Environment**: (leave blank, no environment is used)
60
+
61
+ 3. **Verify the Configuration**:
62
+ - Ensure the trusted publisher is listed in the package settings
63
+ - The workflow will use OIDC to authenticate automatically when publishing
64
+
65
+ ## Security Benefits
66
+
67
+ - **No Long-Lived Tokens**: Eliminates the need to store npm access tokens as GitHub secrets
68
+ - **Automatic Rotation**: Tokens are short-lived and automatically generated for each workflow run
69
+ - **Build Provenance**: The `--provenance` flag creates verifiable attestations linking the package to its source
70
+ - **Reduced Attack Surface**: Compromised secrets cannot be used outside the workflow context
71
+ - **Audit Trail**: All publishes are tied to specific GitHub Actions workflow runs
72
+
73
+ ## Migration Notes
74
+
75
+ ### Removed Configuration
76
+
77
+ The following configuration is no longer needed with trusted publishing:
78
+
79
+ - **Repository Secret**: `DATABIOSPHERE_FINDABLE_UI_NPM_PUBLISH_TOKEN` - This secret can be safely removed from the repository settings as it is no longer used. **Important**: Only remove this secret after confirming the trusted publishing workflow works successfully in production to avoid disrupting the release process.
80
+ - **NODE_AUTH_TOKEN Environment Variable**: No longer required in the publish step
81
+
82
+ ### Workflow Changes
83
+
84
+ 1. Added `id-token: write` permission
85
+ 2. Added `always-auth: true` to `setup-node` action
86
+ 3. Removed `NODE_AUTH_TOKEN` environment variable from publish step
87
+ 4. Added `--provenance` and `--access public` flags to `npm publish`
88
+
89
+ ## Testing
90
+
91
+ To test the trusted publishing workflow:
92
+
93
+ 1. Create a test commit on a feature branch
94
+ 2. Merge to the `main` branch
95
+ 3. If the commit triggers a release (based on conventional commits), the workflow will:
96
+ - Create a release PR via release-please
97
+ - Once merged, create a GitHub release
98
+ - Automatically publish to npm using trusted publishing
99
+
100
+ Monitor the workflow run in the Actions tab to verify successful publication.
101
+
102
+ ## References
103
+
104
+ - [npm Trusted Publishers Documentation](https://docs.npmjs.com/trusted-publishers)
105
+ - [GitHub: Publishing Node.js Packages](https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages/publishing-nodejs-packages-from-github-actions)
106
+ - [npm Provenance Documentation](https://docs.npmjs.com/generating-provenance-statements)
107
+ - [OpenID Connect in GitHub Actions](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
108
+
109
+ ## Troubleshooting
110
+
111
+ ### Publishing Fails with Authentication Error
112
+
113
+ If the workflow fails with an authentication error:
114
+
115
+ 1. Verify that trusted publishing is properly configured on npm for the package
116
+ 2. Ensure the repository, workflow path, and environment (if any) match exactly in the npm settings
117
+ 3. Confirm that the workflow has the `id-token: write` permission
118
+
119
+ ### Provenance Attestation Not Generated
120
+
121
+ If the package is published but provenance is not attached:
122
+
123
+ 1. Ensure the `--provenance` flag is included in the `npm publish` command
124
+ 2. Verify that the workflow has `id-token: write` permission
125
+ 3. Check that the package is being published from a supported environment (GitHub Actions)
126
+
127
+ ### Package Access Issues
128
+
129
+ If the package fails to publish due to access issues:
130
+
131
+ 1. Ensure the `--access public` flag is set (for public packages)
132
+ 2. Verify that the npm package settings allow public access
133
+ 3. Confirm that the organization and package name are correct
@@ -7,7 +7,7 @@ export function isValidUrl(testUrl) {
7
7
  try {
8
8
  return Boolean(new URL(testUrl));
9
9
  }
10
- catch (e) {
10
+ catch {
11
11
  return false;
12
12
  }
13
13
  }
@@ -0,0 +1,6 @@
1
+ import { ColumnDef } from "@tanstack/react-table";
2
+ import { Attribute } from "../../../../../common/entities";
3
+ import { COLUMN_IDENTIFIER } from "./columnIdentifier";
4
+ import { AttributeValue } from "./types";
5
+ export declare const COLUMN_DEF: Record<keyof typeof COLUMN_IDENTIFIER, ColumnDef<Attribute, AttributeValue>>;
6
+ export declare const COLUMN_DEFS: ColumnDef<Attribute, AttributeValue>[];
@@ -0,0 +1,33 @@
1
+ import { BasicCell } from "../components/BasicCell/basicCell";
2
+ import { COLUMN_IDENTIFIER } from "./columnIdentifier";
3
+ const COLUMN_DEF_DESCRIPTION = {
4
+ accessorFn: (row) => row.description,
5
+ cell: (props) => BasicCell({ ...props }),
6
+ header: "Description",
7
+ id: COLUMN_IDENTIFIER.DESCRIPTION,
8
+ meta: { width: { max: "2fr", min: "480px" } },
9
+ };
10
+ const COLUMN_DEF_KEY = {
11
+ accessorFn: (row) => row.key,
12
+ cell: (props) => BasicCell({ ...props }),
13
+ header: "Key",
14
+ id: COLUMN_IDENTIFIER.KEY,
15
+ meta: { width: { max: "1fr", min: "180px" } },
16
+ };
17
+ const COLUMN_DEF_LABEL = {
18
+ accessorFn: (row) => row.label,
19
+ cell: (props) => BasicCell({ ...props }),
20
+ header: "Label",
21
+ id: COLUMN_IDENTIFIER.LABEL,
22
+ meta: { width: { max: "1fr", min: "200px" } },
23
+ };
24
+ export const COLUMN_DEF = {
25
+ DESCRIPTION: COLUMN_DEF_DESCRIPTION,
26
+ KEY: COLUMN_DEF_KEY,
27
+ LABEL: COLUMN_DEF_LABEL,
28
+ };
29
+ export const COLUMN_DEFS = [
30
+ COLUMN_DEF.LABEL,
31
+ COLUMN_DEF.KEY,
32
+ COLUMN_DEF.DESCRIPTION,
33
+ ];
@@ -0,0 +1,5 @@
1
+ export declare const COLUMN_IDENTIFIER: {
2
+ readonly DESCRIPTION: "description";
3
+ readonly KEY: "key";
4
+ readonly LABEL: "label";
5
+ };
@@ -0,0 +1,5 @@
1
+ export const COLUMN_IDENTIFIER = {
2
+ DESCRIPTION: "description",
3
+ KEY: "key",
4
+ LABEL: "label",
5
+ };
@@ -0,0 +1,2 @@
1
+ import { Attribute } from "../../../../../common/entities";
2
+ export type AttributeValue = Attribute[keyof Attribute];
@@ -0,0 +1,4 @@
1
+ import { CellContext } from "@tanstack/react-table";
2
+ import { Attribute } from "../../../../../../common/entities";
3
+ import { AttributeValue } from "../../columns/types";
4
+ export type BasicCellProps = CellContext<Attribute, AttributeValue>;
@@ -0,0 +1,4 @@
1
+ import { RowData } from "@tanstack/react-table";
2
+ import { Attribute } from "../../../../common/entities";
3
+ import { UseDataDictionary } from "./types";
4
+ export declare const useDataDictionary: <T extends RowData = Attribute>() => UseDataDictionary<T>;
@@ -0,0 +1,23 @@
1
+ import { useMemo } from "react";
2
+ import { useConfig } from "../../../../hooks/useConfig";
3
+ import { buildClassesOutline } from "../../components/Outline/utils";
4
+ import { useTable } from "../../components/Table/hook";
5
+ export const useDataDictionary = () => {
6
+ const { config: { dataDictionaries: dataDictionaryConfigs }, } = useConfig();
7
+ // Get dictionary config.
8
+ const dataDictionaryConfig = dataDictionaryConfigs?.[0]; // TODO: Handle multiple data dictionaries
9
+ // Get configured dictionary classes, column definitions and table options.
10
+ const { classes, columnDefs, tableOptions, title } = useMemo(() => {
11
+ return {
12
+ classes: dataDictionaryConfig?.dataDictionary?.classes || [],
13
+ columnDefs: dataDictionaryConfig?.columnDefs || [],
14
+ tableOptions: dataDictionaryConfig?.tableOptions || {},
15
+ title: dataDictionaryConfig?.dataDictionary?.title || "",
16
+ };
17
+ }, [dataDictionaryConfig]);
18
+ // Build table instance.
19
+ const table = useTable(classes, columnDefs, tableOptions);
20
+ // Build outline.
21
+ const outline = buildClassesOutline(table);
22
+ return { outline, table, title };
23
+ };
@@ -0,0 +1,8 @@
1
+ import { RowData, Table } from "@tanstack/react-table";
2
+ import { Attribute } from "../../../../common/entities";
3
+ import { OutlineItem } from "../../../Layout/components/Outline/types";
4
+ export interface UseDataDictionary<T extends RowData = Attribute> {
5
+ outline: OutlineItem[];
6
+ table: Table<T>;
7
+ title: string;
8
+ }
@@ -0,0 +1,2 @@
1
+ import { UseLayoutSpacing } from "./types";
2
+ export declare const useLayoutSpacing: () => UseLayoutSpacing;
@@ -0,0 +1,10 @@
1
+ import { useLayoutDimensions } from "../../../../providers/layoutDimensions/hook";
2
+ export const useLayoutSpacing = () => {
3
+ const { dimensions } = useLayoutDimensions();
4
+ return {
5
+ spacing: {
6
+ bottom: dimensions.footer.height,
7
+ top: dimensions.header.height,
8
+ },
9
+ };
10
+ };
@@ -0,0 +1,7 @@
1
+ export interface LayoutSpacing {
2
+ bottom: number;
3
+ top: number;
4
+ }
5
+ export interface UseLayoutSpacing {
6
+ spacing: LayoutSpacing;
7
+ }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { Table } from "@tanstack/react-table";
3
+ import { ROW_DIRECTION } from "../../../../../Table/common/entities";
4
+ export interface TableBodyProps<T> {
5
+ rowDirection: ROW_DIRECTION;
6
+ tableInstance: Table<T>;
7
+ }
8
+ export declare const TableHead: <T extends object>({ rowDirection, tableInstance, }: TableBodyProps<T>) => JSX.Element;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.TableHead = void 0;
27
+ const material_1 = require("@mui/material");
28
+ const react_table_1 = require("@tanstack/react-table");
29
+ const react_1 = __importStar(require("react"));
30
+ const entities_1 = require("../../../../../Table/common/entities");
31
+ const TableHead = ({ rowDirection, tableInstance, }) => {
32
+ return (react_1.default.createElement(react_1.Fragment, null, rowDirection === entities_1.ROW_DIRECTION.DEFAULT &&
33
+ tableInstance.getHeaderGroups().map((headerGroup) => (react_1.default.createElement(material_1.TableHead, { key: headerGroup.id },
34
+ react_1.default.createElement(material_1.TableRow, null, headerGroup.headers.map((header) => (react_1.default.createElement(material_1.TableCell, { key: header.id }, (0, react_table_1.flexRender)(header.column.columnDef.header, header.getContext()))))))))));
35
+ };
36
+ exports.TableHead = TableHead;