@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.
- package/.babelrc +33 -0
- package/.eslintrc +115 -0
- package/.stylelintrc +40 -0
- package/CHANGELOG.md +152 -554
- package/LICENSE +1 -1
- package/README.md +22 -95
- package/config/env.js +9 -0
- package/jest/api/packages.json +42 -0
- package/jest/identity.js +29 -0
- package/jest/jest.config.js +39 -0
- package/jest/jestEnvironment.js +1 -0
- package/jest/server-handlers.ts +9 -0
- package/jest/server.ts +6 -0
- package/jest/setup-env.ts +15 -0
- package/jest/setup.ts +31 -0
- package/jest/unit/components/__mocks__/api.ts +47 -0
- package/jest/unit/components/__mocks__/token.ts +31 -0
- package/jest/unit/components/store/login.ts +23 -0
- package/jest/unit/components/store/logo.ts +7 -0
- package/jest/unit/components/store/package.ts +174 -0
- package/jest/unit/components/store/packageMeta.ts +592 -0
- package/jest/unit/empty.ts +1 -0
- package/lib/constants.ts +9 -0
- package/package.json +153 -228
- package/src/App/App.test.tsx +123 -0
- package/src/App/App.tsx +54 -0
- package/src/App/AppError.tsx +38 -0
- package/src/App/AppRoute.tsx +63 -0
- package/src/App/Footer/Footer.test.tsx +20 -0
- package/src/App/Footer/Footer.tsx +111 -0
- package/src/App/Footer/__snapshots__/Footer.test.tsx.snap +456 -0
- package/src/App/Footer/index.ts +1 -0
- package/src/App/Footer/styles.ts +44 -0
- package/src/App/Header/Header.test.tsx +152 -0
- package/src/App/Header/Header.tsx +74 -0
- package/src/App/Header/HeaderGreetings.tsx +22 -0
- package/src/App/Header/HeaderInfoDialog.tsx +19 -0
- package/src/App/Header/HeaderLeft.tsx +31 -0
- package/src/App/Header/HeaderMenu.tsx +65 -0
- package/src/App/Header/HeaderRight.tsx +118 -0
- package/src/App/Header/HeaderToolTip.tsx +19 -0
- package/src/App/Header/HeaderToolTipIcon.tsx +75 -0
- package/src/App/Header/LanguageSwitch.tsx +125 -0
- package/src/App/Header/LoginDialog/LoginDialog.test.tsx +112 -0
- package/src/App/Header/LoginDialog/LoginDialog.tsx +81 -0
- package/src/App/Header/LoginDialog/LoginDialogCloseButton.tsx +32 -0
- package/src/App/Header/LoginDialog/LoginDialogForm.tsx +97 -0
- package/src/App/Header/LoginDialog/LoginDialogFormError.tsx +43 -0
- package/src/App/Header/LoginDialog/LoginDialogHeader.tsx +48 -0
- package/src/App/Header/LoginDialog/__snapshots__/LoginDialog.test.tsx.snap +3 -0
- package/src/App/Header/LoginDialog/index.ts +1 -0
- package/src/App/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +27 -0
- package/src/App/Header/RegistryInfoContent/RegistryInfoContent.tsx +155 -0
- package/src/App/Header/RegistryInfoContent/index.ts +1 -0
- package/src/App/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +30 -0
- package/src/App/Header/RegistryInfoDialog/index.ts +1 -0
- package/src/App/Header/RegistryInfoDialog/styles.ts +16 -0
- package/src/App/Header/RegistryInfoDialog/types.ts +7 -0
- package/src/App/Header/Search/Search.test.tsx +168 -0
- package/src/App/Header/Search/Search.tsx +127 -0
- package/src/App/Header/Search/SearchAdornment.tsx +18 -0
- package/src/App/Header/Search/__snapshots__/Search.test.tsx.snap +101 -0
- package/src/App/Header/Search/index.ts +1 -0
- package/src/App/Header/index.ts +1 -0
- package/src/App/Header/styles.ts +89 -0
- package/src/App/index.ts +1 -0
- package/src/App/utils/loadable.tsx +10 -0
- package/src/components/.eslintrc +7 -0
- package/src/components/ActionBar/ActionBar.test.tsx +91 -0
- package/src/components/ActionBar/ActionBar.tsx +45 -0
- package/src/components/ActionBar/ActionBarAction.tsx +75 -0
- package/src/components/ActionBar/__snapshots__/ActionBar.test.tsx.snap +122 -0
- package/src/components/ActionBar/index.ts +1 -0
- package/src/components/AppBar.tsx +10 -0
- package/src/components/Author/Author.test.tsx +75 -0
- package/src/components/Author/Author.tsx +47 -0
- package/src/components/Author/__snapshots__/Author.test.tsx.snap +353 -0
- package/src/components/Author/index.ts +1 -0
- package/src/components/Author/styles.ts +23 -0
- package/src/components/AutoComplete/AutoComplete.tsx +179 -0
- package/src/components/AutoComplete/AutoCompleteV2.tsx +296 -0
- package/src/components/AutoComplete/index.ts +1 -0
- package/src/components/AutoComplete/styles.tsx +58 -0
- package/src/components/AutoComplete/useAutoComplete.tsx +61 -0
- package/src/components/Avatar.tsx +3 -0
- package/src/components/Box.tsx +8 -0
- package/src/components/Button.tsx +10 -0
- package/src/components/Card.tsx +10 -0
- package/src/components/CardActions.tsx +13 -0
- package/src/components/CardContent.tsx +10 -0
- package/src/components/Chip.tsx +10 -0
- package/src/components/CircularProgress.tsx +15 -0
- package/src/components/CopyToClipBoard.tsx +45 -0
- package/src/components/Dialog.tsx +10 -0
- package/src/components/DialogActions.tsx +16 -0
- package/src/components/DialogContent.tsx +16 -0
- package/src/components/DialogTitle.tsx +10 -0
- package/src/components/Divider.tsx +10 -0
- package/src/components/FloatingActionButton.tsx +12 -0
- package/src/components/FormControl.tsx +10 -0
- package/src/components/FormHelperText.tsx +16 -0
- package/src/components/Grid.tsx +10 -0
- package/src/components/Heading.tsx +15 -0
- package/src/components/IconButton.tsx +10 -0
- package/src/components/Icons/.eslintrc +5 -0
- package/src/components/Icons/Earth.tsx +36 -0
- package/src/components/Icons/FileBinary.tsx +20 -0
- package/src/components/Icons/Law.tsx +20 -0
- package/src/components/Icons/License.tsx +18 -0
- package/src/components/Icons/Time.tsx +19 -0
- package/src/components/Icons/Version.tsx +20 -0
- package/src/components/Icons/index.ts +5 -0
- package/src/components/Input.tsx +10 -0
- package/src/components/InputAdornment/InputAdornment.tsx +16 -0
- package/src/components/InputAdornment/index.ts +1 -0
- package/src/components/InputLabel.tsx +10 -0
- package/src/components/Label/Label.test.tsx +15 -0
- package/src/components/Label/Label.tsx +35 -0
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +14 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Link.tsx +39 -0
- package/src/components/List.tsx +10 -0
- package/src/components/ListItem.tsx +23 -0
- package/src/components/ListItemText.tsx +16 -0
- package/src/components/Loading/Loading.test.tsx +12 -0
- package/src/components/Loading/Loading.tsx +17 -0
- package/src/components/Loading/Spinner/Spinner.test.tsx +14 -0
- package/src/components/Loading/Spinner/Spinner.tsx +35 -0
- package/src/components/Loading/Spinner/__snapshots__/Spinner.test.tsx.snap +148 -0
- package/src/components/Loading/Spinner/index.tsx +1 -0
- package/src/components/Loading/__snapshots__/Loading.test.tsx.snap +86 -0
- package/src/components/Loading/index.ts +1 -0
- package/src/components/Loading/styles.ts +17 -0
- package/src/components/Logo/Logo.test.tsx +12 -0
- package/src/components/Logo/Logo.tsx +55 -0
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +19 -0
- package/src/components/Logo/img/logo-black-and-white.svg +1 -0
- package/src/components/Logo/img/logo.svg +1 -0
- package/src/components/Logo/index.ts +1 -0
- package/src/components/Menu.tsx +10 -0
- package/src/components/MenuItem.tsx +25 -0
- package/src/components/NotFound/NotFound.tsx +52 -0
- package/src/components/NotFound/Notfound.test.tsx +37 -0
- package/src/components/NotFound/__snapshots__/Notfound.test.tsx.snap +44 -0
- package/src/components/NotFound/img/package.svg +1 -0
- package/src/components/NotFound/index.ts +1 -0
- package/src/components/NotFound/styles.ts +40 -0
- package/src/components/Paper.tsx +10 -0
- package/src/components/SnackbarContent.tsx +15 -0
- package/src/components/SvgIcon.tsx +38 -0
- package/src/components/Tab.tsx +10 -0
- package/src/components/Tabs.tsx +14 -0
- package/src/components/Text/Text.tsx +17 -0
- package/src/components/Text/TextConfig.ts +7 -0
- package/src/components/Text/index.ts +2 -0
- package/src/components/TextField/TextField.test.tsx +16 -0
- package/src/components/TextField/TextField.tsx +23 -0
- package/src/components/TextField/__snapshots__/TextField.test.tsx.snap +19 -0
- package/src/components/TextField/index.ts +1 -0
- package/src/components/Toolbar.tsx +10 -0
- package/src/components/Tooltip.tsx +25 -0
- package/src/design-tokens/ResetStyles.tsx +44 -0
- package/src/design-tokens/StyleBaseline.tsx +14 -0
- package/src/design-tokens/ThemeContext.ts +13 -0
- package/src/design-tokens/ThemeProvider.tsx +44 -0
- package/src/design-tokens/emotion.ts +5 -0
- package/src/design-tokens/load-dayjs-locale.ts +98 -0
- package/src/design-tokens/theme.ts +159 -0
- package/src/design-tokens/useLocalStorage.ts +40 -0
- package/src/design-tokens/useOnClickOutside.ts +28 -0
- package/src/design-tokens/useTheme.ts +7 -0
- package/src/i18n/ABOUT_TRANSLATIONS.md +13 -0
- package/src/i18n/config.ts +52 -0
- package/src/i18n/crowdin/ui.json +170 -0
- package/src/i18n/deprecated_translations_dont_use/cs-CZ.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/de-DE.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/en-US.json +170 -0
- package/src/i18n/deprecated_translations_dont_use/es-ES.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/fr-FR.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/ja-JP.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/km-KH.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/pt-BR.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/ru-RU.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/tr-TR.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/uk-UA.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/zh-CN.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/zh-TW.json +165 -0
- package/src/i18n/enabledLanguages.ts +35 -0
- package/src/index.tsx +36 -0
- package/src/lib/constants.ts +9 -0
- package/src/pages/Version/DetailContainer/Dependencies/Dependencies.test.tsx +93 -0
- package/src/pages/Version/DetailContainer/Dependencies/Dependencies.tsx +100 -0
- package/src/pages/Version/DetailContainer/Dependencies/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Dependencies/styles.ts +26 -0
- package/src/pages/Version/DetailContainer/Dependencies/types.ts +7 -0
- package/src/pages/Version/DetailContainer/Deprecated/Deprecated.test.tsx +34 -0
- package/src/pages/Version/DetailContainer/Deprecated/Deprecated.tsx +31 -0
- package/src/pages/Version/DetailContainer/Deprecated/index.ts +1 -0
- package/src/pages/Version/DetailContainer/DetailContainer.test.tsx +13 -0
- package/src/pages/Version/DetailContainer/DetailContainer.tsx +37 -0
- package/src/pages/Version/DetailContainer/DetailContainerContent.tsx +41 -0
- package/src/pages/Version/DetailContainer/DetailContainerContentReadme.tsx +19 -0
- package/src/pages/Version/DetailContainer/DetailContainerTabs.tsx +36 -0
- package/src/pages/Version/DetailContainer/NoItems/NoItems.tsx +16 -0
- package/src/pages/Version/DetailContainer/NoItems/Noitems.test.tsx +16 -0
- package/src/pages/Version/DetailContainer/NoItems/__snapshots__/Noitems.test.tsx.snap +9 -0
- package/src/pages/Version/DetailContainer/NoItems/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Readme/Readme.spec.tsx +19 -0
- package/src/pages/Version/DetailContainer/Readme/Readme.tsx +22 -0
- package/src/pages/Version/DetailContainer/Readme/__snapshots__/Readme.spec.tsx.snap +94 -0
- package/src/pages/Version/DetailContainer/Readme/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Readme/types.ts +3 -0
- package/src/pages/Version/DetailContainer/UpLinks/UpLinks.test.tsx +58 -0
- package/src/pages/Version/DetailContainer/UpLinks/UpLinks.tsx +45 -0
- package/src/pages/Version/DetailContainer/UpLinks/__snapshots__/UpLinks.test.tsx.snap +247 -0
- package/src/pages/Version/DetailContainer/UpLinks/index.ts +1 -0
- package/src/pages/Version/DetailContainer/UpLinks/styles.ts +24 -0
- package/src/pages/Version/DetailContainer/Versions/Versions.test.tsx +60 -0
- package/src/pages/Version/DetailContainer/Versions/Versions.tsx +41 -0
- package/src/pages/Version/DetailContainer/Versions/VersionsHistoryList.tsx +40 -0
- package/src/pages/Version/DetailContainer/Versions/VersionsTagList.tsx +28 -0
- package/src/pages/Version/DetailContainer/Versions/__partials__/data.json +5984 -0
- package/src/pages/Version/DetailContainer/Versions/__snapshots__/Versions.test.tsx.snap +3 -0
- package/src/pages/Version/DetailContainer/Versions/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Versions/styles.ts +30 -0
- package/src/pages/Version/DetailContainer/__snapshots__/DetailContainer.test.tsx.snap +103 -0
- package/src/pages/Version/DetailContainer/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/DetailSidebar.tsx +55 -0
- package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.test.tsx +111 -0
- package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.tsx +53 -0
- package/src/pages/Version/DetailSidebar/DetailSidebarTitle.tsx +40 -0
- package/src/pages/Version/DetailSidebar/Developers/Developers.test.tsx +117 -0
- package/src/pages/Version/DetailSidebar/Developers/Developers.tsx +90 -0
- package/src/pages/Version/DetailSidebar/Developers/DevelopersTitle.tsx +32 -0
- package/src/pages/Version/DetailSidebar/Developers/__snapshots__/Developers.test.tsx.snap +380 -0
- package/src/pages/Version/DetailSidebar/Developers/get-unique-developer-values.ts +16 -0
- package/src/pages/Version/DetailSidebar/Developers/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Developers/styles.ts +31 -0
- package/src/pages/Version/DetailSidebar/Dist/Dist.test.tsx +78 -0
- package/src/pages/Version/DetailSidebar/Dist/Dist.tsx +49 -0
- package/src/pages/Version/DetailSidebar/Dist/__snapshots__/Dist.test.tsx.snap +602 -0
- package/src/pages/Version/DetailSidebar/Dist/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Dist/styles.ts +27 -0
- package/src/pages/Version/DetailSidebar/Engines/Engines.test.tsx +71 -0
- package/src/pages/Version/DetailSidebar/Engines/Engines.tsx +58 -0
- package/src/pages/Version/DetailSidebar/Engines/img/node.png +0 -0
- package/src/pages/Version/DetailSidebar/Engines/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Engines/styles.ts +14 -0
- package/src/pages/Version/DetailSidebar/Install/Install.test.tsx +64 -0
- package/src/pages/Version/DetailSidebar/Install/Install.tsx +52 -0
- package/src/pages/Version/DetailSidebar/Install/InstallListItem.tsx +97 -0
- package/src/pages/Version/DetailSidebar/Install/__partials__/data.json +5984 -0
- package/src/pages/Version/DetailSidebar/Install/img/npm.svg +15 -0
- package/src/pages/Version/DetailSidebar/Install/img/pnpm.svg +1 -0
- package/src/pages/Version/DetailSidebar/Install/img/yarn.svg +1 -0
- package/src/pages/Version/DetailSidebar/Install/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Repository/Repository.test.tsx +78 -0
- package/src/pages/Version/DetailSidebar/Repository/Repository.tsx +93 -0
- package/src/pages/Version/DetailSidebar/Repository/__partials__/data.json +5984 -0
- package/src/pages/Version/DetailSidebar/Repository/__snapshots__/Repository.test.tsx.snap +3 -0
- package/src/pages/Version/DetailSidebar/Repository/img/git.png +0 -0
- package/src/pages/Version/DetailSidebar/Repository/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/index.ts +1 -0
- package/src/pages/Version/Version.test.tsx +68 -0
- package/src/pages/Version/Version.tsx +41 -0
- package/src/pages/Version/VersionContextProvider.tsx +43 -0
- package/src/pages/Version/VersionLayout.tsx +20 -0
- package/src/pages/Version/__partials__/data.json +5984 -0
- package/src/pages/Version/context.ts +10 -0
- package/src/pages/Version/get-route-package-name.ts +9 -0
- package/src/pages/Version/index.ts +4 -0
- package/src/pages/Version/version-config.ts +19 -0
- package/src/pages/home/Home.tsx +25 -0
- package/src/pages/home/PackageList/Help/Help.test.tsx +12 -0
- package/src/pages/home/PackageList/Help/Help.tsx +56 -0
- package/src/pages/home/PackageList/Help/__snapshots__/Help.test.tsx.snap +159 -0
- package/src/pages/home/PackageList/Help/index.ts +1 -0
- package/src/pages/home/PackageList/Help/styles.ts +13 -0
- package/src/pages/home/PackageList/Package/Package.test.tsx +56 -0
- package/src/pages/home/PackageList/Package/Package.tsx +253 -0
- package/src/pages/home/PackageList/Package/Tag/Tag.test.tsx +16 -0
- package/src/pages/home/PackageList/Package/Tag/Tag.tsx +11 -0
- package/src/pages/home/PackageList/Package/Tag/__snapshots__/Tag.test.tsx.snap +21 -0
- package/src/pages/home/PackageList/Package/Tag/index.ts +1 -0
- package/src/pages/home/PackageList/Package/Tag/styles.ts +11 -0
- package/src/pages/home/PackageList/Package/index.ts +1 -0
- package/src/pages/home/PackageList/Package/styles.ts +112 -0
- package/src/pages/home/PackageList/PackageList.tsx +81 -0
- package/src/pages/home/PackageList/Packagelist.test.tsx +60 -0
- package/src/pages/home/PackageList/index.ts +1 -0
- package/src/pages/home/index.ts +1 -0
- package/src/providers/API/api.test.ts +136 -0
- package/src/providers/API/api.ts +73 -0
- package/src/providers/API/storage.ts +12 -0
- package/src/providers/config/AppConfigurationProvider.tsx +57 -0
- package/src/providers/config/index.ts +1 -0
- package/src/store/index.ts +1 -0
- package/src/store/models/configuration.ts +42 -0
- package/src/store/models/download.ts +31 -0
- package/src/store/models/index.ts +17 -0
- package/src/store/models/login.ts +90 -0
- package/src/store/models/manifest.ts +91 -0
- package/src/store/models/packages.ts +36 -0
- package/src/store/models/search.ts +81 -0
- package/src/store/store.ts +15 -0
- package/src/template/favicon.ico +0 -0
- package/src/template/index.html +21 -0
- package/src/utils/.eslintrc +5 -0
- package/src/utils/cli-utils.test.ts +66 -0
- package/src/utils/cli-utils.ts +38 -0
- package/src/utils/colors.ts +1 -0
- package/src/utils/constants.ts +5 -0
- package/src/utils/file-size.ts +13 -0
- package/src/utils/i18nForTests.ts +25 -0
- package/src/utils/login.test.ts +71 -0
- package/src/utils/login.ts +44 -0
- package/src/utils/package.test.ts +101 -0
- package/src/utils/package.ts +105 -0
- package/src/utils/sec-utils.ts +15 -0
- package/src/utils/storage.ts +12 -0
- package/src/utils/test-react-testing-library.tsx +38 -0
- package/src/utils/url.test.ts +28 -0
- package/src/utils/url.ts +58 -0
- package/src/utils/windows.ts +3 -0
- package/static/favicon.ico +0 -0
- package/static/index.html +21 -0
- package/static/main.c57129036f278d0c7acf.js +2 -0
- package/static/main.c57129036f278d0c7acf.js.LICENSE.txt +1456 -0
- package/static/manifest.json +5 -17
- package/static/runtime.c57129036f278d0c7acf.js +2 -0
- package/static/{runtime.f6e570dfe38870a45bf5.js.LICENSE.txt → runtime.c57129036f278d0c7acf.js.LICENSE.txt} +2 -2
- package/static/vendors.c57129036f278d0c7acf.js +2 -0
- package/static/vendors.c57129036f278d0c7acf.js.LICENSE.txt +2932 -0
- package/tools/.eslintrc +14 -0
- package/tools/_verdaccio.config.yaml +59 -0
- package/tools/dev.server.js +48 -0
- package/tools/getPackageJson.js +25 -0
- package/tools/verdaccio.js +31 -0
- package/tools/webpack.config.js +82 -0
- package/tools/webpack.dev.config.babel.js +60 -0
- package/tools/webpack.prod.config.babel.js +81 -0
- package/tsconfig.build.json +24 -0
- package/tsconfig.json +27 -0
- package/types/custom.d.ts +9 -0
- package/types/files.d.ts +9 -0
- package/types/index.ts +12 -0
- package/types/jest-dom.d.ts +1 -0
- package/types/packageMeta.ts +82 -0
- package/static/238.f6e570dfe38870a45bf5.js +0 -2
- package/static/238.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/718.f6e570dfe38870a45bf5.js +0 -2
- package/static/718.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/73.f6e570dfe38870a45bf5.js +0 -2
- package/static/73.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Dependencies.f6e570dfe38870a45bf5.js +0 -2
- package/static/Dependencies.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Dist.f6e570dfe38870a45bf5.js +0 -2
- package/static/Dist.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Engines.f6e570dfe38870a45bf5.js +0 -2
- package/static/Engines.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Home.f6e570dfe38870a45bf5.js +0 -2
- package/static/Home.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Install.f6e570dfe38870a45bf5.js +0 -2
- package/static/Install.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/NotFound.f6e570dfe38870a45bf5.js +0 -2
- package/static/NotFound.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Provider.f6e570dfe38870a45bf5.js +0 -2
- package/static/Provider.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Repository.f6e570dfe38870a45bf5.js +0 -2
- package/static/Repository.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/UpLinks.f6e570dfe38870a45bf5.js +0 -2
- package/static/UpLinks.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Version.f6e570dfe38870a45bf5.js +0 -2
- package/static/Version.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Versions.f6e570dfe38870a45bf5.js +0 -2
- package/static/Versions.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/main.f6e570dfe38870a45bf5.js +0 -2
- package/static/main.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/runtime.f6e570dfe38870a45bf5.js +0 -2
- package/static/vendors.f6e570dfe38870a45bf5.js +0 -2
- package/static/vendors.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -98
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<Loading /> component should render the component in default state 1`] = `
|
|
4
|
+
.emotion-0 {
|
|
5
|
+
-webkit-transform: translate(-50%,-50%);
|
|
6
|
+
-ms-transform: translate(-50%,-50%);
|
|
7
|
+
transform: translate(-50%,-50%);
|
|
8
|
+
top: 50%;
|
|
9
|
+
left: 50%;
|
|
10
|
+
position: absolute;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.emotion-2 {
|
|
14
|
+
margin: 0 0 30px 0;
|
|
15
|
+
border-radius: 25px;
|
|
16
|
+
box-shadow: 0 10px 20px 0 rgba(69,58,100,0.2);
|
|
17
|
+
background: #f7f8f6;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.emotion-4 {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
vertical-align: middle;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
background-position: center;
|
|
25
|
+
background-size: contain;
|
|
26
|
+
background-image: url([object Object]);
|
|
27
|
+
background-repeat: no-repeat;
|
|
28
|
+
width: 90px;
|
|
29
|
+
height: 90px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.emotion-6 {
|
|
33
|
+
display: -webkit-box;
|
|
34
|
+
display: -webkit-flex;
|
|
35
|
+
display: -ms-flexbox;
|
|
36
|
+
display: flex;
|
|
37
|
+
-webkit-align-items: center;
|
|
38
|
+
-webkit-box-align: center;
|
|
39
|
+
-ms-flex-align: center;
|
|
40
|
+
align-items: center;
|
|
41
|
+
-webkit-box-pack: center;
|
|
42
|
+
-webkit-justify-content: center;
|
|
43
|
+
-ms-flex-pack: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.emotion-8 {
|
|
48
|
+
color: #4b5e40;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
<div
|
|
52
|
+
class="emotion-0 emotion-1"
|
|
53
|
+
data-testid="loading"
|
|
54
|
+
>
|
|
55
|
+
<div
|
|
56
|
+
class="emotion-2 emotion-3"
|
|
57
|
+
>
|
|
58
|
+
<div
|
|
59
|
+
class="emotion-4 emotion-5"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
<div
|
|
63
|
+
class="emotion-6 emotion-7"
|
|
64
|
+
>
|
|
65
|
+
<div
|
|
66
|
+
class="MuiCircularProgress-root emotion-8 emotion-9 MuiCircularProgress-colorPrimary MuiCircularProgress-indeterminate"
|
|
67
|
+
role="progressbar"
|
|
68
|
+
style="width: 50px; height: 50px;"
|
|
69
|
+
>
|
|
70
|
+
<svg
|
|
71
|
+
class="MuiCircularProgress-svg"
|
|
72
|
+
viewBox="22 22 44 44"
|
|
73
|
+
>
|
|
74
|
+
<circle
|
|
75
|
+
class="MuiCircularProgress-circle MuiCircularProgress-circleIndeterminate"
|
|
76
|
+
cx="44"
|
|
77
|
+
cy="44"
|
|
78
|
+
fill="none"
|
|
79
|
+
r="20.2"
|
|
80
|
+
stroke-width="3.6"
|
|
81
|
+
/>
|
|
82
|
+
</svg>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Loading';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
|
|
3
|
+
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
4
|
+
|
|
5
|
+
export const Wrapper = styled('div')({
|
|
6
|
+
transform: 'translate(-50%, -50%)',
|
|
7
|
+
top: '50%',
|
|
8
|
+
left: '50%',
|
|
9
|
+
position: 'absolute',
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const Badge = styled('div')<{ theme?: Theme }>(({ theme }) => ({
|
|
13
|
+
margin: '0 0 30px 0',
|
|
14
|
+
borderRadius: 25,
|
|
15
|
+
boxShadow: '0 10px 20px 0 rgba(69, 58, 100, 0.2)',
|
|
16
|
+
background: theme?.palette.type === 'dark' ? theme?.palette.black : '#f7f8f6',
|
|
17
|
+
}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from 'verdaccio-ui/utils/test-react-testing-library';
|
|
4
|
+
|
|
5
|
+
import Logo from './Logo';
|
|
6
|
+
|
|
7
|
+
describe('<Logo /> component', () => {
|
|
8
|
+
test('should render the component in default state', () => {
|
|
9
|
+
const { container } = render(<Logo />);
|
|
10
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
5
|
+
import { useConfig } from 'verdaccio-ui/providers/config';
|
|
6
|
+
|
|
7
|
+
import blackAndWithLogo from './img/logo-black-and-white.svg';
|
|
8
|
+
import defaultLogo from './img/logo.svg';
|
|
9
|
+
|
|
10
|
+
const sizes = {
|
|
11
|
+
'x-small': '30px',
|
|
12
|
+
small: '40px',
|
|
13
|
+
big: '90px',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const logos = {
|
|
17
|
+
light: defaultLogo,
|
|
18
|
+
dark: blackAndWithLogo,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
size?: keyof typeof sizes;
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const Logo: React.FC<Props> = ({ size, onClick, className }) => {
|
|
28
|
+
const { configOptions } = useConfig();
|
|
29
|
+
if (configOptions?.logo) {
|
|
30
|
+
return (
|
|
31
|
+
<ImageLogo onClick={onClick} className={className}>
|
|
32
|
+
<img alt="logo" height="40px" src={configOptions.logo} />
|
|
33
|
+
</ImageLogo>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return <StyledLogo size={size} onClick={onClick} className={className} />;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default Logo;
|
|
40
|
+
|
|
41
|
+
const ImageLogo = styled('div')({
|
|
42
|
+
fontSize: 0,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const StyledLogo = styled('div')<Props & { theme?: Theme }>(({ size = 'small', theme }) => ({
|
|
46
|
+
display: 'inline-block',
|
|
47
|
+
verticalAlign: 'middle',
|
|
48
|
+
boxSizing: 'border-box',
|
|
49
|
+
backgroundPosition: 'center',
|
|
50
|
+
backgroundSize: 'contain',
|
|
51
|
+
backgroundImage: `url(${logos[theme?.palette.type]})`,
|
|
52
|
+
backgroundRepeat: ' no-repeat',
|
|
53
|
+
width: sizes[size],
|
|
54
|
+
height: sizes[size],
|
|
55
|
+
}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<Logo /> component should render the component in default state 1`] = `
|
|
4
|
+
.emotion-0 {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
vertical-align: middle;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
background-position: center;
|
|
9
|
+
background-size: contain;
|
|
10
|
+
background-image: url([object Object]);
|
|
11
|
+
background-repeat: no-repeat;
|
|
12
|
+
width: 40px;
|
|
13
|
+
height: 40px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
class="emotion-0 emotion-1"
|
|
18
|
+
/>
|
|
19
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><filter x="-19.8%" y="-11.7%" width="139.6%" height="140.4%" filterUnits="objectBoundingBox" id="a"><feOffset dy="4" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0" in="shadowBlurOuter1"/></filter><filter x="-33.9%" y="-50%" width="167.9%" height="272.7%" filterUnits="objectBoundingBox" id="c"><feOffset dy="4" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0" in="shadowBlurOuter1"/></filter><path id="b" d="M48 16.729L32.672 47h-8.874L0 0h15.328l12.907 25.492 4.437-8.763H48z"/><path d="M35.2 11H28V8.643h8.4l1.2-2.357H32V3.929h6.8l.8-1.572H36V0h20l-5.6 11H35.2z" id="d"/></defs><g fill="none" fill-rule="evenodd"><rect fill="#000" width="100" height="100" rx="37"/><g transform="translate(22 30)"><use fill="#000" filter="url(#a)" xlink:href="#b"/><use fill-opacity=".6" fill="#FFF" xlink:href="#b"/></g><g transform="translate(22 30)"><use fill="#000" filter="url(#c)" xlink:href="#d"/><use fill="#FFF" xlink:href="#d"/></g><path fill="#FFF" d="M54.785 77H45.88L22 30h15.38L58 70.718z"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="verdaccio"><Title>Verdaccio</Title><defs><path id="b" d="M48 17.6L32.8 48H24L.4.8h15.2l12.8 25.6 4.4-8.8H48z"/><filter x="-20%" y="-11.7%" width="139.9%" height="140.3%" filterUnits="objectBoundingBox" id="a"><feOffset dy="4" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0" in="shadowBlurOuter1"/></filter><path id="d" d="M50.8 12H35.6L41.2.8h15.2L50.8 12z"/><filter x="-45.7%" y="-49.1%" width="191.3%" height="269.6%" filterUnits="objectBoundingBox" id="c"><feOffset dy="4" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0" in="shadowBlurOuter1"/></filter></defs><g fill="none" fill-rule="evenodd"><rect fill="#F7F8F6" width="100" height="100" rx="37"/><g transform="translate(22 29)"><use fill="#000" filter="url(#a)" xlink:href="#b"/><path stroke="#405236" stroke-width="2.4" d="M46.058 18.8H33.542L28.4 29.083 14.858 2H2.342l22.4 44.8h7.316l14-28z" stroke-linejoin="square" fill="#405236"/></g><g transform="translate(22 29)"><use fill="#000" filter="url(#c)" xlink:href="#d"/><path stroke="#CD4000" stroke-width="2.4" d="M50.058 10.8l4.4-8.8H41.942l-4.4 8.8h12.516z" stroke-linejoin="square" fill="#CD4000"/></g><path d="M54.06 75.8l2.575-5.112L36.857 31H24.342l22.4 44.8h7.319z" stroke="#405236" stroke-width="2.4" fill="#4A5E3F"/><path d="M59.6 31h15.221M55.6 35h15.221M51.6 39.8h15.221" stroke="#CD4000" stroke-width="2.4" stroke-linecap="square"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Logo';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as MaterialUIMenu, MenuProps } from '@material-ui/core/Menu';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
type MenuRef = HTMLDivElement;
|
|
5
|
+
|
|
6
|
+
const Menu = forwardRef<MenuRef, MenuProps>(function Menu(props, ref) {
|
|
7
|
+
return <MaterialUIMenu {...props} ref={ref} />;
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export default Menu;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import { default as MaterialUIMenuItem, MenuItemProps } from '@material-ui/core/MenuItem';
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
|
|
5
|
+
type HTMLElementTagName = keyof HTMLElementTagNameMap;
|
|
6
|
+
type MenuItemRef = HTMLElementTagNameMap[HTMLElementTagName];
|
|
7
|
+
|
|
8
|
+
interface Props extends Omit<MenuItemProps, 'component'> {
|
|
9
|
+
component?: HTMLElementTagName;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const MenuItem = forwardRef<MenuItemRef, Props>(function MenuItem(props, ref) {
|
|
13
|
+
// it seems typescript has some discrimination type limitions. Please see: https://github.com/mui-org/material-ui/issues/14971
|
|
14
|
+
// @ts-ignore Type Types of property 'button' are incompatible.
|
|
15
|
+
return <StyledMaterialUIMenuItem {...props} ref={ref as any} />;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
MenuItem.defaultProps = {
|
|
19
|
+
component: 'li',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default MenuItem;
|
|
23
|
+
const StyledMaterialUIMenuItem = styled(MaterialUIMenuItem)({
|
|
24
|
+
outline: 'none',
|
|
25
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { useHistory } from 'react-router-dom';
|
|
5
|
+
|
|
6
|
+
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
7
|
+
|
|
8
|
+
import Box from '../Box';
|
|
9
|
+
import Button from '../Button';
|
|
10
|
+
import Heading from '../Heading';
|
|
11
|
+
|
|
12
|
+
import PackageImg from './img/package.svg';
|
|
13
|
+
|
|
14
|
+
const NotFound: React.FC = () => {
|
|
15
|
+
const history = useHistory();
|
|
16
|
+
const { t } = useTranslation();
|
|
17
|
+
|
|
18
|
+
const handleGoHome = useCallback(() => {
|
|
19
|
+
history.push('/');
|
|
20
|
+
}, [history]);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Box
|
|
24
|
+
alignItems="center"
|
|
25
|
+
data-testid="404"
|
|
26
|
+
display="flex"
|
|
27
|
+
flexDirection="column"
|
|
28
|
+
flexGrow={1}
|
|
29
|
+
justifyContent="center"
|
|
30
|
+
p={2}>
|
|
31
|
+
<EmptyPackage alt={t('error.404.page-not-found')} src={PackageImg} />
|
|
32
|
+
<StyledHeading className="not-found-text" variant="h4">
|
|
33
|
+
{t('error.404.sorry-we-could-not-find-it')}
|
|
34
|
+
</StyledHeading>
|
|
35
|
+
<Button data-testid="not-found-go-to-home-button" onClick={handleGoHome} variant="contained">
|
|
36
|
+
{t('button.go-to-the-home-page')}
|
|
37
|
+
</Button>
|
|
38
|
+
</Box>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default NotFound;
|
|
43
|
+
|
|
44
|
+
const EmptyPackage = styled('img')({
|
|
45
|
+
width: '150px',
|
|
46
|
+
margin: '0 auto',
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const StyledHeading = styled(Heading)<{ theme?: Theme }>(({ theme }) => ({
|
|
50
|
+
color: theme?.palette.type === 'light' ? theme?.palette.primary.main : theme?.palette.white,
|
|
51
|
+
marginBottom: 16,
|
|
52
|
+
}));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router';
|
|
3
|
+
|
|
4
|
+
import { render, fireEvent } from 'verdaccio-ui/utils/test-react-testing-library';
|
|
5
|
+
|
|
6
|
+
import NotFound from './NotFound';
|
|
7
|
+
|
|
8
|
+
const mockHistory = jest.fn();
|
|
9
|
+
|
|
10
|
+
jest.mock('react-router-dom', () => ({
|
|
11
|
+
useHistory: () => ({
|
|
12
|
+
push: mockHistory,
|
|
13
|
+
}),
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
describe('<NotFound /> component', () => {
|
|
17
|
+
test('should load the component in default state', () => {
|
|
18
|
+
const { container } = render(
|
|
19
|
+
<MemoryRouter>
|
|
20
|
+
<NotFound />
|
|
21
|
+
</MemoryRouter>
|
|
22
|
+
);
|
|
23
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('go to Home Page button click', async () => {
|
|
27
|
+
const { getByTestId } = render(
|
|
28
|
+
<MemoryRouter>
|
|
29
|
+
<NotFound />
|
|
30
|
+
</MemoryRouter>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const node = getByTestId('not-found-go-to-home-button');
|
|
34
|
+
fireEvent.click(node);
|
|
35
|
+
expect(mockHistory).toHaveBeenCalled();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<NotFound /> component should load the component in default state 1`] = `
|
|
4
|
+
.emotion-0 {
|
|
5
|
+
width: 150px;
|
|
6
|
+
margin: 0 auto;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.emotion-2 {
|
|
10
|
+
color: #4b5e40;
|
|
11
|
+
margin-bottom: 16px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
class="MuiBox-root MuiBox-root-1"
|
|
16
|
+
data-testid="404"
|
|
17
|
+
>
|
|
18
|
+
<img
|
|
19
|
+
alt="404 - Page not found"
|
|
20
|
+
class="emotion-0 emotion-1"
|
|
21
|
+
src="[object Object]"
|
|
22
|
+
/>
|
|
23
|
+
<h4
|
|
24
|
+
class="MuiTypography-root not-found-text emotion-2 emotion-3 MuiTypography-h4"
|
|
25
|
+
>
|
|
26
|
+
Sorry, we couldn't find it...
|
|
27
|
+
</h4>
|
|
28
|
+
<button
|
|
29
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-contained"
|
|
30
|
+
data-testid="not-found-go-to-home-button"
|
|
31
|
+
tabindex="0"
|
|
32
|
+
type="button"
|
|
33
|
+
>
|
|
34
|
+
<span
|
|
35
|
+
class="MuiButton-label"
|
|
36
|
+
>
|
|
37
|
+
Go to the home page
|
|
38
|
+
</span>
|
|
39
|
+
<span
|
|
40
|
+
class="MuiTouchRipple-root"
|
|
41
|
+
/>
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 495.2 495.2"><path fill="#d38c0d" d="M325.6 224.4L495.2 126 325.6 28.4l-168.8 99.2z"/><g fill="#efbb67"><path d="M170.4 224.4l168-97.6-168-98.4L0 126.8z"/><path d="M416 368.4l-168 98.4-168-98.4v-196L248 74l168 98.4z"/></g><path fill="#d38c0d" d="M248 74l168 98.4v196l-168 98.4"/><path fill="#efbb67" d="M326.4 314.8L495.2 218l-169.6-98.4L156 218z"/><path fill="#d38c0d" d="M170.4 316.4l168.8-99.2-168.8-97.6L0 218z"/><path fill="#704a0e" d="M248.8 270.8L416 172.4 248.8 74 78.4 172.4z"/><path fill="#513307" d="M248.8 270.8L416 172.4 248.8 74"/><path fill="#2d1c05" d="M248.8 270.8l36-21.6-36-20.8-36 20.8z"/><g fill="#0dd396"><path d="M368 379.6l40-23.2v-12.8l-40 23.2zM368 356.4l40-23.2v-12.8l-40 23.2zM368 333.2l40-23.2v-13.6l-40 24z"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './NotFound';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
|
|
3
|
+
import { PRIMARY_COLOR } from 'verdaccio-ui/utils/colors';
|
|
4
|
+
|
|
5
|
+
import { default as MuiCard } from '../Card';
|
|
6
|
+
import { default as Typography } from '../Heading';
|
|
7
|
+
import List from '../List';
|
|
8
|
+
|
|
9
|
+
export const Wrapper = styled('div')({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
flex: 1,
|
|
15
|
+
padding: '16px',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const Inner = styled('div')({
|
|
19
|
+
maxWidth: '650px',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
flexDirection: 'column',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const EmptyPackage = styled('img')({
|
|
25
|
+
width: '150px',
|
|
26
|
+
margin: '0 auto',
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const Heading = styled(Typography)({
|
|
30
|
+
color: PRIMARY_COLOR,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const StyledList = styled(List)({
|
|
34
|
+
padding: 0,
|
|
35
|
+
color: PRIMARY_COLOR,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const Card = styled(MuiCard)({
|
|
39
|
+
marginTop: '24px',
|
|
40
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as MaterialUIPaper, PaperProps } from '@material-ui/core/Paper';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
type PaperRef = HTMLElementTagNameMap[keyof HTMLElementTagNameMap];
|
|
5
|
+
|
|
6
|
+
const Paper = forwardRef<PaperRef, PaperProps>(function Paper(props, ref) {
|
|
7
|
+
return <MaterialUIPaper {...props} ref={ref} />;
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export default Paper;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
default as MaterialUISnackbarContent,
|
|
3
|
+
SnackbarContentProps,
|
|
4
|
+
} from '@material-ui/core/SnackbarContent';
|
|
5
|
+
import React, { forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
type SnackbarContentRef = HTMLDivElement;
|
|
8
|
+
|
|
9
|
+
const SnackbarContent = forwardRef<SnackbarContentRef, SnackbarContentProps>(
|
|
10
|
+
function SnackbarContent(props, ref) {
|
|
11
|
+
return <MaterialUISnackbarContent {...props} ref={ref} />;
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export default SnackbarContent;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import { default as MaterialUISvgIcon, SvgIconProps } from '@material-ui/core/SvgIcon';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
type Size = 'sm' | 'md';
|
|
6
|
+
|
|
7
|
+
type Props = Omit<SvgIconProps, 'color' | 'fontsize' | 'name'> & {
|
|
8
|
+
size?: Size;
|
|
9
|
+
title?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const SvgIcon = React.forwardRef<SVGSVGElement, Props>(function SvgIcon(
|
|
14
|
+
{ size = 'md', title, ...props },
|
|
15
|
+
ref
|
|
16
|
+
) {
|
|
17
|
+
return <StyledMaterialUISvgIcon size={size} titleAccess={title} {...props} ref={ref} />;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export { SvgIcon };
|
|
21
|
+
|
|
22
|
+
const getSize = (size: Size) => {
|
|
23
|
+
if (size === 'md') {
|
|
24
|
+
return {
|
|
25
|
+
width: 18,
|
|
26
|
+
height: 18,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
width: 14,
|
|
32
|
+
height: 16,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const StyledMaterialUISvgIcon = styled(MaterialUISvgIcon)<{ size: Size }>(({ size }) => ({
|
|
37
|
+
...getSize(size),
|
|
38
|
+
}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as MaterialUITab, TabProps } from '@material-ui/core/Tab';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
type TabRef = HTMLButtonElement;
|
|
5
|
+
|
|
6
|
+
const Tab = forwardRef<TabRef, TabProps>(function Tab(props, ref) {
|
|
7
|
+
return <MaterialUITab {...props} innerRef={ref} />;
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export default Tab;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as MaterialUITabs, TabsProps } from '@material-ui/core/Tabs';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
type TabsRef = HTMLElementTagNameMap[keyof HTMLElementTagNameMap];
|
|
5
|
+
|
|
6
|
+
interface Props extends Omit<TabsProps, 'onChange'> {
|
|
7
|
+
onChange: (event: React.ChangeEvent<{}>, value: number) => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Tabs = forwardRef<TabsRef, Props>(function Tabs(props, ref) {
|
|
11
|
+
return <MaterialUITabs {...props} innerRef={ref} />;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export default Tabs;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as MaterialUITypography } from '@material-ui/core/Typography';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { TextProps } from './TextConfig';
|
|
5
|
+
|
|
6
|
+
type TextRef = HTMLElementTagNameMap[keyof HTMLElementTagNameMap];
|
|
7
|
+
|
|
8
|
+
// The reference is already from type of the Component, so the any below is not a problem
|
|
9
|
+
const Text = forwardRef<TextRef, TextProps>(function Text(props, ref) {
|
|
10
|
+
return <MaterialUITypography {...props} component="span" ref={ref} />;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
Text.defaultProps = {
|
|
14
|
+
variant: 'subtitle1',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default Text;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from 'verdaccio-ui/utils/test-react-testing-library';
|
|
4
|
+
|
|
5
|
+
import TextField from './TextField';
|
|
6
|
+
|
|
7
|
+
describe('<TextField /> component', () => {
|
|
8
|
+
const props = {
|
|
9
|
+
name: 'test',
|
|
10
|
+
value: 'test',
|
|
11
|
+
};
|
|
12
|
+
test('should load the component in default state', () => {
|
|
13
|
+
const { container } = render(<TextField name={props.name} value={props.value} />);
|
|
14
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as MaterialUITextField, TextFieldProps } from '@material-ui/core/TextField';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
// The default element type of MUI's TextField is 'div'
|
|
5
|
+
type TextFieldRef = HTMLDivElement;
|
|
6
|
+
|
|
7
|
+
const TextField = forwardRef<TextFieldRef, TextFieldProps>(function TextField(
|
|
8
|
+
{ InputProps, classes, ...props },
|
|
9
|
+
ref
|
|
10
|
+
) {
|
|
11
|
+
return (
|
|
12
|
+
<MaterialUITextField
|
|
13
|
+
{...props}
|
|
14
|
+
innerRef={ref}
|
|
15
|
+
InputProps={{
|
|
16
|
+
...InputProps,
|
|
17
|
+
classes,
|
|
18
|
+
}}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export default TextField;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<TextField /> component should load the component in default state 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
class="MuiFormControl-root MuiTextField-root"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl"
|
|
9
|
+
>
|
|
10
|
+
<input
|
|
11
|
+
aria-invalid="false"
|
|
12
|
+
class="MuiInputBase-input MuiInput-input"
|
|
13
|
+
name="test"
|
|
14
|
+
type="text"
|
|
15
|
+
value="test"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TextField';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as MaterialUIToolbar, ToolbarProps } from '@material-ui/core/Toolbar';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
type ToolbarRef = HTMLDivElement;
|
|
5
|
+
|
|
6
|
+
const Toolbar = forwardRef<ToolbarRef, ToolbarProps>(function Toolbar(props, ref) {
|
|
7
|
+
return <MaterialUIToolbar {...props} ref={ref} />;
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export default Toolbar;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as MaterialUITooltip, TooltipProps } from '@material-ui/core/Tooltip';
|
|
2
|
+
import { TFunctionResult } from 'i18next';
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
|
|
5
|
+
// The default element type of MUI's Tooltip is 'div' and the change of this prop is not allowed
|
|
6
|
+
type TooltipRef = HTMLDivElement;
|
|
7
|
+
|
|
8
|
+
// Returning only the children in case of undefined title was necessary as the Tooltip component no longer accepts this type
|
|
9
|
+
// You can read more about this in this issue https://github.com/mui-org/material-ui/issues/20701
|
|
10
|
+
type Props = Omit<TooltipProps, 'title'> & {
|
|
11
|
+
title: TFunctionResult;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Tooltip = forwardRef<TooltipRef, Props>(function ToolTip({ title, children, ...props }, ref) {
|
|
15
|
+
if (!title) {
|
|
16
|
+
return children;
|
|
17
|
+
}
|
|
18
|
+
return (
|
|
19
|
+
<MaterialUITooltip {...props} title={title} innerRef={ref}>
|
|
20
|
+
{children}
|
|
21
|
+
</MaterialUITooltip>
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export default Tooltip;
|