@databiosphere/findable-ui 21.3.0 → 22.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 (289) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/.storybook/main.ts +7 -1
  3. package/CHANGELOG.md +25 -0
  4. package/lib/components/DataDictionary/components/Entities/constants.d.ts +2 -0
  5. package/lib/components/DataDictionary/components/Entities/constants.js +6 -0
  6. package/lib/components/DataDictionary/components/Entities/entities.d.ts +2 -0
  7. package/lib/components/DataDictionary/components/Entities/entities.js +7 -0
  8. package/lib/components/DataDictionary/components/Entities/types.d.ts +4 -0
  9. package/lib/components/DataDictionary/components/Entities/types.js +1 -0
  10. package/lib/components/DataDictionary/components/Entity/constants.d.ts +2 -0
  11. package/lib/components/DataDictionary/components/Entity/constants.js +5 -0
  12. package/lib/components/DataDictionary/components/Entity/entity.d.ts +2 -0
  13. package/lib/components/DataDictionary/components/Entity/entity.js +14 -0
  14. package/lib/components/DataDictionary/components/Entity/types.d.ts +4 -0
  15. package/lib/components/DataDictionary/components/Entity/types.js +1 -0
  16. package/lib/components/DataDictionary/components/Table/columns/columnDef.d.ts +6 -0
  17. package/lib/components/DataDictionary/components/Table/columns/columnDef.js +33 -0
  18. package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.d.ts +5 -0
  19. package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.js +5 -0
  20. package/lib/components/DataDictionary/components/Table/columns/types.d.ts +2 -0
  21. package/lib/components/DataDictionary/components/Table/columns/types.js +1 -0
  22. package/lib/components/DataDictionary/components/Table/components/BasicCell/basicCell.d.ts +2 -0
  23. package/lib/components/DataDictionary/components/Table/components/BasicCell/basicCell.js +6 -0
  24. package/lib/components/DataDictionary/components/Table/components/BasicCell/types.d.ts +4 -0
  25. package/lib/components/DataDictionary/components/Table/components/BasicCell/types.js +1 -0
  26. package/lib/components/DataDictionary/components/Table/hook.d.ts +3 -0
  27. package/lib/components/DataDictionary/components/Table/hook.js +11 -0
  28. package/lib/components/DataDictionary/components/Table/options/core/constants.d.ts +3 -0
  29. package/lib/components/DataDictionary/components/Table/options/core/constants.js +7 -0
  30. package/lib/components/DataDictionary/components/Table/options/hook.d.ts +3 -0
  31. package/lib/components/DataDictionary/components/Table/options/hook.js +8 -0
  32. package/lib/components/DataDictionary/components/Table/options/sorting/constants.d.ts +3 -0
  33. package/lib/components/DataDictionary/components/Table/options/sorting/constants.js +3 -0
  34. package/lib/components/DataDictionary/components/Table/table.d.ts +2 -0
  35. package/lib/components/DataDictionary/components/Table/table.js +17 -0
  36. package/lib/components/DataDictionary/components/Table/table.styles.d.ts +3 -0
  37. package/lib/components/DataDictionary/components/Table/table.styles.js +5 -0
  38. package/lib/components/DataDictionary/components/Table/types.d.ts +5 -0
  39. package/lib/components/DataDictionary/components/Table/types.js +1 -0
  40. package/lib/components/DataDictionary/dataDictionary.d.ts +2 -0
  41. package/lib/components/DataDictionary/dataDictionary.js +9 -0
  42. package/lib/components/DataDictionary/dataDictionary.styles.d.ts +1 -0
  43. package/lib/components/DataDictionary/dataDictionary.styles.js +7 -0
  44. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +2 -0
  45. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +5 -0
  46. package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +4 -0
  47. package/lib/components/DataDictionary/hooks/UseDataDictionary/types.js +1 -0
  48. package/lib/components/Detail/detail.stories.d.ts +36 -5
  49. package/lib/components/Detail/detail.stories.js +27 -18
  50. package/lib/components/Export/components/ExportForm/components/ExportButton/exportButton.js +6 -1
  51. package/lib/components/Export/components/ExportMethod/exportMethod.stories.d.ts +22 -5
  52. package/lib/components/Export/components/ExportMethod/exportMethod.stories.js +9 -9
  53. package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestDownload/fileManifestDownload.js +5 -2
  54. package/lib/components/Filter/components/Filter/filter.stories.d.ts +25 -5
  55. package/lib/components/Filter/components/Filter/filter.stories.js +25 -24
  56. package/lib/components/Filter/components/FilterLabel/filterLabel.stories.d.ts +31 -5
  57. package/lib/components/Filter/components/FilterLabel/filterLabel.stories.js +10 -8
  58. package/lib/components/Filter/components/FilterMenu/filterMenu.stories.d.ts +38 -5
  59. package/lib/components/Filter/components/FilterMenu/filterMenu.stories.js +107 -104
  60. package/lib/components/Filter/components/FilterTag/filterTag.stories.d.ts +16 -5
  61. package/lib/components/Filter/components/FilterTag/filterTag.stories.js +8 -7
  62. package/lib/components/Filter/components/FilterTags/filterTags.stories.d.ts +18 -5
  63. package/lib/components/Filter/components/FilterTags/filterTags.stories.js +40 -39
  64. package/lib/components/Index/components/AzulFileDownload/azulFileDownload.js +10 -5
  65. package/lib/components/Index/components/AzulFileDownload/azulFileDownload.stories.d.ts +8 -5
  66. package/lib/components/Index/components/AzulFileDownload/azulFileDownload.stories.js +9 -6
  67. package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.d.ts +13 -5
  68. package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.js +11 -11
  69. package/lib/components/Index/components/Hero/hero.stories.d.ts +23 -5
  70. package/lib/components/Index/components/Hero/hero.stories.js +8 -6
  71. package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +16 -5
  72. package/lib/components/Index/components/NTagCell/nTagCell.stories.js +8 -8
  73. package/lib/components/Index/index.stories.js +2 -1
  74. package/lib/components/Layout/components/BackPage/backPageView.stories.d.ts +31 -5
  75. package/lib/components/Layout/components/BackPage/backPageView.stories.js +27 -18
  76. package/lib/components/Layout/components/Footer/footer.stories.d.ts +24 -3
  77. package/lib/components/Layout/components/Footer/footer.stories.js +4 -3
  78. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.js +1 -1
  79. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenuItems/navigationMenuItems.js +20 -21
  80. package/lib/components/Layout/components/Header/components/Content/components/Navigation/constants.d.ts +1 -0
  81. package/lib/components/Layout/components/Header/components/Content/components/Navigation/constants.js +1 -0
  82. package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.d.ts +2 -1
  83. package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.js +16 -17
  84. package/lib/components/Layout/components/Header/header.js +2 -1
  85. package/lib/components/Layout/components/Header/header.stories.js +1 -1
  86. package/lib/components/Layout/components/Sidebar/components/SidebarLabel/sidebarLabel.stories.d.ts +13 -5
  87. package/lib/components/Layout/components/Sidebar/components/SidebarLabel/sidebarLabel.stories.js +6 -6
  88. package/lib/components/Layout/components/Sidebar/sidebar.stories.js +2 -0
  89. package/lib/components/Links/links.stories.d.ts +13 -5
  90. package/lib/components/Links/links.stories.js +14 -14
  91. package/lib/components/Loading/loading.stories.d.ts +34 -5
  92. package/lib/components/Loading/loading.stories.js +8 -6
  93. package/lib/components/Login/components/Button/types.d.ts +1 -1
  94. package/lib/components/Login/components/Buttons/buttons.d.ts +2 -0
  95. package/lib/components/Login/components/Buttons/buttons.js +5 -0
  96. package/lib/components/Login/components/Buttons/types.d.ts +8 -0
  97. package/lib/components/Login/components/Buttons/types.js +1 -0
  98. package/lib/components/Login/components/Section/components/Consent/consent.d.ts +3 -0
  99. package/lib/components/Login/components/Section/components/Consent/consent.js +14 -0
  100. package/lib/components/Login/components/Section/components/Consent/consent.styles.d.ts +7 -0
  101. package/lib/components/Login/components/Section/components/Consent/consent.styles.js +14 -0
  102. package/lib/components/Login/components/Section/components/Consent/types.d.ts +6 -0
  103. package/lib/components/Login/components/Section/components/Consent/types.js +1 -0
  104. package/lib/components/Login/components/Section/components/Warning/warning.d.ts +3 -0
  105. package/lib/components/Login/components/Section/components/Warning/warning.js +9 -0
  106. package/lib/components/Login/hooks/useUserConsent/types.d.ts +10 -0
  107. package/lib/components/Login/hooks/useUserConsent/types.js +1 -0
  108. package/lib/components/Login/hooks/useUserConsent/useUserConsent.d.ts +2 -0
  109. package/lib/components/Login/hooks/useUserConsent/useUserConsent.js +24 -0
  110. package/lib/components/Login/hooks/useUserLogin/types.d.ts +6 -0
  111. package/lib/components/Login/hooks/useUserLogin/types.js +1 -0
  112. package/lib/components/Login/hooks/useUserLogin/useUserLogin.d.ts +2 -0
  113. package/lib/components/Login/hooks/useUserLogin/useUserLogin.js +21 -0
  114. package/lib/components/Project/components/CollaboratingOrganizations/collaboratingOrganizations.stories.d.ts +13 -5
  115. package/lib/components/Project/components/CollaboratingOrganizations/collaboratingOrganizations.stories.js +20 -20
  116. package/lib/components/Project/components/Contacts/contacts.stories.d.ts +13 -5
  117. package/lib/components/Project/components/Contacts/contacts.stories.js +18 -18
  118. package/lib/components/Project/components/Contributors/contributors.stories.d.ts +8 -5
  119. package/lib/components/Project/components/Contributors/contributors.stories.js +27 -27
  120. package/lib/components/Project/components/DataCurators/dataCurators.stories.d.ts +13 -5
  121. package/lib/components/Project/components/DataCurators/dataCurators.stories.js +7 -7
  122. package/lib/components/Project/components/DataReleasePolicy/dataReleasePolicy.stories.d.ts +8 -5
  123. package/lib/components/Project/components/DataReleasePolicy/dataReleasePolicy.stories.js +3 -4
  124. package/lib/components/Project/components/Description/description.stories.d.ts +8 -5
  125. package/lib/components/Project/components/Description/description.stories.js +6 -6
  126. package/lib/components/Project/components/Details/details.stories.d.ts +16 -5
  127. package/lib/components/Project/components/Details/details.stories.js +7 -7
  128. package/lib/components/Project/components/Publications/publications.stories.d.ts +8 -5
  129. package/lib/components/Project/components/Publications/publications.stories.js +17 -17
  130. package/lib/components/Project/components/SupplementaryLinks/supplementaryLinks.stories.d.ts +8 -5
  131. package/lib/components/Project/components/SupplementaryLinks/supplementaryLinks.stories.js +18 -18
  132. package/lib/components/Support/components/SupportRequest/components/SupportRequestForm/common/constants.d.ts +16 -33
  133. package/lib/components/Support/components/SupportRequest/components/SupportRequestForm/common/constants.js +10 -9
  134. package/lib/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.js +26 -14
  135. package/lib/components/Support/components/ViewSupport/types.d.ts +6 -0
  136. package/lib/components/Support/components/ViewSupport/types.js +1 -0
  137. package/lib/components/Support/components/ViewSupport/viewSupport.d.ts +2 -9
  138. package/lib/components/Support/components/ViewSupport/viewSupport.js +7 -3
  139. package/lib/components/Table/components/Pagination/pagination.stories.d.ts +28 -5
  140. package/lib/components/Table/components/Pagination/pagination.stories.js +11 -7
  141. package/lib/components/common/Accordion/accordion.stories.d.ts +6 -3
  142. package/lib/components/common/Accordion/accordion.stories.js +2 -1
  143. package/lib/components/common/Breadcrumbs/breadcrumbs.stories.d.ts +10 -7
  144. package/lib/components/common/Breadcrumbs/breadcrumbs.stories.js +42 -43
  145. package/lib/components/common/Button/components/CallToActionButton/callToActionButton.stories.d.ts +9 -6
  146. package/lib/components/common/Button/components/CallToActionButton/callToActionButton.stories.js +13 -15
  147. package/lib/components/common/Button/components/HelpIconButton/helpIconButton.stories.d.ts +19 -2
  148. package/lib/components/common/Button/components/HelpIconButton/helpIconButton.stories.js +2 -2
  149. package/lib/components/common/Card/card.stories.d.ts +6 -3
  150. package/lib/components/common/Card/card.stories.js +2 -1
  151. package/lib/components/common/Code/code.stories.d.ts +5 -3
  152. package/lib/components/common/CopyToClipboard/copyToClipboard.stories.d.ts +11 -3
  153. package/lib/components/common/CopyToClipboard/copyToClipboard.stories.js +2 -1
  154. package/lib/components/common/CustomIcon/components/CloseIcon/closeIcon.d.ts +2 -0
  155. package/lib/components/common/CustomIcon/components/CloseIcon/closeIcon.js +6 -0
  156. package/lib/components/common/LoginDialog/constants.d.ts +6 -0
  157. package/lib/components/common/LoginDialog/constants.js +21 -0
  158. package/lib/components/common/LoginDialog/loginDialog.d.ts +2 -0
  159. package/lib/components/common/LoginDialog/loginDialog.js +27 -0
  160. package/lib/components/common/LoginDialog/loginDialog.styles.d.ts +3 -0
  161. package/lib/components/common/LoginDialog/loginDialog.styles.js +50 -0
  162. package/lib/components/common/LoginDialog/types.d.ts +4 -0
  163. package/lib/components/common/LoginDialog/types.js +1 -0
  164. package/lib/components/common/Section/components/SectionTitle/sectionTitle.stories.d.ts +13 -5
  165. package/lib/components/common/Section/components/SectionTitle/sectionTitle.stories.js +6 -6
  166. package/lib/components/common/Socials/socials.stories.d.ts +11 -3
  167. package/lib/components/common/Socials/socials.stories.js +2 -1
  168. package/lib/components/common/StaticImage/staticImage.stories.d.ts +22 -5
  169. package/lib/components/common/StaticImage/staticImage.stories.js +8 -8
  170. package/lib/components/common/StatusIcon/statusIcon.stories.d.ts +19 -5
  171. package/lib/components/common/StatusIcon/statusIcon.stories.js +7 -7
  172. package/lib/components/common/Tag/tag.stories.d.ts +15 -5
  173. package/lib/components/common/Tag/tag.stories.js +7 -5
  174. package/lib/components/common/ToggleButtonGroup/toggleButtonGroup.stories.d.ts +18 -5
  175. package/lib/components/common/ToggleButtonGroup/toggleButtonGroup.stories.js +19 -19
  176. package/lib/config/entities.d.ts +1 -0
  177. package/lib/providers/loginGuard/common/types.d.ts +18 -0
  178. package/lib/providers/loginGuard/common/types.js +1 -0
  179. package/lib/providers/loginGuard/context.d.ts +6 -0
  180. package/lib/providers/loginGuard/context.js +10 -0
  181. package/lib/providers/loginGuard/hook.d.ts +9 -0
  182. package/lib/providers/loginGuard/hook.js +12 -0
  183. package/lib/providers/loginGuard/provider.d.ts +11 -0
  184. package/lib/providers/loginGuard/provider.js +55 -0
  185. package/lib/styles/common/mui/typography.d.ts +1 -0
  186. package/lib/styles/common/mui/typography.js +8 -0
  187. package/lib/views/DataDictionaryView/dataDictionaryView.d.ts +2 -0
  188. package/lib/views/DataDictionaryView/dataDictionaryView.js +5 -0
  189. package/package.json +13 -13
  190. package/src/components/DataDictionary/components/Entities/constants.ts +8 -0
  191. package/src/components/DataDictionary/components/Entities/entities.tsx +15 -0
  192. package/src/components/DataDictionary/components/Entities/types.ts +5 -0
  193. package/src/components/DataDictionary/components/Entity/constants.ts +7 -0
  194. package/src/components/DataDictionary/components/Entity/entity.tsx +28 -0
  195. package/src/components/DataDictionary/components/Entity/types.ts +5 -0
  196. package/src/components/DataDictionary/components/Table/columns/columnDef.ts +47 -0
  197. package/src/components/DataDictionary/components/Table/columns/columnIdentifier.ts +5 -0
  198. package/src/components/DataDictionary/components/Table/columns/types.ts +3 -0
  199. package/src/components/DataDictionary/components/Table/components/BasicCell/basicCell.tsx +8 -0
  200. package/src/components/DataDictionary/components/Table/components/BasicCell/types.ts +5 -0
  201. package/src/components/DataDictionary/components/Table/hook.ts +13 -0
  202. package/src/components/DataDictionary/components/Table/options/core/constants.ts +12 -0
  203. package/src/components/DataDictionary/components/Table/options/hook.ts +14 -0
  204. package/src/components/DataDictionary/components/Table/options/sorting/constants.ts +9 -0
  205. package/src/components/DataDictionary/components/Table/table.styles.ts +6 -0
  206. package/src/components/DataDictionary/components/Table/table.tsx +35 -0
  207. package/src/components/DataDictionary/components/Table/types.ts +6 -0
  208. package/src/components/DataDictionary/dataDictionary.styles.ts +8 -0
  209. package/src/components/DataDictionary/dataDictionary.tsx +16 -0
  210. package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +9 -0
  211. package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +5 -0
  212. package/src/components/Detail/detail.stories.tsx +41 -36
  213. package/src/components/Export/components/ExportForm/components/ExportButton/exportButton.tsx +8 -1
  214. package/src/components/Export/components/ExportMethod/exportMethod.stories.tsx +13 -13
  215. package/src/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestDownload/fileManifestDownload.tsx +11 -3
  216. package/src/components/Filter/components/Filter/filter.stories.tsx +29 -28
  217. package/src/components/Filter/components/FilterLabel/filterLabel.stories.tsx +14 -12
  218. package/src/components/Filter/components/FilterMenu/filterMenu.stories.tsx +111 -108
  219. package/src/components/Filter/components/FilterTag/filterTag.stories.tsx +12 -11
  220. package/src/components/Filter/components/FilterTags/filterTags.stories.tsx +44 -43
  221. package/src/components/Index/components/AzulFileDownload/azulFileDownload.stories.tsx +13 -10
  222. package/src/components/Index/components/AzulFileDownload/azulFileDownload.tsx +12 -5
  223. package/src/components/Index/components/Hero/components/Summaries/summaries.stories.tsx +15 -15
  224. package/src/components/Index/components/Hero/hero.stories.tsx +12 -8
  225. package/src/components/Index/components/NTagCell/nTagCell.stories.tsx +12 -12
  226. package/src/components/Index/index.stories.tsx +2 -1
  227. package/src/components/Layout/components/BackPage/backPageView.stories.tsx +42 -36
  228. package/src/components/Layout/components/Footer/footer.stories.tsx +6 -4
  229. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.tsx +1 -1
  230. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenuItems/navigationMenuItems.tsx +16 -15
  231. package/src/components/Layout/components/Header/components/Content/components/Navigation/constants.ts +1 -0
  232. package/src/components/Layout/components/Header/components/Content/components/Navigation/navigation.tsx +26 -18
  233. package/src/components/Layout/components/Header/header.stories.tsx +1 -1
  234. package/src/components/Layout/components/Header/header.tsx +6 -1
  235. package/src/components/Layout/components/Sidebar/components/SidebarLabel/sidebarLabel.stories.tsx +10 -10
  236. package/src/components/Layout/components/Sidebar/sidebar.stories.tsx +2 -0
  237. package/src/components/Links/links.stories.tsx +18 -18
  238. package/src/components/Loading/loading.stories.tsx +12 -10
  239. package/src/components/Login/components/Button/types.ts +1 -1
  240. package/src/components/Login/components/Buttons/buttons.tsx +22 -0
  241. package/src/components/Login/components/Buttons/types.ts +9 -0
  242. package/src/components/Login/components/Section/components/Consent/consent.styles.ts +15 -0
  243. package/src/components/Login/components/Section/components/Consent/consent.tsx +30 -0
  244. package/src/components/Login/components/Section/components/Consent/types.ts +10 -0
  245. package/src/components/Login/components/Section/components/Warning/warning.tsx +24 -0
  246. package/src/components/Login/hooks/useUserConsent/types.ts +11 -0
  247. package/src/components/Login/hooks/useUserConsent/useUserConsent.ts +32 -0
  248. package/src/components/Login/hooks/useUserLogin/types.ts +8 -0
  249. package/src/components/Login/hooks/useUserLogin/useUserLogin.ts +29 -0
  250. package/src/components/Project/components/CollaboratingOrganizations/collaboratingOrganizations.stories.tsx +24 -25
  251. package/src/components/Project/components/Contacts/contacts.stories.tsx +22 -22
  252. package/src/components/Project/components/Contributors/contributors.stories.tsx +31 -31
  253. package/src/components/Project/components/DataCurators/dataCurators.stories.tsx +11 -11
  254. package/src/components/Project/components/DataReleasePolicy/dataReleasePolicy.stories.tsx +7 -8
  255. package/src/components/Project/components/Description/description.stories.tsx +11 -11
  256. package/src/components/Project/components/Details/details.stories.tsx +11 -11
  257. package/src/components/Project/components/Publications/publications.stories.tsx +23 -23
  258. package/src/components/Project/components/SupplementaryLinks/supplementaryLinks.stories.tsx +22 -22
  259. package/src/components/Support/components/SupportRequest/components/SupportRequestForm/common/constants.ts +10 -9
  260. package/src/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.tsx +44 -15
  261. package/src/components/Support/components/ViewSupport/types.ts +9 -0
  262. package/src/components/Support/components/ViewSupport/viewSupport.tsx +6 -10
  263. package/src/components/Table/components/Pagination/pagination.stories.tsx +15 -11
  264. package/src/components/common/Accordion/accordion.stories.tsx +4 -2
  265. package/src/components/common/Breadcrumbs/breadcrumbs.stories.tsx +46 -47
  266. package/src/components/common/Button/components/CallToActionButton/callToActionButton.stories.tsx +17 -20
  267. package/src/components/common/Button/components/HelpIconButton/helpIconButton.stories.tsx +4 -4
  268. package/src/components/common/Card/card.stories.tsx +4 -2
  269. package/src/components/common/Code/code.stories.tsx +1 -1
  270. package/src/components/common/CopyToClipboard/copyToClipboard.stories.tsx +4 -2
  271. package/src/components/common/CustomIcon/components/CloseIcon/closeIcon.tsx +17 -0
  272. package/src/components/common/LoginDialog/constants.ts +33 -0
  273. package/src/components/common/LoginDialog/loginDialog.styles.ts +51 -0
  274. package/src/components/common/LoginDialog/loginDialog.tsx +56 -0
  275. package/src/components/common/LoginDialog/types.ts +4 -0
  276. package/src/components/common/Section/components/SectionTitle/sectionTitle.stories.tsx +10 -10
  277. package/src/components/common/Socials/socials.stories.tsx +4 -2
  278. package/src/components/common/StaticImage/staticImage.stories.tsx +12 -12
  279. package/src/components/common/StatusIcon/statusIcon.stories.tsx +11 -11
  280. package/src/components/common/Tag/tag.stories.tsx +11 -9
  281. package/src/components/common/ToggleButtonGroup/toggleButtonGroup.stories.tsx +23 -23
  282. package/src/config/entities.ts +1 -0
  283. package/src/providers/loginGuard/common/types.ts +21 -0
  284. package/src/providers/loginGuard/context.ts +12 -0
  285. package/src/providers/loginGuard/hook.ts +14 -0
  286. package/src/providers/loginGuard/provider.tsx +76 -0
  287. package/src/styles/common/mui/typography.ts +9 -0
  288. package/src/views/DataDictionaryView/dataDictionaryView.tsx +9 -0
  289. package/tests/provider.test.tsx +191 -0
@@ -1,24 +1,24 @@
1
- import { ComponentMeta, ComponentStory } from "@storybook/react";
2
- import React from "react";
1
+ import { Meta, StoryObj } from "@storybook/react";
3
2
  import { Summaries } from "./summaries";
4
3
 
5
- export default {
4
+ const meta = {
6
5
  argTypes: {
7
- summaries: { control: "array" },
6
+ summaries: { control: "object" },
8
7
  },
9
8
  component: Summaries,
10
9
  title: "Components/Summary",
11
- } as ComponentMeta<typeof Summaries>;
10
+ } satisfies Meta<typeof Summaries>;
12
11
 
13
- const SummariesTemplate: ComponentStory<typeof Summaries> = (args) => (
14
- <Summaries {...args} />
15
- );
12
+ export default meta;
16
13
 
17
- export const SummariesStory = SummariesTemplate.bind({});
18
- SummariesStory.args = {
19
- summaries: [
20
- { count: "1", label: "Species" },
21
- { count: "1.1k", label: "Donors" },
22
- { count: "508.5k", label: "Files" },
23
- ],
14
+ type Story = StoryObj<typeof meta>;
15
+
16
+ export const SummariesStory: Story = {
17
+ args: {
18
+ summaries: [
19
+ { count: "1", label: "Species" },
20
+ { count: "1.1k", label: "Donors" },
21
+ { count: "508.5k", label: "Files" },
22
+ ],
23
+ },
24
24
  };
@@ -1,9 +1,10 @@
1
- import { ComponentMeta, ComponentStory } from "@storybook/react";
1
+ import { Meta, StoryObj } from "@storybook/react";
2
2
  import React from "react";
3
+ import { Summaries } from "./components/Summaries/summaries";
3
4
  import { SummariesStory } from "./components/Summaries/summaries.stories";
4
5
  import { Hero } from "./hero";
5
6
 
6
- export default {
7
+ const meta = {
7
8
  argTypes: {
8
9
  Summaries: { table: { disable: true } },
9
10
  title: { table: { disable: true } },
@@ -13,12 +14,15 @@ export default {
13
14
  layout: "fullscreen",
14
15
  },
15
16
  title: "Components/Hero/ExploreView",
16
- } as ComponentMeta<typeof Hero>;
17
+ } satisfies Meta<typeof Hero>;
17
18
 
18
- const HeroTemplate: ComponentStory<typeof Hero> = (args) => <Hero {...args} />;
19
+ export default meta;
19
20
 
20
- export const HeroStory = HeroTemplate.bind({});
21
- HeroStory.args = {
22
- Summaries: <SummariesStory {...SummariesStory.args} />,
23
- title: "Data Explorer",
21
+ type Story = StoryObj<typeof meta>;
22
+
23
+ export const HeroStory: Story = {
24
+ args: {
25
+ Summaries: <Summaries {...SummariesStory.args} />,
26
+ title: "Data Explorer",
27
+ },
24
28
  };
@@ -1,22 +1,22 @@
1
- import { ComponentMeta, ComponentStory } from "@storybook/react";
2
- import React from "react";
1
+ import { Meta, StoryObj } from "@storybook/react";
3
2
  import { NTagCell } from "./nTagCell";
4
3
 
5
- export default {
4
+ const meta = {
6
5
  argTypes: {
7
6
  label: { control: "text" },
8
- values: { control: "array" },
7
+ values: { control: "object" },
9
8
  },
10
9
  component: NTagCell,
11
10
  title: "Components/Table/Cell/NTagCell",
12
- } as ComponentMeta<typeof NTagCell>;
11
+ } satisfies Meta<typeof NTagCell>;
13
12
 
14
- const NTagCellTemplate: ComponentStory<typeof NTagCell> = (args) => (
15
- <NTagCell {...args} />
16
- );
13
+ export default meta;
17
14
 
18
- export const NTagCellStory = NTagCellTemplate.bind({});
19
- NTagCellStory.args = {
20
- label: "species",
21
- values: ["Homo sapiens", "Mus musculus"],
15
+ type Story = StoryObj<typeof meta>;
16
+
17
+ export const NTagCellStory: Story = {
18
+ args: {
19
+ label: "species",
20
+ values: ["Homo sapiens", "Mus musculus"],
21
+ },
22
22
  };
@@ -1,5 +1,6 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
2
  import React from "react";
3
+ import { Summaries } from "./components/Hero/components/Summaries/summaries";
3
4
  import { SummariesStory } from "./components/Hero/components/Summaries/summaries.stories";
4
5
  import { Index } from "./index";
5
6
 
@@ -22,7 +23,7 @@ type Story = StoryObj<typeof Index>;
22
23
  export const IndexStory: Story = {
23
24
  args: {
24
25
  List: undefined,
25
- Summaries: <SummariesStory {...SummariesStory.args} />,
26
+ Summaries: <Summaries {...SummariesStory.args} />,
26
27
  Tabs: undefined,
27
28
  title: "Explore Data",
28
29
  },
@@ -1,17 +1,25 @@
1
- import { ComponentMeta, ComponentStory } from "@storybook/react";
1
+ import { Meta, StoryObj } from "@storybook/react";
2
2
  import React from "react";
3
+ import { CollaboratingOrganizations } from "../../../Project/components/CollaboratingOrganizations/collaboratingOrganizations";
3
4
  import { CollaboratingOrganizationsStory } from "../../../Project/components/CollaboratingOrganizations/collaboratingOrganizations.stories";
5
+ import { Contacts } from "../../../Project/components/Contacts/contacts";
4
6
  import { ContactsStory } from "../../../Project/components/Contacts/contacts.stories";
7
+ import { Contributors } from "../../../Project/components/Contributors/contributors";
5
8
  import { ContributorsStory } from "../../../Project/components/Contributors/contributors.stories";
9
+ import { DataCurators } from "../../../Project/components/DataCurators/dataCurators";
6
10
  import { DataCuratorsStory } from "../../../Project/components/DataCurators/dataCurators.stories";
7
- import { DataReleasePolicyStory } from "../../../Project/components/DataReleasePolicy/dataReleasePolicy.stories";
11
+ import { DataReleasePolicy } from "../../../Project/components/DataReleasePolicy/dataReleasePolicy";
12
+ import { Description } from "../../../Project/components/Description/description";
8
13
  import { DescriptionStory } from "../../../Project/components/Description/description.stories";
14
+ import { Details } from "../../../Project/components/Details/details";
9
15
  import { DetailsStory } from "../../../Project/components/Details/details.stories";
16
+ import { Publications } from "../../../Project/components/Publications/publications";
10
17
  import { PublicationsStory } from "../../../Project/components/Publications/publications.stories";
18
+ import { SupplementaryLinks } from "../../../Project/components/SupplementaryLinks/supplementaryLinks";
11
19
  import { SupplementaryLinksStory } from "../../../Project/components/SupplementaryLinks/supplementaryLinks.stories";
12
20
  import { BackPageView } from "./backPageView";
13
21
 
14
- export default {
22
+ const meta = {
15
23
  argTypes: {
16
24
  isDetailOverview: { control: "boolean" },
17
25
  mainColumn: { table: { disable: true } },
@@ -23,39 +31,37 @@ export default {
23
31
  layout: "fullscreen",
24
32
  },
25
33
  title: "Views/BackPage",
26
- } as ComponentMeta<typeof BackPageView>;
34
+ } satisfies Meta<typeof BackPageView>;
27
35
 
28
- const BackPageViewTemplate: ComponentStory<typeof BackPageView> = (args) => (
29
- <BackPageView {...args} />
30
- );
36
+ export default meta;
31
37
 
32
- export const BackPageViewStory = BackPageViewTemplate.bind({});
33
- BackPageViewStory.args = {
34
- isDetailOverview: true,
35
- mainColumn: (
36
- <>
37
- <DescriptionStory
38
- projectDescription={DescriptionStory.args?.projectDescription || "None"}
39
- />
40
- <ContactsStory {...ContactsStory.args} />
41
- <PublicationsStory {...PublicationsStory.args} />
42
- <ContributorsStory {...ContributorsStory.args} />
43
- <CollaboratingOrganizationsStory
44
- {...CollaboratingOrganizationsStory.args}
45
- />
46
- <DataCuratorsStory {...DataCuratorsStory.args} />
47
- {/*<CitationStory {...CitationStory.args} />*/}
48
- <SupplementaryLinksStory {...SupplementaryLinksStory.args} />
49
- <DataReleasePolicyStory />
50
- </>
51
- ),
52
- sideColumn: (
53
- <>
54
- <DetailsStory
55
- title={DetailsStory.args?.title ?? ""}
56
- keyValuePairs={DetailsStory.args?.keyValuePairs}
57
- />
58
- </>
59
- ),
60
- top: <></>,
38
+ type Story = StoryObj<typeof meta>;
39
+
40
+ export const BackPageViewStory: Story = {
41
+ args: {
42
+ isDetailOverview: true,
43
+ mainColumn: (
44
+ <>
45
+ <Description
46
+ projectDescription={
47
+ DescriptionStory.args?.projectDescription || "None"
48
+ }
49
+ />
50
+ <Contacts {...ContactsStory.args} />
51
+ <Publications {...PublicationsStory.args} />
52
+ <Contributors {...ContributorsStory.args} />
53
+ <CollaboratingOrganizations {...CollaboratingOrganizationsStory.args} />
54
+ <DataCurators {...DataCuratorsStory.args} />
55
+ {/*<Citation {...CitationStory.args} />*/}
56
+ <SupplementaryLinks {...SupplementaryLinksStory.args} />
57
+ <DataReleasePolicy />
58
+ </>
59
+ ),
60
+ sideColumn: (
61
+ <>
62
+ <Details {...DetailsStory.args} />
63
+ </>
64
+ ),
65
+ top: <></>,
66
+ },
61
67
  };
@@ -9,10 +9,10 @@ import { YouTubeIcon } from "../../../common/CustomIcon/components/YouTubeIcon/y
9
9
  import { Logo } from "../Header/components/Content/components/Logo/logo";
10
10
  import { Footer } from "./footer";
11
11
 
12
- export default {
12
+ const meta = {
13
13
  argTypes: {
14
14
  Branding: { control: { disabled: true } },
15
- navLinks: { control: "array" },
15
+ navLinks: { control: "object" },
16
16
  socials: { control: { disabled: true } },
17
17
  },
18
18
  component: Footer,
@@ -20,13 +20,15 @@ export default {
20
20
  layout: "fullscreen",
21
21
  },
22
22
  title: "Components/Layout/Footer",
23
- } as Meta<typeof Footer>;
23
+ } satisfies Meta<typeof Footer>;
24
+
25
+ export default meta;
24
26
 
25
27
  type Story = StoryObj<typeof Footer>;
26
28
 
27
29
  export const FooterStory: Story = {
28
30
  args: {
29
- Branding: <Logo alt="logo" height={24} link={"/"} src={logo} />,
31
+ Branding: <Logo alt="logo" height={24} link={"/"} src={logo.src} />,
30
32
  navLinks: [
31
33
  {
32
34
  label: "Help",
@@ -78,7 +78,7 @@ export const NavigationMenu = ({
78
78
  >
79
79
  <MPaper variant="menu">
80
80
  <MClickAwayListener onClickAway={onClose}>
81
- <MMenuList>
81
+ <MMenuList component="div">
82
82
  <NavigationMenuItems
83
83
  closeMenu={(): void => {
84
84
  onClose();
@@ -2,9 +2,10 @@ import {
2
2
  Divider,
3
3
  ListItemIcon,
4
4
  ListItemText,
5
+ Link as MLink,
5
6
  MenuItem as MMenuItem,
6
7
  } from "@mui/material";
7
- import { useRouter } from "next/router";
8
+ import Link from "next/link";
8
9
  import React, { Fragment, ReactNode } from "react";
9
10
  import {
10
11
  TEXT_BODY_400,
@@ -38,7 +39,6 @@ export const NavigationMenuItems = ({
38
39
  menuItems,
39
40
  pathname,
40
41
  }: NavLinkMenuProps): JSX.Element => {
41
- const router = useRouter();
42
42
  return (
43
43
  <>
44
44
  {menuItems.map(
@@ -54,8 +54,9 @@ export const NavigationMenuItems = ({
54
54
  url,
55
55
  },
56
56
  i
57
- ) =>
58
- nestedMenuItems ? (
57
+ ) => {
58
+ const isClientSide = isClientSideNavigation(url);
59
+ return nestedMenuItems ? (
59
60
  <NavigationMenu
60
61
  key={i}
61
62
  closeAncestor={closeMenu}
@@ -69,18 +70,17 @@ export const NavigationMenuItems = ({
69
70
  ) : (
70
71
  <Fragment key={i}>
71
72
  <MMenuItem
73
+ component={isClientSide ? Link : MLink}
72
74
  disabled={!url}
73
- onClick={(): void => {
74
- closeMenu();
75
- isClientSideNavigation(url)
76
- ? router.push(url)
77
- : window.open(
78
- url,
79
- target,
80
- REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
81
- );
82
- }}
75
+ href={url}
76
+ onClick={(): void => closeMenu()}
77
+ rel={
78
+ isClientSide
79
+ ? REL_ATTRIBUTE.NO_OPENER
80
+ : REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
81
+ }
83
82
  selected={isNavigationLinkSelected(pathname, selectedPatterns)}
83
+ target={target}
84
84
  >
85
85
  {icon && <ListItemIcon>{icon}</ListItemIcon>}
86
86
  <ListItemText
@@ -100,7 +100,8 @@ export const NavigationMenuItems = ({
100
100
  </MMenuItem>
101
101
  {divider && <Divider />}
102
102
  </Fragment>
103
- )
103
+ );
104
+ }
104
105
  )}
105
106
  </>
106
107
  );
@@ -0,0 +1 @@
1
+ export const NAVIGATION_TEST_ID = "navigation";
@@ -1,5 +1,5 @@
1
- import { Button, Divider } from "@mui/material";
2
- import { useRouter } from "next/router";
1
+ import { Button, Divider, Link as MLink } from "@mui/material";
2
+ import Link from "next/link";
3
3
  import React, { CSSProperties, forwardRef, Fragment, ReactNode } from "react";
4
4
  import { BreakpointKey } from "../../../../../../../../hooks/useBreakpointHelper";
5
5
  import {
@@ -7,6 +7,7 @@ import {
7
7
  REL_ATTRIBUTE,
8
8
  } from "../../../../../../../Links/common/entities";
9
9
  import { isClientSideNavigation } from "../../../../../../../Links/common/utils";
10
+ import { TestIdProps } from "../../../../../../../types";
10
11
  import { SelectedMatch } from "../../../../common/entities";
11
12
  import { HeaderProps } from "../../../../header";
12
13
  import { isNavigationLinkSelected } from "./common/utils";
@@ -28,7 +29,7 @@ export interface NavLinkItem {
28
29
  visible?: Partial<Record<BreakpointKey, boolean>>;
29
30
  }
30
31
 
31
- export interface NavigationProps {
32
+ export interface NavigationProps extends TestIdProps {
32
33
  className?: string;
33
34
  closeAncestor?: () => void;
34
35
  headerProps?: HeaderProps;
@@ -48,12 +49,18 @@ export const Navigation = forwardRef<HTMLDivElement, NavigationProps>(
48
49
  links,
49
50
  pathname,
50
51
  style,
52
+ testId,
51
53
  }: NavigationProps,
52
54
  ref
53
55
  ): JSX.Element {
54
- const router = useRouter();
55
56
  return (
56
- <Links ref={ref} className={className} isMenuIn={isMenuIn} style={style}>
57
+ <Links
58
+ ref={ref}
59
+ className={className}
60
+ data-testid={testId}
61
+ isMenuIn={isMenuIn}
62
+ style={style}
63
+ >
57
64
  {links.map(
58
65
  (
59
66
  {
@@ -65,8 +72,9 @@ export const Navigation = forwardRef<HTMLDivElement, NavigationProps>(
65
72
  url,
66
73
  },
67
74
  i
68
- ) =>
69
- menuItems ? (
75
+ ) => {
76
+ const isClientSide = isClientSideNavigation(url);
77
+ return menuItems ? (
70
78
  <Fragment key={i}>
71
79
  {isMenuIn ? (
72
80
  <NavigationDrawer
@@ -98,17 +106,16 @@ export const Navigation = forwardRef<HTMLDivElement, NavigationProps>(
98
106
  ) : (
99
107
  <Fragment key={i}>
100
108
  <Button
109
+ component={isClientSide ? Link : MLink}
101
110
  disabled={!url}
102
- onClick={(): void => {
103
- closeAncestor?.();
104
- isClientSideNavigation(url)
105
- ? router.push(url)
106
- : window.open(
107
- url,
108
- target,
109
- REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
110
- );
111
- }}
111
+ href={url}
112
+ onClick={(): void => closeAncestor?.()}
113
+ rel={
114
+ isClientSide
115
+ ? REL_ATTRIBUTE.NO_OPENER
116
+ : REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
117
+ }
118
+ target={target}
112
119
  variant={
113
120
  isNavigationLinkSelected(pathname, selectedPatterns)
114
121
  ? "activeNav"
@@ -119,7 +126,8 @@ export const Navigation = forwardRef<HTMLDivElement, NavigationProps>(
119
126
  </Button>
120
127
  {divider && <Divider />}
121
128
  </Fragment>
122
- )
129
+ );
130
+ }
123
131
  )}
124
132
  </Links>
125
133
  );
@@ -31,7 +31,7 @@ const url = "/";
31
31
  export const HeaderStory: Story = {
32
32
  args: {
33
33
  authenticationEnabled: false,
34
- logo: <Logo alt="Logo" height={40} link="/" src={logo} />,
34
+ logo: <Logo alt="Logo" height={40} link="/" src={logo.src} />,
35
35
  navigation: [
36
36
  undefined,
37
37
  [
@@ -21,6 +21,7 @@ import {
21
21
  renderIconButton as renderSearchIconButton,
22
22
  Search,
23
23
  } from "./components/Content/components/Actions/components/Search/search";
24
+ import { NAVIGATION_TEST_ID } from "./components/Content/components/Navigation/constants";
24
25
  import { Navigation as DXNavigation } from "./components/Content/components/Navigation/navigation";
25
26
  import { Slogan } from "./components/Content/components/Slogan/slogan";
26
27
  import { Divider } from "./components/Content/components/Slogan/slogan.styles";
@@ -92,7 +93,11 @@ export const Header = ({ ...headerProps }: HeaderProps): JSX.Element => {
92
93
  <Center>
93
94
  {/* Center navigation */}
94
95
  {isIn.isCenterNavigationIn && (
95
- <DXNavigation {...navigationProps} links={navItemsC} />
96
+ <DXNavigation
97
+ {...navigationProps}
98
+ testId={NAVIGATION_TEST_ID}
99
+ links={navItemsC}
100
+ />
96
101
  )}
97
102
  </Center>
98
103
  </Fade>
@@ -1,20 +1,20 @@
1
- import { ComponentMeta, ComponentStory } from "@storybook/react";
2
- import React from "react";
1
+ import { Meta, StoryObj } from "@storybook/react";
3
2
  import { SidebarLabel } from "./sidebarLabel";
4
3
 
5
- export default {
4
+ const meta = {
6
5
  argTypes: {
7
6
  label: { control: "text" },
8
7
  },
9
8
  component: SidebarLabel,
10
9
  title: "Components/Label",
11
- } as ComponentMeta<typeof SidebarLabel>;
10
+ } satisfies Meta<typeof SidebarLabel>;
12
11
 
13
- const SidebarLabelTemplate: ComponentStory<typeof SidebarLabel> = (args) => (
14
- <SidebarLabel {...args} />
15
- );
12
+ export default meta;
16
13
 
17
- export const SidebarLabelStory = SidebarLabelTemplate.bind({});
18
- SidebarLabelStory.args = {
19
- label: "Filter",
14
+ type Story = StoryObj<typeof meta>;
15
+
16
+ export const SidebarLabelStory: Story = {
17
+ args: {
18
+ label: "Filter",
19
+ },
20
20
  };
@@ -1,4 +1,5 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
+ import { fn } from "@storybook/test";
2
3
  import React from "react";
3
4
  import { Sidebar } from "./sidebar";
4
5
 
@@ -46,5 +47,6 @@ export const TemporaryOpenSidebarStory: Story = {
46
47
  args: {
47
48
  children: <div />,
48
49
  drawerOpen: true,
50
+ onDrawerClose: fn(),
49
51
  },
50
52
  };
@@ -1,28 +1,28 @@
1
- import { ComponentMeta, ComponentStory } from "@storybook/react";
2
- import React from "react";
1
+ import { Meta, StoryObj } from "@storybook/react";
3
2
  import { Links } from "./links";
4
3
 
5
- export default {
4
+ const FACEBOOK_URL = "https://www.facebook.com";
5
+ const GOOGLE_URL = "https://www.google.com";
6
+ const TWITTER_URL = "https://www.twitter.com";
7
+
8
+ const meta = {
6
9
  argTypes: {
7
- links: { control: "array" },
10
+ links: { control: "object" },
8
11
  },
9
12
  component: Links,
10
13
  title: "Components/Deprecated/Links",
11
- } as ComponentMeta<typeof Links>;
14
+ } satisfies Meta<typeof Links>;
12
15
 
13
- const LinksTemplate: ComponentStory<typeof Links> = (args) => (
14
- <Links {...args} />
15
- );
16
+ export default meta;
16
17
 
17
- const FACEBOOK_URL = "https://www.facebook.com";
18
- const GOOGLE_URL = "https://www.google.com";
19
- const TWITTER_URL = "https://www.twitter.com";
18
+ type Story = StoryObj<typeof meta>;
20
19
 
21
- export const LinksStory = LinksTemplate.bind({});
22
- LinksStory.args = {
23
- links: [
24
- { label: "Facebook", url: FACEBOOK_URL },
25
- { label: "Google", url: GOOGLE_URL },
26
- { label: "Twitter", url: TWITTER_URL },
27
- ],
20
+ export const LinksStory: Story = {
21
+ args: {
22
+ links: [
23
+ { label: "Facebook", url: FACEBOOK_URL },
24
+ { label: "Google", url: GOOGLE_URL },
25
+ { label: "Twitter", url: TWITTER_URL },
26
+ ],
27
+ },
28
28
  };
@@ -1,11 +1,12 @@
1
- import { ComponentMeta, ComponentStory } from "@storybook/react";
1
+ import { Meta, StoryObj } from "@storybook/react";
2
2
  import React from "react";
3
3
  import { PAPER_PANEL_STYLE } from "../common/Paper/paper";
4
4
  import { Loading } from "./loading";
5
5
 
6
- export default {
6
+ const meta = {
7
7
  argTypes: {
8
- className: { control: { disabled: true } },
8
+ appear: { control: "boolean" },
9
+ iconSize: { control: "select", options: ["small", "medium", "large"] },
9
10
  loading: { control: "boolean" },
10
11
  panelStyle: {
11
12
  control: "select",
@@ -29,13 +30,14 @@ export default {
29
30
  ),
30
31
  ],
31
32
  title: "Components/Communication/Loading",
32
- } as ComponentMeta<typeof Loading>;
33
+ } satisfies Meta<typeof Loading>;
33
34
 
34
- const LoadingTemplate: ComponentStory<typeof Loading> = (args) => (
35
- <Loading {...args} />
36
- );
35
+ export default meta;
37
36
 
38
- export const LoadingStory = LoadingTemplate.bind({});
39
- LoadingStory.args = {
40
- loading: true,
37
+ type Story = StoryObj<typeof meta>;
38
+
39
+ export const LoadingStory: Story = {
40
+ args: {
41
+ loading: true,
42
+ },
41
43
  };
@@ -1,4 +1,4 @@
1
- import { ButtonProps } from "@mui/material/Button/Button";
1
+ import { ButtonProps } from "@mui/material";
2
2
  import { BaseComponentProps } from "../../../../theme/common/entities";
3
3
 
4
4
  export type Props = BaseComponentProps & ButtonProps;
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { Button } from "../Button/button";
3
+ import { Props } from "./types";
4
+
5
+ export const Buttons = <P,>({
6
+ className,
7
+ handleLogin,
8
+ providers = [],
9
+ ...props /* Mui ButtonProps */
10
+ }: Props<P>): JSX.Element[] => {
11
+ return providers?.map((provider) => (
12
+ <Button
13
+ key={provider.id}
14
+ className={className}
15
+ endIcon={"icon" in provider && provider.icon}
16
+ onClick={() => handleLogin(provider.id)}
17
+ {...props}
18
+ >
19
+ {provider.name}
20
+ </Button>
21
+ ));
22
+ };
@@ -0,0 +1,9 @@
1
+ import { ButtonProps } from "@mui/material";
2
+ import { ClientSafeProvider } from "next-auth/react";
3
+ import { OAuthProvider } from "../../../../config/entities";
4
+ import { BaseComponentProps } from "../../../../theme/common/entities";
5
+
6
+ export interface Props<P> extends BaseComponentProps, ButtonProps {
7
+ handleLogin: (providerId: string) => void;
8
+ providers?: ClientSafeProvider[] | OAuthProvider<P>[];
9
+ }