@verdaccio/ui-theme 3.1.0 → 6.0.0-6-next.11

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 (381) hide show
  1. package/.babelrc +33 -0
  2. package/.eslintrc +115 -0
  3. package/.stylelintrc +40 -0
  4. package/CHANGELOG.md +152 -554
  5. package/LICENSE +1 -1
  6. package/README.md +22 -95
  7. package/config/env.js +9 -0
  8. package/jest/api/packages.json +42 -0
  9. package/jest/identity.js +29 -0
  10. package/jest/jest.config.js +39 -0
  11. package/jest/jestEnvironment.js +1 -0
  12. package/jest/server-handlers.ts +9 -0
  13. package/jest/server.ts +6 -0
  14. package/jest/setup-env.ts +15 -0
  15. package/jest/setup.ts +31 -0
  16. package/jest/unit/components/__mocks__/api.ts +47 -0
  17. package/jest/unit/components/__mocks__/token.ts +31 -0
  18. package/jest/unit/components/store/login.ts +23 -0
  19. package/jest/unit/components/store/logo.ts +7 -0
  20. package/jest/unit/components/store/package.ts +174 -0
  21. package/jest/unit/components/store/packageMeta.ts +592 -0
  22. package/jest/unit/empty.ts +1 -0
  23. package/lib/constants.ts +9 -0
  24. package/package.json +153 -228
  25. package/src/App/App.test.tsx +123 -0
  26. package/src/App/App.tsx +54 -0
  27. package/src/App/AppError.tsx +38 -0
  28. package/src/App/AppRoute.tsx +63 -0
  29. package/src/App/Footer/Footer.test.tsx +20 -0
  30. package/src/App/Footer/Footer.tsx +111 -0
  31. package/src/App/Footer/__snapshots__/Footer.test.tsx.snap +456 -0
  32. package/src/App/Footer/index.ts +1 -0
  33. package/src/App/Footer/styles.ts +44 -0
  34. package/src/App/Header/Header.test.tsx +152 -0
  35. package/src/App/Header/Header.tsx +74 -0
  36. package/src/App/Header/HeaderGreetings.tsx +22 -0
  37. package/src/App/Header/HeaderInfoDialog.tsx +19 -0
  38. package/src/App/Header/HeaderLeft.tsx +31 -0
  39. package/src/App/Header/HeaderMenu.tsx +65 -0
  40. package/src/App/Header/HeaderRight.tsx +118 -0
  41. package/src/App/Header/HeaderToolTip.tsx +19 -0
  42. package/src/App/Header/HeaderToolTipIcon.tsx +75 -0
  43. package/src/App/Header/LanguageSwitch.tsx +125 -0
  44. package/src/App/Header/LoginDialog/LoginDialog.test.tsx +112 -0
  45. package/src/App/Header/LoginDialog/LoginDialog.tsx +81 -0
  46. package/src/App/Header/LoginDialog/LoginDialogCloseButton.tsx +32 -0
  47. package/src/App/Header/LoginDialog/LoginDialogForm.tsx +97 -0
  48. package/src/App/Header/LoginDialog/LoginDialogFormError.tsx +43 -0
  49. package/src/App/Header/LoginDialog/LoginDialogHeader.tsx +48 -0
  50. package/src/App/Header/LoginDialog/__snapshots__/LoginDialog.test.tsx.snap +3 -0
  51. package/src/App/Header/LoginDialog/index.ts +1 -0
  52. package/src/App/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +27 -0
  53. package/src/App/Header/RegistryInfoContent/RegistryInfoContent.tsx +155 -0
  54. package/src/App/Header/RegistryInfoContent/index.ts +1 -0
  55. package/src/App/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +30 -0
  56. package/src/App/Header/RegistryInfoDialog/index.ts +1 -0
  57. package/src/App/Header/RegistryInfoDialog/styles.ts +16 -0
  58. package/src/App/Header/RegistryInfoDialog/types.ts +7 -0
  59. package/src/App/Header/Search/Search.test.tsx +168 -0
  60. package/src/App/Header/Search/Search.tsx +127 -0
  61. package/src/App/Header/Search/SearchAdornment.tsx +18 -0
  62. package/src/App/Header/Search/__snapshots__/Search.test.tsx.snap +101 -0
  63. package/src/App/Header/Search/index.ts +1 -0
  64. package/src/App/Header/index.ts +1 -0
  65. package/src/App/Header/styles.ts +89 -0
  66. package/src/App/index.ts +1 -0
  67. package/src/App/utils/loadable.tsx +10 -0
  68. package/src/components/.eslintrc +7 -0
  69. package/src/components/ActionBar/ActionBar.test.tsx +91 -0
  70. package/src/components/ActionBar/ActionBar.tsx +45 -0
  71. package/src/components/ActionBar/ActionBarAction.tsx +75 -0
  72. package/src/components/ActionBar/__snapshots__/ActionBar.test.tsx.snap +122 -0
  73. package/src/components/ActionBar/index.ts +1 -0
  74. package/src/components/AppBar.tsx +10 -0
  75. package/src/components/Author/Author.test.tsx +75 -0
  76. package/src/components/Author/Author.tsx +47 -0
  77. package/src/components/Author/__snapshots__/Author.test.tsx.snap +353 -0
  78. package/src/components/Author/index.ts +1 -0
  79. package/src/components/Author/styles.ts +23 -0
  80. package/src/components/AutoComplete/AutoComplete.tsx +179 -0
  81. package/src/components/AutoComplete/AutoCompleteV2.tsx +296 -0
  82. package/src/components/AutoComplete/index.ts +1 -0
  83. package/src/components/AutoComplete/styles.tsx +58 -0
  84. package/src/components/AutoComplete/useAutoComplete.tsx +61 -0
  85. package/src/components/Avatar.tsx +3 -0
  86. package/src/components/Box.tsx +8 -0
  87. package/src/components/Button.tsx +10 -0
  88. package/src/components/Card.tsx +10 -0
  89. package/src/components/CardActions.tsx +13 -0
  90. package/src/components/CardContent.tsx +10 -0
  91. package/src/components/Chip.tsx +10 -0
  92. package/src/components/CircularProgress.tsx +15 -0
  93. package/src/components/CopyToClipBoard.tsx +45 -0
  94. package/src/components/Dialog.tsx +10 -0
  95. package/src/components/DialogActions.tsx +16 -0
  96. package/src/components/DialogContent.tsx +16 -0
  97. package/src/components/DialogTitle.tsx +10 -0
  98. package/src/components/Divider.tsx +10 -0
  99. package/src/components/FloatingActionButton.tsx +12 -0
  100. package/src/components/FormControl.tsx +10 -0
  101. package/src/components/FormHelperText.tsx +16 -0
  102. package/src/components/Grid.tsx +10 -0
  103. package/src/components/Heading.tsx +15 -0
  104. package/src/components/IconButton.tsx +10 -0
  105. package/src/components/Icons/.eslintrc +5 -0
  106. package/src/components/Icons/Earth.tsx +36 -0
  107. package/src/components/Icons/FileBinary.tsx +20 -0
  108. package/src/components/Icons/Law.tsx +20 -0
  109. package/src/components/Icons/License.tsx +18 -0
  110. package/src/components/Icons/Time.tsx +19 -0
  111. package/src/components/Icons/Version.tsx +20 -0
  112. package/src/components/Icons/index.ts +5 -0
  113. package/src/components/Input.tsx +10 -0
  114. package/src/components/InputAdornment/InputAdornment.tsx +16 -0
  115. package/src/components/InputAdornment/index.ts +1 -0
  116. package/src/components/InputLabel.tsx +10 -0
  117. package/src/components/Label/Label.test.tsx +15 -0
  118. package/src/components/Label/Label.tsx +35 -0
  119. package/src/components/Label/__snapshots__/Label.test.tsx.snap +14 -0
  120. package/src/components/Label/index.ts +1 -0
  121. package/src/components/Link.tsx +39 -0
  122. package/src/components/List.tsx +10 -0
  123. package/src/components/ListItem.tsx +23 -0
  124. package/src/components/ListItemText.tsx +16 -0
  125. package/src/components/Loading/Loading.test.tsx +12 -0
  126. package/src/components/Loading/Loading.tsx +17 -0
  127. package/src/components/Loading/Spinner/Spinner.test.tsx +14 -0
  128. package/src/components/Loading/Spinner/Spinner.tsx +35 -0
  129. package/src/components/Loading/Spinner/__snapshots__/Spinner.test.tsx.snap +148 -0
  130. package/src/components/Loading/Spinner/index.tsx +1 -0
  131. package/src/components/Loading/__snapshots__/Loading.test.tsx.snap +86 -0
  132. package/src/components/Loading/index.ts +1 -0
  133. package/src/components/Loading/styles.ts +17 -0
  134. package/src/components/Logo/Logo.test.tsx +12 -0
  135. package/src/components/Logo/Logo.tsx +55 -0
  136. package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +19 -0
  137. package/src/components/Logo/img/logo-black-and-white.svg +1 -0
  138. package/src/components/Logo/img/logo.svg +1 -0
  139. package/src/components/Logo/index.ts +1 -0
  140. package/src/components/Menu.tsx +10 -0
  141. package/src/components/MenuItem.tsx +25 -0
  142. package/src/components/NotFound/NotFound.tsx +52 -0
  143. package/src/components/NotFound/Notfound.test.tsx +37 -0
  144. package/src/components/NotFound/__snapshots__/Notfound.test.tsx.snap +44 -0
  145. package/src/components/NotFound/img/package.svg +1 -0
  146. package/src/components/NotFound/index.ts +1 -0
  147. package/src/components/NotFound/styles.ts +40 -0
  148. package/src/components/Paper.tsx +10 -0
  149. package/src/components/SnackbarContent.tsx +15 -0
  150. package/src/components/SvgIcon.tsx +38 -0
  151. package/src/components/Tab.tsx +10 -0
  152. package/src/components/Tabs.tsx +14 -0
  153. package/src/components/Text/Text.tsx +17 -0
  154. package/src/components/Text/TextConfig.ts +7 -0
  155. package/src/components/Text/index.ts +2 -0
  156. package/src/components/TextField/TextField.test.tsx +16 -0
  157. package/src/components/TextField/TextField.tsx +23 -0
  158. package/src/components/TextField/__snapshots__/TextField.test.tsx.snap +19 -0
  159. package/src/components/TextField/index.ts +1 -0
  160. package/src/components/Toolbar.tsx +10 -0
  161. package/src/components/Tooltip.tsx +25 -0
  162. package/src/design-tokens/ResetStyles.tsx +44 -0
  163. package/src/design-tokens/StyleBaseline.tsx +14 -0
  164. package/src/design-tokens/ThemeContext.ts +13 -0
  165. package/src/design-tokens/ThemeProvider.tsx +44 -0
  166. package/src/design-tokens/emotion.ts +5 -0
  167. package/src/design-tokens/load-dayjs-locale.ts +98 -0
  168. package/src/design-tokens/theme.ts +159 -0
  169. package/src/design-tokens/useLocalStorage.ts +40 -0
  170. package/src/design-tokens/useOnClickOutside.ts +28 -0
  171. package/src/design-tokens/useTheme.ts +7 -0
  172. package/src/i18n/ABOUT_TRANSLATIONS.md +13 -0
  173. package/src/i18n/config.ts +52 -0
  174. package/src/i18n/crowdin/ui.json +170 -0
  175. package/src/i18n/deprecated_translations_dont_use/cs-CZ.json +168 -0
  176. package/src/i18n/deprecated_translations_dont_use/de-DE.json +168 -0
  177. package/src/i18n/deprecated_translations_dont_use/en-US.json +170 -0
  178. package/src/i18n/deprecated_translations_dont_use/es-ES.json +168 -0
  179. package/src/i18n/deprecated_translations_dont_use/fr-FR.json +168 -0
  180. package/src/i18n/deprecated_translations_dont_use/ja-JP.json +168 -0
  181. package/src/i18n/deprecated_translations_dont_use/km-KH.json +168 -0
  182. package/src/i18n/deprecated_translations_dont_use/pt-BR.json +168 -0
  183. package/src/i18n/deprecated_translations_dont_use/ru-RU.json +168 -0
  184. package/src/i18n/deprecated_translations_dont_use/tr-TR.json +168 -0
  185. package/src/i18n/deprecated_translations_dont_use/uk-UA.json +168 -0
  186. package/src/i18n/deprecated_translations_dont_use/zh-CN.json +168 -0
  187. package/src/i18n/deprecated_translations_dont_use/zh-TW.json +165 -0
  188. package/src/i18n/enabledLanguages.ts +35 -0
  189. package/src/index.tsx +36 -0
  190. package/src/lib/constants.ts +9 -0
  191. package/src/pages/Version/DetailContainer/Dependencies/Dependencies.test.tsx +93 -0
  192. package/src/pages/Version/DetailContainer/Dependencies/Dependencies.tsx +100 -0
  193. package/src/pages/Version/DetailContainer/Dependencies/index.ts +1 -0
  194. package/src/pages/Version/DetailContainer/Dependencies/styles.ts +26 -0
  195. package/src/pages/Version/DetailContainer/Dependencies/types.ts +7 -0
  196. package/src/pages/Version/DetailContainer/Deprecated/Deprecated.test.tsx +34 -0
  197. package/src/pages/Version/DetailContainer/Deprecated/Deprecated.tsx +31 -0
  198. package/src/pages/Version/DetailContainer/Deprecated/index.ts +1 -0
  199. package/src/pages/Version/DetailContainer/DetailContainer.test.tsx +13 -0
  200. package/src/pages/Version/DetailContainer/DetailContainer.tsx +37 -0
  201. package/src/pages/Version/DetailContainer/DetailContainerContent.tsx +41 -0
  202. package/src/pages/Version/DetailContainer/DetailContainerContentReadme.tsx +19 -0
  203. package/src/pages/Version/DetailContainer/DetailContainerTabs.tsx +36 -0
  204. package/src/pages/Version/DetailContainer/NoItems/NoItems.tsx +16 -0
  205. package/src/pages/Version/DetailContainer/NoItems/Noitems.test.tsx +16 -0
  206. package/src/pages/Version/DetailContainer/NoItems/__snapshots__/Noitems.test.tsx.snap +9 -0
  207. package/src/pages/Version/DetailContainer/NoItems/index.ts +1 -0
  208. package/src/pages/Version/DetailContainer/Readme/Readme.spec.tsx +19 -0
  209. package/src/pages/Version/DetailContainer/Readme/Readme.tsx +22 -0
  210. package/src/pages/Version/DetailContainer/Readme/__snapshots__/Readme.spec.tsx.snap +94 -0
  211. package/src/pages/Version/DetailContainer/Readme/index.ts +1 -0
  212. package/src/pages/Version/DetailContainer/Readme/types.ts +3 -0
  213. package/src/pages/Version/DetailContainer/UpLinks/UpLinks.test.tsx +58 -0
  214. package/src/pages/Version/DetailContainer/UpLinks/UpLinks.tsx +45 -0
  215. package/src/pages/Version/DetailContainer/UpLinks/__snapshots__/UpLinks.test.tsx.snap +247 -0
  216. package/src/pages/Version/DetailContainer/UpLinks/index.ts +1 -0
  217. package/src/pages/Version/DetailContainer/UpLinks/styles.ts +24 -0
  218. package/src/pages/Version/DetailContainer/Versions/Versions.test.tsx +60 -0
  219. package/src/pages/Version/DetailContainer/Versions/Versions.tsx +41 -0
  220. package/src/pages/Version/DetailContainer/Versions/VersionsHistoryList.tsx +40 -0
  221. package/src/pages/Version/DetailContainer/Versions/VersionsTagList.tsx +28 -0
  222. package/src/pages/Version/DetailContainer/Versions/__partials__/data.json +5984 -0
  223. package/src/pages/Version/DetailContainer/Versions/__snapshots__/Versions.test.tsx.snap +3 -0
  224. package/src/pages/Version/DetailContainer/Versions/index.ts +1 -0
  225. package/src/pages/Version/DetailContainer/Versions/styles.ts +30 -0
  226. package/src/pages/Version/DetailContainer/__snapshots__/DetailContainer.test.tsx.snap +103 -0
  227. package/src/pages/Version/DetailContainer/index.ts +1 -0
  228. package/src/pages/Version/DetailSidebar/DetailSidebar.tsx +55 -0
  229. package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.test.tsx +111 -0
  230. package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.tsx +53 -0
  231. package/src/pages/Version/DetailSidebar/DetailSidebarTitle.tsx +40 -0
  232. package/src/pages/Version/DetailSidebar/Developers/Developers.test.tsx +117 -0
  233. package/src/pages/Version/DetailSidebar/Developers/Developers.tsx +90 -0
  234. package/src/pages/Version/DetailSidebar/Developers/DevelopersTitle.tsx +32 -0
  235. package/src/pages/Version/DetailSidebar/Developers/__snapshots__/Developers.test.tsx.snap +380 -0
  236. package/src/pages/Version/DetailSidebar/Developers/get-unique-developer-values.ts +16 -0
  237. package/src/pages/Version/DetailSidebar/Developers/index.ts +1 -0
  238. package/src/pages/Version/DetailSidebar/Developers/styles.ts +31 -0
  239. package/src/pages/Version/DetailSidebar/Dist/Dist.test.tsx +78 -0
  240. package/src/pages/Version/DetailSidebar/Dist/Dist.tsx +49 -0
  241. package/src/pages/Version/DetailSidebar/Dist/__snapshots__/Dist.test.tsx.snap +602 -0
  242. package/src/pages/Version/DetailSidebar/Dist/index.ts +1 -0
  243. package/src/pages/Version/DetailSidebar/Dist/styles.ts +27 -0
  244. package/src/pages/Version/DetailSidebar/Engines/Engines.test.tsx +71 -0
  245. package/src/pages/Version/DetailSidebar/Engines/Engines.tsx +58 -0
  246. package/src/pages/Version/DetailSidebar/Engines/img/node.png +0 -0
  247. package/src/pages/Version/DetailSidebar/Engines/index.ts +1 -0
  248. package/src/pages/Version/DetailSidebar/Engines/styles.ts +14 -0
  249. package/src/pages/Version/DetailSidebar/Install/Install.test.tsx +64 -0
  250. package/src/pages/Version/DetailSidebar/Install/Install.tsx +52 -0
  251. package/src/pages/Version/DetailSidebar/Install/InstallListItem.tsx +97 -0
  252. package/src/pages/Version/DetailSidebar/Install/__partials__/data.json +5984 -0
  253. package/src/pages/Version/DetailSidebar/Install/img/npm.svg +15 -0
  254. package/src/pages/Version/DetailSidebar/Install/img/pnpm.svg +1 -0
  255. package/src/pages/Version/DetailSidebar/Install/img/yarn.svg +1 -0
  256. package/src/pages/Version/DetailSidebar/Install/index.ts +1 -0
  257. package/src/pages/Version/DetailSidebar/Repository/Repository.test.tsx +78 -0
  258. package/src/pages/Version/DetailSidebar/Repository/Repository.tsx +93 -0
  259. package/src/pages/Version/DetailSidebar/Repository/__partials__/data.json +5984 -0
  260. package/src/pages/Version/DetailSidebar/Repository/__snapshots__/Repository.test.tsx.snap +3 -0
  261. package/src/pages/Version/DetailSidebar/Repository/img/git.png +0 -0
  262. package/src/pages/Version/DetailSidebar/Repository/index.ts +1 -0
  263. package/src/pages/Version/DetailSidebar/index.ts +1 -0
  264. package/src/pages/Version/Version.test.tsx +68 -0
  265. package/src/pages/Version/Version.tsx +41 -0
  266. package/src/pages/Version/VersionContextProvider.tsx +43 -0
  267. package/src/pages/Version/VersionLayout.tsx +20 -0
  268. package/src/pages/Version/__partials__/data.json +5984 -0
  269. package/src/pages/Version/context.ts +10 -0
  270. package/src/pages/Version/get-route-package-name.ts +9 -0
  271. package/src/pages/Version/index.ts +4 -0
  272. package/src/pages/Version/version-config.ts +19 -0
  273. package/src/pages/home/Home.tsx +25 -0
  274. package/src/pages/home/PackageList/Help/Help.test.tsx +12 -0
  275. package/src/pages/home/PackageList/Help/Help.tsx +56 -0
  276. package/src/pages/home/PackageList/Help/__snapshots__/Help.test.tsx.snap +159 -0
  277. package/src/pages/home/PackageList/Help/index.ts +1 -0
  278. package/src/pages/home/PackageList/Help/styles.ts +13 -0
  279. package/src/pages/home/PackageList/Package/Package.test.tsx +56 -0
  280. package/src/pages/home/PackageList/Package/Package.tsx +253 -0
  281. package/src/pages/home/PackageList/Package/Tag/Tag.test.tsx +16 -0
  282. package/src/pages/home/PackageList/Package/Tag/Tag.tsx +11 -0
  283. package/src/pages/home/PackageList/Package/Tag/__snapshots__/Tag.test.tsx.snap +21 -0
  284. package/src/pages/home/PackageList/Package/Tag/index.ts +1 -0
  285. package/src/pages/home/PackageList/Package/Tag/styles.ts +11 -0
  286. package/src/pages/home/PackageList/Package/index.ts +1 -0
  287. package/src/pages/home/PackageList/Package/styles.ts +112 -0
  288. package/src/pages/home/PackageList/PackageList.tsx +81 -0
  289. package/src/pages/home/PackageList/Packagelist.test.tsx +60 -0
  290. package/src/pages/home/PackageList/index.ts +1 -0
  291. package/src/pages/home/index.ts +1 -0
  292. package/src/providers/API/api.test.ts +136 -0
  293. package/src/providers/API/api.ts +73 -0
  294. package/src/providers/API/storage.ts +12 -0
  295. package/src/providers/config/AppConfigurationProvider.tsx +57 -0
  296. package/src/providers/config/index.ts +1 -0
  297. package/src/store/index.ts +1 -0
  298. package/src/store/models/configuration.ts +42 -0
  299. package/src/store/models/download.ts +31 -0
  300. package/src/store/models/index.ts +17 -0
  301. package/src/store/models/login.ts +90 -0
  302. package/src/store/models/manifest.ts +91 -0
  303. package/src/store/models/packages.ts +36 -0
  304. package/src/store/models/search.ts +81 -0
  305. package/src/store/store.ts +15 -0
  306. package/src/template/favicon.ico +0 -0
  307. package/src/template/index.html +21 -0
  308. package/src/utils/.eslintrc +5 -0
  309. package/src/utils/cli-utils.test.ts +66 -0
  310. package/src/utils/cli-utils.ts +38 -0
  311. package/src/utils/colors.ts +1 -0
  312. package/src/utils/constants.ts +5 -0
  313. package/src/utils/file-size.ts +13 -0
  314. package/src/utils/i18nForTests.ts +25 -0
  315. package/src/utils/login.test.ts +71 -0
  316. package/src/utils/login.ts +44 -0
  317. package/src/utils/package.test.ts +101 -0
  318. package/src/utils/package.ts +105 -0
  319. package/src/utils/sec-utils.ts +15 -0
  320. package/src/utils/storage.ts +12 -0
  321. package/src/utils/test-react-testing-library.tsx +38 -0
  322. package/src/utils/url.test.ts +28 -0
  323. package/src/utils/url.ts +58 -0
  324. package/src/utils/windows.ts +3 -0
  325. package/static/favicon.ico +0 -0
  326. package/static/index.html +21 -0
  327. package/static/main.c57129036f278d0c7acf.js +2 -0
  328. package/static/main.c57129036f278d0c7acf.js.LICENSE.txt +1456 -0
  329. package/static/manifest.json +5 -17
  330. package/static/runtime.c57129036f278d0c7acf.js +2 -0
  331. package/static/{runtime.f6e570dfe38870a45bf5.js.LICENSE.txt → runtime.c57129036f278d0c7acf.js.LICENSE.txt} +2 -2
  332. package/static/vendors.c57129036f278d0c7acf.js +2 -0
  333. package/static/vendors.c57129036f278d0c7acf.js.LICENSE.txt +2932 -0
  334. package/tools/.eslintrc +14 -0
  335. package/tools/_verdaccio.config.yaml +59 -0
  336. package/tools/dev.server.js +48 -0
  337. package/tools/getPackageJson.js +25 -0
  338. package/tools/verdaccio.js +31 -0
  339. package/tools/webpack.config.js +82 -0
  340. package/tools/webpack.dev.config.babel.js +60 -0
  341. package/tools/webpack.prod.config.babel.js +81 -0
  342. package/tsconfig.build.json +24 -0
  343. package/tsconfig.json +27 -0
  344. package/types/custom.d.ts +9 -0
  345. package/types/files.d.ts +9 -0
  346. package/types/index.ts +12 -0
  347. package/types/jest-dom.d.ts +1 -0
  348. package/types/packageMeta.ts +82 -0
  349. package/static/238.f6e570dfe38870a45bf5.js +0 -2
  350. package/static/238.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  351. package/static/718.f6e570dfe38870a45bf5.js +0 -2
  352. package/static/718.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  353. package/static/73.f6e570dfe38870a45bf5.js +0 -2
  354. package/static/73.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  355. package/static/Dependencies.f6e570dfe38870a45bf5.js +0 -2
  356. package/static/Dependencies.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  357. package/static/Dist.f6e570dfe38870a45bf5.js +0 -2
  358. package/static/Dist.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  359. package/static/Engines.f6e570dfe38870a45bf5.js +0 -2
  360. package/static/Engines.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  361. package/static/Home.f6e570dfe38870a45bf5.js +0 -2
  362. package/static/Home.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  363. package/static/Install.f6e570dfe38870a45bf5.js +0 -2
  364. package/static/Install.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  365. package/static/NotFound.f6e570dfe38870a45bf5.js +0 -2
  366. package/static/NotFound.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  367. package/static/Provider.f6e570dfe38870a45bf5.js +0 -2
  368. package/static/Provider.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  369. package/static/Repository.f6e570dfe38870a45bf5.js +0 -2
  370. package/static/Repository.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  371. package/static/UpLinks.f6e570dfe38870a45bf5.js +0 -2
  372. package/static/UpLinks.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  373. package/static/Version.f6e570dfe38870a45bf5.js +0 -2
  374. package/static/Version.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  375. package/static/Versions.f6e570dfe38870a45bf5.js +0 -2
  376. package/static/Versions.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  377. package/static/main.f6e570dfe38870a45bf5.js +0 -2
  378. package/static/main.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
  379. package/static/runtime.f6e570dfe38870a45bf5.js +0 -2
  380. package/static/vendors.f6e570dfe38870a45bf5.js +0 -2
  381. package/static/vendors.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -98
@@ -0,0 +1,15 @@
1
+ import { default as MaterialUITypography, TypographyProps } from '@material-ui/core/Typography';
2
+ import React, { forwardRef } from 'react';
3
+
4
+ type HeadingType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
5
+ type HeadingRef = HTMLHeadingElement;
6
+
7
+ interface Props extends Omit<TypographyProps, 'variant'> {
8
+ variant?: HeadingType;
9
+ }
10
+
11
+ const Heading = forwardRef<HeadingRef, Props>(function Heading({ variant = 'h6', ...props }, ref) {
12
+ return <MaterialUITypography {...props} variant={variant} ref={ref} />;
13
+ });
14
+
15
+ export default Heading;
@@ -0,0 +1,10 @@
1
+ import { default as MaterialUIIconButton, IconButtonProps } from '@material-ui/core/IconButton';
2
+ import React, { forwardRef } from 'react';
3
+
4
+ type IconButtonRef = HTMLButtonElement;
5
+
6
+ const IconButton = forwardRef<IconButtonRef, IconButtonProps>(function IconButton(props, ref) {
7
+ return <MaterialUIIconButton {...props} ref={ref} />;
8
+ });
9
+
10
+ export default IconButton;
@@ -0,0 +1,5 @@
1
+ {
2
+ "rules": {
3
+ "max-len": 0
4
+ }
5
+ }
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+
3
+ import { SvgIcon } from '../SvgIcon';
4
+
5
+ type Props = React.ComponentProps<typeof SvgIcon>;
6
+
7
+ const Earth = React.forwardRef(function Earth(props: Props, ref: React.Ref<SVGSVGElement>) {
8
+ return (
9
+ <SvgIcon viewBox="0 0 45 45" {...props} ref={ref}>
10
+ <defs>
11
+ <clipPath id="prefix__a">
12
+ <path d="M0 36h36V0H0v36z" />
13
+ </clipPath>
14
+ <clipPath id="prefix__b">
15
+ <path d="M18 36C8.059 36 0 27.941 0 18S8.059 0 18 0s18 8.059 18 18-8.059 18-18 18z" />
16
+ </clipPath>
17
+ </defs>
18
+ <g clipPath="url(#prefix__a)" transform="matrix(1.25 0 0 -1.25 0 45)">
19
+ <path
20
+ d="M36 18c0-9.941-8.059-18-18-18S0 8.059 0 18s8.059 18 18 18 18-8.059 18-18"
21
+ fill="#88c9f9"
22
+ />
23
+ </g>
24
+ <g clipPath="url(#prefix__b)" transform="matrix(1.25 0 0 -1.25 0 45)">
25
+ <path
26
+ d="M3.627 28.952c-.45 2.93 2.195 4.156 3.607 4.47 1.412.314 2.776.62 2.933-.006.156-.628.311-1.46 1.173-1.148.862.314 3.043.56 4.063 1.342 1.02.783 2.244.787 3.264.473 1.02-.313 3.877-.227 3.25-1.167-.627-.94-1.825-.827-2.45-1.924-.628-1.099.171-1.826 1.033-1.826.865 0 1.71-.135 2.26.727.548.863-.383 2.463.324 2.357.706-.106 1.477-.866 2.03-2.043.547-1.176 1.408-.47 1.723-1.176.313-.705 2.04-2.039 1.177-1.804-.864.236-1.726.392-1.96-.47-.237-.863.388-1.726-.237-1.647-.627.08-.86-.089-1.725-.004-.862.083-1.333.631-2.039-.545-.705-1.175-1.254-1.96-1.567-2.509-.315-.549-.785-.86-.55-1.96.235-1.099-.628-.785-.628.156 0 .94-.548 1.098-1.253.942-.706-.157-1.803-.313-1.724-1.098.077-.784-.315-1.725.313-2.352.627-.629 1.33.076 1.723-.158.393-.237 1.525-.023 1.133-.416-.393-.39-1.76-.88-.976-1.509a4.831 4.831 0 011.893-.907c.313-.08.062.774 1.083 1.166 1.017.392 2.608 1.29 3 .584.391-.705.338-.595 1.75-.75 1.41-.156 1.79-.585 2.417-1.917.626-1.333.446-1.192 1.462-1.58 1.021-.394 1.678-.223.737-1.087-.94-.86-1.65-.814-2.199-1.833-.55-1.017-.153-1.73-1.25-2.75A20.755 20.755 0 0024 4c-.618-.37-2.162-2.07-3.083-2.667-.834-.54-1.083 0-1.083 0s.256 1.667.964 2.372c.704.705 1.105 3.344.87 4.128-.235.783-1.36 1.02-1.75 1.333-.393.312-1.418 1.548-1.418 2.334 0 .784 1.71 2.81 1.71 2.81.218-1.089-1.039.328-1.627.523-.47.157-1.542 1.656-2.459 1.814-.916.16-1.363.7-2.068 1.25-.706.55-2.43 1.332-2.353 2.195.08.862-1.725 1.568-2.038 1.568-.314 0-1.019 0-1.647 1.098-.627 1.098-1.725 2.196-1.41 2.98.312.783.391 1.726.233 2.588-.156.862-1.332 1.176-1.567.941-.235-.236-1.489-1.335-1.647-.315"
27
+ fill="#5c913b"
28
+ />
29
+ </g>
30
+ </SvgIcon>
31
+ );
32
+ });
33
+
34
+ Earth.displayName = 'Earth';
35
+
36
+ export { Earth };
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import { SvgIcon } from '../SvgIcon';
4
+
5
+ type Props = React.ComponentProps<typeof SvgIcon>;
6
+
7
+ const FileBinary = React.forwardRef(function FileBinary(
8
+ props: Props,
9
+ ref: React.Ref<SVGSVGElement>
10
+ ) {
11
+ return (
12
+ <SvgIcon {...props} ref={ref}>
13
+ <path d="M8.5 1H1c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V4.5L8.5 1zM11 14H1V2h7l3 3v9zM5 6.98L3.5 8.5 5 10l-.5 1L2 8.5 4.5 6l.5.98zM7.5 6L10 8.5 7.5 11l-.5-.98L8.5 8.5 7 7l.5-1z" />
14
+ </SvgIcon>
15
+ );
16
+ });
17
+
18
+ FileBinary.displayName = 'FileBinary';
19
+
20
+ export { FileBinary };
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import { SvgIcon } from '../SvgIcon';
4
+
5
+ type Props = React.ComponentProps<typeof SvgIcon>;
6
+
7
+ const Law = React.forwardRef(function Law(props: Props, ref: React.Ref<SVGSVGElement>) {
8
+ return (
9
+ <SvgIcon {...props} ref={ref}>
10
+ <path
11
+ fillRule="evenodd"
12
+ d="M7 4c-.83 0-1.5-.67-1.5-1.5S6.17 1 7 1s1.5.67 1.5 1.5S7.83 4 7 4zm7 6c0 1.11-.89 2-2 2h-1c-1.11 0-2-.89-2-2l2-4h-1c-.55 0-1-.45-1-1H8v8c.42 0 1 .45 1 1h1c.42 0 1 .45 1 1H3c0-.55.58-1 1-1h1c0-.55.58-1 1-1h.03L6 5H5c0 .55-.45 1-1 1H3l2 4c0 1.11-.89 2-2 2H2c-1.11 0-2-.89-2-2l2-4H1V5h3c0-.55.45-1 1-1h4c.55 0 1 .45 1 1h3v1h-1l2 4zM2.5 7L1 10h3L2.5 7zM13 10l-1.5-3-1.5 3h3z"
13
+ />
14
+ </SvgIcon>
15
+ );
16
+ });
17
+
18
+ Law.displayName = 'Law';
19
+
20
+ export { Law };
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+
3
+ import { SvgIcon } from '../SvgIcon';
4
+
5
+ type Props = React.ComponentProps<typeof SvgIcon>;
6
+
7
+ const License = React.forwardRef(function License(props: Props, ref: React.Ref<SVGSVGElement>) {
8
+ return (
9
+ <SvgIcon viewBox="0 0 490.652 490.652" {...props} ref={ref}>
10
+ <path d="M456.607 9.904H34.04C15.269 9.904 0 25.17 0 43.945V310.17c0 18.77 15.269 34.039 34.04 34.039h260.642c-4.043-10.35-6.534-21.737-7.159-33.742l-253.974-.297.491-266.718 423.063.493V310.17c0 .279-.23.492-.495.492l-15.251-.019c-.637 11.942-3.111 23.263-7.138 33.565h22.389c18.777 0 34.045-15.27 34.045-34.039V43.945c-.001-18.775-15.268-34.041-34.046-34.041z" />
11
+ <path d="M364.447 381.02c33.354 0 60.386-34.152 60.386-76.289 0-42.131-27.031-76.284-60.386-76.284-33.35 0-60.38 34.153-60.38 76.284 0 42.137 27.031 76.289 60.38 76.289zM81.087 118.345h149.561c9.273 0 16.776-7.499 16.776-16.772 0-9.271-7.504-16.775-16.776-16.775H81.087c-9.271 0-16.771 7.504-16.771 16.775 0 9.273 7.499 16.772 16.771 16.772zm334.08 58.716c0-9.273-7.505-16.779-16.776-16.779H81.087c-9.271 0-16.771 7.506-16.771 16.779 0 9.271 7.499 16.77 16.771 16.77h317.304c9.271 0 16.776-7.498 16.776-16.77zm-334.08 58.707c-9.271 0-16.771 7.504-16.771 16.771 0 9.273 7.499 16.777 16.771 16.777h149.561c9.273 0 16.776-7.504 16.776-16.777 0-9.268-7.504-16.771-16.776-16.771H81.087zm334.338 138.684c-.065.082-23.295 26.869-55.728 23.081l40.331 81.577a2.93 2.93 0 002.637 1.639h.215a2.95 2.95 0 002.571-2.031l10.174-31.234a3.024 3.024 0 011.488-1.728 3.07 3.07 0 012.28-.13l30.977 10.88c.324.112.651.163.98.163.836 0 1.623-.348 2.195-.982.803-.9.964-2.18.441-3.244l-38.561-77.991zm-101.772.146c-.049-.047-.118-.096-.185-.146l-38.561 77.973a2.953 2.953 0 00.448 3.262 2.961 2.961 0 003.174.819l30.978-10.88c.328-.113.658-.16.982-.16.442 0 .884.096 1.294.29.706.36 1.245.987 1.493 1.741l10.173 31.221c.378 1.133 1.391 1.936 2.572 2.014h.21a2.95 2.95 0 002.642-1.621l26.206-53.01-16.755-33.893c-.066-.034-14.672-5.884-24.671-17.61z" />
12
+ </SvgIcon>
13
+ );
14
+ });
15
+
16
+ License.displayName = 'License';
17
+
18
+ export { License };
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+
3
+ import { SvgIcon } from '../SvgIcon';
4
+
5
+ type Props = React.ComponentProps<typeof SvgIcon>;
6
+
7
+ const Time = React.forwardRef(function Time(props: Props, ref: React.Ref<SVGSVGElement>) {
8
+ return (
9
+ <SvgIcon viewBox="0 0 24 24" {...props} ref={ref}>
10
+ <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" />
11
+ <path d="M0 0h24v24H0z" fill="none" />
12
+ <path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" />
13
+ </SvgIcon>
14
+ );
15
+ });
16
+
17
+ Time.displayName = 'Time';
18
+
19
+ export { Time };
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import { SvgIcon } from '../SvgIcon';
4
+
5
+ type Props = React.ComponentProps<typeof SvgIcon>;
6
+
7
+ const Version = React.forwardRef(function Version(props: Props, ref: React.Ref<SVGSVGElement>) {
8
+ return (
9
+ <SvgIcon viewBox="0 0 14 16" height={16} width={14} {...props} ref={ref}>
10
+ <path
11
+ fillRule="evenodd"
12
+ d="M13 3H7c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h6c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-1 8H8V5h4v6zM4 4h1v1H4v6h1v1H4c-.55 0-1-.45-1-1V5c0-.55.45-1 1-1zM1 5h1v1H1v4h1v1H1c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1z"
13
+ />
14
+ </SvgIcon>
15
+ );
16
+ });
17
+
18
+ Version.displayName = 'Version';
19
+
20
+ export { Version };
@@ -0,0 +1,5 @@
1
+ export { Version } from './Version';
2
+ export { Time } from './Time';
3
+ export { FileBinary } from './FileBinary';
4
+ export { Law } from './Law';
5
+ export { Earth } from './Earth';
@@ -0,0 +1,10 @@
1
+ import { default as MaterialUIInput, InputProps } from '@material-ui/core/Input';
2
+ import React, { forwardRef } from 'react';
3
+
4
+ type InputRef = HTMLDivElement;
5
+
6
+ const Input = forwardRef<InputRef, InputProps>(function Input(props, ref) {
7
+ return <MaterialUIInput {...props} ref={ref} />;
8
+ });
9
+
10
+ export default Input;
@@ -0,0 +1,16 @@
1
+ import {
2
+ default as MaterialUIInputAdornment,
3
+ InputAdornmentProps,
4
+ } from '@material-ui/core/InputAdornment';
5
+ import React, { forwardRef } from 'react';
6
+
7
+ type InputAdornmentRef = HTMLDivElement;
8
+
9
+ const InputAdornment = forwardRef<InputAdornmentRef, InputAdornmentProps>(function InputAdornment(
10
+ props,
11
+ ref
12
+ ) {
13
+ return <MaterialUIInputAdornment {...props} ref={ref} />;
14
+ });
15
+
16
+ export default InputAdornment;
@@ -0,0 +1 @@
1
+ export { default } from './InputAdornment';
@@ -0,0 +1,10 @@
1
+ import { default as MaterialUIInputLabel, InputLabelProps } from '@material-ui/core/InputLabel';
2
+ import React, { forwardRef } from 'react';
3
+
4
+ type InputLabelRef = HTMLLabelElement;
5
+
6
+ const InputLabel = forwardRef<InputLabelRef, InputLabelProps>(function InputLabel(props, ref) {
7
+ return <MaterialUIInputLabel {...props} ref={ref} />;
8
+ });
9
+
10
+ export default InputLabel;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+
3
+ import { render } from 'verdaccio-ui/utils/test-react-testing-library';
4
+
5
+ import Label from './Label';
6
+
7
+ describe('<Label /> component', () => {
8
+ const props = {
9
+ text: 'test',
10
+ };
11
+ test('should render the component in default state', () => {
12
+ const { container } = render(<Label text={props.text} />);
13
+ expect(container.firstChild).toMatchSnapshot();
14
+ });
15
+ });
@@ -0,0 +1,35 @@
1
+ import styled from '@emotion/styled';
2
+ import React from 'react';
3
+
4
+ import { Theme, FontWeight } from 'verdaccio-ui/design-tokens/theme';
5
+
6
+ interface Props {
7
+ text: string;
8
+ capitalize?: boolean;
9
+ weight?: FontWeight;
10
+ }
11
+
12
+ interface WrapperProps {
13
+ capitalize: boolean;
14
+ weight: FontWeight;
15
+ }
16
+
17
+ const Wrapper = styled('div')<WrapperProps & { theme?: Theme }>((props) => ({
18
+ fontWeight: props.theme?.fontWeight[props.weight],
19
+ textTransform: props.capitalize ? 'capitalize' : 'none',
20
+ }));
21
+
22
+ const Label: React.FC<Props> = ({
23
+ text = '',
24
+ capitalize = false,
25
+ weight = 'regular',
26
+ ...props
27
+ }) => {
28
+ return (
29
+ <Wrapper capitalize={capitalize} weight={weight} {...props}>
30
+ {text}
31
+ </Wrapper>
32
+ );
33
+ };
34
+
35
+ export default Label;
@@ -0,0 +1,14 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<Label /> component should render the component in default state 1`] = `
4
+ .emotion-0 {
5
+ font-weight: 400;
6
+ text-transform: none;
7
+ }
8
+
9
+ <div
10
+ class="emotion-0 emotion-1"
11
+ >
12
+ test
13
+ </div>
14
+ `;
@@ -0,0 +1 @@
1
+ export { default } from './Label';
@@ -0,0 +1,39 @@
1
+ import React, { MouseEvent } from 'react';
2
+ import { Link as RouterLink } from 'react-router-dom';
3
+
4
+ import Text, { TextProps } from './Text';
5
+
6
+ interface Props extends Pick<TextProps, 'variant'> {
7
+ external?: boolean;
8
+ className?: string;
9
+ to: string;
10
+ children?: React.ReactNode;
11
+ onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
12
+ }
13
+
14
+ type LinkRef = HTMLAnchorElement;
15
+
16
+ /* eslint-disable verdaccio/jsx-spread */
17
+ const Link = React.forwardRef<LinkRef, Props>(function Link(
18
+ { external, to, children, variant, className, ...props },
19
+ ref
20
+ ) {
21
+ const LinkTextContent = <Text variant={variant}>{children}</Text>;
22
+ return external ? (
23
+ <a
24
+ className={className}
25
+ href={to}
26
+ ref={ref}
27
+ rel="noopener noreferrer"
28
+ target="_blank"
29
+ {...props}>
30
+ {LinkTextContent}
31
+ </a>
32
+ ) : (
33
+ <RouterLink className={className} innerRef={ref} to={to} {...props}>
34
+ {LinkTextContent}
35
+ </RouterLink>
36
+ );
37
+ });
38
+
39
+ export default Link;
@@ -0,0 +1,10 @@
1
+ import { default as MaterialUIList, ListProps } from '@material-ui/core/List';
2
+ import React, { forwardRef } from 'react';
3
+
4
+ type ListRef = HTMLUListElement;
5
+
6
+ const List = forwardRef<ListRef, ListProps>(function List(props, ref) {
7
+ return <MaterialUIList {...props} ref={ref} />;
8
+ });
9
+
10
+ export default List;
@@ -0,0 +1,23 @@
1
+ import { default as MaterialUIListItem, ListItemProps } from '@material-ui/core/ListItem';
2
+ import React, { forwardRef } from 'react';
3
+
4
+ type ListItemRef<T extends boolean = false> = T extends true ? HTMLDivElement : HTMLLIElement;
5
+
6
+ interface Props<T extends boolean = false> extends Omit<ListItemProps, 'button'> {
7
+ button?: T;
8
+ }
9
+
10
+ const ListItem = forwardRef(function ListItem<T extends boolean>(
11
+ { button, ...props }: Props<T>,
12
+ ref: React.Ref<ListItemRef<T>>
13
+ ) {
14
+ // it seems typescript has some discrimination type limitions. Please see: https://github.com/mui-org/material-ui/issues/14971
15
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
+ return <MaterialUIListItem {...props} button={button as any} innerRef={ref} />;
17
+ });
18
+
19
+ ListItem.defaultProps = {
20
+ button: false,
21
+ };
22
+
23
+ export default ListItem;
@@ -0,0 +1,16 @@
1
+ import {
2
+ default as MaterialUIListItemText,
3
+ ListItemTextProps,
4
+ } from '@material-ui/core/ListItemText';
5
+ import React, { forwardRef } from 'react';
6
+
7
+ type ListItemTextRef = HTMLDivElement;
8
+
9
+ const ListItemText = forwardRef<ListItemTextRef, ListItemTextProps>(function ListItemText(
10
+ props,
11
+ ref
12
+ ) {
13
+ return <MaterialUIListItemText {...props} ref={ref} />;
14
+ });
15
+
16
+ export default ListItemText;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+
3
+ import { render } from 'verdaccio-ui/utils/test-react-testing-library';
4
+
5
+ import Loading from './Loading';
6
+
7
+ describe('<Loading /> component', () => {
8
+ test('should render the component in default state', () => {
9
+ const { container } = render(<Loading />);
10
+ expect(container.firstChild).toMatchSnapshot();
11
+ });
12
+ });
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ import Logo from '../Logo';
4
+
5
+ import Spinner from './Spinner';
6
+ import { Wrapper, Badge } from './styles';
7
+
8
+ const Loading: React.FC = () => (
9
+ <Wrapper data-testid="loading">
10
+ <Badge>
11
+ <Logo size="big" />
12
+ </Badge>
13
+ <Spinner data-testid="spinnerLogo" />
14
+ </Wrapper>
15
+ );
16
+
17
+ export default Loading;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+
3
+ import { render, cleanup } from 'verdaccio-ui/utils/test-react-testing-library';
4
+
5
+ import Spinner from './Spinner';
6
+
7
+ describe('<Spinner /> component', () => {
8
+ beforeEach(cleanup);
9
+
10
+ test('should render the component in default state', () => {
11
+ const wrapper = render(<Spinner />);
12
+ expect(wrapper).toMatchSnapshot();
13
+ });
14
+ });
@@ -0,0 +1,35 @@
1
+ import styled from '@emotion/styled';
2
+ import React from 'react';
3
+
4
+ import { Theme } from 'verdaccio-ui/design-tokens/theme';
5
+
6
+ import CircularProgress from '../../CircularProgress';
7
+
8
+ interface Props {
9
+ size?: number;
10
+ centered?: boolean;
11
+ }
12
+
13
+ const Spinner: React.FC<Props> = ({ size = 50, centered = false }) => (
14
+ <Wrapper centered={centered}>
15
+ <Circular size={size} />
16
+ </Wrapper>
17
+ );
18
+
19
+ export default Spinner;
20
+
21
+ const Wrapper = styled('div')<Pick<Props, 'centered'>>(({ centered }) => ({
22
+ display: 'flex',
23
+ alignItems: 'center',
24
+ justifyContent: 'center',
25
+ ...(centered && {
26
+ position: 'absolute',
27
+ top: '50%',
28
+ left: '50%',
29
+ transform: 'translate(-50%, -50%)',
30
+ }),
31
+ }));
32
+
33
+ const Circular = styled(CircularProgress)<{ theme?: Theme }>(({ theme }) => ({
34
+ color: theme?.palette.type === 'dark' ? theme?.palette.white : theme?.palette.primary.main,
35
+ }));
@@ -0,0 +1,148 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<Spinner /> component should render the component in default state 1`] = `
4
+ Object {
5
+ "asFragment": [Function],
6
+ "baseElement": .emotion-0 {
7
+ display: -webkit-box;
8
+ display: -webkit-flex;
9
+ display: -ms-flexbox;
10
+ display: flex;
11
+ -webkit-align-items: center;
12
+ -webkit-box-align: center;
13
+ -ms-flex-align: center;
14
+ align-items: center;
15
+ -webkit-box-pack: center;
16
+ -webkit-justify-content: center;
17
+ -ms-flex-pack: center;
18
+ justify-content: center;
19
+ }
20
+
21
+ .emotion-2 {
22
+ color: #4b5e40;
23
+ }
24
+
25
+ <body>
26
+ <div>
27
+ <div
28
+ class="emotion-0 emotion-1"
29
+ >
30
+ <div
31
+ class="MuiCircularProgress-root emotion-2 emotion-3 MuiCircularProgress-colorPrimary MuiCircularProgress-indeterminate"
32
+ role="progressbar"
33
+ style="width: 50px; height: 50px;"
34
+ >
35
+ <svg
36
+ class="MuiCircularProgress-svg"
37
+ viewBox="22 22 44 44"
38
+ >
39
+ <circle
40
+ class="MuiCircularProgress-circle MuiCircularProgress-circleIndeterminate"
41
+ cx="44"
42
+ cy="44"
43
+ fill="none"
44
+ r="20.2"
45
+ stroke-width="3.6"
46
+ />
47
+ </svg>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </body>,
52
+ "container": .emotion-0 {
53
+ display: -webkit-box;
54
+ display: -webkit-flex;
55
+ display: -ms-flexbox;
56
+ display: flex;
57
+ -webkit-align-items: center;
58
+ -webkit-box-align: center;
59
+ -ms-flex-align: center;
60
+ align-items: center;
61
+ -webkit-box-pack: center;
62
+ -webkit-justify-content: center;
63
+ -ms-flex-pack: center;
64
+ justify-content: center;
65
+ }
66
+
67
+ .emotion-2 {
68
+ color: #4b5e40;
69
+ }
70
+
71
+ <div>
72
+ <div
73
+ class="emotion-0 emotion-1"
74
+ >
75
+ <div
76
+ class="MuiCircularProgress-root emotion-2 emotion-3 MuiCircularProgress-colorPrimary MuiCircularProgress-indeterminate"
77
+ role="progressbar"
78
+ style="width: 50px; height: 50px;"
79
+ >
80
+ <svg
81
+ class="MuiCircularProgress-svg"
82
+ viewBox="22 22 44 44"
83
+ >
84
+ <circle
85
+ class="MuiCircularProgress-circle MuiCircularProgress-circleIndeterminate"
86
+ cx="44"
87
+ cy="44"
88
+ fill="none"
89
+ r="20.2"
90
+ stroke-width="3.6"
91
+ />
92
+ </svg>
93
+ </div>
94
+ </div>
95
+ </div>,
96
+ "debug": [Function],
97
+ "findAllByAltText": [Function],
98
+ "findAllByDisplayValue": [Function],
99
+ "findAllByLabelText": [Function],
100
+ "findAllByPlaceholderText": [Function],
101
+ "findAllByRole": [Function],
102
+ "findAllByTestId": [Function],
103
+ "findAllByText": [Function],
104
+ "findAllByTitle": [Function],
105
+ "findByAltText": [Function],
106
+ "findByDisplayValue": [Function],
107
+ "findByLabelText": [Function],
108
+ "findByPlaceholderText": [Function],
109
+ "findByRole": [Function],
110
+ "findByTestId": [Function],
111
+ "findByText": [Function],
112
+ "findByTitle": [Function],
113
+ "getAllByAltText": [Function],
114
+ "getAllByDisplayValue": [Function],
115
+ "getAllByLabelText": [Function],
116
+ "getAllByPlaceholderText": [Function],
117
+ "getAllByRole": [Function],
118
+ "getAllByTestId": [Function],
119
+ "getAllByText": [Function],
120
+ "getAllByTitle": [Function],
121
+ "getByAltText": [Function],
122
+ "getByDisplayValue": [Function],
123
+ "getByLabelText": [Function],
124
+ "getByPlaceholderText": [Function],
125
+ "getByRole": [Function],
126
+ "getByTestId": [Function],
127
+ "getByText": [Function],
128
+ "getByTitle": [Function],
129
+ "queryAllByAltText": [Function],
130
+ "queryAllByDisplayValue": [Function],
131
+ "queryAllByLabelText": [Function],
132
+ "queryAllByPlaceholderText": [Function],
133
+ "queryAllByRole": [Function],
134
+ "queryAllByTestId": [Function],
135
+ "queryAllByText": [Function],
136
+ "queryAllByTitle": [Function],
137
+ "queryByAltText": [Function],
138
+ "queryByDisplayValue": [Function],
139
+ "queryByLabelText": [Function],
140
+ "queryByPlaceholderText": [Function],
141
+ "queryByRole": [Function],
142
+ "queryByTestId": [Function],
143
+ "queryByText": [Function],
144
+ "queryByTitle": [Function],
145
+ "rerender": [Function],
146
+ "unmount": [Function],
147
+ }
148
+ `;
@@ -0,0 +1 @@
1
+ export { default } from './Spinner';