@verdaccio/ui-components 3.0.0-next-7.7 → 3.0.0-next-7.9

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 (412) hide show
  1. package/.eslintrc +1 -1
  2. package/CHANGELOG.md +14 -0
  3. package/build/AppTest/AppRoute.js +2 -2
  4. package/build/AppTest/pages/Front/index.js +1 -1
  5. package/build/AppTest/pages/Version/Version.js +2 -2
  6. package/build/AppTest/pages/Version/index.js +1 -1
  7. package/build/Theme/ResetStyles.js +1 -1
  8. package/build/Theme/StyleBaseline.js +1 -1
  9. package/build/Theme/ThemeProvider.js +2 -2
  10. package/build/Theme/index.js +2 -2
  11. package/build/Theme/theme.js +3 -3
  12. package/build/__mocks__/react-markdown.js +1 -1
  13. package/build/components/ActionBar/ActionBar.js +6 -4
  14. package/build/components/ActionBar/ActionBarAction.js +10 -9
  15. package/build/components/ActionBar/index.js +1 -1
  16. package/build/components/Author/Author.js +14 -43
  17. package/build/components/Author/index.js +1 -1
  18. package/build/components/Author/styles.js +1 -1
  19. package/build/components/CopyClipboard/CopyToClipBoard.js +1 -1
  20. package/build/components/CopyClipboard/index.js +1 -1
  21. package/build/components/CopyClipboard/utils.js +3 -12
  22. package/build/components/Dependencies/Dependencies.js +14 -15
  23. package/build/components/Dependencies/DependencyBlock.js +6 -5
  24. package/build/components/Dependencies/index.js +1 -1
  25. package/build/components/Deprecated/Deprecated.js +1 -1
  26. package/build/components/Deprecated/index.js +1 -1
  27. package/build/components/Developers/DeveloperType.js +12 -0
  28. package/build/components/Developers/Developers.js +22 -24
  29. package/build/components/Developers/Title.js +6 -10
  30. package/build/components/Developers/index.js +4 -4
  31. package/build/components/Distribution/Dist.js +2 -2
  32. package/build/components/Distribution/index.js +1 -1
  33. package/build/components/Distribution/styles.js +11 -24
  34. package/build/components/Engines/Engines.js +9 -3
  35. package/build/components/Engines/index.js +1 -1
  36. package/build/components/Engines/styles.js +7 -7
  37. package/build/components/ErrorBoundary/ErrorBoundary.js +1 -1
  38. package/build/components/ErrorBoundary/index.js +1 -1
  39. package/build/components/Forbidden/Forbidden.js +2 -2
  40. package/build/components/Forbidden/index.js +1 -1
  41. package/build/components/FundButton/FundButton.js +10 -11
  42. package/build/components/FundButton/index.js +1 -1
  43. package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +4 -3
  44. package/build/components/HeaderInfoDialog/index.js +1 -1
  45. package/build/components/Heading/Heading.js +3 -3
  46. package/build/components/Heading/index.js +1 -1
  47. package/build/components/Help/Help.js +2 -2
  48. package/build/components/Help/index.js +1 -1
  49. package/build/components/Help/styles.js +1 -1
  50. package/build/components/Icons/DevsIcons/CommonJS.js +2 -13
  51. package/build/components/Icons/DevsIcons/ES6Module.js +3 -14
  52. package/build/components/Icons/DevsIcons/Git.js +2 -13
  53. package/build/components/Icons/DevsIcons/NodeJS.js +2 -13
  54. package/build/components/Icons/DevsIcons/TypeScript.js +2 -13
  55. package/build/components/Icons/Earth.js +2 -2
  56. package/build/components/Icons/FileBinary.js +13 -7
  57. package/build/components/Icons/Law.js +14 -8
  58. package/build/components/Icons/License.js +2 -2
  59. package/build/components/Icons/License.js.map +1 -1
  60. package/build/components/Icons/Managers/Npm.js +2 -13
  61. package/build/components/Icons/Managers/Pnpm.js +2 -13
  62. package/build/components/Icons/Managers/Yarn.js +2 -13
  63. package/build/components/Icons/SvgIcon.js +2 -2
  64. package/build/components/Icons/Time.js +2 -2
  65. package/build/components/Icons/Version.js +2 -2
  66. package/build/components/Install/Install.js +28 -23
  67. package/build/components/Install/InstallListItem.js +20 -19
  68. package/build/components/Install/index.js +1 -1
  69. package/build/components/Keywords/KeywordListItems.js +34 -0
  70. package/build/components/Keywords/Keywords.js +39 -0
  71. package/build/components/Keywords/index.js +14 -0
  72. package/build/components/Label/Label.js +2 -2
  73. package/build/components/Label/index.js +1 -1
  74. package/build/components/Link/Link.js +5 -17
  75. package/build/components/Link/index.js +2 -2
  76. package/build/components/LinkExternal/LinkExternal.js +32 -0
  77. package/build/components/LinkExternal/index.js +14 -0
  78. package/build/components/Loading/Loading.js +1 -1
  79. package/build/components/Loading/Spinner/Spinner.js +1 -1
  80. package/build/components/Loading/Spinner/index.js +1 -1
  81. package/build/components/Loading/index.js +1 -1
  82. package/build/components/Loading/styles.js +4 -3
  83. package/build/components/LoginDialog/LoginDialog.js +14 -3
  84. package/build/components/LoginDialog/LoginDialogCloseButton.js +4 -3
  85. package/build/components/LoginDialog/LoginDialogForm.js +5 -17
  86. package/build/components/LoginDialog/LoginDialogFormError.js +5 -4
  87. package/build/components/LoginDialog/LoginDialogHeader.js +1 -1
  88. package/build/components/LoginDialog/index.js +1 -1
  89. package/build/components/Logo/Logo.js +14 -7
  90. package/build/components/Logo/index.js +1 -1
  91. package/build/components/MenuItem/MenuItem.js +3 -3
  92. package/build/components/MenuItem/index.js +1 -1
  93. package/build/components/NoItems/NoItems.js +1 -1
  94. package/build/components/NoItems/index.js +1 -1
  95. package/build/components/NotFound/NotFound.js +2 -2
  96. package/build/components/NotFound/index.js +1 -1
  97. package/build/components/Package/Package.js +46 -37
  98. package/build/components/Package/index.js +1 -1
  99. package/build/components/Package/styles.js +47 -59
  100. package/build/components/PackageList/PackageList.js +1 -1
  101. package/build/components/PackageList/index.js +1 -1
  102. package/build/components/Person/Person.js +48 -0
  103. package/build/components/Person/PersonTooltip.js +22 -0
  104. package/build/components/Person/index.js +14 -0
  105. package/build/components/Person/utils.js +17 -0
  106. package/build/components/RawViewer/RawViewer.js +12 -6
  107. package/build/components/RawViewer/index.js +1 -1
  108. package/build/components/Readme/Readme.js +16 -7
  109. package/build/components/Readme/Readme.js.map +1 -1
  110. package/build/components/Readme/Readme.spec.js +20 -1
  111. package/build/components/Readme/Readme.spec.js.map +1 -1
  112. package/build/components/Readme/index.js +1 -1
  113. package/build/components/Readme/utils.js +3 -6
  114. package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +1 -1
  115. package/build/components/RegistryInfoDialog/index.js +1 -1
  116. package/build/components/RegistryInfoDialog/styles.js +10 -11
  117. package/build/components/Repository/Repository.js +22 -34
  118. package/build/components/Repository/index.js +1 -1
  119. package/build/components/Search/AutoComplete/AutoComplete.js +2 -2
  120. package/build/components/Search/AutoComplete/index.js +1 -1
  121. package/build/components/Search/AutoComplete/styles.js +5 -42
  122. package/build/components/Search/Search.js +9 -7
  123. package/build/components/Search/SearchItem.js +54 -41
  124. package/build/components/Search/index.js +1 -1
  125. package/build/components/Search/styles.js +1 -1
  126. package/build/components/Search/utils.js +23 -0
  127. package/build/components/SettingsMenu/SettingsMenu.js +36 -10
  128. package/build/components/SettingsMenu/index.js +1 -1
  129. package/build/components/SideBarTitle/SideBarTitle.js +17 -7
  130. package/build/components/SideBarTitle/index.js +1 -1
  131. package/build/components/SideBarTitle/utils.js +1 -1
  132. package/build/components/TextField/TextField.js +3 -3
  133. package/build/components/TextField/index.js +1 -1
  134. package/build/components/UpLinks/UpLinks.js +36 -7
  135. package/build/components/UpLinks/UplinkLink.js +22 -0
  136. package/build/components/UpLinks/index.js +1 -1
  137. package/build/components/UpLinks/styles.js +6 -5
  138. package/build/components/Versions/HistoryList.js +9 -6
  139. package/build/components/Versions/TagList.js +9 -5
  140. package/build/components/Versions/Versions.js +32 -9
  141. package/build/components/Versions/index.js +1 -1
  142. package/build/components/Versions/styles.js +1 -1
  143. package/build/hooks/index.js +1 -1
  144. package/build/index.js +29 -5
  145. package/build/layouts/Version/Version.js +1 -1
  146. package/build/layouts/Version/index.js +1 -1
  147. package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +3 -2
  148. package/build/providers/AppConfigurationProvider/index.js +1 -1
  149. package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +3 -2
  150. package/build/providers/PersistenceSettingProvider/index.js +1 -1
  151. package/build/providers/TranslatorProvider/TranslatorProvider.js +2 -2
  152. package/build/providers/TranslatorProvider/TranslatorProvider.spec.js +2 -2
  153. package/build/providers/TranslatorProvider/index.js +1 -1
  154. package/build/providers/VersionProvider/VersionProvider.js +2 -2
  155. package/build/providers/VersionProvider/index.js +1 -1
  156. package/build/sections/Detail/ContainerContent.js +2 -2
  157. package/build/sections/Detail/Detail.js +10 -6
  158. package/build/sections/Detail/ReadmeSection.js +1 -1
  159. package/build/sections/Detail/Tabs.js +5 -4
  160. package/build/sections/Detail/index.js +1 -1
  161. package/build/sections/Footer/Footer.js +38 -9
  162. package/build/sections/Footer/index.js +1 -1
  163. package/build/sections/Footer/styles.js +14 -11
  164. package/build/sections/Header/Header.js +2 -2
  165. package/build/sections/Header/HeaderGreetings.js +1 -1
  166. package/build/sections/Header/HeaderLeft.js +15 -18
  167. package/build/sections/Header/HeaderMenu.js +2 -2
  168. package/build/sections/Header/HeaderRight.js +14 -5
  169. package/build/sections/Header/HeaderSettingsDialog.js +4 -4
  170. package/build/sections/Header/HeaderToolTip.js +1 -1
  171. package/build/sections/Header/HeaderToolTipIcon.js +2 -2
  172. package/build/sections/Header/LanguageSwitch.js +4 -4
  173. package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +4 -4
  174. package/build/sections/Header/RegistryInfoContent/index.js +1 -1
  175. package/build/sections/Header/RegistryInfoContent/styles.js +1 -1
  176. package/build/sections/Header/index.js +1 -1
  177. package/build/sections/Header/styles.js +44 -83
  178. package/build/sections/Home/Home.js +2 -2
  179. package/build/sections/Home/index.js +1 -1
  180. package/build/sections/SideBar/Sidebar.js +12 -17
  181. package/build/sections/SideBar/index.js +1 -1
  182. package/build/sections/index.js +1 -1
  183. package/build/src/Theme/ThemeProvider.test.d.ts +1 -0
  184. package/build/src/components/Author/Author.d.ts +0 -5
  185. package/build/src/components/CopyClipboard/CopyToClipBoard.test.d.ts +1 -0
  186. package/build/src/components/Dependencies/Dependencies.d.ts +0 -1
  187. package/build/src/components/Developers/DeveloperType.d.ts +4 -0
  188. package/build/src/components/Developers/Developers.d.ts +1 -4
  189. package/build/src/components/Developers/Title.d.ts +1 -4
  190. package/build/src/components/Developers/index.d.ts +2 -1
  191. package/build/src/components/Distribution/styles.d.ts +0 -1
  192. package/build/src/components/ErrorBoundary/ErrorBoundary.test.d.ts +1 -0
  193. package/build/src/components/HeaderInfoDialog/HeaderInfoDialog.test.d.ts +1 -0
  194. package/build/src/components/Heading/Heading.test.d.ts +1 -0
  195. package/build/src/components/Icons/Icons.test.d.ts +1 -0
  196. package/build/src/components/Install/InstallListItem.d.ts +1 -1
  197. package/build/src/components/Keywords/KeywordListItems.d.ts +5 -0
  198. package/build/src/components/Keywords/Keywords.d.ts +6 -0
  199. package/build/src/components/Keywords/Keywords.stories.d.ts +5 -0
  200. package/build/src/components/Keywords/Keywords.test.d.ts +1 -0
  201. package/build/src/components/Keywords/index.d.ts +1 -0
  202. package/build/src/components/Link/Link.d.ts +0 -3
  203. package/build/src/components/Link/Link.test.d.ts +1 -0
  204. package/build/src/components/Link/index.d.ts +1 -1
  205. package/build/src/components/LinkExternal/LinkExternal.d.ts +3 -0
  206. package/build/src/components/LinkExternal/LinkExternal.test.d.ts +1 -0
  207. package/build/src/components/LinkExternal/index.d.ts +1 -0
  208. package/build/src/components/Logo/Logo.d.ts +1 -0
  209. package/build/src/components/Logo/Logo.stories.d.ts +5 -0
  210. package/build/src/components/Package/Package.d.ts +1 -1
  211. package/build/src/components/Package/styles.d.ts +0 -8
  212. package/build/src/components/Person/Person.d.ts +9 -0
  213. package/build/src/components/Person/Person.test.d.ts +1 -0
  214. package/build/src/components/Person/PersonTooltip.d.ts +6 -0
  215. package/build/src/components/Person/index.d.ts +1 -0
  216. package/build/src/components/Person/utils.d.ts +3 -0
  217. package/build/src/components/Readme/Readme.d.ts +0 -1
  218. package/build/src/components/Search/AutoComplete/styles.d.ts +0 -8
  219. package/build/src/components/Search/utils.d.ts +1 -0
  220. package/build/src/components/SettingsMenu/SettingsMenu.d.ts +2 -2
  221. package/build/src/components/SettingsMenu/SettingsMenu.test.d.ts +1 -0
  222. package/build/src/components/UpLinks/UplinkLink.d.ts +6 -0
  223. package/build/src/components/Versions/Versions.d.ts +1 -0
  224. package/build/src/index.d.ts +4 -1
  225. package/build/src/sections/Detail/Tabs.d.ts +1 -0
  226. package/build/src/sections/Header/styles.d.ts +0 -7
  227. package/build/src/store/models/routes.d.ts +8 -0
  228. package/build/src/store/models/utils.d.ts +1 -0
  229. package/build/src/types/packageMeta.d.ts +7 -5
  230. package/build/src/utils/routes.d.ts +1 -0
  231. package/build/src/utils/utils.d.ts +1 -0
  232. package/build/store/api.js +1 -1
  233. package/build/store/index.js +1 -1
  234. package/build/store/models/configuration.js +3 -2
  235. package/build/store/models/download.js +1 -1
  236. package/build/store/models/login.js +5 -3
  237. package/build/store/models/manifest.js +6 -4
  238. package/build/store/models/packages.js +5 -3
  239. package/build/store/models/routes.js +18 -0
  240. package/build/store/models/search.js +6 -4
  241. package/build/store/models/utils.js +10 -0
  242. package/build/store/storage.js +1 -1
  243. package/build/store/store.js +1 -1
  244. package/build/test/i18n-config.js +1 -1
  245. package/build/test/test-react-testing-library.js +1 -1
  246. package/build/utils/index.js +2 -2
  247. package/build/utils/loadable.js +1 -1
  248. package/build/utils/routes.js +1 -0
  249. package/build/utils/token.js +1 -1
  250. package/build/utils/url.js +1 -1
  251. package/build/utils/utils.js +21 -2
  252. package/package.json +8 -8
  253. package/src/AppTest/AppRoute.test.tsx +65 -0
  254. package/src/Theme/ThemeProvider.test.tsx +27 -0
  255. package/src/Theme/theme.ts +3 -3
  256. package/src/components/ActionBar/ActionBar.test.tsx +36 -15
  257. package/src/components/ActionBar/ActionBar.tsx +1 -1
  258. package/src/components/ActionBar/ActionBarAction.tsx +8 -5
  259. package/src/components/Author/Author.test.tsx +7 -1
  260. package/src/components/Author/Author.tsx +3 -41
  261. package/src/components/CopyClipboard/CopyToClipBoard.test.tsx +23 -0
  262. package/src/components/CopyClipboard/utils.ts +2 -13
  263. package/src/components/Dependencies/Dependencies.tsx +9 -9
  264. package/src/components/Dependencies/DependencyBlock.tsx +2 -1
  265. package/src/components/Developers/DeveloperType.tsx +4 -0
  266. package/src/components/Developers/Developers.test.tsx +37 -10
  267. package/src/components/Developers/Developers.tsx +13 -13
  268. package/src/components/Developers/Title.tsx +1 -5
  269. package/src/components/Developers/index.ts +2 -1
  270. package/src/components/Distribution/Dist.test.tsx +1 -1
  271. package/src/components/Distribution/Dist.tsx +2 -4
  272. package/src/components/Distribution/styles.ts +0 -6
  273. package/src/components/Engines/Engines.tsx +6 -2
  274. package/src/components/Engines/styles.ts +1 -1
  275. package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +39 -0
  276. package/src/components/FundButton/FundButton.tsx +5 -5
  277. package/src/components/HeaderInfoDialog/HeaderInfoDialog.test.tsx +51 -0
  278. package/src/components/HeaderInfoDialog/HeaderInfoDialog.tsx +2 -2
  279. package/src/components/Heading/Heading.test.tsx +20 -0
  280. package/src/components/Icons/DevsIcons/CommonJS.tsx +1 -7
  281. package/src/components/Icons/DevsIcons/ES6Module.tsx +2 -8
  282. package/src/components/Icons/DevsIcons/Git.tsx +1 -7
  283. package/src/components/Icons/DevsIcons/NodeJS.tsx +1 -7
  284. package/src/components/Icons/DevsIcons/TypeScript.tsx +1 -7
  285. package/src/components/Icons/FileBinary.tsx +2 -1
  286. package/src/components/Icons/Icons.stories.tsx +21 -5
  287. package/src/components/Icons/Icons.test.tsx +70 -0
  288. package/src/components/Icons/Law.tsx +2 -1
  289. package/src/components/Icons/Managers/Npm.tsx +1 -7
  290. package/src/components/Icons/Managers/Pnpm.tsx +1 -7
  291. package/src/components/Icons/Managers/Yarn.tsx +1 -7
  292. package/src/components/Install/Install.test.tsx +54 -13
  293. package/src/components/Install/Install.tsx +12 -11
  294. package/src/components/Install/InstallListItem.tsx +12 -11
  295. package/src/components/Keywords/KeywordListItems.tsx +22 -0
  296. package/src/components/Keywords/Keywords.stories.tsx +19 -0
  297. package/src/components/Keywords/Keywords.test.tsx +57 -0
  298. package/src/components/Keywords/Keywords.tsx +35 -0
  299. package/src/components/Keywords/index.ts +1 -0
  300. package/src/components/Link/Link.test.tsx +25 -0
  301. package/src/components/Link/Link.tsx +4 -18
  302. package/src/components/Link/index.ts +1 -1
  303. package/src/components/LinkExternal/LinkExternal.test.tsx +18 -0
  304. package/src/components/LinkExternal/LinkExternal.tsx +22 -0
  305. package/src/components/LinkExternal/index.ts +1 -0
  306. package/src/components/Loading/Loading.test.tsx +8 -5
  307. package/src/components/Loading/styles.ts +1 -0
  308. package/src/components/LoginDialog/LoginDialog.test.tsx +1 -1
  309. package/src/components/LoginDialog/LoginDialog.tsx +10 -1
  310. package/src/components/LoginDialog/LoginDialogCloseButton.tsx +1 -0
  311. package/src/components/LoginDialog/LoginDialogForm.tsx +0 -2
  312. package/src/components/LoginDialog/LoginDialogFormError.tsx +1 -1
  313. package/src/components/Logo/Logo.stories.tsx +16 -0
  314. package/src/components/Logo/Logo.test.tsx +8 -1
  315. package/src/components/Logo/Logo.tsx +19 -3
  316. package/src/components/Package/Package.test.tsx +47 -14
  317. package/src/components/Package/Package.tsx +41 -44
  318. package/src/components/Package/styles.ts +7 -17
  319. package/src/components/PackageList/Packagelist.test.tsx +1 -0
  320. package/src/components/Person/Person.test.tsx +50 -0
  321. package/src/components/Person/Person.tsx +45 -0
  322. package/src/components/Person/PersonTooltip.tsx +26 -0
  323. package/src/components/Person/index.ts +1 -0
  324. package/src/components/Person/utils.ts +20 -0
  325. package/src/components/RawViewer/RawViewer.tsx +8 -4
  326. package/src/components/Readme/Readme.spec.tsx +17 -0
  327. package/src/components/Readme/Readme.tsx +10 -5
  328. package/src/components/Readme/utils.ts +2 -5
  329. package/src/components/RegistryInfoDialog/styles.ts +5 -4
  330. package/src/components/Repository/Repository.tsx +9 -14
  331. package/src/components/Search/AutoComplete/styles.ts +7 -0
  332. package/src/components/Search/Search.test.tsx +36 -9
  333. package/src/components/Search/Search.tsx +4 -2
  334. package/src/components/Search/SearchItem.tsx +19 -8
  335. package/src/components/Search/utils.ts +17 -0
  336. package/src/components/SettingsMenu/SettingsMenu.test.tsx +41 -0
  337. package/src/components/SettingsMenu/SettingsMenu.tsx +48 -10
  338. package/src/components/SideBarTitle/SideBarTitle.tsx +19 -3
  339. package/src/components/UpLinks/UpLinks.test.tsx +7 -0
  340. package/src/components/UpLinks/UpLinks.tsx +38 -15
  341. package/src/components/UpLinks/UplinkLink.tsx +20 -0
  342. package/src/components/UpLinks/styles.ts +1 -0
  343. package/src/components/Versions/HistoryList.tsx +9 -4
  344. package/src/components/Versions/TagList.tsx +4 -3
  345. package/src/components/Versions/Versions.test.tsx +2 -0
  346. package/src/components/Versions/Versions.tsx +57 -32
  347. package/src/index.ts +4 -1
  348. package/src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx +1 -0
  349. package/src/providers/PersistenceSettingProvider/PersistenceSettingProvider.tsx +2 -0
  350. package/src/providers/VersionProvider/VersionProvider.test.tsx +3 -3
  351. package/src/sections/Detail/Detail.test.tsx +8 -1
  352. package/src/sections/Detail/Detail.tsx +11 -4
  353. package/src/sections/Detail/Tabs.tsx +5 -2
  354. package/src/sections/Footer/Footer.tsx +26 -12
  355. package/src/sections/Footer/styles.ts +4 -0
  356. package/src/sections/Header/Header.test.tsx +12 -10
  357. package/src/sections/Header/HeaderLeft.tsx +19 -11
  358. package/src/sections/Header/HeaderMenu.tsx +1 -1
  359. package/src/sections/Header/HeaderRight.tsx +14 -3
  360. package/src/sections/Header/HeaderSettingsDialog.tsx +1 -1
  361. package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +1 -1
  362. package/src/sections/Header/styles.ts +4 -16
  363. package/src/sections/Home/Home.test.tsx +12 -4
  364. package/src/sections/SideBar/Sidebar.test.tsx +20 -13
  365. package/src/sections/SideBar/Sidebar.tsx +5 -9
  366. package/src/store/api.test.ts +16 -0
  367. package/src/store/models/configuration.ts +2 -1
  368. package/src/store/models/login.ts +10 -12
  369. package/src/store/models/manifest.ts +6 -5
  370. package/src/store/models/packages.ts +4 -5
  371. package/src/store/models/routes.ts +10 -0
  372. package/src/store/models/search.ts +4 -2
  373. package/src/store/models/utils.ts +3 -0
  374. package/src/types/packageMeta.ts +7 -5
  375. package/src/utils/routes.ts +1 -0
  376. package/src/utils/utils.test.ts +34 -0
  377. package/src/utils/utils.ts +20 -5
  378. package/tsconfig.json +1 -1
  379. package/build/components/Developers/styles.js +0 -65
  380. package/build/components/Distribution/utils.js +0 -25
  381. package/build/components/Distribution/utilts.spec.js +0 -18
  382. package/build/components/Package/Tag/Tag.js +0 -14
  383. package/build/components/Package/Tag/index.js +0 -14
  384. package/build/components/Package/Tag/styles.js +0 -24
  385. package/build/sections/Header/RegistryInfoDialog/RegistryInfoDialog.js +0 -36
  386. package/build/sections/Header/RegistryInfoDialog/index.js +0 -14
  387. package/build/sections/Header/RegistryInfoDialog/styles.js +0 -46
  388. package/build/sections/Header/RegistryInfoDialog/types.js +0 -6
  389. package/build/src/components/Developers/styles.d.ts +0 -11
  390. package/build/src/components/Distribution/utils.d.ts +0 -7
  391. package/build/src/components/Package/Tag/Tag.d.ts +0 -6
  392. package/build/src/components/Package/Tag/index.d.ts +0 -1
  393. package/build/src/components/Package/Tag/styles.d.ts +0 -5
  394. package/build/src/sections/Header/RegistryInfoDialog/RegistryInfoDialog.d.ts +0 -4
  395. package/build/src/sections/Header/RegistryInfoDialog/index.d.ts +0 -1
  396. package/build/src/sections/Header/RegistryInfoDialog/styles.d.ts +0 -13
  397. package/build/src/sections/Header/RegistryInfoDialog/types.d.ts +0 -7
  398. package/src/components/Developers/styles.ts +0 -31
  399. package/src/components/Distribution/utils.ts +0 -32
  400. package/src/components/Distribution/utilts.spec.ts +0 -17
  401. package/src/components/Package/Tag/Tag.test.tsx +0 -15
  402. package/src/components/Package/Tag/Tag.tsx +0 -11
  403. package/src/components/Package/Tag/index.ts +0 -1
  404. package/src/components/Package/Tag/styles.ts +0 -11
  405. package/src/components/Search/AutoComplete/styles.tsx +0 -42
  406. package/src/sections/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +0 -31
  407. package/src/sections/Header/RegistryInfoDialog/index.ts +0 -1
  408. package/src/sections/Header/RegistryInfoDialog/styles.ts +0 -21
  409. package/src/sections/Header/RegistryInfoDialog/types.ts +0 -8
  410. /package/build/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
  411. /package/build/src/{components/Package/Tag/Tag.test.d.ts → AppTest/AppRoute.test.d.ts} +0 -0
  412. /package/src/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
@@ -1,3 +1,6 @@
1
+ import Box from '@mui/material/Box';
2
+ import Card from '@mui/material/Card';
3
+ import CardContent from '@mui/material/CardContent';
1
4
  import List from '@mui/material/List';
2
5
  import ListItem from '@mui/material/ListItem';
3
6
  import React from 'react';
@@ -5,6 +8,7 @@ import { useTranslation } from 'react-i18next';
5
8
 
6
9
  import { utils } from '../../utils';
7
10
  import NoItems from '../NoItems';
11
+ import UpLinkLink from './UplinkLink';
8
12
  import { ListItemText, Spacer, StyledText } from './styles';
9
13
 
10
14
  const UpLinks: React.FC<{ packageMeta: any }> = ({ packageMeta }) => {
@@ -17,24 +21,43 @@ const UpLinks: React.FC<{ packageMeta: any }> = ({ packageMeta }) => {
17
21
  const { _uplinks: uplinks, latest } = packageMeta;
18
22
 
19
23
  if (Object.keys(uplinks).length === 0) {
20
- return <NoItems data-testid="no-uplinks" text={t('uplinks.no-items', { name: latest.name })} />;
24
+ return (
25
+ <Card sx={{ mb: 2 }}>
26
+ <CardContent>
27
+ <NoItems data-testid="no-uplinks" text={t('uplinks.no-items', { name: latest.name })} />
28
+ </CardContent>
29
+ </Card>
30
+ );
21
31
  }
22
32
 
23
33
  return (
24
- <>
25
- <StyledText variant="subtitle1">{t('uplinks.title')}</StyledText>
26
- <List>
27
- {Object.keys(uplinks)
28
- .reverse()
29
- .map((name) => (
30
- <ListItem key={name}>
31
- <ListItemText>{name}</ListItemText>
32
- <Spacer />
33
- <ListItemText>{utils.formatDateDistance(uplinks[name].fetched)}</ListItemText>
34
- </ListItem>
35
- ))}
36
- </List>
37
- </>
34
+ <Card sx={{ mb: 2 }}>
35
+ <CardContent>
36
+ <Box data-testid="uplinks" sx={{ m: 2 }}>
37
+ <StyledText variant="subtitle1">{t('uplinks.title')}</StyledText>
38
+ <List dense={true}>
39
+ {Object.keys(uplinks)
40
+ .reverse()
41
+ .map((name) => (
42
+ <ListItem
43
+ className="version-item"
44
+ data-testid={`uplink-${name}`}
45
+ key={name}
46
+ sx={{ pr: 0 }}
47
+ >
48
+ <ListItemText>
49
+ <UpLinkLink packageName={latest.name} uplinkName={name} />
50
+ </ListItemText>
51
+ <Spacer />
52
+ <ListItemText title={utils.formatDate(uplinks[name].fetched)}>
53
+ {utils.formatDateDistance(uplinks[name].fetched)}
54
+ </ListItemText>
55
+ </ListItem>
56
+ ))}
57
+ </List>
58
+ </Box>
59
+ </CardContent>
60
+ </Card>
38
61
  );
39
62
  };
40
63
 
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import { utils } from '../../utils';
4
+ import LinkExternal from '../LinkExternal';
5
+
6
+ const UpLinkLink: React.FC<{ packageName: string; uplinkName: string }> = ({
7
+ packageName,
8
+ uplinkName,
9
+ }) => {
10
+ const link = utils.getUplink(uplinkName, packageName);
11
+ return link ? (
12
+ <LinkExternal to={link} variant="outline">
13
+ {uplinkName}
14
+ </LinkExternal>
15
+ ) : (
16
+ <>{uplinkName}</>
17
+ );
18
+ };
19
+
20
+ export default UpLinkLink;
@@ -15,6 +15,7 @@ export const Spacer = styled('div')<{ theme?: Theme }>(({ theme }) => ({
15
15
  } `,
16
16
  whiteSpace: 'nowrap',
17
17
  height: '0.5em',
18
+ margin: '0 16px',
18
19
  }));
19
20
 
20
21
  export const ListItemText = styled(MuiListItemText)<{ theme?: Theme }>(({ theme }) => ({
@@ -7,8 +7,8 @@ import { useTranslation } from 'react-i18next';
7
7
 
8
8
  import { useConfig } from '../../providers';
9
9
  import { Time, Versions } from '../../types/packageMeta';
10
- import { utils } from '../../utils';
11
- import { Link } from '../Link';
10
+ import { Route, utils } from '../../utils';
11
+ import Link from '../Link';
12
12
  import { ListItemText, Spacer } from './styles';
13
13
 
14
14
  interface Props {
@@ -40,8 +40,13 @@ const VersionsHistoryList: React.FC<Props> = ({ versions, packageName, time }) =
40
40
  {Object.keys(listVersions)
41
41
  .reverse()
42
42
  .map((version) => (
43
- <ListItem className="version-item" data-testid={`version-${version}`} key={version}>
44
- <Link to={`/-/web/detail/${packageName}/v/${version}`} variant="caption">
43
+ <ListItem
44
+ className="version-item"
45
+ data-testid={`version-${version}`}
46
+ key={version}
47
+ sx={{ pr: 0 }}
48
+ >
49
+ <Link to={`${Route.DETAIL}${packageName}/v/${version}`} variant="outline">
45
50
  <ListItemText disableTypography={false} primary={version}></ListItemText>
46
51
  </Link>
47
52
  {typeof versions[version]?.deprecated === 'string' ? (
@@ -3,7 +3,8 @@ import ListItem from '@mui/material/ListItem';
3
3
  import React from 'react';
4
4
 
5
5
  import { DistTags, Time } from '../../types/packageMeta';
6
- import { Link } from '../Link';
6
+ import { Route } from '../../utils';
7
+ import Link from '../Link';
7
8
  import { ListItemText, Spacer } from './styles';
8
9
 
9
10
  interface Props {
@@ -19,8 +20,8 @@ const VersionsTagList: React.FC<Props> = ({ tags, packageName, time }) => (
19
20
  return time[tags[a]] < time[tags[b]] ? 1 : time[tags[a]] > time[tags[b]] ? -1 : 0;
20
21
  })
21
22
  .map((tag) => (
22
- <ListItem className="version-item" data-testid={`tag-${tag}`} key={tag}>
23
- <Link to={`/-/web/detail/${packageName}/v/${tags[tag]}`} variant="outline">
23
+ <ListItem className="version-item" data-testid={`tag-${tag}`} key={tag} sx={{ pr: 0 }}>
24
+ <Link to={`${Route.DETAIL}${packageName}/v/${tags[tag]}`} variant="outline">
24
25
  <ListItemText>{tag}</ListItemText>
25
26
  </Link>
26
27
  <Spacer />
@@ -45,6 +45,8 @@ describe('<Version /> component', () => {
45
45
  expect(screen.queryAllByTestId('version-list-text')).toHaveLength(65);
46
46
  fireEvent.change(screen.getByRole('textbox'), { target: { value: '2.3.0' } });
47
47
  expect(screen.queryAllByTestId('version-list-text')).toHaveLength(1);
48
+ fireEvent.change(screen.getByRole('textbox'), { target: { value: '' } });
49
+ expect(screen.queryAllByTestId('version-list-text')).toHaveLength(65);
48
50
  });
49
51
 
50
52
  test('should not render versions', () => {
@@ -1,4 +1,8 @@
1
+ import styled from '@emotion/styled';
1
2
  import Alert from '@mui/material/Alert';
3
+ import Box from '@mui/material/Box';
4
+ import Card from '@mui/material/Card';
5
+ import CardContent from '@mui/material/CardContent';
2
6
  import TextField from '@mui/material/TextField';
3
7
  import Typography from '@mui/material/Typography';
4
8
  import { useTheme } from '@mui/styles';
@@ -7,12 +11,18 @@ import React, { useState } from 'react';
7
11
  import { useTranslation } from 'react-i18next';
8
12
  import semver from 'semver';
9
13
 
14
+ import { Theme } from '../../Theme';
10
15
  import { useConfig } from '../../providers';
11
16
  import VersionsHistoryList from './HistoryList';
12
17
  import VersionsTagList from './TagList';
13
18
 
14
19
  export type Props = { packageMeta: any; packageName: string };
15
20
 
21
+ export const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({
22
+ fontWeight: props.theme && props.theme.fontWeight.bold,
23
+ textTransform: 'capitalize',
24
+ }));
25
+
16
26
  const Versions: React.FC<Props> = ({ packageMeta, packageName }) => {
17
27
  const { t } = useTranslation();
18
28
  const { configOptions } = useConfig();
@@ -46,38 +56,53 @@ const Versions: React.FC<Props> = ({ packageMeta, packageName }) => {
46
56
  };
47
57
 
48
58
  return (
49
- <>
50
- {hasDistTags ? (
51
- <>
52
- <Typography variant="subtitle1">{t('versions.current-tags')}</Typography>
53
- <VersionsTagList packageName={packageName} tags={distTags} time={time} />
54
- </>
55
- ) : null}
56
- <>
57
- <Typography variant="subtitle1">{t('versions.version-history')}</Typography>
58
- <TextField
59
- helperText={t('versions.search.placeholder')}
60
- onChange={debounce((e) => {
61
- filterVersions(e.target.value);
62
- }, 200)}
63
- size="small"
64
- variant="standard"
65
- />
66
- </>
67
- {hasVersionHistory ? (
68
- <>
69
- {hideDeprecatedVersions === true && (
70
- <Alert
71
- severity="info"
72
- sx={{ marginTop: theme.spacing(1), marginBottom: theme.spacing(1) }}
73
- >
74
- {t('versions.hide-deprecated')}
75
- </Alert>
76
- )}
77
- <VersionsHistoryList packageName={packageName} time={time} versions={packageVersions} />
78
- </>
79
- ) : null}
80
- </>
59
+ <Card sx={{ mb: 2 }}>
60
+ <CardContent>
61
+ <Box data-testid="versions" sx={{ m: 2 }}>
62
+ {hasDistTags ? (
63
+ <>
64
+ <StyledText variant="subtitle1">
65
+ {t('versions.current-tags')}
66
+ <span>{` (${Object.keys(distTags).length})`}</span>
67
+ </StyledText>
68
+ <VersionsTagList packageName={packageName} tags={distTags} time={time} />
69
+ </>
70
+ ) : null}
71
+ <>
72
+ <StyledText variant="subtitle1">
73
+ {t('versions.version-history')}
74
+ <span>{` (${Object.keys(packageVersions).length})`}</span>
75
+ </StyledText>
76
+ <TextField
77
+ helperText={t('versions.search.placeholder')}
78
+ onChange={debounce((e) => {
79
+ filterVersions(e.target.value);
80
+ }, 200)}
81
+ size="small"
82
+ variant="standard"
83
+ width="50%"
84
+ />
85
+ </>
86
+ {hasVersionHistory ? (
87
+ <>
88
+ {hideDeprecatedVersions === true && (
89
+ <Alert
90
+ severity="info"
91
+ sx={{ marginTop: theme.spacing(1), marginBottom: theme.spacing(1) }}
92
+ >
93
+ {t('versions.hide-deprecated')}
94
+ </Alert>
95
+ )}
96
+ <VersionsHistoryList
97
+ packageName={packageName}
98
+ time={time}
99
+ versions={packageVersions}
100
+ />
101
+ </>
102
+ ) : null}
103
+ </Box>
104
+ </CardContent>
105
+ </Card>
81
106
  );
82
107
  };
83
108
 
package/src/index.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export { default as CopyClipboard, copyToClipBoardUtility } from './components/CopyClipboard';
2
2
  export * from './components/CopyClipboard';
3
- export { Link } from './components/Link';
4
3
  export { default as ActionBar } from './components/ActionBar';
5
4
  export { default as Author } from './components/Author';
6
5
  export { default as Dependencies } from './components/Dependencies';
@@ -12,7 +11,11 @@ export { default as FundButton } from './components/FundButton';
12
11
  export { default as Heading } from './components/Heading';
13
12
  export * as Icons from './components/Icons';
14
13
  export { default as Install } from './components/Install';
14
+ export { default as Keywords } from './components/Keywords';
15
+ export { default as Link } from './components/Link';
16
+ export { default as LinkExternal } from './components/LinkExternal';
15
17
  export { default as RawViewer } from './components/RawViewer';
18
+ export { default as Person } from './components/Person';
16
19
  export { default as Readme } from './components/Readme';
17
20
  export { default as SideBarTitle } from './components/SideBarTitle';
18
21
  export { default as UpLinks } from './components/UpLinks';
@@ -28,6 +28,7 @@ const defaultValues: ConfigProviderProps = {
28
28
  showSearch: true,
29
29
  showRaw: true,
30
30
  showDownloadTarball: true,
31
+ showUplinks: true,
31
32
  hideDeprecatedVersions: false,
32
33
  title: 'Verdaccio',
33
34
  },
@@ -10,11 +10,13 @@ import React, {
10
10
  import useLocalStorage from '../../hooks/useLocalStorage';
11
11
 
12
12
  type PersistenceSettingsProps = {
13
+ isLatest?: boolean;
13
14
  isGlobal?: boolean;
14
15
  yarnModern: boolean;
15
16
  };
16
17
 
17
18
  const defaultValues: PersistenceSettingsProps = {
19
+ isLatest: false,
18
20
  isGlobal: false,
19
21
  yarnModern: false,
20
22
  };
@@ -30,7 +30,7 @@ describe('<Header /> component with logged in state', () => {
30
30
  });
31
31
 
32
32
  test('should load data from the provider', async () => {
33
- await act(async () => {
33
+ act(() =>
34
34
  renderWithStore(
35
35
  <MemoryRouter initialEntries={[`/-/web/detail/storybook`]}>
36
36
  <Route path={Routes.PACKAGE}>
@@ -40,8 +40,8 @@ describe('<Header /> component with logged in state', () => {
40
40
  </Route>
41
41
  </MemoryRouter>,
42
42
  store
43
- );
44
- });
43
+ )
44
+ );
45
45
  await waitFor(() => screen.getByText('storybook'));
46
46
  expect(screen.getByText('storybook')).toBeInTheDocument();
47
47
  expect(screen.getByText('MIT')).toBeInTheDocument();
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { render } from '../../test/test-react-testing-library';
3
+ import { render, screen } from '../../test/test-react-testing-library';
4
4
  import DetailContainer from './Detail';
5
5
 
6
6
  describe('DetailContainer', () => {
@@ -8,5 +8,12 @@ describe('DetailContainer', () => {
8
8
  const { container } = render(<DetailContainer />);
9
9
  expect(container.firstChild).toMatchSnapshot();
10
10
  });
11
+
12
+ test('renders without uplinks', () => {
13
+ window.__VERDACCIO_BASENAME_UI_OPTIONS.showUplinks = false;
14
+ render(<DetailContainer />);
15
+ expect(screen.queryByTestId('uplinks-tab')).toBeFalsy();
16
+ });
17
+
11
18
  test.todo('should test click on tabs');
12
19
  });
@@ -2,7 +2,7 @@ import Box from '@mui/material/Box';
2
2
  import React, { useState } from 'react';
3
3
 
4
4
  import Deprecated from '../../components/Deprecated';
5
- import { useVersion } from '../../providers';
5
+ import { useConfig, useVersion } from '../../providers';
6
6
  import ContainerContent from './ContainerContent';
7
7
  import Tabs from './Tabs';
8
8
 
@@ -14,7 +14,10 @@ export enum TabPosition {
14
14
  }
15
15
 
16
16
  const DetailContainer: React.FC = () => {
17
- const tabs = Object.values(TabPosition);
17
+ const { configOptions } = useConfig();
18
+ const tabs = configOptions.showUplinks
19
+ ? Object.values(TabPosition)
20
+ : Object.values(TabPosition).filter((tab) => tab !== TabPosition.UPLINKS);
18
21
  const [tabPosition, setTabPosition] = useState(0);
19
22
  const { readMe, packageMeta } = useVersion();
20
23
 
@@ -23,8 +26,12 @@ const DetailContainer: React.FC = () => {
23
26
  };
24
27
 
25
28
  return (
26
- <Box component="div" display="flex" flexDirection="column" padding={2}>
27
- <Tabs onChange={handleChange} tabPosition={tabPosition} />
29
+ <Box component="div" display="flex" flexDirection="column" padding={0}>
30
+ <Tabs
31
+ onChange={handleChange}
32
+ showUplinks={configOptions.showUplinks}
33
+ tabPosition={tabPosition}
34
+ />
28
35
  {packageMeta?.latest?.deprecated && <Deprecated message={packageMeta?.latest?.deprecated} />}
29
36
  <ContainerContent readDescription={readMe} tabPosition={tabs[tabPosition]} />
30
37
  </Box>
@@ -9,16 +9,19 @@ import { Theme } from '../../Theme';
9
9
  interface Props {
10
10
  onChange: (event: React.ChangeEvent<{}>, newValue: number) => void;
11
11
  tabPosition: number;
12
+ showUplinks?: boolean;
12
13
  }
13
14
 
14
- const DetailContainerTabs: React.FC<Props> = ({ tabPosition, onChange }) => {
15
+ const DetailContainerTabs: React.FC<Props> = ({ tabPosition, onChange, showUplinks }) => {
15
16
  const { t } = useTranslation();
16
17
  return (
17
18
  <Tabs onChange={onChange} value={tabPosition} variant={'fullWidth'}>
18
19
  <Tab data-testid={'readme-tab'} id={'readme-tab'} label={t('tab.readme')} />
19
20
  <Tab data-testid={'dependencies-tab'} id={'dependencies-tab'} label={t('tab.dependencies')} />
20
21
  <Tab data-testid={'versions-tab'} id={'versions-tab'} label={t('tab.versions')} />
21
- <Tab data-testid={'uplinks-tab'} id={'uplinks-tab'} label={t('tab.uplinks')} />
22
+ {showUplinks && (
23
+ <Tab data-testid={'uplinks-tab'} id={'uplinks-tab'} label={t('tab.uplinks')} />
24
+ )}
22
25
  </Tabs>
23
26
  );
24
27
  };
@@ -27,28 +27,34 @@ const Footer = () => {
27
27
  <StyledEarth />
28
28
  <Flags>
29
29
  <Icon>
30
- <FlagsIcon.ES />
30
+ <FlagsIcon.ES title={t('flag.spain')} />
31
31
  </Icon>
32
32
  <Icon>
33
- <FlagsIcon.NI />
33
+ <FlagsIcon.NI title={t('flag.nicaragua')} />
34
34
  </Icon>
35
35
  <Icon>
36
- <FlagsIcon.IN />
36
+ <FlagsIcon.IN title={t('flag.india')} />
37
37
  </Icon>
38
38
  <Icon>
39
- <FlagsIcon.BR />
39
+ <FlagsIcon.BR title={t('flag.brazil')} />
40
40
  </Icon>
41
41
  <Icon>
42
- <FlagsIcon.CN />
42
+ <FlagsIcon.CN title={t('flag.china')} />
43
43
  </Icon>
44
44
  <Icon>
45
- <FlagsIcon.AU />
45
+ <FlagsIcon.AU title={t('flag.australia')} />
46
46
  </Icon>
47
47
  <Icon>
48
- <FlagsIcon.DE />
48
+ <FlagsIcon.DE title={t('flag.germany')} />
49
49
  </Icon>
50
50
  <Icon>
51
- <FlagsIcon.TW />
51
+ <FlagsIcon.TW title={t('flag.taiwan')} />
52
+ </Icon>
53
+ <Icon>
54
+ <FlagsIcon.AT title={t('flag.austria')} />
55
+ </Icon>
56
+ <Icon>
57
+ <FlagsIcon.CA title={t('flag.canada')} />
52
58
  </Icon>
53
59
  </Flags>
54
60
  </ToolTip>
@@ -56,9 +62,13 @@ const Footer = () => {
56
62
  <Right>
57
63
  {configOptions?.version && (
58
64
  <>
59
- <span data-testid="version-footer">{t('footer.powered-by')}</span>
60
- <Logo isDefault={true} onClick={goToVerdaccioWebsite} size="x-small" />
61
- {`/ ${configOptions.version}`}
65
+ <PoweredBy data-testid="version-footer">{t('footer.powered-by')}</PoweredBy>
66
+ <Logo
67
+ isDefault={true}
68
+ onClick={goToVerdaccioWebsite}
69
+ size="x-small"
70
+ title={configOptions.version}
71
+ />
62
72
  </>
63
73
  )}
64
74
  </Right>
@@ -69,13 +79,17 @@ const Footer = () => {
69
79
 
70
80
  export default Footer;
71
81
 
82
+ const PoweredBy = styled('span')(() => ({
83
+ paddingRight: '5px',
84
+ }));
85
+
72
86
  const StyledEarth = styled(Earth)<{ theme?: Theme }>(({ theme }) => ({
73
87
  margin: theme.spacing(0, 1),
74
88
  }));
75
89
 
76
90
  const Flags = styled('span')<{ theme?: Theme }>(({ theme }) => ({
77
91
  display: 'inline-grid',
78
- gridTemplateColumns: 'repeat(8, max-content)',
92
+ gridTemplateColumns: 'repeat(10, max-content)',
79
93
  gridGap: theme.spacing(0, 1),
80
94
  position: 'absolute',
81
95
  background: theme?.palette.greyAthens,
@@ -14,6 +14,8 @@ export const Inner = styled('div')<{ theme?: Theme }>(({ theme }) => ({
14
14
  display: 'flex',
15
15
  alignItems: 'center',
16
16
  justifyContent: 'flex-end',
17
+ paddingLeft: 16,
18
+ paddingRight: 16,
17
19
  width: '100%',
18
20
  [`@media (min-width: ${theme?.breakPoints.medium}px)`]: {
19
21
  minWidth: 400,
@@ -32,10 +34,12 @@ export const Left = styled('div')<{ theme?: Theme }>(({ theme }) => ({
32
34
  [`@media (min-width: ${theme?.breakPoints.medium}px)`]: {
33
35
  display: 'flex',
34
36
  },
37
+ marginLeft: 1,
35
38
  }));
36
39
 
37
40
  export const Right = styled(Left)({
38
41
  display: 'flex',
42
+ marginRight: 1,
39
43
  });
40
44
 
41
45
  export const Love = styled('span')<{ theme?: Theme }>(({ theme }) => ({
@@ -39,7 +39,7 @@ describe('<Header /> component with logged in state', () => {
39
39
  cleanup();
40
40
  });
41
41
 
42
- test('should load the component n logged out state', () => {
42
+ test('should load the component in logged out state', () => {
43
43
  renderWithStore(
44
44
  <Router>
45
45
  <Header />
@@ -59,7 +59,9 @@ describe('<Header /> component with logged in state', () => {
59
59
  </Router>,
60
60
  store
61
61
  );
62
- store.dispatch.login.logInUser({ username: 'store', token: '12345' });
62
+ act(() => {
63
+ store.dispatch.login.logInUser({ username: 'store', token: '12345' });
64
+ });
63
65
 
64
66
  await waitFor(() => {
65
67
  expect(screen.getByTestId('logInDialogIcon')).toBeTruthy();
@@ -78,13 +80,13 @@ describe('<Header /> component with logged in state', () => {
78
80
  const loginBtn = screen.getByTestId('header--button-login');
79
81
  fireEvent.click(loginBtn);
80
82
 
81
- const loginDialog = await waitFor(() => screen.getByTestId('login--dialog'));
83
+ const loginDialog = await waitFor(() => screen.findByTestId('login--dialog'));
82
84
 
83
85
  expect(loginDialog).toBeTruthy();
84
86
  });
85
87
 
86
88
  test('should login and logout the user', async () => {
87
- const { getByText, getByTestId } = renderWithStore(
89
+ const { getByText, getByTestId, findByText, findByTestId } = renderWithStore(
88
90
  <Router>
89
91
  <Header />
90
92
  </Router>,
@@ -104,14 +106,14 @@ describe('<Header /> component with logged in state', () => {
104
106
  await act(async () => {
105
107
  fireEvent.click(signInButton);
106
108
  });
107
- await waitFor(() => getByTestId('logInDialogIcon'));
109
+ await waitFor(() => findByTestId('logInDialogIcon'));
108
110
  const headerMenuAccountCircle = getByTestId('logInDialogIcon');
109
111
  fireEvent.click(headerMenuAccountCircle);
110
112
 
111
113
  // // wait for button Logout's appearance and return the element
112
- const logoutBtn = await waitFor(() => getByText('button.logout'));
114
+ const logoutBtn = await waitFor(() => findByText('button.logout'));
113
115
  fireEvent.click(logoutBtn);
114
- await waitFor(() => getByText('button.login'));
116
+ await waitFor(() => findByText('button.login'));
115
117
  expect(getByText('button.login')).toBeTruthy();
116
118
  });
117
119
 
@@ -169,12 +171,12 @@ describe('<Header /> component with logged in state', () => {
169
171
  expect(infoBtn).toBeInTheDocument();
170
172
  fireEvent.click(infoBtn);
171
173
  // wait for registrationInfo modal appearance and return the element
172
- const registrationInfoModal = await waitFor(() => screen.getByTestId('registryInfo--dialog'));
174
+ const registrationInfoModal = await waitFor(() => screen.findByTestId('registryInfo--dialog'));
173
175
  expect(registrationInfoModal).toBeTruthy();
174
176
  });
175
177
 
176
178
  test('should close the registrationInfo modal when clicking on the button close', async () => {
177
- const { getByTestId, getByText, queryByTestId } = renderWithStore(
179
+ const { getByTestId, findByText, queryByTestId } = renderWithStore(
178
180
  <Router>
179
181
  <Header HeaderInfoDialog={CustomInfoDialog} />
180
182
  </Router>,
@@ -185,7 +187,7 @@ describe('<Header /> component with logged in state', () => {
185
187
  fireEvent.click(infoBtn);
186
188
 
187
189
  // wait for Close's button of registrationInfo modal appearance and return the element
188
- const closeBtn = await waitFor(() => getByText('button.close'));
190
+ const closeBtn = await waitFor(() => findByText('button.close'));
189
191
  fireEvent.click(closeBtn);
190
192
 
191
193
  const hasRegistrationInfoModalBeenRemoved = await waitForElementToBeRemoved(() =>
@@ -1,29 +1,37 @@
1
- import styled from '@emotion/styled';
1
+ import Toolbar from '@mui/material/Toolbar';
2
2
  import React from 'react';
3
- import { Link } from 'react-router-dom';
3
+ import { Link as RouterLink } from 'react-router-dom';
4
4
 
5
5
  import { Logo, Search } from '../../';
6
- import { LeftSide, SearchWrapper } from './styles';
6
+ import { SearchWrapper } from './styles';
7
7
 
8
8
  interface Props {
9
9
  showSearch?: boolean;
10
10
  }
11
11
 
12
- const StyledLink = styled(Link)({
13
- marginRight: '1em',
14
- });
15
-
16
12
  const HeaderLeft: React.FC<Props> = ({ showSearch }) => (
17
- <LeftSide>
18
- <StyledLink to={'/'}>
13
+ <Toolbar
14
+ sx={{
15
+ display: 'flex',
16
+ padding: 0,
17
+ marginLeft: 1,
18
+ flex: 1,
19
+ '@media (min-width: 600px)': {
20
+ padding: 0,
21
+ marginLeft: 1,
22
+ marginRight: '20px',
23
+ },
24
+ }}
25
+ >
26
+ <RouterLink to={'/'}>
19
27
  <Logo />
20
- </StyledLink>
28
+ </RouterLink>
21
29
  {showSearch && (
22
30
  <SearchWrapper data-testid="search-container">
23
31
  <Search />
24
32
  </SearchWrapper>
25
33
  )}
26
- </LeftSide>
34
+ </Toolbar>
27
35
  );
28
36
 
29
37
  export default HeaderLeft;