@databiosphere/findable-ui 25.0.0 → 26.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 (351) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +56 -0
  3. package/lib/common/entities.d.ts +25 -0
  4. package/lib/components/DataDictionary/common/utils.js +10 -8
  5. package/lib/components/DataDictionary/components/Entities/entities.d.ts +1 -1
  6. package/lib/components/DataDictionary/components/Entities/entities.js +2 -2
  7. package/lib/components/DataDictionary/components/Entities/types.d.ts +3 -1
  8. package/lib/components/DataDictionary/components/Entity/entity.d.ts +1 -1
  9. package/lib/components/DataDictionary/components/Entity/entity.js +2 -2
  10. package/lib/components/DataDictionary/components/Entity/types.d.ts +3 -1
  11. package/lib/components/DataDictionary/components/Table/components/BasicCell/types.d.ts +1 -2
  12. package/lib/components/DataDictionary/components/Table/hook.d.ts +2 -2
  13. package/lib/components/DataDictionary/components/Table/hook.js +2 -3
  14. package/lib/components/DataDictionary/dataDictionary.js +2 -2
  15. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +7 -2
  16. package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +3 -1
  17. package/lib/components/Detail/components/Table/stories/args.d.ts +27 -0
  18. package/lib/components/Detail/components/Table/stories/args.js +100 -0
  19. package/lib/components/Detail/components/Table/stories/constants.d.ts +4 -0
  20. package/lib/components/Detail/components/Table/stories/constants.js +11 -0
  21. package/lib/components/Detail/components/Table/stories/filter/args.d.ts +5 -0
  22. package/lib/components/Detail/components/Table/stories/filter/args.js +50 -0
  23. package/lib/components/Detail/components/Table/stories/filter/filter.stories.d.ts +11 -0
  24. package/lib/components/Detail/components/Table/stories/filter/filter.stories.js +78 -0
  25. package/lib/components/Detail/components/Table/stories/table.stories.d.ts +6 -0
  26. package/lib/components/Detail/components/Table/stories/table.stories.js +19 -0
  27. package/lib/components/Detail/components/Table/table.js +2 -0
  28. package/lib/components/Export/components/ExportMethod/exportMethod.d.ts +2 -2
  29. package/lib/components/Export/components/ExportMethod/exportMethod.styles.js +1 -1
  30. package/lib/components/Filter/components/ClearAllFilters/clearAllFilters.js +2 -1
  31. package/lib/components/Filter/components/Filter/filter.js +2 -1
  32. package/lib/components/Filter/components/FilterRange/constants.d.ts +8 -0
  33. package/lib/components/Filter/components/FilterRange/constants.js +27 -0
  34. package/lib/components/Filter/components/FilterRange/filterRange.d.ts +2 -0
  35. package/lib/components/Filter/components/FilterRange/filterRange.js +26 -0
  36. package/lib/components/Filter/components/FilterRange/filterRange.styles.d.ts +4 -0
  37. package/lib/components/Filter/components/FilterRange/filterRange.styles.js +66 -0
  38. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.d.ts +2 -0
  39. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.js +14 -0
  40. package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/types.d.ts +8 -0
  41. package/lib/components/Filter/components/FilterRange/stories/filterRange.stories.d.ts +6 -0
  42. package/lib/components/Filter/components/FilterRange/stories/filterRange.stories.js +9 -0
  43. package/lib/components/Filter/components/FilterRange/types.d.ts +8 -0
  44. package/lib/components/Filter/components/FilterRange/types.js +6 -0
  45. package/lib/components/Filter/components/Filters/filters.js +2 -1
  46. package/lib/components/Filter/components/HighlightedLabel/highlightedLabel.d.ts +3 -2
  47. package/lib/components/Filter/components/HighlightedLabel/highlightedLabel.js +2 -2
  48. package/lib/components/Filter/components/SearchAllFilters/components/VariableSizeListItem/variableSizeListItem.js +3 -2
  49. package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.js +2 -1
  50. package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.js +1 -2
  51. package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.js +3 -2
  52. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.d.ts +1 -1
  53. package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.js +5 -2
  54. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.d.ts +2 -1
  55. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.js +2 -1
  56. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.js +10 -7
  57. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.d.ts +6 -0
  58. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.js +4 -4
  59. package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.js +1 -2
  60. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.js +1 -0
  61. package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.js +0 -1
  62. package/lib/components/Index/components/EntitiesView/components/ChartView/types.d.ts +2 -0
  63. package/lib/components/Index/components/EntitiesView/entitiesView.d.ts +1 -1
  64. package/lib/components/Index/components/EntitiesView/entitiesView.js +3 -2
  65. package/lib/components/Index/components/EntitiesView/types.d.ts +2 -2
  66. package/lib/components/Index/components/Hero/components/ExportButton/exportButton.js +2 -1
  67. package/lib/components/Layout/components/Header/components/Content/components/Slogan/slogan.styles.d.ts +1 -1
  68. package/lib/components/Layout/components/Outline/outline.styles.js +1 -2
  69. package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.js +2 -1
  70. package/lib/components/Layout/components/Sidebar/sidebar.js +4 -1
  71. package/lib/components/Loading/loading.styles.js +2 -1
  72. package/lib/components/Login/components/Button/constants.js +2 -3
  73. package/lib/components/Login/components/Button/types.d.ts +1 -1
  74. package/lib/components/Login/components/Buttons/types.d.ts +1 -1
  75. package/lib/components/Support/components/SupportRequest/components/Dialog/dialog.styles.js +4 -4
  76. package/lib/components/Support/components/ViewSupport/viewSupport.styles.js +2 -2
  77. package/lib/components/Table/columnDef/columnFilters/filterFn.d.ts +13 -0
  78. package/lib/components/Table/columnDef/columnFilters/filterFn.js +22 -0
  79. package/lib/components/Table/common/columnDef.js +2 -0
  80. package/lib/components/Table/common/utils.d.ts +1 -13
  81. package/lib/components/Table/common/utils.js +1 -23
  82. package/lib/components/Table/components/Pagination/pagination.js +3 -2
  83. package/lib/components/Table/components/PaginationSummary/paginationSummary.js +2 -1
  84. package/lib/components/Table/components/TableRows/tableRows.js +7 -3
  85. package/lib/components/Table/table.js +3 -1
  86. package/lib/components/TableCreator/tableCreator.js +12 -3
  87. package/lib/components/common/Button/components/ButtonOutline/buttonOutline.styles.js +7 -7
  88. package/lib/components/common/Button/constants.d.ts +2 -0
  89. package/lib/components/common/Button/constants.js +21 -0
  90. package/lib/components/common/LoginDialog/loginDialog.styles.js +2 -3
  91. package/lib/components/types.d.ts +3 -0
  92. package/lib/config/entities.d.ts +3 -3
  93. package/lib/config/utils.js +1 -1
  94. package/lib/hooks/useEntityList.js +2 -1
  95. package/lib/hooks/useEntityService.js +1 -1
  96. package/lib/hooks/useExploreMode/types.d.ts +6 -0
  97. package/lib/hooks/useExploreMode/types.js +6 -0
  98. package/lib/hooks/{useExploreMode.d.ts → useExploreMode/useExploreMode.d.ts} +1 -6
  99. package/lib/hooks/{useExploreMode.js → useExploreMode/useExploreMode.js} +1 -7
  100. package/lib/hooks/useFetchEntity.js +2 -1
  101. package/lib/styles/common/constants/colorMixes.d.ts +18 -0
  102. package/lib/styles/common/constants/colorMixes.js +19 -0
  103. package/lib/styles/common/constants/shadows.d.ts +5 -0
  104. package/lib/styles/common/constants/shadows.js +5 -0
  105. package/lib/styles/common/mui/button.d.ts +10 -2
  106. package/lib/styles/common/mui/button.js +12 -2
  107. package/lib/tests/mui/constants.d.ts +1 -0
  108. package/lib/tests/mui/constants.js +1 -0
  109. package/lib/tests/testIds.d.ts +19 -0
  110. package/lib/tests/testIds.js +19 -0
  111. package/lib/theme/common/components.d.ts +2 -3
  112. package/lib/theme/common/components.js +47 -51
  113. package/lib/theme/common/palette.d.ts +0 -44
  114. package/lib/theme/common/palette.js +27 -82
  115. package/lib/theme/common/shadows.d.ts +2 -28
  116. package/lib/theme/common/shadows.js +27 -32
  117. package/lib/theme/components/muiAlert.js +5 -5
  118. package/lib/theme/theme.js +7 -7
  119. package/lib/views/ExploreView/exploreView.js +4 -3
  120. package/package.json +4 -4
  121. package/src/common/entities.ts +30 -0
  122. package/src/components/DataDictionary/common/utils.ts +12 -8
  123. package/src/components/DataDictionary/components/Entities/entities.tsx +11 -2
  124. package/src/components/DataDictionary/components/Entities/types.ts +3 -1
  125. package/src/components/DataDictionary/components/Entity/entity.tsx +2 -1
  126. package/src/components/DataDictionary/components/Entity/types.ts +3 -1
  127. package/src/components/DataDictionary/components/Table/components/BasicCell/types.ts +1 -2
  128. package/src/components/DataDictionary/components/Table/hook.ts +6 -4
  129. package/src/components/DataDictionary/dataDictionary.tsx +2 -2
  130. package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +8 -2
  131. package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +3 -1
  132. package/src/components/Detail/components/Table/stories/args.ts +104 -0
  133. package/src/components/Detail/components/Table/stories/constants.ts +15 -0
  134. package/src/components/Detail/components/Table/stories/filter/args.ts +54 -0
  135. package/src/components/Detail/components/Table/stories/filter/filter.stories.tsx +90 -0
  136. package/src/components/Detail/components/Table/stories/table.stories.tsx +32 -0
  137. package/src/components/Detail/components/Table/table.tsx +2 -0
  138. package/src/components/Export/components/ExportMethod/exportMethod.styles.ts +1 -1
  139. package/src/components/Export/components/ExportMethod/exportMethod.tsx +3 -2
  140. package/src/components/Filter/components/ClearAllFilters/clearAllFilters.tsx +7 -1
  141. package/src/components/Filter/components/Filter/filter.tsx +2 -0
  142. package/src/components/Filter/components/FilterRange/constants.ts +41 -0
  143. package/src/components/Filter/components/FilterRange/filterRange.styles.ts +71 -0
  144. package/src/components/Filter/components/FilterRange/filterRange.tsx +71 -0
  145. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.ts +20 -0
  146. package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/types.ts +9 -0
  147. package/src/components/Filter/components/FilterRange/stories/filterRange.stories.tsx +15 -0
  148. package/src/components/Filter/components/FilterRange/types.ts +9 -0
  149. package/src/components/Filter/components/Filters/filters.tsx +7 -1
  150. package/src/components/Filter/components/HighlightedLabel/highlightedLabel.tsx +4 -2
  151. package/src/components/Filter/components/SearchAllFilters/components/VariableSizeListItem/variableSizeListItem.tsx +14 -2
  152. package/src/components/Filter/components/SearchAllFilters/searchAllFilters.tsx +2 -0
  153. package/src/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.ts +1 -2
  154. package/src/components/Filter/components/VariableSizeListItem/variableSizeListItem.tsx +14 -2
  155. package/src/components/Index/components/EntitiesView/components/ChartView/chartView.tsx +2 -1
  156. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.ts +3 -1
  157. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.ts +10 -7
  158. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.ts +10 -4
  159. package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.tsx +1 -2
  160. package/src/components/Index/components/EntitiesView/components/ChartView/stories/args.ts +1 -0
  161. package/src/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.tsx +0 -1
  162. package/src/components/Index/components/EntitiesView/components/ChartView/types.ts +2 -0
  163. package/src/components/Index/components/EntitiesView/entitiesView.tsx +2 -2
  164. package/src/components/Index/components/EntitiesView/types.ts +2 -2
  165. package/src/components/Index/components/Hero/components/ExportButton/exportButton.tsx +2 -0
  166. package/src/components/Layout/components/Outline/outline.styles.ts +1 -2
  167. package/src/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.tsx +2 -0
  168. package/src/components/Layout/components/Sidebar/sidebar.tsx +4 -1
  169. package/src/components/Loading/loading.styles.ts +2 -1
  170. package/src/components/Login/components/Button/constants.ts +2 -3
  171. package/src/components/Login/components/Button/types.ts +1 -1
  172. package/src/components/Login/components/Buttons/types.ts +1 -1
  173. package/src/components/Support/components/SupportRequest/components/Dialog/dialog.styles.ts +4 -4
  174. package/src/components/Support/components/ViewSupport/viewSupport.styles.ts +2 -2
  175. package/src/components/Table/columnDef/columnFilters/filterFn.ts +27 -0
  176. package/src/components/Table/common/columnDef.ts +2 -0
  177. package/src/components/Table/common/utils.ts +1 -27
  178. package/src/components/Table/components/Pagination/pagination.tsx +3 -2
  179. package/src/components/Table/components/PaginationSummary/paginationSummary.tsx +2 -1
  180. package/src/components/Table/components/TableRows/tableRows.tsx +10 -3
  181. package/src/components/Table/table.tsx +3 -1
  182. package/src/components/TableCreator/tableCreator.tsx +17 -3
  183. package/src/components/common/Button/components/ButtonOutline/buttonOutline.styles.ts +7 -7
  184. package/src/components/common/Button/constants.ts +23 -0
  185. package/src/components/common/LoginDialog/loginDialog.styles.ts +2 -3
  186. package/src/components/types.ts +4 -0
  187. package/src/config/entities.ts +3 -3
  188. package/src/config/utils.ts +1 -1
  189. package/src/hooks/useEntityList.ts +2 -1
  190. package/src/hooks/useEntityService.ts +1 -1
  191. package/src/hooks/useExploreMode/types.ts +7 -0
  192. package/src/hooks/{useExploreMode.ts → useExploreMode/useExploreMode.ts} +2 -9
  193. package/src/hooks/useFetchEntity.tsx +2 -1
  194. package/src/styles/common/constants/colorMixes.ts +20 -0
  195. package/src/styles/common/constants/shadows.ts +5 -0
  196. package/src/styles/common/mui/button.ts +20 -2
  197. package/src/tests/mui/constants.ts +1 -0
  198. package/src/tests/testIds.ts +19 -0
  199. package/src/theme/common/components.ts +47 -59
  200. package/src/theme/common/palette.ts +27 -86
  201. package/src/theme/common/shadows.ts +28 -33
  202. package/src/theme/components/muiAlert.ts +5 -5
  203. package/src/theme/theme.ts +50 -51
  204. package/src/views/ExploreView/exploreView.tsx +8 -3
  205. package/tests/chart.test.tsx +113 -22
  206. package/tests/chartView.test.tsx +12 -0
  207. package/tests/entitiesView.test.tsx +7 -11
  208. package/tests/filterRange.test.tsx +87 -0
  209. package/tests/filterRangeMock.test.tsx +38 -0
  210. package/tests/tableFilter.test.tsx +90 -0
  211. package/lib/components/DataDictionary/components/Table/columns/columnDef.d.ts +0 -6
  212. package/lib/components/DataDictionary/components/Table/columns/columnDef.js +0 -33
  213. package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.d.ts +0 -5
  214. package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.js +0 -5
  215. package/lib/components/DataDictionary/components/Table/columns/types.d.ts +0 -2
  216. package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +0 -8
  217. package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +0 -36
  218. package/lib/components/Index/components/Cell/cell.d.ts +0 -7
  219. package/lib/components/Index/components/Cell/cell.js +0 -10
  220. package/lib/components/Index/components/EntitiesView/constants.d.ts +0 -1
  221. package/lib/components/Index/components/EntitiesView/constants.js +0 -1
  222. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.d.ts +0 -8
  223. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.js +0 -57
  224. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.d.ts +0 -4
  225. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.js +0 -10
  226. package/lib/components/Index/components/NTag/nTag.d.ts +0 -10
  227. package/lib/components/Index/components/NTag/nTag.js +0 -8
  228. package/lib/components/Index/components/NTagCell/nTagCell.d.ts +0 -11
  229. package/lib/components/Index/components/NTagCell/nTagCell.js +0 -29
  230. package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +0 -5
  231. package/lib/components/Index/components/NTagCell/nTagCell.stories.js +0 -16
  232. package/lib/components/Index/components/TitleCell/titleCell.d.ts +0 -6
  233. package/lib/components/Index/components/TitleCell/titleCell.js +0 -10
  234. package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +0 -3
  235. package/lib/components/Index/components/TitleCell/titleCell.styles.js +0 -6
  236. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.d.ts +0 -6
  237. package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.js +0 -10
  238. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.d.ts +0 -5
  239. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.js +0 -29
  240. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +0 -6
  241. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +0 -13
  242. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +0 -36
  243. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +0 -9
  244. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +0 -5
  245. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +0 -10
  246. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +0 -36
  247. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +0 -9
  248. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +0 -5
  249. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +0 -19
  250. package/lib/components/Layout/components/Outline/common/constants.d.ts +0 -2
  251. package/lib/components/Layout/components/Outline/common/constants.js +0 -1
  252. package/lib/components/Login/login.stories.d.ts +0 -6
  253. package/lib/components/Login/login.stories.js +0 -31
  254. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.d.ts +0 -16
  255. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +0 -28
  256. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.d.ts +0 -5
  257. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.js +0 -46
  258. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +0 -3
  259. package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +0 -21
  260. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +0 -2
  261. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +0 -37
  262. package/lib/components/TableCreator/common/constants.d.ts +0 -6
  263. package/lib/components/TableCreator/common/constants.js +0 -19
  264. package/lib/components/TableCreator/common/entities.d.ts +0 -5
  265. package/lib/components/TableCreator/common/entities.js +0 -1
  266. package/lib/components/TableCreator/tableCreator.styles.d.ts +0 -4
  267. package/lib/components/TableCreator/tableCreator.styles.js +0 -4
  268. package/lib/components/common/Alert/alert.stories.d.ts +0 -6
  269. package/lib/components/common/Alert/alert.stories.js +0 -36
  270. package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +0 -4
  271. package/lib/components/common/Alert/components/AlertText/alertText.styles.js +0 -19
  272. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +0 -7
  273. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +0 -5
  274. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +0 -3
  275. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +0 -19
  276. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +0 -10
  277. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +0 -16
  278. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +0 -3
  279. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +0 -21
  280. package/lib/components/common/Button/components/LoginButton/loginButton.d.ts +0 -3
  281. package/lib/components/common/Button/components/LoginButton/loginButton.js +0 -6
  282. package/lib/components/common/Button/components/LoginButton/loginButton.styles.d.ts +0 -7
  283. package/lib/components/common/Button/components/LoginButton/loginButton.styles.js +0 -11
  284. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +0 -5
  285. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +0 -10
  286. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +0 -3
  287. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +0 -9
  288. package/lib/hooks/useAuthentication/common/constants.d.ts +0 -4
  289. package/lib/hooks/useAuthentication/common/constants.js +0 -19
  290. package/lib/hooks/useAuthentication/common/entities.d.ts +0 -25
  291. package/lib/hooks/useAuthentication/common/entities.js +0 -11
  292. package/lib/hooks/useAuthentication/common/utils.d.ts +0 -15
  293. package/lib/hooks/useAuthentication/common/utils.js +0 -25
  294. package/lib/hooks/useAuthentication/useAuthentication.d.ts +0 -6
  295. package/lib/hooks/useAuthentication/useAuthentication.js +0 -9
  296. package/lib/hooks/useAuthentication/useAuthenticationComplete.d.ts +0 -6
  297. package/lib/hooks/useAuthentication/useAuthenticationComplete.js +0 -55
  298. package/lib/hooks/useAuthentication/useAuthenticationForm.d.ts +0 -20
  299. package/lib/hooks/useAuthentication/useAuthenticationForm.js +0 -88
  300. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.d.ts +0 -18
  301. package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.js +0 -50
  302. package/lib/hooks/useAuthentication/useAuthenticationStatus.d.ts +0 -20
  303. package/lib/hooks/useAuthentication/useAuthenticationStatus.js +0 -32
  304. package/lib/hooks/useAuthentication/useFetchGoogleProfile.d.ts +0 -21
  305. package/lib/hooks/useAuthentication/useFetchGoogleProfile.js +0 -41
  306. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.d.ts +0 -18
  307. package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.js +0 -62
  308. package/lib/hooks/useAuthentication/useFetchTerraProfile.d.ts +0 -24
  309. package/lib/hooks/useAuthentication/useFetchTerraProfile.js +0 -62
  310. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.d.ts +0 -15
  311. package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.js +0 -62
  312. package/lib/hooks/useAuthentication/useTokenClient.d.ts +0 -11
  313. package/lib/hooks/useAuthentication/useTokenClient.js +0 -29
  314. package/lib/hooks/useAuthenticationConfig.d.ts +0 -6
  315. package/lib/hooks/useAuthenticationConfig.js +0 -14
  316. package/lib/hooks/useCategoryConfigs.d.ts +0 -6
  317. package/lib/hooks/useCategoryConfigs.js +0 -17
  318. package/lib/hooks/useEntityListRelatedView.d.ts +0 -15
  319. package/lib/hooks/useEntityListRelatedView.js +0 -62
  320. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +0 -15
  321. package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +0 -27
  322. package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +0 -5
  323. package/lib/hooks/useFileManifest/useFileManifestURL.js +0 -11
  324. package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +0 -9
  325. package/lib/hooks/useFileManifest/useRequestFileManifest.js +0 -37
  326. package/lib/hooks/useLayoutState.d.ts +0 -6
  327. package/lib/hooks/useLayoutState.js +0 -9
  328. package/lib/hooks/useMenu.d.ts +0 -10
  329. package/lib/hooks/useMenu.js +0 -17
  330. package/lib/hooks/useMenuWithPosition.d.ts +0 -14
  331. package/lib/hooks/useMenuWithPosition.js +0 -33
  332. package/lib/hooks/useSessionTimeout.d.ts +0 -11
  333. package/lib/hooks/useSessionTimeout.js +0 -28
  334. package/lib/providers/authentication.d.ts +0 -51
  335. package/lib/providers/authentication.js +0 -110
  336. package/lib/providers/layoutState.d.ts +0 -40
  337. package/lib/providers/layoutState.js +0 -47
  338. package/lib/styles/common/mixins/shadows.d.ts +0 -3
  339. package/lib/styles/common/mixins/shadows.js +0 -4
  340. package/lib/theme/common/entities.d.ts +0 -6
  341. package/lib/theme/common/entities.js +0 -1
  342. package/src/components/DataDictionary/components/Table/columns/columnDef.ts +0 -47
  343. package/src/components/DataDictionary/components/Table/columns/columnIdentifier.ts +0 -5
  344. package/src/components/DataDictionary/components/Table/columns/types.ts +0 -3
  345. package/src/components/Index/components/EntitiesView/constants.ts +0 -1
  346. package/src/styles/common/mixins/shadows.ts +0 -7
  347. package/src/theme/common/entities.ts +0 -7
  348. /package/lib/components/{DataDictionary/components/Table/columns → Filter/components/FilterRange/hooks/UseFilterRange}/types.js +0 -0
  349. /package/lib/styles/common/{mui → constants}/palette.d.ts +0 -0
  350. /package/lib/styles/common/{mui → constants}/palette.js +0 -0
  351. /package/src/styles/common/{mui → constants}/palette.ts +0 -0
@@ -1,34 +1,29 @@
1
- /*
2
- * Elevation
3
- */
4
- enum ELEVATION {
5
- E00 = "none",
6
- E01 = "0 1px 4px 0 #00000012",
7
- E02 = "0 8px 8px -4px #10182808, 0 20px 24px -4px #10182814",
8
- }
1
+ import { Shadows } from "@mui/material";
9
2
 
10
- /**
11
- * Stroke
12
- */
13
- enum STROKE {
14
- BOTTOM = "inset 0 -1px 0 0",
15
- TOP = "inset 0 1px 0 0",
16
- }
17
-
18
- /**
19
- * Elevation constants
20
- */
21
- export const elevation00 = ELEVATION.E00;
22
- export const elevation01 = ELEVATION.E01;
23
- export const elevation02 = ELEVATION.E02;
24
-
25
- /**
26
- * Shadows constants
27
- */
28
- export const shadows = [elevation00, elevation01, elevation02];
29
-
30
- /**
31
- * Stroke constants
32
- */
33
- export const strokeBottom = STROKE.BOTTOM;
34
- export const strokeTop = STROKE.TOP;
3
+ export const shadows: Shadows = [
4
+ "none",
5
+ "0 1px 4px 0 #00000012",
6
+ "0 8px 8px -4px #10182808, 0 20px 24px -4px #10182814",
7
+ "none",
8
+ "none",
9
+ "none",
10
+ "none",
11
+ "none",
12
+ "none",
13
+ "none",
14
+ "none",
15
+ "none",
16
+ "none",
17
+ "none",
18
+ "none",
19
+ "none",
20
+ "none",
21
+ "none",
22
+ "none",
23
+ "none",
24
+ "none",
25
+ "none",
26
+ "none",
27
+ "none",
28
+ "none",
29
+ ];
@@ -3,10 +3,10 @@ import { ErrorIcon } from "../../components/common/CustomIcon/components/ErrorIc
3
3
  import { InfoIcon } from "../../components/common/CustomIcon/components/InfoIcon/infoIcon";
4
4
  import { SuccessIcon } from "../../components/common/CustomIcon/components/SuccessIcon/successIcon";
5
5
  import { WarningIcon } from "../../components/common/CustomIcon/components/WarningIcon/warningIcon";
6
+ import { COLOR_MIXES } from "../../styles/common/constants/colorMixes";
6
7
  import { SIZE } from "../../styles/common/constants/size";
7
8
  import { COLOR, SEVERITY, VARIANT } from "../../styles/common/mui/alert";
8
9
  import { FONT_SIZE } from "../../styles/common/mui/icon";
9
- import { alpha32 } from "../common/palette";
10
10
  import { TEXT_BODY_500 } from "../common/typography";
11
11
 
12
12
  export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
@@ -42,7 +42,7 @@ export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
42
42
  props: { severity: SEVERITY.ERROR },
43
43
  style: {
44
44
  backgroundColor: theme.palette.alert.lightest,
45
- border: `1px solid ${theme.palette.alert.main}${alpha32}`,
45
+ border: `1px solid ${COLOR_MIXES.ALERT_MAIN_32}`,
46
46
  // eslint-disable-next-line sort-keys -- disabling key order for readability
47
47
  "& .MuiAlert-icon": {
48
48
  color: theme.palette.alert.main,
@@ -53,7 +53,7 @@ export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
53
53
  props: { severity: SEVERITY.INFO },
54
54
  style: {
55
55
  backgroundColor: theme.palette.info.lightest,
56
- border: `1px solid ${theme.palette.info.main}${alpha32}`,
56
+ border: `1px solid ${COLOR_MIXES.INFO_MAIN_32}`,
57
57
  // eslint-disable-next-line sort-keys -- disabling key order for readability
58
58
  "& .MuiAlert-icon": {
59
59
  color: theme.palette.info.main,
@@ -64,7 +64,7 @@ export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
64
64
  props: { severity: SEVERITY.SUCCESS },
65
65
  style: {
66
66
  backgroundColor: theme.palette.success.lightest,
67
- border: `1px solid ${theme.palette.success.main}${alpha32}`,
67
+ border: `1px solid ${COLOR_MIXES.SUCCESS_MAIN_32}`,
68
68
  // eslint-disable-next-line sort-keys -- disabling key order for readability
69
69
  "& .MuiAlert-icon": {
70
70
  color: theme.palette.success.main,
@@ -75,7 +75,7 @@ export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
75
75
  props: { severity: SEVERITY.WARNING },
76
76
  style: {
77
77
  backgroundColor: theme.palette.warning.lightest,
78
- border: `1px solid ${theme.palette.warning.main}${alpha32}`,
78
+ border: `1px solid ${COLOR_MIXES.WARNING_MAIN_32}`,
79
79
  // eslint-disable-next-line sort-keys -- disabling key order for readability
80
80
  "& .MuiAlert-icon": {
81
81
  color: theme.palette.warning.main,
@@ -1,4 +1,5 @@
1
- import { createTheme, Shadows, Theme, ThemeOptions } from "@mui/material";
1
+ import { createTheme, Theme, ThemeOptions } from "@mui/material";
2
+ import { deepmerge } from "@mui/utils";
2
3
  import * as B from "./common/breakpoints";
3
4
  import * as C from "./common/components";
4
5
  import * as P from "./common/palette";
@@ -15,60 +16,58 @@ export interface ThemeProps {
15
16
  * @param customOptions - Custom theme option overrides.
16
17
  * @returns theme with custom theme overrides.
17
18
  */
18
- export function createAppTheme(customOptions?: ThemeOptions): Theme {
19
+ export function createAppTheme(customOptions: ThemeOptions = {}): Theme {
19
20
  // Generate default theme with custom overrides.
20
21
  const theme = createTheme(
21
- {
22
- breakpoints: {
23
- values: {
24
- lg: B.desktop,
25
- md: B.desktopSm,
26
- sm: B.tablet,
27
- xs: B.mobile,
22
+ deepmerge(
23
+ {
24
+ breakpoints: {
25
+ values: {
26
+ lg: B.desktop,
27
+ md: B.desktopSm,
28
+ sm: B.tablet,
29
+ xs: B.mobile,
30
+ },
31
+ },
32
+ cssVariables: true,
33
+ palette: {
34
+ alert: P.alert,
35
+ background: P.background,
36
+ common: P.common,
37
+ info: P.info,
38
+ ink: P.ink,
39
+ primary: P.primary,
40
+ smoke: P.smoke,
41
+ success: P.success,
42
+ text: P.text,
43
+ warning: P.warning,
44
+ },
45
+ shadows,
46
+ spacing: 4,
47
+ typography: {
48
+ [T.TEXT_BODY_400]: T.textBody400,
49
+ [T.TEXT_BODY_400_2_LINES]: T.textBody4002Lines,
50
+ [T.TEXT_BODY_500]: T.textBody500,
51
+ [T.TEXT_BODY_500_2_LINES]: T.textBody5002Lines,
52
+ [T.TEXT_BODY_LARGE_400]: T.textBodyLarge400,
53
+ [T.TEXT_BODY_LARGE_400_2_LINES]: T.textBodyLarge4002Lines,
54
+ [T.TEXT_BODY_LARGE_500]: T.textBodyLarge500,
55
+ [T.TEXT_BODY_SMALL_400]: T.textBodySmall400,
56
+ [T.TEXT_BODY_SMALL_400_2_LINES]: T.textBodySmall4002Lines,
57
+ [T.TEXT_BODY_SMALL_500]: T.textBodySmall500,
58
+ [T.TEXT_HEADING]: T.textHeading,
59
+ [T.TEXT_HEADING_LARGE]: T.textHeadingLarge,
60
+ [T.TEXT_HEADING_SMALL]: T.textHeadingSmall,
61
+ [T.TEXT_HEADING_XLARGE]: T.textHeadingXLarge,
62
+ [T.TEXT_HEADING_XSMALL]: T.textHeadingXSmall,
63
+ [T.TEXT_UPPERCASE_500]: T.textUppercase500,
64
+ fontFamily: T.fontFamily,
28
65
  },
29
66
  },
30
- cssVariables: true,
31
- palette: {
32
- alert: P.alert,
33
- background: P.background,
34
- common: P.common,
35
- info: P.info,
36
- ink: P.ink,
37
- primary: P.primary,
38
- smoke: P.smoke,
39
- success: P.success,
40
- text: P.text,
41
- warning: P.warning,
42
- },
43
- spacing: 4,
44
- typography: {
45
- [T.TEXT_BODY_400]: T.textBody400,
46
- [T.TEXT_BODY_400_2_LINES]: T.textBody4002Lines,
47
- [T.TEXT_BODY_500]: T.textBody500,
48
- [T.TEXT_BODY_500_2_LINES]: T.textBody5002Lines,
49
- [T.TEXT_BODY_LARGE_400]: T.textBodyLarge400,
50
- [T.TEXT_BODY_LARGE_400_2_LINES]: T.textBodyLarge4002Lines,
51
- [T.TEXT_BODY_LARGE_500]: T.textBodyLarge500,
52
- [T.TEXT_BODY_SMALL_400]: T.textBodySmall400,
53
- [T.TEXT_BODY_SMALL_400_2_LINES]: T.textBodySmall4002Lines,
54
- [T.TEXT_BODY_SMALL_500]: T.textBodySmall500,
55
- [T.TEXT_HEADING]: T.textHeading,
56
- [T.TEXT_HEADING_LARGE]: T.textHeadingLarge,
57
- [T.TEXT_HEADING_SMALL]: T.textHeadingSmall,
58
- [T.TEXT_HEADING_XLARGE]: T.textHeadingXLarge,
59
- [T.TEXT_HEADING_XSMALL]: T.textHeadingXSmall,
60
- [T.TEXT_UPPERCASE_500]: T.textUppercase500,
61
- fontFamily: T.fontFamily,
62
- },
63
- },
64
- { ...customOptions }
67
+ customOptions
68
+ )
65
69
  );
66
70
 
67
- // Default shadow overrides.
68
- theme.shadows = [...theme.shadows].map(
69
- (shadow, s) => shadows[s] || shadow
70
- ) as Shadows;
71
-
72
71
  // Theme components.
73
72
  theme.components = {
74
73
  MuiAccordion: C.MuiAccordion(theme),
@@ -77,7 +76,7 @@ export function createAppTheme(customOptions?: ThemeOptions): Theme {
77
76
  MuiAlert: M.MuiAlert(theme),
78
77
  MuiAlertTitle: M.MuiAlertTitle,
79
78
  MuiAppBar: C.MuiAppBar,
80
- MuiBackdrop: C.MuiBackdrop(theme),
79
+ MuiBackdrop: C.MuiBackdrop,
81
80
  MuiBreadcrumbs: C.MuiBreadcrumbs(theme),
82
81
  MuiButton: C.MuiButton(theme),
83
82
  MuiButtonBase: C.MuiButtonBase(theme),
@@ -87,7 +86,7 @@ export function createAppTheme(customOptions?: ThemeOptions): Theme {
87
86
  MuiChip: C.MuiChip(theme),
88
87
  MuiCircularProgress: C.MuiCircularProgress(theme),
89
88
  MuiCssBaseline: C.MuiCssBaseline(theme),
90
- MuiDialog: C.MuiDialog(theme),
89
+ MuiDialog: C.MuiDialog,
91
90
  MuiDialogActions: C.MuiDialogActions,
92
91
  MuiDialogContent: C.MuiDialogContent(theme),
93
92
  MuiDialogTitle: C.MuiDialogTitle(theme),
@@ -40,6 +40,7 @@ import { useExploreState } from "../../hooks/useExploreState";
40
40
  import { useSummary } from "../../hooks/useSummary";
41
41
  import { ExploreActionKind } from "../../providers/exploreState";
42
42
  import { SELECT_CATEGORY_KEY } from "../../providers/exploreState/constants";
43
+ import { TEST_IDS } from "../../tests/testIds";
43
44
  import { DESKTOP_SM } from "../../theme/common/breakpoints";
44
45
 
45
46
  export interface ExploreViewProps extends AzulEntitiesStaticResponse {
@@ -52,7 +53,7 @@ export const ExploreView = (props: ExploreViewProps): JSX.Element => {
52
53
  const { config, entityConfig } = useConfig(); // Get app level config.
53
54
  const { exploreDispatch, exploreState } = useExploreState(); // Get the useReducer state and dispatch for "Explore".
54
55
  const { explorerTitle, summaryConfig, trackingConfig } = config;
55
- const { listView } = entityConfig;
56
+ const { label, listView } = entityConfig;
56
57
  const { listHero, subTitleHero } = listView || {};
57
58
  const { categoryGroups, categoryViews, filterCount, loading } = exploreState;
58
59
  const { response: summaryResponse } = useSummary(); // Fetch summary.
@@ -145,7 +146,7 @@ export const ExploreView = (props: ExploreViewProps): JSX.Element => {
145
146
  <>
146
147
  {categoryViews && !!categoryViews.length && (
147
148
  <Sidebar drawerOpen={isDrawerOpen} onDrawerClose={onCloseDrawer}>
148
- <SidebarTools>
149
+ <SidebarTools data-testid={TEST_IDS.FILTER_CONTROLS}>
149
150
  <SidebarLabel label={"Filters"} />
150
151
  <ClearAllFilters />
151
152
  <SearchAllFilters
@@ -165,7 +166,11 @@ export const ExploreView = (props: ExploreViewProps): JSX.Element => {
165
166
  <IndexView
166
167
  className={props.className}
167
168
  chart={
168
- <ChartView categoryFilters={categoryFilters} loading={loading} />
169
+ <ChartView
170
+ categoryFilters={categoryFilters}
171
+ entityName={label}
172
+ loading={loading}
173
+ />
169
174
  }
170
175
  list={<EntityList entityListType={entityListType} />}
171
176
  ListHero={renderComponent(listHero)}
@@ -2,9 +2,15 @@ import { composeStories } from "@storybook/react";
2
2
  import { render, screen } from "@testing-library/react";
3
3
  import React from "react";
4
4
  import { SelectCategoryValueView } from "../src/common/entities";
5
+ import { parseTranslate } from "../src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils";
5
6
  import { CHART_TEST_ID } from "../src/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants";
6
7
  import * as stories from "../src/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories";
7
- import { PALETTE } from "../src/styles/common/mui/palette";
8
+ import { PALETTE } from "../src/styles/common/constants/palette";
9
+
10
+ const CLASSNAMES = {
11
+ TEXT_CATEGORY_LABEL: "text-category-label",
12
+ TEXT_COUNT: "text-count",
13
+ };
8
14
 
9
15
  const { Default, Selected } = composeStories(stories);
10
16
 
@@ -29,30 +35,35 @@ describe("Chart", () => {
29
35
  });
30
36
 
31
37
  describe("category labels and counts", () => {
32
- const countSet = new Set(DATA.map(mapCount));
33
- const labelSet = new Set(DATA.map(mapLabel));
38
+ const counts = DATA.map(mapCount);
39
+ const labels = DATA.map(mapLabel);
34
40
  let countTextEls: NodeListOf<SVGElement>;
35
41
  let labelTextEls: NodeListOf<SVGElement>;
42
+ let titleTextEls: NodeListOf<SVGElement>;
36
43
 
37
44
  beforeEach(() => {
38
45
  render(<Default testId={CHART_TEST_ID} />);
39
- countTextEls = getEls("text-count", "text");
40
- labelTextEls = getEls("text-category-label", "text");
46
+ countTextEls = getEls(CLASSNAMES.TEXT_COUNT, "text");
47
+ labelTextEls = getEls(CLASSNAMES.TEXT_CATEGORY_LABEL, "text");
48
+ titleTextEls = getEls(CLASSNAMES.TEXT_CATEGORY_LABEL, "title");
41
49
  });
42
50
 
43
- it("renders category labels", () => {
44
- expect(labelTextEls.length).toEqual(labelSet.size);
45
- labelTextEls.forEach(({ textContent }) => {
46
- expect(textContent).toBeDefined();
47
- expect(labelSet.has(textContent || "")).toBeTruthy();
51
+ it("renders category labels and matching titles", () => {
52
+ expect(labelTextEls.length).toEqual(labels.length);
53
+ expect(titleTextEls.length).toEqual(labels.length);
54
+ labelTextEls.forEach((el, i) => {
55
+ const labelText = getLabelText(el);
56
+ const titleText = titleTextEls[i].textContent || "";
57
+ expect(labels.some((l) => l.includes(labelText))).toBeTruthy();
58
+ expect(labels.includes(titleText)).toBeTruthy();
48
59
  });
49
60
  });
50
61
 
51
62
  it("renders category counts", () => {
52
- expect(countTextEls.length).toEqual(countSet.size);
63
+ expect(countTextEls.length).toEqual(counts.length);
53
64
  countTextEls.forEach(({ textContent }) => {
54
65
  expect(textContent).toBeDefined();
55
- expect(countSet.has(textContent || "")).toBeTruthy();
66
+ expect(counts.includes(textContent || "")).toBeTruthy();
56
67
  });
57
68
  });
58
69
  });
@@ -60,18 +71,21 @@ describe("Chart", () => {
60
71
  describe("category labels with selected values", () => {
61
72
  it("renders selected category labels with '(selected)'", () => {
62
73
  render(<Selected testId={CHART_TEST_ID} />);
63
- const textEls = getEls("text-category-label", "text");
64
- for (let i = 0; i < SELECTED_DATA.length; i++) {
65
- const selectedData = SELECTED_DATA[i];
66
- const textEl = textEls[i];
74
+ const textEls = getEls(CLASSNAMES.TEXT_CATEGORY_LABEL, "text");
75
+ const titleEls = getEls(CLASSNAMES.TEXT_CATEGORY_LABEL, "title");
76
+ SELECTED_DATA.forEach((selectedData, i) => {
77
+ const labelText = getLabelText(textEls[i]);
78
+ const titleText = titleEls[i].textContent || "";
67
79
  if (selectedData.selected) {
68
- expect(textEl.textContent).toEqual(
69
- `${selectedData.label} (selected)`
70
- );
71
- continue;
80
+ const expected = `${selectedData.label} (selected)`;
81
+ expect(titleText).toEqual(expected);
82
+ expect(expected.includes(labelText)).toBeTruthy();
83
+ return;
72
84
  }
73
- expect(textEl.textContent).toEqual(selectedData.label);
74
- }
85
+ const expected = selectedData.label;
86
+ expect(titleText).toEqual(expected);
87
+ expect(expected.includes(labelText)).toBeTruthy();
88
+ });
75
89
  });
76
90
  });
77
91
 
@@ -108,8 +122,31 @@ describe("Chart", () => {
108
122
  expect([...barEls].some(isFillPrimaryMain)).toBeTruthy();
109
123
  });
110
124
  });
125
+
126
+ describe("bars sorted by count", () => {
127
+ it("renders bars in descending order of count", () => {
128
+ render(<Default testId={CHART_TEST_ID} />);
129
+ // Order data by count in descending order.
130
+ const counts = [...DATA].sort(sortByCount).map(mapCount);
131
+ // Sort count <text> elements by their transform’s translate‑Y (vertical) value, since they’re rendered in data order.
132
+ const countTextEls = getEls(CLASSNAMES.TEXT_COUNT, "text");
133
+ const textContents = [...countTextEls]
134
+ .sort(sortByTransform)
135
+ .map(mapTextContent);
136
+ expect(textContents).toEqual(counts);
137
+ });
138
+ });
111
139
  });
112
140
 
141
+ /**
142
+ * Finds the first text node within the given SVGElement.
143
+ * @param el - The SVG element to search for a text node.
144
+ * @returns The first text node found within the element.
145
+ */
146
+ function findTextNode(el: SVGElement): Node | undefined {
147
+ return [...el.childNodes].find(({ nodeType }) => nodeType === Node.TEXT_NODE);
148
+ }
149
+
113
150
  /**
114
151
  * Get the SVG group element for a given class name.
115
152
  * @param className - Class name.
@@ -133,6 +170,17 @@ function getEls(className: string, selectors: string): NodeListOf<SVGElement> {
133
170
  return gEls[0].querySelectorAll(selectors);
134
171
  }
135
172
 
173
+ /**
174
+ * Retrieves the label text from a given SVGElement by extracting and processing its text content.
175
+ * @param el - The SVGElement from which the label text is to be retrieved.
176
+ * @returns The processed label text derived from the SVGElement.
177
+ */
178
+ function getLabelText(el: SVGElement): string {
179
+ const labelText = stripTrailingEllipsis(findTextNode(el)?.textContent);
180
+ expect(labelText).toBeDefined();
181
+ return labelText || "";
182
+ }
183
+
136
184
  /**
137
185
  * Check if the fill attribute of the element is #C5E3FC.
138
186
  * @param element - Element to check.
@@ -168,3 +216,46 @@ function mapCount(categoryValueView: SelectCategoryValueView): string {
168
216
  function mapLabel(categoryValueView: SelectCategoryValueView): string {
169
217
  return categoryValueView.label;
170
218
  }
219
+
220
+ /**
221
+ * Maps the text content of an SVG element to a string.
222
+ * @param el - SVG element.
223
+ * @returns Text content as a string.
224
+ */
225
+ function mapTextContent(el: SVGElement): string | null {
226
+ return el.textContent;
227
+ }
228
+
229
+ /**
230
+ * Sorts category value views by count in descending order.
231
+ * @param a - First category value view.
232
+ * @param b - Second category value view.
233
+ * @returns Sorted category value views.
234
+ */
235
+ function sortByCount(
236
+ a: SelectCategoryValueView,
237
+ b: SelectCategoryValueView
238
+ ): number {
239
+ return b.count - a.count;
240
+ }
241
+
242
+ /**
243
+ * Sorts SVG elements by their "y" transform attribute.
244
+ * @param a - First SVG element.
245
+ * @param b - Second SVG element.
246
+ * @returns Sorted SVG elements.
247
+ */
248
+ function sortByTransform(a: SVGElement, b: SVGElement): number {
249
+ const aTransform = parseTranslate(a.getAttribute("transform"));
250
+ const bTransform = parseTranslate(b.getAttribute("transform"));
251
+ return aTransform[1] - bTransform[1];
252
+ }
253
+
254
+ /**
255
+ * Strips trailing ellipsis from a string.
256
+ * @param text - The input string.
257
+ * @returns The string without trailing ellipsis.
258
+ */
259
+ function stripTrailingEllipsis(text?: string | null): string {
260
+ return (text || "").replace(/…{1,3}$/, "");
261
+ }
@@ -28,6 +28,18 @@ describe("ChartView", () => {
28
28
  expect(categoryLabels.length).toBe(2);
29
29
  });
30
30
 
31
+ it("renders chart titles correctly", () => {
32
+ render(<Default />);
33
+ const {
34
+ args: { entityName },
35
+ } = Default;
36
+ ["Biological Sex", "Genus Species"].forEach((category) => {
37
+ expect(
38
+ screen.getByText(new RegExp(`${entityName} per ${category}`))
39
+ ).toBeDefined();
40
+ });
41
+ });
42
+
31
43
  it("renders charts for each category", () => {
32
44
  render(<Default />);
33
45
  const svgEls = document.querySelectorAll("svg");
@@ -1,35 +1,31 @@
1
1
  import { composeStories } from "@storybook/react";
2
2
  import { render, screen } from "@testing-library/react";
3
3
  import React from "react";
4
- import { ENTITIES_VIEW_TEST_ID } from "../src/components/Index/components/EntitiesView/constants";
5
4
  import { VIEW_MODE } from "../src/components/Index/components/EntitiesView/hooks/UseEntitiesView/types";
6
5
  import * as stories from "../src/components/Index/components/EntitiesView/stories/entitiesView.stories";
6
+ import { TEST_IDS } from "../src/tests/testIds";
7
7
 
8
8
  const { Default } = composeStories(stories);
9
9
 
10
10
  describe("EntitiesView", () => {
11
11
  it("renders correctly", () => {
12
- render(<Default testId={ENTITIES_VIEW_TEST_ID} />);
13
- const viewEl = screen.getByTestId(ENTITIES_VIEW_TEST_ID);
12
+ render(<Default />);
13
+ const viewEl = screen.getByTestId(TEST_IDS.ENTITIES_VIEW);
14
14
  expect(viewEl).not.toBeNull();
15
15
  });
16
16
 
17
17
  it("does not render toggle buttons when disabled", () => {
18
- render(<Default testId={ENTITIES_VIEW_TEST_ID} />);
19
- const viewEl = screen.getByTestId(ENTITIES_VIEW_TEST_ID);
18
+ render(<Default />);
19
+ const viewEl = screen.getByTestId(TEST_IDS.ENTITIES_VIEW);
20
20
  const buttonsEl = viewEl.getElementsByClassName("MuiToggleButton-root");
21
21
  expect(buttonsEl.length).toEqual(0);
22
22
  });
23
23
 
24
24
  it("renders toggle buttons when enabled", () => {
25
25
  render(
26
- <Default
27
- testId={ENTITIES_VIEW_TEST_ID}
28
- viewMode={VIEW_MODE.TABLE}
29
- viewStatus={{ disabled: false }}
30
- />
26
+ <Default viewMode={VIEW_MODE.TABLE} viewStatus={{ disabled: false }} />
31
27
  );
32
- const viewEl = screen.getByTestId(ENTITIES_VIEW_TEST_ID);
28
+ const viewEl = screen.getByTestId(TEST_IDS.ENTITIES_VIEW);
33
29
  const buttonsEl = viewEl.getElementsByClassName("MuiToggleButton-root");
34
30
  expect(buttonsEl.length).toEqual(2);
35
31
  });
@@ -0,0 +1,87 @@
1
+ import { composeStories } from "@storybook/react";
2
+ import { fireEvent, render, screen } from "@testing-library/react";
3
+ import React from "react";
4
+ import * as stories from "../src/components/Filter/components/FilterRange/stories/filterRange.stories";
5
+ import { MUI_CLASSES } from "../src/tests/mui/constants";
6
+ import { TEST_IDS } from "../src/tests/testIds";
7
+ import { getClassNames } from "../src/utils/tests";
8
+
9
+ const BETWEEN = "Between";
10
+ const GREATER_THAN = "Greater Than";
11
+ const LESS_THAN = "Less Than";
12
+
13
+ const { Default } = composeStories(stories);
14
+
15
+ describe("FilterRange", () => {
16
+ let filterEl: HTMLFormElement;
17
+
18
+ beforeEach(() => {
19
+ render(<Default />);
20
+ filterEl = screen.getByTestId(TEST_IDS.FILTER_RANGE);
21
+ });
22
+
23
+ describe("Operator BETWEEN", () => {
24
+ it("renders the toggle buttons with correct text", () => {
25
+ expect(screen.getByRole("button", { name: BETWEEN })).toBeDefined();
26
+ expect(screen.getByRole("button", { name: LESS_THAN })).toBeDefined();
27
+ expect(screen.getByRole("button", { name: GREATER_THAN })).toBeDefined();
28
+ });
29
+
30
+ it("renders BETWEEN toggle button as selected", () => {
31
+ expect(
32
+ getClassNames(screen.getByRole("button", { name: BETWEEN }))
33
+ ).toContain(MUI_CLASSES.SELECTED);
34
+ });
35
+
36
+ it("renders BETWEEN input fields with correct labels", () => {
37
+ expect(filterEl.querySelectorAll("label")).toHaveLength(2);
38
+ expect(filterEl.querySelectorAll("input")).toHaveLength(2);
39
+ expect(filterEl.querySelector('label[for="between"]')).toBeDefined();
40
+ expect(filterEl.querySelector('label[for="between-to"]')).toBeDefined();
41
+ expect(filterEl.querySelector('input[name="between"]')).toBeDefined();
42
+ expect(filterEl.querySelector('input[name="between-to"]')).toBeDefined();
43
+ });
44
+
45
+ it("renders filter button", () => {
46
+ expect(screen.getByText("Filter")).toBeDefined();
47
+ });
48
+ });
49
+
50
+ describe("Operator LESS THAN", () => {
51
+ beforeEach(() => {
52
+ fireEvent.click(screen.getByRole("button", { name: LESS_THAN }));
53
+ });
54
+
55
+ it("renders LESS THAN toggle button as selected", () => {
56
+ expect(
57
+ getClassNames(screen.getByRole("button", { name: LESS_THAN }))
58
+ ).toContain(MUI_CLASSES.SELECTED);
59
+ });
60
+
61
+ it("renders LESS THAN input field with correct label", () => {
62
+ expect(filterEl.querySelectorAll("label")).toHaveLength(1);
63
+ expect(filterEl.querySelectorAll("input")).toHaveLength(1);
64
+ expect(filterEl.querySelector('label[for="lessThan"]')).toBeDefined();
65
+ expect(filterEl.querySelector('input[name="lessThan"]')).toBeDefined();
66
+ });
67
+ });
68
+
69
+ describe("Operator GREATER THAN", () => {
70
+ beforeEach(() => {
71
+ fireEvent.click(screen.getByRole("button", { name: GREATER_THAN }));
72
+ });
73
+
74
+ it("renders GREATER THAN toggle button as selected", () => {
75
+ expect(
76
+ getClassNames(screen.getByRole("button", { name: GREATER_THAN }))
77
+ ).toContain(MUI_CLASSES.SELECTED);
78
+ });
79
+
80
+ it("renders GREATER THAN input field with correct label", () => {
81
+ expect(filterEl.querySelectorAll("label")).toHaveLength(1);
82
+ expect(filterEl.querySelectorAll("input")).toHaveLength(1);
83
+ expect(filterEl.querySelector('label[for="greaterThan"]')).toBeDefined();
84
+ expect(filterEl.querySelector('input[name="greaterThan"]')).toBeDefined();
85
+ });
86
+ });
87
+ });
@@ -0,0 +1,38 @@
1
+ import { jest } from "@jest/globals";
2
+ import { composeStories } from "@storybook/react";
3
+ import { render, screen } from "@testing-library/react";
4
+ import React, { FormEvent } from "react";
5
+ import { RANGE_OPERATOR } from "../src/components/Filter/components/FilterRange/types";
6
+
7
+ const ON_SUBMIT = jest.fn();
8
+
9
+ jest.unstable_mockModule(
10
+ "../src/components/Filter/components/FilterRange/hooks/UseFilterRange/hook",
11
+ () => ({
12
+ useFilterRange: jest.fn(() => ({
13
+ onChange: jest.fn(),
14
+ onSubmit: (e: FormEvent): void => {
15
+ e.preventDefault();
16
+ ON_SUBMIT(e);
17
+ },
18
+ value: RANGE_OPERATOR.BETWEEN,
19
+ })),
20
+ })
21
+ );
22
+
23
+ const stories = await import(
24
+ "../src/components/Filter/components/FilterRange/stories/filterRange.stories"
25
+ );
26
+ const { Default } = composeStories(stories);
27
+
28
+ describe("FilterRangeWithMockedHook", () => {
29
+ describe("submit button", () => {
30
+ beforeEach(() => {
31
+ render(<Default />);
32
+ });
33
+ it("has a submit button that can be clicked", () => {
34
+ screen.getByText("Filter").click();
35
+ expect(ON_SUBMIT).toHaveBeenCalledTimes(1);
36
+ });
37
+ });
38
+ });