@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,58 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
|
|
4
|
+
import Avatar from 'verdaccio-ui/components/Avatar';
|
|
5
|
+
import Grid from 'verdaccio-ui/components/Grid';
|
|
6
|
+
import List from 'verdaccio-ui/components/List';
|
|
7
|
+
import ListItemText from 'verdaccio-ui/components/ListItemText';
|
|
8
|
+
|
|
9
|
+
import { DetailContext } from '../../context';
|
|
10
|
+
import npm from '../Install/img/npm.svg';
|
|
11
|
+
|
|
12
|
+
import node from './img/node.png';
|
|
13
|
+
import { StyledText, EngineListItem } from './styles';
|
|
14
|
+
|
|
15
|
+
const Engine: React.FC = () => {
|
|
16
|
+
const { packageMeta } = useContext(DetailContext);
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
|
|
19
|
+
const engines = packageMeta?.latest?.engines;
|
|
20
|
+
|
|
21
|
+
if (!engines || (!engines.node && !engines.npm)) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Grid container={true}>
|
|
27
|
+
{engines.node && (
|
|
28
|
+
<Grid item={true} xs={6}>
|
|
29
|
+
<List
|
|
30
|
+
subheader={
|
|
31
|
+
<StyledText variant={'subtitle1'}>{t('sidebar.engines.node-js')}</StyledText>
|
|
32
|
+
}>
|
|
33
|
+
<EngineListItem button={true}>
|
|
34
|
+
<Avatar src={node} />
|
|
35
|
+
<ListItemText primary={engines.node} />
|
|
36
|
+
</EngineListItem>
|
|
37
|
+
</List>
|
|
38
|
+
</Grid>
|
|
39
|
+
)}
|
|
40
|
+
|
|
41
|
+
{engines.npm && (
|
|
42
|
+
<Grid item={true} xs={6}>
|
|
43
|
+
<List
|
|
44
|
+
subheader={
|
|
45
|
+
<StyledText variant={'subtitle1'}>{t('sidebar.engines.npm-version')}</StyledText>
|
|
46
|
+
}>
|
|
47
|
+
<EngineListItem button={true}>
|
|
48
|
+
<Avatar src={npm} />
|
|
49
|
+
<ListItemText primary={engines.npm} />
|
|
50
|
+
</EngineListItem>
|
|
51
|
+
</List>
|
|
52
|
+
</Grid>
|
|
53
|
+
)}
|
|
54
|
+
</Grid>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default Engine;
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Engines';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
|
|
3
|
+
import ListItem from 'verdaccio-ui/components/ListItem';
|
|
4
|
+
import Text from 'verdaccio-ui/components/Text';
|
|
5
|
+
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
6
|
+
|
|
7
|
+
export const StyledText = styled(Text)<{ theme?: Theme }>((props) => ({
|
|
8
|
+
fontWeight: props.theme?.fontWeight.bold,
|
|
9
|
+
textTransform: 'capitalize',
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
export const EngineListItem = styled(ListItem)({
|
|
13
|
+
paddingLeft: 0,
|
|
14
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render, screen } from 'verdaccio-ui/utils/test-react-testing-library';
|
|
4
|
+
|
|
5
|
+
import { DetailContext } from '../../context';
|
|
6
|
+
import { DetailContextProps } from '../../version-config';
|
|
7
|
+
|
|
8
|
+
import data from './__partials__/data.json';
|
|
9
|
+
import Install from './Install';
|
|
10
|
+
|
|
11
|
+
const detailContextValue: Partial<DetailContextProps> = {
|
|
12
|
+
packageName: 'foo',
|
|
13
|
+
packageMeta: data,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const ComponentToBeRendered: React.FC = () => (
|
|
17
|
+
<DetailContext.Provider value={detailContextValue}>
|
|
18
|
+
<Install />
|
|
19
|
+
</DetailContext.Provider>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/* eslint-disable react/jsx-no-bind*/
|
|
23
|
+
describe('<Install />', () => {
|
|
24
|
+
test('renders correctly', () => {
|
|
25
|
+
render(<ComponentToBeRendered />);
|
|
26
|
+
expect(screen.getByText('pnpm install foo')).toBeInTheDocument();
|
|
27
|
+
expect(screen.getByText('yarn add foo')).toBeInTheDocument();
|
|
28
|
+
expect(screen.getByText('npm install foo')).toBeInTheDocument();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('should have 3 children', () => {
|
|
32
|
+
window.__VERDACCIO_BASENAME_UI_OPTIONS.pkgManagers = ['yarn', 'pnpm', 'npm'];
|
|
33
|
+
const { getByTestId } = render(<ComponentToBeRendered />);
|
|
34
|
+
const installListItems = getByTestId('installList');
|
|
35
|
+
// installitems + subHeader = 4
|
|
36
|
+
expect(installListItems.children.length).toBe(4);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('should have the element NPM', () => {
|
|
40
|
+
window.__VERDACCIO_BASENAME_UI_OPTIONS.pkgManagers = ['npm'];
|
|
41
|
+
const { getByTestId, queryByText } = render(<ComponentToBeRendered />);
|
|
42
|
+
expect(getByTestId('installListItem-npm')).toBeTruthy();
|
|
43
|
+
expect(queryByText(`npm install ${detailContextValue.packageName}`)).toBeTruthy();
|
|
44
|
+
expect(queryByText('Install using npm')).toBeTruthy();
|
|
45
|
+
expect(screen.queryByText('pnpm install foo')).not.toBeInTheDocument();
|
|
46
|
+
expect(screen.queryByText('yarn add foo')).not.toBeInTheDocument();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('should have the element YARN', () => {
|
|
50
|
+
window.__VERDACCIO_BASENAME_UI_OPTIONS.pkgManagers = ['yarn'];
|
|
51
|
+
const { getByTestId, queryByText } = render(<ComponentToBeRendered />);
|
|
52
|
+
expect(getByTestId('installListItem-yarn')).toBeTruthy();
|
|
53
|
+
expect(queryByText(`yarn add ${detailContextValue.packageName}`)).toBeTruthy();
|
|
54
|
+
expect(queryByText('Install using yarn')).toBeTruthy();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test('should have the element PNPM', () => {
|
|
58
|
+
window.__VERDACCIO_BASENAME_UI_OPTIONS.pkgManagers = ['pnpm'];
|
|
59
|
+
const { getByTestId, queryByText } = render(<ComponentToBeRendered />);
|
|
60
|
+
expect(getByTestId('installListItem-pnpm')).toBeTruthy();
|
|
61
|
+
expect(queryByText(`pnpm install ${detailContextValue.packageName}`)).toBeTruthy();
|
|
62
|
+
expect(queryByText('Install using pnpm')).toBeTruthy();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
|
|
5
|
+
import List from 'verdaccio-ui/components/List';
|
|
6
|
+
import Text from 'verdaccio-ui/components/Text';
|
|
7
|
+
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
8
|
+
import { useConfig } from 'verdaccio-ui/providers/config';
|
|
9
|
+
|
|
10
|
+
import { DetailContext } from '../..';
|
|
11
|
+
|
|
12
|
+
import InstallListItem, { DependencyManager } from './InstallListItem';
|
|
13
|
+
|
|
14
|
+
const StyledText = styled(Text)<{ theme?: Theme }>((props) => ({
|
|
15
|
+
fontWeight: props.theme?.fontWeight.bold,
|
|
16
|
+
textTransform: 'capitalize',
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
const Install: React.FC = () => {
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
const { configOptions } = useConfig();
|
|
22
|
+
const detailContext = useContext(DetailContext);
|
|
23
|
+
|
|
24
|
+
const { packageMeta, packageName } = detailContext;
|
|
25
|
+
|
|
26
|
+
if (!packageMeta || !packageName) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const hasNpm = configOptions?.pkgManagers?.includes('npm');
|
|
31
|
+
const hasYarn = configOptions?.pkgManagers?.includes('yarn');
|
|
32
|
+
const hasPnpm = configOptions?.pkgManagers?.includes('pnpm') ?? true;
|
|
33
|
+
const hasPkgManagers = hasNpm | hasPnpm | hasYarn;
|
|
34
|
+
|
|
35
|
+
return hasPkgManagers ? (
|
|
36
|
+
<List
|
|
37
|
+
data-testid={'installList'}
|
|
38
|
+
subheader={<StyledText variant={'subtitle1'}>{t('sidebar.installation.title')}</StyledText>}>
|
|
39
|
+
{hasNpm && (
|
|
40
|
+
<InstallListItem dependencyManager={DependencyManager.NPM} packageName={packageName} />
|
|
41
|
+
)}
|
|
42
|
+
{hasYarn && (
|
|
43
|
+
<InstallListItem dependencyManager={DependencyManager.YARN} packageName={packageName} />
|
|
44
|
+
)}
|
|
45
|
+
{hasPnpm && (
|
|
46
|
+
<InstallListItem dependencyManager={DependencyManager.PNPM} packageName={packageName} />
|
|
47
|
+
)}
|
|
48
|
+
</List>
|
|
49
|
+
) : null;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default Install;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
|
|
5
|
+
import Avatar from 'verdaccio-ui/components/Avatar';
|
|
6
|
+
import CopyToClipBoard from 'verdaccio-ui/components/CopyToClipBoard';
|
|
7
|
+
import ListItem from 'verdaccio-ui/components/ListItem';
|
|
8
|
+
import ListItemText from 'verdaccio-ui/components/ListItemText';
|
|
9
|
+
|
|
10
|
+
// logos of package managers
|
|
11
|
+
import npmLogo from './img/npm.svg';
|
|
12
|
+
import pnpmLogo from './img/pnpm.svg';
|
|
13
|
+
import yarnLogo from './img/yarn.svg';
|
|
14
|
+
|
|
15
|
+
const InstallItem = styled(ListItem)({
|
|
16
|
+
padding: 0,
|
|
17
|
+
':hover': {
|
|
18
|
+
backgroundColor: 'transparent',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const InstallListItemText = styled(ListItemText)({
|
|
23
|
+
padding: '0 10px',
|
|
24
|
+
margin: 0,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const PackageMangerAvatar = styled(Avatar)({
|
|
28
|
+
borderRadius: '0px',
|
|
29
|
+
padding: '0',
|
|
30
|
+
img: {
|
|
31
|
+
backgroundColor: 'transparent',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export enum DependencyManager {
|
|
36
|
+
NPM = 'npm',
|
|
37
|
+
YARN = 'yarn',
|
|
38
|
+
PNPM = 'pnpm',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface Interface {
|
|
42
|
+
packageName: string;
|
|
43
|
+
dependencyManager: DependencyManager;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const InstallListItem: React.FC<Interface> = ({ packageName, dependencyManager }) => {
|
|
47
|
+
const { t } = useTranslation();
|
|
48
|
+
|
|
49
|
+
switch (dependencyManager) {
|
|
50
|
+
case DependencyManager.NPM:
|
|
51
|
+
return (
|
|
52
|
+
<InstallItem button={true} data-testid={'installListItem-npm'}>
|
|
53
|
+
<PackageMangerAvatar alt="npm" src={npmLogo} />
|
|
54
|
+
<InstallListItemText
|
|
55
|
+
primary={
|
|
56
|
+
<CopyToClipBoard
|
|
57
|
+
text={t('sidebar.installation.install-using-npm-command', { packageName })}
|
|
58
|
+
/>
|
|
59
|
+
}
|
|
60
|
+
secondary={t('sidebar.installation.install-using-npm')}
|
|
61
|
+
/>
|
|
62
|
+
</InstallItem>
|
|
63
|
+
);
|
|
64
|
+
case DependencyManager.YARN:
|
|
65
|
+
return (
|
|
66
|
+
<InstallItem button={true} data-testid={'installListItem-yarn'}>
|
|
67
|
+
<PackageMangerAvatar alt="yarn" src={yarnLogo} />
|
|
68
|
+
<InstallListItemText
|
|
69
|
+
primary={
|
|
70
|
+
<CopyToClipBoard
|
|
71
|
+
text={t('sidebar.installation.install-using-yarn-command', { packageName })}
|
|
72
|
+
/>
|
|
73
|
+
}
|
|
74
|
+
secondary={t('sidebar.installation.install-using-yarn')}
|
|
75
|
+
/>
|
|
76
|
+
</InstallItem>
|
|
77
|
+
);
|
|
78
|
+
case DependencyManager.PNPM:
|
|
79
|
+
return (
|
|
80
|
+
<InstallItem button={true} data-testid={'installListItem-pnpm'}>
|
|
81
|
+
<PackageMangerAvatar alt={'pnpm'} src={pnpmLogo} />
|
|
82
|
+
<InstallListItemText
|
|
83
|
+
primary={
|
|
84
|
+
<CopyToClipBoard
|
|
85
|
+
text={t('sidebar.installation.install-using-pnpm-command', { packageName })}
|
|
86
|
+
/>
|
|
87
|
+
}
|
|
88
|
+
secondary={t('sidebar.installation.install-using-pnpm')}
|
|
89
|
+
/>
|
|
90
|
+
</InstallItem>
|
|
91
|
+
);
|
|
92
|
+
default:
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default InstallListItem;
|