@verdaccio/ui-theme 6.0.0-6-next.9 → 6.0.0-6-next.13

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 (323) hide show
  1. package/.babelrc +1 -1
  2. package/.eslintrc +0 -15
  3. package/CHANGELOG.md +61 -0
  4. package/jest/api/packages.json +42 -0
  5. package/jest/jest.config.js +2 -2
  6. package/jest/server-handlers.ts +9 -0
  7. package/jest/server.ts +6 -0
  8. package/jest/setup-env.ts +18 -0
  9. package/jest/setup.ts +2 -7
  10. package/jest/unit/components/__mocks__/token.ts +0 -1
  11. package/jest/unit/components/store/login.ts +1 -0
  12. package/package.json +43 -33
  13. package/src/App/App.test.tsx +75 -51
  14. package/src/App/App.tsx +7 -42
  15. package/src/App/AppRoute.tsx +3 -16
  16. package/src/App/Footer/Footer.test.tsx +0 -1
  17. package/src/App/Footer/Footer.tsx +35 -22
  18. package/src/App/Footer/__snapshots__/Footer.test.tsx.snap +208 -302
  19. package/src/App/Footer/styles.ts +2 -3
  20. package/src/App/Header/Header.test.tsx +53 -61
  21. package/src/App/Header/Header.tsx +13 -24
  22. package/src/App/Header/HeaderGreetings.tsx +0 -1
  23. package/src/App/Header/HeaderLeft.tsx +0 -1
  24. package/src/App/Header/HeaderMenu.tsx +6 -6
  25. package/src/App/Header/HeaderRight.tsx +1 -2
  26. package/src/App/Header/HeaderToolTip.tsx +0 -1
  27. package/src/App/Header/HeaderToolTipIcon.tsx +10 -10
  28. package/src/App/Header/LanguageSwitch.tsx +17 -79
  29. package/src/App/Header/LoginDialog/LoginDialog.test.tsx +25 -35
  30. package/src/App/Header/LoginDialog/LoginDialog.tsx +28 -46
  31. package/src/App/Header/LoginDialog/LoginDialogCloseButton.tsx +1 -2
  32. package/src/App/Header/LoginDialog/LoginDialogForm.tsx +0 -1
  33. package/src/App/Header/LoginDialog/LoginDialogFormError.tsx +1 -2
  34. package/src/App/Header/LoginDialog/LoginDialogHeader.tsx +4 -4
  35. package/src/App/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +1 -3
  36. package/src/App/Header/RegistryInfoContent/RegistryInfoContent.tsx +9 -10
  37. package/src/App/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +1 -2
  38. package/src/App/Header/RegistryInfoDialog/styles.ts +0 -1
  39. package/src/App/Header/Search/Search.test.tsx +48 -43
  40. package/src/App/Header/Search/Search.tsx +23 -108
  41. package/src/App/Header/Search/__snapshots__/Search.test.tsx.snap +392 -28
  42. package/src/App/Header/styles.ts +2 -3
  43. package/src/App/index.ts +0 -1
  44. package/src/App/utils/loadable.tsx +3 -1
  45. package/src/components/ActionBar/ActionBar.test.tsx +13 -14
  46. package/src/components/ActionBar/ActionBar.tsx +0 -2
  47. package/src/components/ActionBar/ActionBarAction.tsx +11 -14
  48. package/src/components/ActionBar/__snapshots__/ActionBar.test.tsx.snap +198 -53
  49. package/src/components/AppBar.tsx +1 -1
  50. package/src/components/Author/Author.test.tsx +1 -4
  51. package/src/components/Author/Author.tsx +2 -4
  52. package/src/components/Author/__snapshots__/Author.test.tsx.snap +804 -48
  53. package/src/components/Author/styles.ts +0 -1
  54. package/src/components/AutoComplete/AutoComplete.tsx +85 -163
  55. package/src/components/AutoComplete/AutoCompleteV2.tsx +8 -10
  56. package/src/components/AutoComplete/styles.tsx +0 -15
  57. package/src/components/Avatar.tsx +1 -1
  58. package/src/components/Box.tsx +1 -1
  59. package/src/components/Button.tsx +1 -1
  60. package/src/components/Card.tsx +1 -1
  61. package/src/components/CardActions.tsx +1 -1
  62. package/src/components/CardContent.tsx +1 -1
  63. package/src/components/Chip.tsx +1 -1
  64. package/src/components/CircularProgress.tsx +2 -2
  65. package/src/components/CopyToClipBoard.tsx +2 -3
  66. package/src/components/Dialog.tsx +1 -1
  67. package/src/components/DialogActions.tsx +2 -2
  68. package/src/components/DialogContent.tsx +2 -2
  69. package/src/components/DialogTitle.tsx +1 -1
  70. package/src/components/Divider.tsx +1 -1
  71. package/src/components/FloatingActionButton.tsx +1 -1
  72. package/src/components/FormControl.tsx +1 -1
  73. package/src/components/FormHelperText.tsx +2 -2
  74. package/src/components/Grid.tsx +1 -1
  75. package/src/components/Heading.tsx +1 -1
  76. package/src/components/IconButton.tsx +1 -1
  77. package/src/components/Icons/index.ts +1 -17
  78. package/src/components/Input.tsx +1 -1
  79. package/src/components/InputAdornment/InputAdornment.tsx +2 -2
  80. package/src/components/InputLabel.tsx +1 -1
  81. package/src/components/Label/Label.test.tsx +0 -1
  82. package/src/components/Label/Label.tsx +2 -3
  83. package/src/components/List.tsx +1 -1
  84. package/src/components/ListItem.tsx +1 -1
  85. package/src/components/ListItemText.tsx +1 -4
  86. package/src/components/Loading/Loading.test.tsx +0 -1
  87. package/src/components/Loading/Loading.tsx +1 -2
  88. package/src/components/Loading/Spinner/Spinner.test.tsx +1 -2
  89. package/src/components/Loading/Spinner/Spinner.tsx +1 -2
  90. package/src/components/Loading/Spinner/__snapshots__/Spinner.test.tsx.snap +114 -16
  91. package/src/components/Loading/__snapshots__/Loading.test.tsx.snap +63 -11
  92. package/src/components/Loading/styles.ts +1 -2
  93. package/src/components/Logo/Logo.test.tsx +0 -1
  94. package/src/components/Logo/Logo.tsx +1 -2
  95. package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +2 -0
  96. package/src/components/Menu.tsx +1 -1
  97. package/src/components/MenuItem.tsx +1 -1
  98. package/src/components/NotFound/NotFound.tsx +1 -3
  99. package/src/components/NotFound/Notfound.test.tsx +1 -2
  100. package/src/components/NotFound/__snapshots__/Notfound.test.tsx.snap +138 -11
  101. package/src/components/NotFound/styles.ts +0 -1
  102. package/src/components/Paper.tsx +1 -1
  103. package/src/components/SnackbarContent.tsx +1 -1
  104. package/src/components/SvgIcon.tsx +1 -1
  105. package/src/components/Tab.tsx +1 -1
  106. package/src/components/Tabs.tsx +1 -1
  107. package/src/components/Text/Text.tsx +1 -1
  108. package/src/components/Text/TextConfig.ts +1 -1
  109. package/src/components/TextField/TextField.test.tsx +0 -1
  110. package/src/components/TextField/TextField.tsx +2 -2
  111. package/src/components/TextField/__snapshots__/TextField.test.tsx.snap +216 -3
  112. package/src/components/Toolbar.tsx +1 -1
  113. package/src/components/Tooltip.tsx +1 -1
  114. package/src/design-tokens/ResetStyles.tsx +1 -1
  115. package/src/design-tokens/StyleBaseline.tsx +2 -2
  116. package/src/design-tokens/ThemeContext.ts +1 -1
  117. package/src/design-tokens/ThemeProvider.tsx +15 -12
  118. package/src/design-tokens/theme.ts +28 -26
  119. package/src/design-tokens/useTheme.ts +1 -1
  120. package/src/{design-tokens → hooks}/useLocalStorage.ts +0 -0
  121. package/src/{design-tokens → hooks}/useOnClickOutside.ts +0 -0
  122. package/src/i18n/ABOUT_TRANSLATIONS.md +13 -0
  123. package/src/i18n/__mocks__/loadTranslationFile.ts +5 -0
  124. package/src/i18n/config.ts +38 -0
  125. package/src/i18n/crowdin/ui.json +170 -0
  126. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/cs-CZ.json +0 -0
  127. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/de-DE.json +0 -0
  128. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/en-US.json +0 -0
  129. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/es-ES.json +0 -0
  130. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/fr-FR.json +0 -0
  131. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/ja-JP.json +0 -0
  132. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/km-KH.json +0 -0
  133. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/pt-BR.json +0 -0
  134. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/ru-RU.json +0 -0
  135. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/tr-TR.json +0 -0
  136. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/uk-UA.json +0 -0
  137. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/zh-CN.json +0 -0
  138. package/{i18n/translations → src/i18n/deprecated_translations_dont_use}/zh-TW.json +0 -0
  139. package/src/i18n/download_translations/ar-SA/ui.json +170 -0
  140. package/src/i18n/download_translations/cs-CZ/ui.json +170 -0
  141. package/src/i18n/download_translations/de-DE/ui.json +170 -0
  142. package/src/i18n/download_translations/es-ES/ui.json +170 -0
  143. package/src/i18n/download_translations/fi-FI/ui.json +170 -0
  144. package/src/i18n/download_translations/fil-PH/ui.json +170 -0
  145. package/src/i18n/download_translations/fr-FR/ui.json +170 -0
  146. package/src/i18n/download_translations/gl-ES/ui.json +170 -0
  147. package/src/i18n/download_translations/hi-IN/ui.json +170 -0
  148. package/src/i18n/download_translations/it-IT/ui.json +170 -0
  149. package/src/i18n/download_translations/ja-JP/ui.json +170 -0
  150. package/src/i18n/download_translations/km-KH/ui.json +170 -0
  151. package/src/i18n/download_translations/ko-KR/ui.json +170 -0
  152. package/src/i18n/download_translations/pl-PL/ui.json +170 -0
  153. package/src/i18n/download_translations/pt-BR/ui.json +170 -0
  154. package/src/i18n/download_translations/pt-PT/ui.json +170 -0
  155. package/src/i18n/download_translations/ro-RO/ui.json +170 -0
  156. package/src/i18n/download_translations/ru-RU/ui.json +170 -0
  157. package/src/i18n/download_translations/si-LK/ui.json +170 -0
  158. package/src/i18n/download_translations/sr-CS/ui.json +170 -0
  159. package/src/i18n/download_translations/sr-SP/ui.json +170 -0
  160. package/src/i18n/download_translations/tg-TJ/ui.json +170 -0
  161. package/src/i18n/download_translations/tr-TR/ui.json +170 -0
  162. package/src/i18n/download_translations/uk-UA/ui.json +170 -0
  163. package/src/i18n/download_translations/vi-VN/ui.json +170 -0
  164. package/src/i18n/download_translations/yo-NG/ui.json +170 -0
  165. package/src/i18n/download_translations/zh-CN/ui.json +170 -0
  166. package/src/i18n/download_translations/zh-TW/ui.json +170 -0
  167. package/src/i18n/enabledLanguages.ts +35 -0
  168. package/src/i18n/loadTranslationFile.ts +14 -0
  169. package/src/index.tsx +13 -11
  170. package/src/pages/Version/DetailContainer/Dependencies/Dependencies.test.tsx +0 -2
  171. package/src/pages/Version/DetailContainer/Dependencies/Dependencies.tsx +1 -3
  172. package/src/pages/Version/DetailContainer/Dependencies/styles.ts +0 -1
  173. package/src/pages/Version/DetailContainer/Deprecated/Deprecated.test.tsx +1 -3
  174. package/src/pages/Version/DetailContainer/Deprecated/Deprecated.tsx +2 -3
  175. package/src/pages/Version/DetailContainer/DetailContainer.test.tsx +0 -1
  176. package/src/pages/Version/DetailContainer/DetailContainer.tsx +1 -3
  177. package/src/pages/Version/DetailContainer/DetailContainerContent.tsx +0 -1
  178. package/src/pages/Version/DetailContainer/DetailContainerContentReadme.tsx +0 -1
  179. package/src/pages/Version/DetailContainer/DetailContainerTabs.tsx +0 -1
  180. package/src/pages/Version/DetailContainer/NoItems/NoItems.tsx +0 -1
  181. package/src/pages/Version/DetailContainer/NoItems/Noitems.test.tsx +0 -1
  182. package/src/pages/Version/DetailContainer/NoItems/__snapshots__/Noitems.test.tsx.snap +10 -1
  183. package/src/pages/Version/DetailContainer/Readme/Readme.spec.tsx +1 -2
  184. package/src/pages/Version/DetailContainer/Readme/Readme.tsx +1 -2
  185. package/src/pages/Version/DetailContainer/UpLinks/UpLinks.test.tsx +1 -9
  186. package/src/pages/Version/DetailContainer/UpLinks/UpLinks.tsx +1 -3
  187. package/src/pages/Version/DetailContainer/UpLinks/__snapshots__/UpLinks.test.tsx.snap +184 -26
  188. package/src/pages/Version/DetailContainer/UpLinks/styles.ts +2 -3
  189. package/src/pages/Version/DetailContainer/Versions/Versions.test.tsx +3 -5
  190. package/src/pages/Version/DetailContainer/Versions/Versions.tsx +1 -2
  191. package/src/pages/Version/DetailContainer/Versions/VersionsHistoryList.tsx +2 -4
  192. package/src/pages/Version/DetailContainer/Versions/VersionsTagList.tsx +1 -3
  193. package/src/pages/Version/DetailContainer/Versions/styles.ts +2 -3
  194. package/src/pages/Version/DetailContainer/__snapshots__/DetailContainer.test.tsx.snap +168 -34
  195. package/src/pages/Version/DetailSidebar/DetailSidebar.tsx +0 -2
  196. package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.test.tsx +0 -2
  197. package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.tsx +1 -2
  198. package/src/pages/Version/DetailSidebar/DetailSidebarTitle.tsx +0 -1
  199. package/src/pages/Version/DetailSidebar/Developers/Developers.test.tsx +3 -5
  200. package/src/pages/Version/DetailSidebar/Developers/Developers.tsx +3 -5
  201. package/src/pages/Version/DetailSidebar/Developers/DevelopersTitle.tsx +0 -1
  202. package/src/pages/Version/DetailSidebar/Developers/__snapshots__/Developers.test.tsx.snap +328 -40
  203. package/src/pages/Version/DetailSidebar/Developers/styles.ts +0 -1
  204. package/src/pages/Version/DetailSidebar/Dist/Dist.test.tsx +1 -3
  205. package/src/pages/Version/DetailSidebar/Dist/Dist.tsx +1 -3
  206. package/src/pages/Version/DetailSidebar/Dist/__snapshots__/Dist.test.tsx.snap +1436 -74
  207. package/src/pages/Version/DetailSidebar/Dist/styles.ts +2 -1
  208. package/src/pages/Version/DetailSidebar/Engines/Engines.test.tsx +1 -3
  209. package/src/pages/Version/DetailSidebar/Engines/Engines.tsx +1 -3
  210. package/src/pages/Version/DetailSidebar/Engines/styles.ts +0 -1
  211. package/src/pages/Version/DetailSidebar/Install/Install.test.tsx +1 -3
  212. package/src/pages/Version/DetailSidebar/Install/Install.tsx +0 -2
  213. package/src/pages/Version/DetailSidebar/Install/InstallListItem.tsx +0 -1
  214. package/src/pages/Version/DetailSidebar/Repository/Repository.test.tsx +1 -3
  215. package/src/pages/Version/DetailSidebar/Repository/Repository.tsx +1 -3
  216. package/src/pages/Version/Version.test.tsx +3 -5
  217. package/src/pages/Version/Version.tsx +21 -6
  218. package/src/pages/Version/VersionContextProvider.tsx +14 -45
  219. package/src/pages/Version/VersionLayout.tsx +1 -1
  220. package/src/pages/Version/context.ts +1 -1
  221. package/src/pages/home/Home.tsx +9 -28
  222. package/src/pages/home/PackageList/Help/Help.test.tsx +0 -1
  223. package/src/pages/home/PackageList/Help/Help.tsx +0 -1
  224. package/src/pages/home/PackageList/Help/__snapshots__/Help.test.tsx.snap +298 -59
  225. package/src/pages/home/PackageList/Help/styles.ts +0 -1
  226. package/src/pages/home/PackageList/Package/Package.test.tsx +5 -4
  227. package/src/pages/home/PackageList/Package/Package.tsx +20 -28
  228. package/src/pages/home/PackageList/Package/Tag/Tag.test.tsx +0 -1
  229. package/src/pages/home/PackageList/Package/styles.ts +5 -6
  230. package/src/pages/home/PackageList/PackageList.tsx +17 -17
  231. package/src/pages/home/PackageList/Packagelist.test.tsx +6 -5
  232. package/src/providers/API/api.test.ts +1 -0
  233. package/src/providers/API/api.ts +7 -3
  234. package/src/providers/config/AppConfigurationProvider.tsx +3 -3
  235. package/src/store/index.ts +1 -0
  236. package/src/store/models/configuration.ts +41 -0
  237. package/src/store/models/download.ts +30 -0
  238. package/src/store/models/index.ts +18 -0
  239. package/src/store/models/login.ts +92 -0
  240. package/src/store/models/manifest.ts +91 -0
  241. package/src/store/models/packages.ts +36 -0
  242. package/src/store/models/search.ts +81 -0
  243. package/src/store/store.ts +15 -0
  244. package/src/utils/login.test.ts +3 -4
  245. package/src/utils/package.test.ts +2 -3
  246. package/src/utils/package.ts +2 -1
  247. package/src/utils/sec-utils.ts +1 -1
  248. package/src/utils/test-react-testing-library.tsx +22 -5
  249. package/src/utils/url.test.ts +1 -1
  250. package/src/utils/url.ts +1 -0
  251. package/static/Dependencies.15768a14646212b71166.js +2 -0
  252. package/static/Dependencies.15768a14646212b71166.js.LICENSE.txt +78 -0
  253. package/static/Dist.15768a14646212b71166.js +2 -0
  254. package/static/Dist.15768a14646212b71166.js.LICENSE.txt +60 -0
  255. package/static/Engines.15768a14646212b71166.js +2 -0
  256. package/static/Engines.15768a14646212b71166.js.LICENSE.txt +66 -0
  257. package/static/Home.15768a14646212b71166.js +2 -0
  258. package/static/Home.15768a14646212b71166.js.LICENSE.txt +222 -0
  259. package/static/Install.15768a14646212b71166.js +2 -0
  260. package/static/Install.15768a14646212b71166.js.LICENSE.txt +66 -0
  261. package/static/NotFound.15768a14646212b71166.js +2 -0
  262. package/static/NotFound.15768a14646212b71166.js.LICENSE.txt +40 -0
  263. package/static/Provider.15768a14646212b71166.js +2 -0
  264. package/static/Provider.15768a14646212b71166.js.LICENSE.txt +32 -0
  265. package/static/Repository.15768a14646212b71166.js +2 -0
  266. package/static/Repository.15768a14646212b71166.js.LICENSE.txt +50 -0
  267. package/static/UpLinks.15768a14646212b71166.js +2 -0
  268. package/static/UpLinks.15768a14646212b71166.js.LICENSE.txt +56 -0
  269. package/static/Version.15768a14646212b71166.js +2 -0
  270. package/static/Version.15768a14646212b71166.js.LICENSE.txt +380 -0
  271. package/static/Versions.15768a14646212b71166.js +2 -0
  272. package/static/Versions.15768a14646212b71166.js.LICENSE.txt +64 -0
  273. package/static/index.html +1 -1
  274. package/static/main.15768a14646212b71166.js +2 -0
  275. package/static/main.15768a14646212b71166.js.LICENSE.txt +972 -0
  276. package/static/manifest.json +17 -3
  277. package/static/runtime.15768a14646212b71166.js +2 -0
  278. package/static/{runtime.9525ddaaf85378590c63.js.LICENSE.txt → runtime.15768a14646212b71166.js.LICENSE.txt} +2 -2
  279. package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-123400.15768a14646212b71166.js +2 -0
  280. package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-123400.15768a14646212b71166.js.LICENSE.txt +148 -0
  281. package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-d2b578.15768a14646212b71166.js +2 -0
  282. package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-d2b578.15768a14646212b71166.js.LICENSE.txt +218 -0
  283. package/static/vendors-node_modules_pnpm_mui_material_5_0_6_033766d34292bd5d464212fd95cb4b6d_node_modules_mu-1fb115.15768a14646212b71166.js +2 -0
  284. package/static/vendors-node_modules_pnpm_mui_material_5_0_6_033766d34292bd5d464212fd95cb4b6d_node_modules_mu-1fb115.15768a14646212b71166.js.LICENSE.txt +316 -0
  285. package/static/vendors.15768a14646212b71166.js +103 -0
  286. package/static/vendors.15768a14646212b71166.js.LICENSE.txt +3158 -0
  287. package/tools/dev.server.js +0 -1
  288. package/tools/webpack.dev.config.babel.js +1 -3
  289. package/tools/webpack.prod.config.babel.js +1 -1
  290. package/tsconfig.json +1 -3
  291. package/types/index.ts +3 -20
  292. package/i18n/config.ts +0 -94
  293. package/src/App/AppContext.ts +0 -18
  294. package/src/App/AppContextProvider.tsx +0 -44
  295. package/src/App/Header/Search/SearchAdornment.tsx +0 -18
  296. package/src/components/Icons/Austria.tsx +0 -23
  297. package/src/components/Icons/Brazil.tsx +0 -44
  298. package/src/components/Icons/China.tsx +0 -33
  299. package/src/components/Icons/Czech.tsx +0 -21
  300. package/src/components/Icons/France.tsx +0 -27
  301. package/src/components/Icons/Germany.tsx +0 -27
  302. package/src/components/Icons/India.tsx +0 -44
  303. package/src/components/Icons/Japan.tsx +0 -23
  304. package/src/components/Icons/Khmer.tsx +0 -40
  305. package/src/components/Icons/Nicaragua.tsx +0 -66
  306. package/src/components/Icons/Russia.tsx +0 -27
  307. package/src/components/Icons/Spain.tsx +0 -43
  308. package/src/components/Icons/Taiwan.tsx +0 -25
  309. package/src/components/Icons/Turkey.tsx +0 -23
  310. package/src/components/Icons/Ukraine.tsx +0 -30
  311. package/src/components/Icons/Usa.tsx +0 -34
  312. package/src/design-tokens/emotion.ts +0 -5
  313. package/src/lib/constants.ts +0 -9
  314. package/src/pages/Version/DetailSidebar/ActionBar/ActionBar.test.tsx +0 -84
  315. package/src/pages/Version/DetailSidebar/ActionBar/__snapshots__/ActionBar.test.tsx.snap +0 -122
  316. package/src/pages/Version/is-package-version-valid.ts +0 -19
  317. package/src/providers/API/APIProvider.tsx +0 -109
  318. package/src/providers/API/index.ts +0 -1
  319. package/static/main.9525ddaaf85378590c63.js +0 -2
  320. package/static/main.9525ddaaf85378590c63.js.LICENSE.txt +0 -1588
  321. package/static/runtime.9525ddaaf85378590c63.js +0 -2
  322. package/static/vendors.9525ddaaf85378590c63.js +0 -2
  323. package/static/vendors.9525ddaaf85378590c63.js.LICENSE.txt +0 -4540
@@ -3,50 +3,409 @@
3
3
  exports[`<Search /> component should load the component in default state 1`] = `
4
4
  .emotion-0 {
5
5
  width: 100%;
6
- height: 32px;
7
6
  position: relative;
8
7
  z-index: 1;
9
8
  }
10
9
 
11
- .emotion-2 .MuiInputBase-root:before {
10
+ .emotion-2 {
11
+ width: 100%;
12
+ }
13
+
14
+ .emotion-2.Mui-focused .MuiAutocomplete-clearIndicator {
15
+ visibility: visible;
16
+ }
17
+
18
+ @media (pointer: fine) {
19
+ .emotion-2:hover .MuiAutocomplete-clearIndicator {
20
+ visibility: visible;
21
+ }
22
+ }
23
+
24
+ .emotion-2 .MuiAutocomplete-tag {
25
+ margin: 3px;
26
+ max-width: calc(100% - 6px);
27
+ }
28
+
29
+ .emotion-2 .MuiAutocomplete-inputRoot {
30
+ -webkit-box-flex-wrap: wrap;
31
+ -webkit-flex-wrap: wrap;
32
+ -ms-flex-wrap: wrap;
33
+ flex-wrap: wrap;
34
+ }
35
+
36
+ .MuiAutocomplete-hasPopupIcon.emotion-2 .MuiAutocomplete-inputRoot,
37
+ .MuiAutocomplete-hasClearIcon.emotion-2 .MuiAutocomplete-inputRoot {
38
+ padding-right: 30px;
39
+ }
40
+
41
+ .MuiAutocomplete-hasPopupIcon.MuiAutocomplete-hasClearIcon.emotion-2 .MuiAutocomplete-inputRoot {
42
+ padding-right: 56px;
43
+ }
44
+
45
+ .emotion-2 .MuiAutocomplete-inputRoot .MuiAutocomplete-input {
46
+ width: 0;
47
+ min-width: 30px;
48
+ }
49
+
50
+ .emotion-2 .MuiInput-root {
51
+ padding-bottom: 1px;
52
+ }
53
+
54
+ .emotion-2 .MuiInput-root .MuiInput-input {
55
+ padding: 4px 4px 4px 0px;
56
+ }
57
+
58
+ .emotion-2 .MuiInput-root.MuiInputBase-sizeSmall .MuiInput-input {
59
+ padding: 2px 4px 3px 0;
60
+ }
61
+
62
+ .emotion-2 .MuiOutlinedInput-root {
63
+ padding: 9px;
64
+ }
65
+
66
+ .MuiAutocomplete-hasPopupIcon.emotion-2 .MuiOutlinedInput-root,
67
+ .MuiAutocomplete-hasClearIcon.emotion-2 .MuiOutlinedInput-root {
68
+ padding-right: 39px;
69
+ }
70
+
71
+ .MuiAutocomplete-hasPopupIcon.MuiAutocomplete-hasClearIcon.emotion-2 .MuiOutlinedInput-root {
72
+ padding-right: 65px;
73
+ }
74
+
75
+ .emotion-2 .MuiOutlinedInput-root .MuiAutocomplete-input {
76
+ padding: 7.5px 4px 7.5px 6px;
77
+ }
78
+
79
+ .emotion-2 .MuiOutlinedInput-root .MuiAutocomplete-endAdornment {
80
+ right: 9px;
81
+ }
82
+
83
+ .emotion-2 .MuiOutlinedInput-root.MuiInputBase-sizeSmall {
84
+ padding: 6px;
85
+ }
86
+
87
+ .emotion-2 .MuiOutlinedInput-root.MuiInputBase-sizeSmall .MuiAutocomplete-input {
88
+ padding: 2.5px 4px 2.5px 6px;
89
+ }
90
+
91
+ .emotion-2 .MuiFilledInput-root {
92
+ padding-top: 19px;
93
+ padding-left: 8px;
94
+ }
95
+
96
+ .MuiAutocomplete-hasPopupIcon.emotion-2 .MuiFilledInput-root,
97
+ .MuiAutocomplete-hasClearIcon.emotion-2 .MuiFilledInput-root {
98
+ padding-right: 39px;
99
+ }
100
+
101
+ .MuiAutocomplete-hasPopupIcon.MuiAutocomplete-hasClearIcon.emotion-2 .MuiFilledInput-root {
102
+ padding-right: 65px;
103
+ }
104
+
105
+ .emotion-2 .MuiFilledInput-root .MuiFilledInput-input {
106
+ padding: 7px 4px;
107
+ }
108
+
109
+ .emotion-2 .MuiFilledInput-root .MuiAutocomplete-endAdornment {
110
+ right: 9px;
111
+ }
112
+
113
+ .emotion-2 .MuiFilledInput-root.MuiInputBase-sizeSmall {
114
+ padding-bottom: 1px;
115
+ }
116
+
117
+ .emotion-2 .MuiFilledInput-root.MuiInputBase-sizeSmall .MuiFilledInput-input {
118
+ padding: 2.5px 4px;
119
+ }
120
+
121
+ .emotion-2 .MuiAutocomplete-input {
122
+ -webkit-box-flex: 1;
123
+ -webkit-flex-grow: 1;
124
+ -ms-flex-positive: 1;
125
+ flex-grow: 1;
126
+ text-overflow: ellipsis;
127
+ opacity: 1;
128
+ }
129
+
130
+ .emotion-4 {
131
+ display: -webkit-inline-box;
132
+ display: -webkit-inline-flex;
133
+ display: -ms-inline-flexbox;
134
+ display: inline-flex;
135
+ -webkit-flex-direction: column;
136
+ -ms-flex-direction: column;
137
+ flex-direction: column;
138
+ position: relative;
139
+ min-width: 0;
140
+ padding: 0;
141
+ margin: 0;
142
+ border: 0;
143
+ vertical-align: top;
144
+ width: 100%;
145
+ }
146
+
147
+ .emotion-4 .MuiInputBase-root:before {
12
148
  content: '';
13
149
  border: none;
14
150
  }
15
151
 
16
- .emotion-2 .MuiInputBase-root:after {
152
+ .emotion-4 .MuiInputBase-root:after {
17
153
  border-color: #fff;
18
154
  }
19
155
 
20
- .emotion-2 .MuiInputBase-root:hover:before {
156
+ .emotion-4 .MuiInputBase-root:hover:before {
21
157
  content: none;
22
158
  }
23
159
 
24
- .emotion-2 .MuiInputBase-root:hover:after {
160
+ .emotion-4 .MuiInputBase-root:hover:after {
25
161
  content: none;
26
162
  -webkit-transform: scaleX(1);
163
+ -moz-transform: scaleX(1);
27
164
  -ms-transform: scaleX(1);
28
165
  transform: scaleX(1);
29
166
  }
30
167
 
31
- @media screen and (min-width:768px) {
32
- .emotion-2 .MuiInputBase-root:hover:after {
168
+ @media screen and (min-width: 768px) {
169
+ .emotion-4 .MuiInputBase-root:hover:after {
33
170
  content: '';
34
171
  }
35
172
  }
36
173
 
37
- @media screen and (min-width:768px) {
38
- .emotion-2 .MuiInputBase-input {
174
+ @media screen and (min-width: 768px) {
175
+ .emotion-4 .MuiInputBase-input {
39
176
  color: #fff;
40
177
  }
41
178
  }
42
179
 
43
- .emotion-4 {
180
+ .emotion-5 {
181
+ font-family: -apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
182
+ font-weight: 400;
183
+ font-size: 1rem;
184
+ line-height: 1.4375em;
185
+ color: rgba(0, 0, 0, 0.87);
186
+ box-sizing: border-box;
187
+ position: relative;
188
+ cursor: text;
189
+ display: -webkit-inline-box;
190
+ display: -webkit-inline-flex;
191
+ display: -ms-inline-flexbox;
192
+ display: inline-flex;
193
+ -webkit-align-items: center;
194
+ -webkit-box-align: center;
195
+ -ms-flex-align: center;
196
+ align-items: center;
197
+ width: 100%;
198
+ position: relative;
199
+ }
200
+
201
+ .emotion-5.Mui-disabled {
202
+ color: rgba(0, 0, 0, 0.38);
203
+ cursor: default;
204
+ }
205
+
206
+ label+.emotion-5 {
207
+ margin-top: 16px;
208
+ }
209
+
210
+ .emotion-5:after {
211
+ border-bottom: 2px solid #4b5e40;
212
+ left: 0;
213
+ bottom: 0;
214
+ content: "";
215
+ position: absolute;
216
+ right: 0;
217
+ -webkit-transform: scaleX(0);
218
+ -moz-transform: scaleX(0);
219
+ -ms-transform: scaleX(0);
220
+ transform: scaleX(0);
221
+ -webkit-transition: -webkit-transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;
222
+ transition: transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;
223
+ pointer-events: none;
224
+ }
225
+
226
+ .emotion-5.Mui-focused:after {
227
+ -webkit-transform: scaleX(1);
228
+ -moz-transform: scaleX(1);
229
+ -ms-transform: scaleX(1);
230
+ transform: scaleX(1);
231
+ }
232
+
233
+ .emotion-5.Mui-error:after {
234
+ border-bottom-color: #d32f2f;
235
+ -webkit-transform: scaleX(1);
236
+ -moz-transform: scaleX(1);
237
+ -ms-transform: scaleX(1);
238
+ transform: scaleX(1);
239
+ }
240
+
241
+ .emotion-5:before {
242
+ border-bottom: 1px solid rgba(0, 0, 0, 0.42);
243
+ left: 0;
244
+ bottom: 0;
245
+ content: "\\00a0";
246
+ position: absolute;
247
+ right: 0;
248
+ -webkit-transition: border-bottom-color 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
249
+ transition: border-bottom-color 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
250
+ pointer-events: none;
251
+ }
252
+
253
+ .emotion-5:hover:not(.Mui-disabled):before {
254
+ border-bottom: 2px solid rgba(0, 0, 0, 0.87);
255
+ }
256
+
257
+ @media (hover: none) {
258
+ .emotion-5:hover:not(.Mui-disabled):before {
259
+ border-bottom: 1px solid rgba(0, 0, 0, 0.42);
260
+ }
261
+ }
262
+
263
+ .emotion-5.Mui-disabled:before {
264
+ border-bottom-style: dotted;
265
+ }
266
+
267
+ .emotion-7 {
268
+ display: -webkit-box;
269
+ display: -webkit-flex;
270
+ display: -ms-flexbox;
271
+ display: flex;
272
+ height: 0.01em;
273
+ max-height: 2em;
274
+ -webkit-align-items: center;
275
+ -webkit-box-align: center;
276
+ -ms-flex-align: center;
277
+ align-items: center;
278
+ white-space: nowrap;
279
+ color: rgba(0, 0, 0, 0.54);
280
+ margin-right: 8px;
44
281
  color: #fff;
45
282
  }
46
283
 
47
- .emotion-6 {
48
- max-height: 500px;
49
- overflow-y: auto;
284
+ .emotion-8 {
285
+ -webkit-user-select: none;
286
+ -moz-user-select: none;
287
+ -ms-user-select: none;
288
+ user-select: none;
289
+ width: 1em;
290
+ height: 1em;
291
+ display: inline-block;
292
+ fill: currentColor;
293
+ -webkit-flex-shrink: 0;
294
+ -ms-flex-negative: 0;
295
+ flex-shrink: 0;
296
+ -webkit-transition: fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
297
+ transition: fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
298
+ font-size: 1.5rem;
299
+ }
300
+
301
+ .emotion-9 {
302
+ font: inherit;
303
+ letter-spacing: inherit;
304
+ color: currentColor;
305
+ padding: 4px 0 5px;
306
+ border: 0;
307
+ box-sizing: content-box;
308
+ background: none;
309
+ height: 1.4375em;
310
+ margin: 0;
311
+ -webkit-tap-highlight-color: transparent;
312
+ display: block;
313
+ min-width: 0;
314
+ width: 100%;
315
+ -webkit-animation-name: mui-auto-fill-cancel;
316
+ animation-name: mui-auto-fill-cancel;
317
+ -webkit-animation-duration: 10ms;
318
+ animation-duration: 10ms;
319
+ }
320
+
321
+ .emotion-9::-webkit-input-placeholder {
322
+ color: currentColor;
323
+ opacity: 0.42;
324
+ -webkit-transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
325
+ transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
326
+ }
327
+
328
+ .emotion-9::-moz-placeholder {
329
+ color: currentColor;
330
+ opacity: 0.42;
331
+ -webkit-transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
332
+ transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
333
+ }
334
+
335
+ .emotion-9:-ms-input-placeholder {
336
+ color: currentColor;
337
+ opacity: 0.42;
338
+ -webkit-transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
339
+ transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
340
+ }
341
+
342
+ .emotion-9::-ms-input-placeholder {
343
+ color: currentColor;
344
+ opacity: 0.42;
345
+ -webkit-transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
346
+ transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
347
+ }
348
+
349
+ .emotion-9:focus {
350
+ outline: 0;
351
+ }
352
+
353
+ .emotion-9:invalid {
354
+ box-shadow: none;
355
+ }
356
+
357
+ .emotion-9::-webkit-search-decoration {
358
+ -webkit-appearance: none;
359
+ }
360
+
361
+ label[data-shrink=false]+.MuiInputBase-formControl .emotion-9::-webkit-input-placeholder {
362
+ opacity: 0!important;
363
+ }
364
+
365
+ label[data-shrink=false]+.MuiInputBase-formControl .emotion-9::-moz-placeholder {
366
+ opacity: 0!important;
367
+ }
368
+
369
+ label[data-shrink=false]+.MuiInputBase-formControl .emotion-9:-ms-input-placeholder {
370
+ opacity: 0!important;
371
+ }
372
+
373
+ label[data-shrink=false]+.MuiInputBase-formControl .emotion-9::-ms-input-placeholder {
374
+ opacity: 0!important;
375
+ }
376
+
377
+ label[data-shrink=false]+.MuiInputBase-formControl .emotion-9:focus::-webkit-input-placeholder {
378
+ opacity: 0.42;
379
+ }
380
+
381
+ label[data-shrink=false]+.MuiInputBase-formControl .emotion-9:focus::-moz-placeholder {
382
+ opacity: 0.42;
383
+ }
384
+
385
+ label[data-shrink=false]+.MuiInputBase-formControl .emotion-9:focus:-ms-input-placeholder {
386
+ opacity: 0.42;
387
+ }
388
+
389
+ label[data-shrink=false]+.MuiInputBase-formControl .emotion-9:focus::-ms-input-placeholder {
390
+ opacity: 0.42;
391
+ }
392
+
393
+ .emotion-9.Mui-disabled {
394
+ opacity: 1;
395
+ -webkit-text-fill-color: rgba(0, 0, 0, 0.38);
396
+ }
397
+
398
+ .emotion-9:-webkit-autofill {
399
+ -webkit-animation-duration: 5000s;
400
+ animation-duration: 5000s;
401
+ -webkit-animation-name: mui-auto-fill;
402
+ animation-name: mui-auto-fill;
403
+ }
404
+
405
+ .emotion-10 {
406
+ position: absolute;
407
+ right: 0;
408
+ top: calc(50% - 14px);
50
409
  }
51
410
 
52
411
  <div
@@ -54,25 +413,28 @@ exports[`<Search /> component should load the component in default state 1`] = `
54
413
  >
55
414
  <div
56
415
  aria-expanded="false"
57
- aria-haspopup="listbox"
58
- aria-owns="react-autowhatever-1"
59
- class="react-autosuggest__container"
416
+ class="MuiAutocomplete-root MuiAutocomplete-fullWidth emotion-2"
60
417
  role="combobox"
61
418
  >
62
419
  <div
63
- aria-autocomplete="list"
64
- aria-controls="react-autowhatever-1"
65
- class="MuiFormControl-root MuiTextField-root react-autosuggest__input emotion-2 emotion-3 MuiFormControl-fullWidth"
420
+ class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root emotion-3 emotion-4"
66
421
  >
422
+
67
423
  <div
68
- class="MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-fullWidth MuiInput-fullWidth MuiInputBase-formControl MuiInput-formControl MuiInputBase-adornedStart"
424
+ class="MuiInput-root MuiInput-underline MuiInputBase-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-adornedStart MuiInputBase-adornedEnd MuiAutocomplete-inputRoot emotion-5"
69
425
  >
70
426
  <div
71
- class="MuiInputAdornment-root emotion-4 emotion-5 MuiInputAdornment-positionStart"
427
+ class="MuiInputAdornment-root MuiInputAdornment-positionStart MuiInputAdornment-standard MuiInputAdornment-sizeMedium emotion-6 emotion-7"
72
428
  >
429
+ <span
430
+ class="notranslate"
431
+ >
432
+
433
+ </span>
73
434
  <svg
74
435
  aria-hidden="true"
75
- class="MuiSvgIcon-root"
436
+ class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium emotion-8"
437
+ data-testid="SearchIcon"
76
438
  focusable="false"
77
439
  viewBox="0 0 24 24"
78
440
  >
@@ -82,20 +444,22 @@ exports[`<Search /> component should load the component in default state 1`] = `
82
444
  </svg>
83
445
  </div>
84
446
  <input
447
+ aria-autocomplete="list"
85
448
  aria-invalid="false"
449
+ autocapitalize="none"
86
450
  autocomplete="off"
87
- class="MuiInputBase-input MuiInput-input MuiInputBase-inputAdornedStart"
451
+ class="MuiInput-input MuiInputBase-input MuiInputBase-inputAdornedStart MuiInputBase-inputAdornedEnd MuiAutocomplete-input MuiAutocomplete-inputFocused MuiAutocomplete-input MuiAutocomplete-inputFocused emotion-9"
452
+ id="search-header-suggest"
88
453
  placeholder="Search Packages"
454
+ spellcheck="false"
89
455
  type="text"
90
456
  value=""
91
457
  />
458
+ <div
459
+ class="MuiAutocomplete-endAdornment emotion-10"
460
+ />
92
461
  </div>
93
462
  </div>
94
- <div
95
- class="MuiPaper-root react-autosuggest__suggestions-container emotion-6 emotion-7 MuiPaper-elevation1"
96
- id="react-autowhatever-1"
97
- role="listbox"
98
- />
99
463
  </div>
100
464
  </div>
101
465
  `;
@@ -1,6 +1,5 @@
1
- import { css } from '@emotion/core';
1
+ import { css } from '@emotion/react';
2
2
  import styled from '@emotion/styled';
3
-
4
3
  import AppBar from 'verdaccio-ui/components/AppBar';
5
4
  import IconButton from 'verdaccio-ui/components/IconButton';
6
5
  import Link from 'verdaccio-ui/components/Link';
@@ -54,7 +53,7 @@ export const SearchWrapper = styled('div')({
54
53
 
55
54
  export const NavBar = styled(AppBar)<{ theme?: Theme }>(({ theme }) => ({
56
55
  backgroundColor:
57
- theme?.palette.type === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue,
56
+ theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue,
58
57
  color: theme?.palette.white,
59
58
  minHeight: 60,
60
59
  display: 'flex',
package/src/App/index.ts CHANGED
@@ -1,2 +1 @@
1
1
  export { default } from './App';
2
- export { default as AppContextProvider } from './AppContextProvider';
@@ -1,4 +1,6 @@
1
- import React, { lazy, Suspense } from 'react';
1
+ /* eslint-disable verdaccio/jsx-spread */
2
+ import React, { Suspense, lazy } from 'react';
3
+
2
4
  export default (importCallback: any) => {
3
5
  const TargetComponent = lazy(importCallback);
4
6
  return (props: any) => (
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
-
3
- import { render, cleanup } from 'verdaccio-ui/utils/test-react-testing-library';
2
+ import { cleanup, renderWithStore, screen } from 'verdaccio-ui/utils/test-react-testing-library';
4
3
 
5
4
  import { DetailContext, DetailContextProps } from '../../pages/Version';
6
-
5
+ import { store } from '../../store/store';
7
6
  import ActionBar from './ActionBar';
8
7
 
9
8
  const detailContextValue: DetailContextProps = {
@@ -44,7 +43,10 @@ describe('<ActionBar /> component', () => {
44
43
  });
45
44
 
46
45
  test('should render the component in default state', () => {
47
- const { container } = render(<ComponentToBeRendered contextValue={detailContextValue} />);
46
+ const { container } = renderWithStore(
47
+ <ComponentToBeRendered contextValue={detailContextValue} />,
48
+ store
49
+ );
48
50
  expect(container.firstChild).toMatchSnapshot();
49
51
  });
50
52
 
@@ -62,23 +64,20 @@ describe('<ActionBar /> component', () => {
62
64
  },
63
65
  };
64
66
 
65
- const { container } = render(
66
- <ComponentToBeRendered contextValue={{ ...detailContextValue, packageMeta }} />
67
+ const { container } = renderWithStore(
68
+ <ComponentToBeRendered contextValue={{ ...detailContextValue, packageMeta }} />,
69
+ store
67
70
  );
68
71
  expect(container.firstChild).toMatchSnapshot();
69
72
  });
70
73
 
71
74
  test('when there is a button to download a tarball', () => {
72
- const { getByTitle } = render(
73
- <ComponentToBeRendered contextValue={{ ...detailContextValue }} />
74
- );
75
- expect(getByTitle('Download tarball')).toBeTruthy();
75
+ renderWithStore(<ComponentToBeRendered contextValue={{ ...detailContextValue }} />, store);
76
+ expect(screen.getByLabelText('Download tarball')).toBeTruthy();
76
77
  });
77
78
 
78
79
  test('when there is a button to open an issue', () => {
79
- const { getByTitle } = render(
80
- <ComponentToBeRendered contextValue={{ ...detailContextValue }} />
81
- );
82
- expect(getByTitle('Open an issue')).toBeTruthy();
80
+ renderWithStore(<ComponentToBeRendered contextValue={{ ...detailContextValue }} />, store);
81
+ expect(screen.getByLabelText('Open an issue')).toBeTruthy();
83
82
  });
84
83
  });
@@ -1,10 +1,8 @@
1
1
  import React from 'react';
2
-
3
2
  import { isURL } from 'verdaccio-ui/utils/url';
4
3
 
5
4
  import { DetailContext } from '../../pages/Version';
6
5
  import Box from '../Box';
7
-
8
6
  import ActionBarAction, { ActionBarActionProps } from './ActionBarAction';
9
7
 
10
8
  /* eslint-disable verdaccio/jsx-spread */
@@ -1,25 +1,24 @@
1
1
  import styled from '@emotion/styled';
2
- import BugReportIcon from '@material-ui/icons/BugReport';
3
- import DownloadIcon from '@material-ui/icons/CloudDownload';
4
- import HomeIcon from '@material-ui/icons/Home';
2
+ import BugReportIcon from '@mui/icons-material/BugReport';
3
+ import DownloadIcon from '@mui/icons-material/CloudDownload';
4
+ import HomeIcon from '@mui/icons-material/Home';
5
+ import Tooltip from '@mui/material/Tooltip';
5
6
  import React, { useCallback } from 'react';
6
7
  import { useTranslation } from 'react-i18next';
7
-
8
+ import { useDispatch } from 'react-redux';
8
9
  import { Theme } from 'verdaccio-ui/design-tokens/theme';
9
- import { useAPI } from 'verdaccio-ui/providers/API/APIProvider';
10
- import { extractFileName, downloadFile } from 'verdaccio-ui/utils/url';
11
10
 
11
+ import { Dispatch } from '../../store/store';
12
12
  import FloatingActionButton from '../FloatingActionButton';
13
13
  import Link from '../Link';
14
- import Tooltip from '../Tooltip';
15
14
 
16
15
  export const Fab = styled(FloatingActionButton)<{ theme?: Theme }>(({ theme }) => ({
17
16
  backgroundColor:
18
- theme?.palette.type === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue,
17
+ theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue,
19
18
  color: theme?.palette.white,
20
19
  marginRight: 10,
21
20
  ':hover': {
22
- color: theme?.palette.type === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue,
21
+ color: theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue,
23
22
  background: theme?.palette.white,
24
23
  },
25
24
  }));
@@ -34,13 +33,11 @@ export interface ActionBarActionProps {
34
33
  /* eslint-disable react/jsx-no-bind */
35
34
  const ActionBarAction: React.FC<ActionBarActionProps> = ({ type, link }) => {
36
35
  const { t } = useTranslation();
37
- const { getResource } = useAPI();
36
+ const dispatch = useDispatch<Dispatch>();
38
37
 
39
38
  const handleDownload = useCallback(async () => {
40
- const fileStream = await getResource(link);
41
- const fileName = extractFileName(link);
42
- downloadFile(fileStream, fileName);
43
- }, [getResource, link]);
39
+ dispatch.download.getTarball({ link });
40
+ }, [dispatch, link]);
44
41
 
45
42
  switch (type) {
46
43
  case 'VISIT_HOMEPAGE':