@verdaccio/ui-components 3.0.0-next.2 → 4.0.0-next-8.0
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/.eslintrc +1 -1
- package/CHANGELOG.md +85 -0
- package/build/AppTest/AppRoute.js +34 -0
- package/build/AppTest/pages/Front/Home.js +9 -0
- package/build/AppTest/pages/Front/index.js +14 -0
- package/build/AppTest/pages/Version/Version.js +34 -0
- package/build/AppTest/pages/Version/index.js +14 -0
- package/build/Theme/ResetStyles.js +2 -3
- package/build/Theme/StyleBaseline.js +2 -3
- package/build/Theme/ThemeProvider.js +3 -3
- package/build/Theme/colors.js +1 -2
- package/build/Theme/index.js +3 -3
- package/build/Theme/theme.js +17 -7
- package/build/__mocks__/react-markdown.js +1 -1
- package/build/components/ActionBar/ActionBar.js +8 -7
- package/build/components/ActionBar/ActionBarAction.js +13 -14
- package/build/components/ActionBar/index.js +1 -1
- package/build/components/Author/Author.js +15 -45
- package/build/components/Author/index.js +1 -1
- package/build/components/Author/styles.js +3 -5
- package/build/components/CopyClipboard/CopyToClipBoard.js +2 -3
- package/build/components/CopyClipboard/index.js +1 -1
- package/build/components/CopyClipboard/utils.js +3 -12
- package/build/components/Dependencies/Dependencies.js +31 -58
- package/build/components/Dependencies/DependencyBlock.js +102 -0
- package/build/components/Dependencies/index.js +1 -1
- package/build/components/Dependencies/utits.js +10 -0
- package/build/components/Deprecated/Deprecated.js +2 -3
- package/build/components/Deprecated/index.js +1 -1
- package/build/components/Developers/DeveloperType.js +12 -0
- package/build/components/Developers/Developers.js +26 -32
- package/build/components/Developers/Title.js +7 -13
- package/build/components/Developers/get-unique-developer-values.js +1 -2
- package/build/components/Developers/index.js +4 -4
- package/build/components/Distribution/Dist.js +3 -4
- package/build/components/Distribution/index.js +1 -1
- package/build/components/Distribution/styles.js +14 -31
- package/build/components/Engines/Engines.js +10 -5
- package/build/components/Engines/index.js +1 -1
- package/build/components/Engines/styles.js +9 -11
- package/build/components/ErrorBoundary/ErrorBoundary.js +2 -2
- package/build/components/ErrorBoundary/index.js +1 -1
- package/build/components/Forbidden/Forbidden.js +75 -0
- package/build/components/Forbidden/index.js +14 -0
- package/build/components/FundButton/FundButton.js +11 -13
- package/build/components/FundButton/index.js +1 -1
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +5 -5
- package/build/components/HeaderInfoDialog/index.js +1 -1
- package/build/components/Heading/Heading.js +5 -6
- package/build/components/Heading/index.js +1 -1
- package/build/components/Help/Help.js +4 -5
- package/build/components/Help/index.js +1 -1
- package/build/components/Help/styles.js +2 -3
- package/build/components/Icons/DevsIcons/CommonJS.js +2 -13
- package/build/components/Icons/DevsIcons/ES6Module.js +3 -14
- package/build/components/Icons/DevsIcons/Git.js +2 -13
- package/build/components/Icons/DevsIcons/NodeJS.js +2 -13
- package/build/components/Icons/DevsIcons/TypeScript.js +2 -13
- package/build/components/Icons/Earth.js +3 -4
- package/build/components/Icons/FileBinary.js +14 -9
- package/build/components/Icons/Law.js +15 -10
- package/build/components/Icons/License.js +3 -4
- package/build/components/Icons/License.js.map +1 -1
- package/build/components/Icons/Managers/Npm.js +2 -13
- package/build/components/Icons/Managers/Pnpm.js +2 -13
- package/build/components/Icons/Managers/Yarn.js +2 -13
- package/build/components/Icons/SvgIcon.js +3 -4
- package/build/components/Icons/Time.js +3 -4
- package/build/components/Icons/Version.js +3 -4
- package/build/components/Install/Install.js +30 -26
- package/build/components/Install/InstallListItem.js +22 -23
- package/build/components/Install/index.js +1 -1
- package/build/components/Keywords/KeywordListItems.js +34 -0
- package/build/components/Keywords/Keywords.js +39 -0
- package/build/components/Keywords/index.js +14 -0
- package/build/components/Label/Label.js +3 -4
- package/build/components/Label/index.js +1 -1
- package/build/components/Link/Link.js +5 -19
- package/build/components/Link/index.js +2 -2
- package/build/components/LinkExternal/LinkExternal.js +32 -0
- package/build/components/LinkExternal/index.js +14 -0
- package/build/components/Loading/Loading.js +2 -3
- package/build/components/Loading/Spinner/Spinner.js +2 -3
- package/build/components/Loading/Spinner/index.js +1 -1
- package/build/components/Loading/index.js +1 -1
- package/build/components/Loading/styles.js +6 -7
- package/build/components/LoginDialog/LoginDialog.js +16 -6
- package/build/components/LoginDialog/LoginDialogCloseButton.js +5 -5
- package/build/components/LoginDialog/LoginDialogForm.js +7 -20
- package/build/components/LoginDialog/LoginDialogFormError.js +7 -7
- package/build/components/LoginDialog/LoginDialogHeader.js +2 -3
- package/build/components/LoginDialog/index.js +1 -1
- package/build/components/Logo/Logo.js +15 -9
- package/build/components/Logo/index.js +1 -1
- package/build/components/MenuItem/MenuItem.js +5 -6
- package/build/components/MenuItem/index.js +1 -1
- package/build/components/NoItems/NoItems.js +2 -3
- package/build/components/NoItems/index.js +1 -1
- package/build/components/NotFound/NotFound.js +20 -19
- package/build/components/NotFound/index.js +1 -1
- package/build/components/Package/Package.js +48 -40
- package/build/components/Package/index.js +2 -2
- package/build/components/Package/styles.js +59 -84
- package/build/components/PackageList/PackageList.js +2 -3
- package/build/components/PackageList/index.js +1 -1
- package/build/components/Person/Person.js +48 -0
- package/build/components/Person/PersonTooltip.js +22 -0
- package/build/components/Person/index.js +14 -0
- package/build/components/Person/utils.js +17 -0
- package/build/components/RawViewer/RawViewer.js +13 -8
- package/build/components/RawViewer/index.js +1 -1
- package/build/components/Readme/Readme.js +46 -11
- package/build/components/Readme/Readme.js.map +1 -1
- package/build/components/Readme/Readme.spec.js +20 -1
- package/build/components/Readme/Readme.spec.js.map +1 -1
- package/build/components/Readme/{github-markdown-dark.css → github-markdown.css} +266 -83
- package/build/components/Readme/index.js +1 -1
- package/build/components/Readme/utils.js +14 -17
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +2 -3
- package/build/components/RegistryInfoDialog/index.js +1 -1
- package/build/components/RegistryInfoDialog/styles.js +13 -17
- package/build/components/Repository/Repository.js +23 -36
- package/build/components/Repository/index.js +1 -1
- package/build/components/Search/AutoComplete/AutoComplete.js +4 -5
- package/build/components/Search/AutoComplete/index.js +1 -1
- package/build/components/Search/AutoComplete/styles.js +6 -45
- package/build/components/Search/Search.js +11 -10
- package/build/components/Search/SearchItem.js +56 -45
- package/build/components/Search/index.js +1 -1
- package/build/components/Search/styles.js +3 -5
- package/build/components/Search/utils.js +23 -0
- package/build/components/SettingsMenu/SettingsMenu.js +36 -11
- package/build/components/SettingsMenu/index.js +1 -1
- package/build/components/SideBarTitle/SideBarTitle.js +104 -0
- package/build/components/SideBarTitle/index.js +14 -0
- package/build/components/{SideBarTittle → SideBarTitle}/utils.js +2 -3
- package/build/components/TextField/TextField.js +5 -6
- package/build/components/TextField/index.js +1 -1
- package/build/components/UpLinks/UpLinks.js +37 -9
- package/build/components/UpLinks/UplinkLink.js +22 -0
- package/build/components/UpLinks/index.js +1 -1
- package/build/components/UpLinks/styles.js +9 -11
- package/build/components/Versions/HistoryList.js +32 -26
- package/build/components/Versions/TagList.js +10 -7
- package/build/components/Versions/Versions.js +69 -16
- package/build/components/Versions/index.js +1 -1
- package/build/components/Versions/styles.js +3 -5
- package/build/hooks/index.js +1 -1
- package/build/hooks/useLocalStorage.js +1 -2
- package/build/hooks/useOnClickOutside.js +1 -2
- package/build/index.js +40 -8
- package/build/layouts/Version/Version.js +2 -3
- package/build/layouts/Version/index.js +1 -1
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +5 -5
- package/build/providers/AppConfigurationProvider/index.js +2 -2
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +5 -5
- package/build/providers/PersistenceSettingProvider/index.js +2 -2
- package/build/providers/TranslatorProvider/TranslatorProvider.js +4 -5
- package/build/providers/TranslatorProvider/TranslatorProvider.spec.js +3 -3
- package/build/providers/TranslatorProvider/index.js +2 -2
- package/build/providers/VersionProvider/VersionProvider.js +5 -7
- package/build/providers/VersionProvider/index.js +2 -2
- package/build/sections/Detail/ContainerContent.js +5 -7
- package/build/sections/Detail/Detail.js +13 -11
- package/build/sections/Detail/ReadmeSection.js +2 -3
- package/build/sections/Detail/Tabs.js +6 -8
- package/build/sections/Detail/index.js +1 -1
- package/build/sections/Footer/Footer.js +39 -11
- package/build/sections/Footer/index.js +1 -1
- package/build/sections/Footer/styles.js +19 -21
- package/build/sections/Header/Header.js +4 -5
- package/build/sections/Header/HeaderGreetings.js +2 -3
- package/build/sections/Header/HeaderLeft.js +16 -20
- package/build/sections/Header/HeaderMenu.js +3 -4
- package/build/sections/Header/HeaderRight.js +16 -8
- package/build/sections/Header/HeaderSettingsDialog.js +6 -10
- package/build/sections/Header/HeaderToolTip.js +2 -3
- package/build/sections/Header/HeaderToolTipIcon.js +4 -5
- package/build/sections/Header/LanguageSwitch.js +10 -13
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +14 -24
- package/build/sections/Header/RegistryInfoContent/index.js +1 -1
- package/build/sections/Header/RegistryInfoContent/styles.js +3 -5
- package/build/sections/Header/index.js +1 -1
- package/build/sections/Header/styles.js +54 -106
- package/build/sections/Home/Home.js +4 -5
- package/build/sections/Home/index.js +1 -1
- package/build/sections/SideBar/Sidebar.js +23 -30
- package/build/sections/SideBar/index.js +1 -1
- package/build/sections/index.js +1 -1
- package/build/src/AppTest/App.stories.d.ts +8 -0
- package/build/src/AppTest/AppRoute.d.ts +3 -0
- package/build/src/AppTest/pages/Front/Home.d.ts +2 -0
- package/build/src/AppTest/pages/Front/index.d.ts +1 -0
- package/build/src/AppTest/pages/Version/Version.d.ts +3 -0
- package/build/src/AppTest/pages/Version/index.d.ts +1 -0
- package/build/src/Theme/ThemeProvider.test.d.ts +1 -0
- package/build/src/components/Author/Author.d.ts +0 -5
- package/build/src/components/CopyClipboard/CopyToClipBoard.test.d.ts +1 -0
- package/build/src/components/Dependencies/DependencyBlock.d.ts +16 -0
- package/build/src/components/Dependencies/DependencyBlock.test.d.ts +1 -0
- package/build/src/components/Dependencies/utits.d.ts +3 -0
- package/build/src/components/Developers/DeveloperType.d.ts +4 -0
- package/build/src/components/Developers/Developers.d.ts +1 -4
- package/build/src/components/Developers/Title.d.ts +1 -4
- package/build/src/components/Developers/index.d.ts +2 -1
- package/build/src/components/Distribution/styles.d.ts +0 -1
- package/build/src/components/ErrorBoundary/ErrorBoundary.test.d.ts +1 -0
- package/build/src/components/Forbidden/Forbidden.d.ts +3 -0
- package/build/src/components/Forbidden/Forbidden.test.d.ts +1 -0
- package/build/src/components/Forbidden/index.d.ts +1 -0
- package/build/src/components/HeaderInfoDialog/HeaderInfoDialog.test.d.ts +1 -0
- package/build/src/components/Heading/Heading.test.d.ts +1 -0
- package/build/src/components/Icons/Icons.test.d.ts +1 -0
- package/build/src/components/Install/InstallListItem.d.ts +1 -1
- package/build/src/components/Keywords/KeywordListItems.d.ts +5 -0
- package/build/src/components/Keywords/Keywords.d.ts +6 -0
- package/build/src/components/Keywords/Keywords.stories.d.ts +5 -0
- package/build/src/components/Keywords/Keywords.test.d.ts +1 -0
- package/build/src/components/Keywords/index.d.ts +1 -0
- package/build/src/components/Link/Link.d.ts +0 -3
- package/build/src/components/Link/Link.test.d.ts +1 -0
- package/build/src/components/Link/index.d.ts +1 -1
- package/build/src/components/LinkExternal/LinkExternal.d.ts +3 -0
- package/build/src/components/LinkExternal/LinkExternal.test.d.ts +1 -0
- package/build/src/components/LinkExternal/index.d.ts +1 -0
- package/build/src/components/Loading/styles.d.ts +2 -2
- package/build/src/components/Logo/Logo.d.ts +1 -0
- package/build/src/components/Logo/Logo.stories.d.ts +5 -0
- package/build/src/components/Package/Package.d.ts +1 -1
- package/build/src/components/Package/styles.d.ts +7 -15
- package/build/src/components/Person/Person.d.ts +9 -0
- package/build/src/components/Person/Person.test.d.ts +1 -0
- package/build/src/components/Person/PersonTooltip.d.ts +6 -0
- package/build/src/components/Person/index.d.ts +1 -0
- package/build/src/components/Person/utils.d.ts +3 -0
- package/build/src/components/Readme/Readme.d.ts +1 -1
- package/build/src/components/RegistryInfoDialog/styles.d.ts +1 -1
- package/build/src/components/Search/AutoComplete/styles.d.ts +1 -9
- package/build/src/components/Search/SearchItem.d.ts +1 -1
- package/build/src/components/Search/utils.d.ts +1 -0
- package/build/src/components/SettingsMenu/SettingsMenu.d.ts +2 -2
- package/build/src/components/SettingsMenu/SettingsMenu.test.d.ts +1 -0
- package/build/src/components/SideBarTitle/index.d.ts +1 -0
- package/build/src/components/UpLinks/UplinkLink.d.ts +6 -0
- package/build/src/components/UpLinks/styles.d.ts +2 -2
- package/build/src/components/Versions/Versions.d.ts +1 -0
- package/build/src/components/Versions/styles.d.ts +2 -2
- package/build/src/index.d.ts +6 -2
- package/build/src/sections/Detail/Detail.stories.d.ts +1 -0
- package/build/src/sections/Detail/Tabs.d.ts +1 -0
- package/build/src/sections/Footer/styles.d.ts +5 -5
- package/build/src/sections/Header/RegistryInfoContent/RegistryInfoContent.d.ts +3 -3
- package/build/src/sections/Header/RegistryInfoContent/styles.d.ts +2 -2
- package/build/src/sections/Header/styles.d.ts +4 -11
- package/build/src/sections/Home/Home.test.d.ts +1 -0
- package/build/src/store/models/manifest.d.ts +11 -0
- package/build/src/store/models/routes.d.ts +8 -0
- package/build/src/store/models/utils.d.ts +1 -0
- package/build/src/types/packageMeta.d.ts +7 -5
- package/build/src/utils/__partials__/packageMeta.d.ts +0 -1
- package/build/src/utils/routes.d.ts +1 -0
- package/build/src/utils/utils.d.ts +1 -0
- package/build/store/api.js +14 -9
- package/build/store/index.js +1 -1
- package/build/store/models/configuration.js +4 -4
- package/build/store/models/download.js +2 -3
- package/build/store/models/index.js +1 -2
- package/build/store/models/login.js +7 -7
- package/build/store/models/manifest.js +27 -8
- package/build/store/models/packages.js +6 -5
- package/build/store/models/routes.js +18 -0
- package/build/store/models/search.js +7 -6
- package/build/store/models/utils.js +10 -0
- package/build/store/storage.js +2 -3
- package/build/store/store.js +2 -3
- package/build/test/i18n-config.js +2 -3
- package/build/test/test-react-testing-library.js +1 -1
- package/build/utils/__partials__/packageMeta.js +1 -3
- package/build/utils/index.js +3 -3
- package/build/utils/loadable.js +2 -2
- package/build/utils/routes.js +2 -2
- package/build/utils/token.js +1 -1
- package/build/utils/url.js +1 -1
- package/build/utils/utils.js +22 -4
- package/package.json +33 -32
- package/src/AppTest/App.stories.tsx +32 -0
- package/src/AppTest/AppRoute.test.tsx +65 -0
- package/src/AppTest/AppRoute.tsx +42 -0
- package/src/AppTest/pages/Front/Home.ts +3 -0
- package/src/AppTest/pages/Front/index.ts +1 -0
- package/src/AppTest/pages/Version/Version.tsx +28 -0
- package/src/AppTest/pages/Version/index.ts +1 -0
- package/src/Theme/ThemeProvider.test.tsx +27 -0
- package/src/Theme/theme.ts +12 -5
- package/src/components/ActionBar/ActionBar.test.tsx +36 -15
- package/src/components/ActionBar/ActionBar.tsx +1 -1
- package/src/components/ActionBar/ActionBarAction.tsx +8 -5
- package/src/components/Author/Author.test.tsx +7 -1
- package/src/components/Author/Author.tsx +3 -41
- package/src/components/CopyClipboard/CopyToClipBoard.test.tsx +23 -0
- package/src/components/CopyClipboard/utils.ts +2 -13
- package/src/components/Dependencies/Dependencies.stories.tsx +11 -11
- package/src/components/Dependencies/Dependencies.test.tsx +1 -11
- package/src/components/Dependencies/Dependencies.tsx +30 -69
- package/src/components/Dependencies/DependencyBlock.test.tsx +46 -0
- package/src/components/Dependencies/DependencyBlock.tsx +83 -0
- package/src/components/Dependencies/utits.ts +3 -0
- package/src/components/Developers/DeveloperType.tsx +4 -0
- package/src/components/Developers/Developers.test.tsx +37 -10
- package/src/components/Developers/Developers.tsx +13 -13
- package/src/components/Developers/Title.tsx +1 -5
- package/src/components/Developers/index.ts +2 -1
- package/src/components/Distribution/Dist.test.tsx +1 -1
- package/src/components/Distribution/Dist.tsx +2 -4
- package/src/components/Distribution/styles.ts +0 -6
- package/src/components/Engines/Engines.tsx +6 -2
- package/src/components/Engines/styles.ts +1 -1
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +39 -0
- package/src/components/Forbidden/Forbidden.test.tsx +38 -0
- package/src/components/Forbidden/Forbidden.tsx +56 -0
- package/src/components/Forbidden/index.ts +1 -0
- package/src/components/FundButton/FundButton.tsx +5 -5
- package/src/components/HeaderInfoDialog/HeaderInfoDialog.test.tsx +51 -0
- package/src/components/HeaderInfoDialog/HeaderInfoDialog.tsx +2 -2
- package/src/components/Heading/Heading.test.tsx +20 -0
- package/src/components/Help/Help.test.tsx +10 -3
- package/src/components/Icons/DevsIcons/CommonJS.tsx +1 -7
- package/src/components/Icons/DevsIcons/ES6Module.tsx +2 -8
- package/src/components/Icons/DevsIcons/Git.tsx +1 -7
- package/src/components/Icons/DevsIcons/NodeJS.tsx +1 -7
- package/src/components/Icons/DevsIcons/TypeScript.tsx +1 -7
- package/src/components/Icons/FileBinary.tsx +2 -1
- package/src/components/Icons/Icons.stories.tsx +21 -5
- package/src/components/Icons/Icons.test.tsx +70 -0
- package/src/components/Icons/Law.tsx +2 -1
- package/src/components/Icons/Managers/Npm.tsx +1 -7
- package/src/components/Icons/Managers/Pnpm.tsx +1 -7
- package/src/components/Icons/Managers/Yarn.tsx +1 -7
- package/src/components/Install/Install.test.tsx +54 -13
- package/src/components/Install/Install.tsx +12 -11
- package/src/components/Install/InstallListItem.tsx +15 -13
- package/src/components/Keywords/KeywordListItems.tsx +22 -0
- package/src/components/Keywords/Keywords.stories.tsx +19 -0
- package/src/components/Keywords/Keywords.test.tsx +57 -0
- package/src/components/Keywords/Keywords.tsx +35 -0
- package/src/components/Keywords/index.ts +1 -0
- package/src/components/Link/Link.test.tsx +25 -0
- package/src/components/Link/Link.tsx +4 -18
- package/src/components/Link/index.ts +1 -1
- package/src/components/LinkExternal/LinkExternal.test.tsx +18 -0
- package/src/components/LinkExternal/LinkExternal.tsx +22 -0
- package/src/components/LinkExternal/index.ts +1 -0
- package/src/components/Loading/Loading.test.tsx +8 -4
- package/src/components/Loading/styles.ts +1 -0
- package/src/components/LoginDialog/LoginDialog.test.tsx +1 -1
- package/src/components/LoginDialog/LoginDialog.tsx +10 -1
- package/src/components/LoginDialog/LoginDialogCloseButton.tsx +1 -0
- package/src/components/LoginDialog/LoginDialogForm.tsx +0 -2
- package/src/components/LoginDialog/LoginDialogFormError.tsx +1 -1
- package/src/components/Logo/Logo.stories.tsx +16 -0
- package/src/components/Logo/Logo.test.tsx +8 -1
- package/src/components/Logo/Logo.tsx +19 -3
- package/src/components/NotFound/NotFound.tsx +6 -5
- package/src/components/NotFound/Notfound.test.tsx +6 -3
- package/src/components/Package/Package.test.tsx +47 -14
- package/src/components/Package/Package.tsx +41 -44
- package/src/components/Package/styles.ts +7 -17
- package/src/components/PackageList/Packagelist.test.tsx +1 -0
- package/src/components/Person/Person.test.tsx +50 -0
- package/src/components/Person/Person.tsx +45 -0
- package/src/components/Person/PersonTooltip.tsx +26 -0
- package/src/components/Person/index.ts +1 -0
- package/src/components/Person/utils.ts +20 -0
- package/src/components/RawViewer/RawViewer.tsx +8 -4
- package/src/components/Readme/Readme.spec.tsx +17 -0
- package/src/components/Readme/Readme.tsx +34 -7
- package/src/components/Readme/{github-markdown-dark.css → github-markdown.css} +266 -83
- package/src/components/Readme/utils.ts +15 -14
- package/src/components/RegistryInfoDialog/styles.ts +5 -4
- package/src/components/Repository/Repository.tsx +10 -17
- package/src/components/Search/AutoComplete/AutoComplete.tsx +1 -1
- package/src/components/Search/AutoComplete/styles.ts +7 -0
- package/src/components/Search/Search.test.tsx +38 -11
- package/src/components/Search/Search.tsx +4 -2
- package/src/components/Search/SearchItem.tsx +19 -8
- package/src/components/Search/utils.ts +17 -0
- package/src/components/SettingsMenu/SettingsMenu.test.tsx +41 -0
- package/src/components/SettingsMenu/SettingsMenu.tsx +48 -10
- package/src/components/{SideBarTittle/SideBarTittle.tsx → SideBarTitle/SideBarTitle.tsx} +19 -3
- package/src/components/SideBarTitle/index.ts +1 -0
- package/src/components/UpLinks/UpLinks.test.tsx +7 -0
- package/src/components/UpLinks/UpLinks.tsx +38 -15
- package/src/components/UpLinks/UplinkLink.tsx +20 -0
- package/src/components/UpLinks/styles.ts +1 -0
- package/src/components/Versions/HistoryList.tsx +11 -6
- package/src/components/Versions/TagList.tsx +4 -3
- package/src/components/Versions/Versions.test.tsx +26 -8
- package/src/components/Versions/Versions.tsx +81 -28
- package/src/index.ts +6 -2
- package/src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx +1 -0
- package/src/providers/PersistenceSettingProvider/PersistenceSettingProvider.tsx +2 -0
- package/src/providers/VersionProvider/VersionProvider.test.tsx +3 -3
- package/src/sections/Detail/Detail.stories.tsx +10 -0
- package/src/sections/Detail/Detail.test.tsx +8 -1
- package/src/sections/Detail/Detail.tsx +11 -4
- package/src/sections/Detail/Tabs.tsx +6 -9
- package/src/sections/Footer/Footer.tsx +26 -12
- package/src/sections/Footer/styles.ts +4 -0
- package/src/sections/Header/Header.test.tsx +12 -10
- package/src/sections/Header/HeaderLeft.tsx +19 -11
- package/src/sections/Header/HeaderMenu.tsx +1 -1
- package/src/sections/Header/HeaderRight.tsx +14 -3
- package/src/sections/Header/HeaderSettingsDialog.tsx +2 -3
- package/src/sections/Header/LanguageSwitch.tsx +10 -7
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +1 -1
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.tsx +2 -7
- package/src/sections/Header/styles.ts +4 -16
- package/src/sections/Home/Home.test.tsx +37 -0
- package/src/sections/Home/Home.tsx +0 -1
- package/src/sections/SideBar/Sidebar.test.tsx +52 -84
- package/src/sections/SideBar/Sidebar.tsx +11 -26
- package/src/store/api.test.ts +19 -2
- package/src/store/api.ts +13 -6
- package/src/store/models/configuration.ts +2 -1
- package/src/store/models/login.ts +10 -12
- package/src/store/models/manifest.ts +25 -6
- package/src/store/models/packages.ts +4 -5
- package/src/store/models/routes.ts +10 -0
- package/src/store/models/search.ts +4 -2
- package/src/store/models/utils.ts +3 -0
- package/src/types/packageMeta.ts +7 -5
- package/src/utils/__partials__/packageMeta.ts +0 -1
- package/src/utils/routes.ts +1 -0
- package/src/utils/utils.test.ts +34 -0
- package/src/utils/utils.ts +20 -5
- package/tsconfig.json +1 -1
- package/build/components/Dependencies/styles.js +0 -68
- package/build/components/Developers/styles.js +0 -69
- package/build/components/Distribution/utils.js +0 -25
- package/build/components/Distribution/utilts.spec.js +0 -18
- package/build/components/Package/Tag/Tag.js +0 -15
- package/build/components/Package/Tag/index.js +0 -14
- package/build/components/Package/Tag/styles.js +0 -25
- package/build/components/Readme/ReadmeDark.js +0 -46
- package/build/components/Readme/ReadmeLight.js +0 -46
- package/build/components/Readme/github-markdown-light.css +0 -1014
- package/build/components/SideBarTittle/SideBarTittle.js +0 -95
- package/build/components/SideBarTittle/index.js +0 -14
- package/build/sections/Header/RegistryInfoDialog/RegistryInfoDialog.js +0 -37
- package/build/sections/Header/RegistryInfoDialog/index.js +0 -14
- package/build/sections/Header/RegistryInfoDialog/styles.js +0 -49
- package/build/sections/Header/RegistryInfoDialog/types.js +0 -6
- package/build/src/components/Dependencies/styles.d.ts +0 -8
- package/build/src/components/Developers/styles.d.ts +0 -11
- package/build/src/components/Distribution/utils.d.ts +0 -7
- package/build/src/components/Package/Tag/Tag.d.ts +0 -6
- package/build/src/components/Package/Tag/index.d.ts +0 -1
- package/build/src/components/Package/Tag/styles.d.ts +0 -5
- package/build/src/components/Readme/ReadmeDark.d.ts +0 -5
- package/build/src/components/Readme/ReadmeLight.d.ts +0 -5
- package/build/src/components/SideBarTittle/index.d.ts +0 -1
- package/build/src/sections/Header/RegistryInfoDialog/RegistryInfoDialog.d.ts +0 -4
- package/build/src/sections/Header/RegistryInfoDialog/index.d.ts +0 -1
- package/build/src/sections/Header/RegistryInfoDialog/styles.d.ts +0 -13
- package/build/src/sections/Header/RegistryInfoDialog/types.d.ts +0 -7
- package/src/components/Dependencies/styles.ts +0 -26
- package/src/components/Developers/styles.ts +0 -31
- package/src/components/Distribution/utils.ts +0 -32
- package/src/components/Distribution/utilts.spec.ts +0 -17
- package/src/components/Package/Tag/Tag.test.tsx +0 -15
- package/src/components/Package/Tag/Tag.tsx +0 -11
- package/src/components/Package/Tag/index.ts +0 -1
- package/src/components/Package/Tag/styles.ts +0 -11
- package/src/components/Readme/ReadmeDark.tsx +0 -32
- package/src/components/Readme/ReadmeLight.tsx +0 -32
- package/src/components/Readme/github-markdown-light.css +0 -1014
- package/src/components/Search/AutoComplete/styles.tsx +0 -42
- package/src/components/SideBarTittle/index.ts +0 -1
- package/src/sections/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +0 -31
- package/src/sections/Header/RegistryInfoDialog/index.ts +0 -1
- package/src/sections/Header/RegistryInfoDialog/styles.ts +0 -21
- package/src/sections/Header/RegistryInfoDialog/types.ts +0 -8
- /package/build/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
- /package/build/src/{components/Package/Tag/Tag.test.d.ts → AppTest/AppRoute.test.d.ts} +0 -0
- /package/build/src/components/{SideBarTittle/SideBarTittle.d.ts → SideBarTitle/SideBarTitle.d.ts} +0 -0
- /package/build/src/components/{SideBarTittle/SideBarTittle.stories.d.ts → SideBarTitle/SideBarTitle.stories.d.ts} +0 -0
- /package/build/src/components/{SideBarTittle → SideBarTitle}/utils.d.ts +0 -0
- /package/src/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
- /package/src/components/{SideBarTittle/SideBarTittle.stories.tsx → SideBarTitle/SideBarTitle.stories.tsx} +0 -0
- /package/src/components/{SideBarTittle → SideBarTitle}/utils.ts +0 -0
|
@@ -4,11 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
|
|
6
6
|
import { Theme } from '../../Theme';
|
|
7
|
-
|
|
8
|
-
export enum DeveloperType {
|
|
9
|
-
CONTRIBUTORS = 'contributors',
|
|
10
|
-
MAINTAINERS = 'maintainers',
|
|
11
|
-
}
|
|
7
|
+
import { DeveloperType } from './';
|
|
12
8
|
|
|
13
9
|
interface Props {
|
|
14
10
|
type: DeveloperType;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { default } from './Developers';
|
|
2
|
+
export { DeveloperType } from './DeveloperType';
|
|
@@ -33,7 +33,7 @@ describe('<Dist /> component', () => {
|
|
|
33
33
|
expect(getByText('sidebar.distribution.size')).toBeInTheDocument();
|
|
34
34
|
expect(getByText('sidebar.distribution.size')).toBeInTheDocument();
|
|
35
35
|
expect(getByText('7', { exact: false })).toBeInTheDocument();
|
|
36
|
-
expect(getByText('10
|
|
36
|
+
expect(getByText('10 Bytes', { exact: false })).toBeInTheDocument();
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
test('should render the component with license as string', () => {
|
|
@@ -3,8 +3,8 @@ import React, { FC } from 'react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
|
|
5
5
|
import { PackageMetaInterface } from '../../types/packageMeta';
|
|
6
|
+
import { fileSizeSI, formatLicense } from '../../utils/utils';
|
|
6
7
|
import { DistChips, DistListItem, StyledText } from './styles';
|
|
7
|
-
import { fileSizeSI, formatLicense } from './utils';
|
|
8
8
|
|
|
9
9
|
const DistChip: FC<{ name: string; children?: React.ReactElement | string }> = ({
|
|
10
10
|
name,
|
|
@@ -47,9 +47,7 @@ const Dist: FC<{ packageMeta: PackageMetaInterface }> = ({ packageMeta }) => {
|
|
|
47
47
|
<DistChip name={t('sidebar.distribution.size')}>{fileSizeSI(dist.unpackedSize)}</DistChip>
|
|
48
48
|
) : null}
|
|
49
49
|
|
|
50
|
-
<DistChip name={t('sidebar.distribution.license')}>
|
|
51
|
-
{formatLicense(license as string)}
|
|
52
|
-
</DistChip>
|
|
50
|
+
<DistChip name={t('sidebar.distribution.license')}>{formatLicense(license)}</DistChip>
|
|
53
51
|
</DistListItem>
|
|
54
52
|
</List>
|
|
55
53
|
);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import Chip from '@mui/material/Chip';
|
|
3
|
-
import FabMUI from '@mui/material/Fab';
|
|
4
3
|
import ListItem from '@mui/material/ListItem';
|
|
5
4
|
import Typography from '@mui/material/Typography';
|
|
6
5
|
|
|
@@ -22,8 +21,3 @@ export const DistChips = styled(Chip)({
|
|
|
22
21
|
textTransform: 'capitalize',
|
|
23
22
|
marginTop: 5,
|
|
24
23
|
});
|
|
25
|
-
|
|
26
|
-
export const DownloadButton = styled(FabMUI)<{ theme?: Theme }>((props) => ({
|
|
27
|
-
backgroundColor: props.theme?.palette.primary.main,
|
|
28
|
-
color: props.theme?.palette.white,
|
|
29
|
-
}));
|
|
@@ -23,8 +23,12 @@ const EngineItem: FC<EngineItemProps> = ({ title, element, engineText }) => (
|
|
|
23
23
|
<Grid item={true} xs={6}>
|
|
24
24
|
<List subheader={<StyledText variant={'subtitle1'}>{title}</StyledText>}>
|
|
25
25
|
<EngineListItem>
|
|
26
|
-
<Avatar sx={{
|
|
27
|
-
|
|
26
|
+
<Avatar sx={{ backgroundColor: 'transparent', marginLeft: 0, padding: 0 }}>
|
|
27
|
+
{element}
|
|
28
|
+
</Avatar>
|
|
29
|
+
<Typography sx={{ margin: 0, padding: '0 0 0 10px' }} variant="subtitle2">
|
|
30
|
+
{engineText}
|
|
31
|
+
</Typography>
|
|
28
32
|
</EngineListItem>
|
|
29
33
|
</List>
|
|
30
34
|
</Grid>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render, screen } from '../../test/test-react-testing-library';
|
|
4
|
+
import ErrorBoundary from './ErrorBoundary';
|
|
5
|
+
|
|
6
|
+
describe('ErrorBoundary component', () => {
|
|
7
|
+
test('should render children when no error is caught', () => {
|
|
8
|
+
render(
|
|
9
|
+
<ErrorBoundary>
|
|
10
|
+
<div>{'Test'}</div>
|
|
11
|
+
</ErrorBoundary>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
expect(screen.getByText('Test')).toBeInTheDocument();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('should render error information when error is caught', () => {
|
|
18
|
+
const ErrorComponent = () => {
|
|
19
|
+
throw new Error('Test error');
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Suppress error messages for this test
|
|
23
|
+
const spy = jest.spyOn(console, 'error');
|
|
24
|
+
spy.mockImplementation(() => {});
|
|
25
|
+
|
|
26
|
+
render(
|
|
27
|
+
<ErrorBoundary>
|
|
28
|
+
<ErrorComponent />
|
|
29
|
+
</ErrorBoundary>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
expect(screen.getByText('Something went wrong.')).toBeInTheDocument();
|
|
33
|
+
expect(screen.getByText(/error:/)).toBeInTheDocument();
|
|
34
|
+
expect(screen.getByText(/info:/)).toBeInTheDocument();
|
|
35
|
+
|
|
36
|
+
// Restore console.error after test
|
|
37
|
+
spy.mockRestore();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router';
|
|
3
|
+
|
|
4
|
+
import { fireEvent, render, screen } from '../../test/test-react-testing-library';
|
|
5
|
+
import Forbidden from './Forbidden';
|
|
6
|
+
|
|
7
|
+
const mockHistory = jest.fn();
|
|
8
|
+
|
|
9
|
+
jest.mock('react-router-dom', () => ({
|
|
10
|
+
useHistory: () => ({
|
|
11
|
+
push: mockHistory,
|
|
12
|
+
}),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
describe('<Forbidden /> component', () => {
|
|
16
|
+
test('should load the component in default state', () => {
|
|
17
|
+
render(
|
|
18
|
+
<MemoryRouter>
|
|
19
|
+
<Forbidden />
|
|
20
|
+
</MemoryRouter>
|
|
21
|
+
);
|
|
22
|
+
expect(screen.getByTestId('LockIcon')).toBeInTheDocument();
|
|
23
|
+
expect(screen.getByText('error.401.sorry-no-access')).toBeInTheDocument();
|
|
24
|
+
expect(screen.getByText('button.go-to-the-home-page')).toBeInTheDocument();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('go to Home Page button click', async () => {
|
|
28
|
+
const { getByTestId } = render(
|
|
29
|
+
<MemoryRouter>
|
|
30
|
+
<Forbidden />
|
|
31
|
+
</MemoryRouter>
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const node = getByTestId('not-found-go-to-home-button');
|
|
35
|
+
fireEvent.click(node);
|
|
36
|
+
expect(mockHistory).toHaveBeenCalled();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* eslint-disable react/forbid-component-props */
|
|
2
|
+
|
|
3
|
+
/* eslint-disable verdaccio/jsx-no-style */
|
|
4
|
+
import styled from '@emotion/styled';
|
|
5
|
+
import LockIcon from '@mui/icons-material/Lock';
|
|
6
|
+
import Box from '@mui/material/Box';
|
|
7
|
+
import Button from '@mui/material/Button';
|
|
8
|
+
import React, { useCallback } from 'react';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import { useHistory } from 'react-router-dom';
|
|
11
|
+
|
|
12
|
+
import { Theme } from '../..';
|
|
13
|
+
import Heading from '../Heading';
|
|
14
|
+
|
|
15
|
+
const Foebidden: React.FC = () => {
|
|
16
|
+
const history = useHistory();
|
|
17
|
+
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
|
|
20
|
+
const handleGoHome = useCallback(() => {
|
|
21
|
+
history.push('/');
|
|
22
|
+
}, [history]);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Box
|
|
26
|
+
alignItems="center"
|
|
27
|
+
data-testid="404"
|
|
28
|
+
display="flex"
|
|
29
|
+
flexDirection="column"
|
|
30
|
+
flexGrow={1}
|
|
31
|
+
justifyContent="center"
|
|
32
|
+
p={2}
|
|
33
|
+
>
|
|
34
|
+
<Container>
|
|
35
|
+
<LockIcon color="primary" style={{ fontSize: 236 }} />
|
|
36
|
+
</Container>
|
|
37
|
+
<StyledHeading className="not-found-text" variant="h4">
|
|
38
|
+
{t('error.401.sorry-no-access')}
|
|
39
|
+
</StyledHeading>
|
|
40
|
+
<Button data-testid="not-found-go-to-home-button" onClick={handleGoHome} variant="contained">
|
|
41
|
+
{t('button.go-to-the-home-page')}
|
|
42
|
+
</Button>
|
|
43
|
+
</Box>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default Foebidden;
|
|
48
|
+
|
|
49
|
+
const Container = styled('div')({
|
|
50
|
+
margin: '0 auto',
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const StyledHeading = styled(Heading)<{ theme?: Theme }>(({ theme }) => ({
|
|
54
|
+
color: theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.white,
|
|
55
|
+
marginBottom: 16,
|
|
56
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Forbidden';
|
|
@@ -6,11 +6,11 @@ import { Trans } from 'react-i18next';
|
|
|
6
6
|
|
|
7
7
|
import { Theme } from '../../Theme';
|
|
8
8
|
import { url } from '../../utils';
|
|
9
|
-
import
|
|
9
|
+
import LinkExternal from '../LinkExternal';
|
|
10
10
|
|
|
11
|
-
const StyledLink = styled(
|
|
12
|
-
marginTop: theme?.spacing(
|
|
13
|
-
marginBottom: theme?.spacing(
|
|
11
|
+
const StyledLink = styled(LinkExternal)<{ theme?: Theme }>(({ theme }) => ({
|
|
12
|
+
marginTop: theme?.spacing(2),
|
|
13
|
+
marginBottom: theme?.spacing(2),
|
|
14
14
|
textDecoration: 'none',
|
|
15
15
|
display: 'block',
|
|
16
16
|
}));
|
|
@@ -32,7 +32,7 @@ const FundButton: React.FC<{ packageMeta: any }> = ({ packageMeta }) => {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<StyledLink
|
|
35
|
+
<StyledLink to={fundingUrl} variant="button">
|
|
36
36
|
<Button
|
|
37
37
|
color="primary"
|
|
38
38
|
fullWidth={true}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { fireEvent, render, screen } from '../../test/test-react-testing-library';
|
|
4
|
+
import HeaderInfoDialog from './HeaderInfoDialog';
|
|
5
|
+
|
|
6
|
+
describe('HeaderInfoDialog', () => {
|
|
7
|
+
const onCloseDialog = jest.fn();
|
|
8
|
+
|
|
9
|
+
const tabs = [{ label: 'Tab 1' }, { label: 'Tab 2' }];
|
|
10
|
+
|
|
11
|
+
const tabPanels = [{ element: <div>{'Panel 1'}</div> }, { element: <div>{'Panel 2'}</div> }];
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
render(
|
|
15
|
+
<HeaderInfoDialog
|
|
16
|
+
dialogTitle="Dialog Title"
|
|
17
|
+
isOpen={true}
|
|
18
|
+
onCloseDialog={onCloseDialog}
|
|
19
|
+
tabPanels={tabPanels}
|
|
20
|
+
tabs={tabs}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('renders without crashing', () => {
|
|
26
|
+
expect(screen.getByRole('dialog')).toBeInTheDocument();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('displays the dialog title', () => {
|
|
30
|
+
expect(screen.getByText('Dialog Title')).toBeInTheDocument();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('renders the tabs correctly', () => {
|
|
34
|
+
expect(screen.getByText('Tab 1')).toBeInTheDocument();
|
|
35
|
+
expect(screen.getByText('Tab 2')).toBeInTheDocument();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('renders the tab panels correctly', async () => {
|
|
39
|
+
expect(screen.getByText('Panel 1')).toBeInTheDocument();
|
|
40
|
+
// Panel 2 should not be visible initially
|
|
41
|
+
expect(screen.queryByText('Panel 2')).not.toBeInTheDocument();
|
|
42
|
+
// Switch to Tab 2
|
|
43
|
+
fireEvent.click(screen.getByText('Tab 2'));
|
|
44
|
+
await expect(screen.queryByText('Panel 2')).toBeInTheDocument();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('calls onCloseDialog when the dialog is closed', () => {
|
|
48
|
+
fireEvent.click(screen.getByRole('button'));
|
|
49
|
+
expect(onCloseDialog).toHaveBeenCalled();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -54,7 +54,7 @@ const HeaderInfoDialog: React.FC<Props> = ({
|
|
|
54
54
|
<RegistryInfoDialog onClose={onCloseDialog} open={isOpen} title={dialogTitle}>
|
|
55
55
|
<Box sx={{ width: '100%' }}>
|
|
56
56
|
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
|
57
|
-
<Tabs aria-label="infoTabs" onChange={handleChange} value={value}>
|
|
57
|
+
<Tabs aria-label="infoTabs" data-testid={'tabs'} onChange={handleChange} value={value}>
|
|
58
58
|
{tabs
|
|
59
59
|
? tabs.map((item, index) => {
|
|
60
60
|
return (
|
|
@@ -68,7 +68,7 @@ const HeaderInfoDialog: React.FC<Props> = ({
|
|
|
68
68
|
{tabPanels
|
|
69
69
|
? tabPanels.map((item, index) => {
|
|
70
70
|
return (
|
|
71
|
-
<TabPanel index={index} key={
|
|
71
|
+
<TabPanel index={index} key={index} value={value}>
|
|
72
72
|
{item.element}
|
|
73
73
|
</TabPanel>
|
|
74
74
|
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render, screen } from '../../test/test-react-testing-library';
|
|
4
|
+
import Heading from './Heading';
|
|
5
|
+
|
|
6
|
+
describe('Heading component', () => {
|
|
7
|
+
test('should render correctly with default props', () => {
|
|
8
|
+
render(<Heading>{'Test'}</Heading>);
|
|
9
|
+
const headingElement = screen.getByText('Test');
|
|
10
|
+
expect(headingElement).toBeInTheDocument();
|
|
11
|
+
expect(headingElement.tagName).toBe('H6');
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('should render correctly with custom props', () => {
|
|
15
|
+
render(<Heading variant="h1">{'Test'}</Heading>);
|
|
16
|
+
const headingElement = screen.getByText('Test');
|
|
17
|
+
expect(headingElement).toBeInTheDocument();
|
|
18
|
+
expect(headingElement.tagName).toBe('H1');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { render } from '../../test/test-react-testing-library';
|
|
3
|
+
import { render, screen } from '../../test/test-react-testing-library';
|
|
4
4
|
import Help from './Help';
|
|
5
5
|
|
|
6
6
|
describe('<Help /> component', () => {
|
|
7
7
|
test('should load the component in default state', () => {
|
|
8
|
-
|
|
9
|
-
expect(
|
|
8
|
+
render(<Help />);
|
|
9
|
+
expect(screen.getByText('help.title')).toBeInTheDocument();
|
|
10
|
+
expect(screen.getByText('help.sub-title')).toBeInTheDocument();
|
|
11
|
+
expect(screen.getByText('help.first-step')).toBeInTheDocument();
|
|
12
|
+
expect(screen.getByText('help.first-step-command-line')).toBeInTheDocument();
|
|
13
|
+
expect(screen.getByText('help.second-step')).toBeInTheDocument();
|
|
14
|
+
expect(screen.getByText('help.second-step-command-line')).toBeInTheDocument();
|
|
15
|
+
expect(screen.getByText('help.third-step')).toBeInTheDocument();
|
|
16
|
+
expect(screen.getByText('button.learn-more')).toBeInTheDocument();
|
|
10
17
|
});
|
|
11
18
|
});
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import { Theme } from '@mui/material';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
|
|
5
3
|
const icon = require('./commonjs.svg');
|
|
6
4
|
|
|
7
|
-
const ImgIcon = styled.img<{ theme?: Theme }>(({ theme }) => ({
|
|
8
|
-
marginLeft: theme?.spacing(1),
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
5
|
export function CommonJS() {
|
|
12
|
-
return <
|
|
6
|
+
return <img alt="commonjs" height="20" src={icon} width="20" />;
|
|
13
7
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import { Theme } from '@mui/material';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
|
|
5
|
-
const icon = require('./
|
|
6
|
-
|
|
7
|
-
const ImgIcon = styled.img<{ theme?: Theme }>(({ theme }) => ({
|
|
8
|
-
marginLeft: theme?.spacing(1),
|
|
9
|
-
}));
|
|
3
|
+
const icon = require('./es6module.svg');
|
|
10
4
|
|
|
11
5
|
export function ES6Modules() {
|
|
12
|
-
return <
|
|
6
|
+
return <img alt="es6 modules" height="20" src={icon} width="20" />;
|
|
13
7
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import { Theme } from '@mui/material';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
|
|
5
3
|
const icon = require('./git.svg');
|
|
6
4
|
|
|
7
|
-
const ImgIcon = styled.img<{ theme?: Theme }>(({ theme }) => ({
|
|
8
|
-
marginLeft: theme?.spacing(1),
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
5
|
export function Git() {
|
|
12
|
-
return <
|
|
6
|
+
return <img alt="git" height="20" src={icon} width="20" />;
|
|
13
7
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import { Theme } from '@mui/material';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
|
|
5
3
|
const icon = require('./nodejs.svg');
|
|
6
4
|
|
|
7
|
-
const ImgIcon = styled.img<{ theme?: Theme }>(({ theme }) => ({
|
|
8
|
-
marginLeft: theme?.spacing(1),
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
5
|
export function NodeJS() {
|
|
12
|
-
return <
|
|
6
|
+
return <img alt="nodejs" height="20" src={icon} width="20" />;
|
|
13
7
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import { Theme } from '@mui/material';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
|
|
5
3
|
const icon = require('./typescript.svg');
|
|
6
4
|
|
|
7
|
-
const ImgIcon = styled.img<{ theme?: Theme }>(({ theme }) => ({
|
|
8
|
-
marginLeft: theme?.spacing(1),
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
5
|
export function TypeScript() {
|
|
12
|
-
return <
|
|
6
|
+
return <img alt="typescript" height="20" src={icon} width="20" />;
|
|
13
7
|
}
|
|
@@ -9,7 +9,8 @@ const FileBinary = React.forwardRef(function FileBinary(
|
|
|
9
9
|
ref: React.Ref<SVGSVGElement>
|
|
10
10
|
) {
|
|
11
11
|
return (
|
|
12
|
-
|
|
12
|
+
// eslint-disable-next-line verdaccio/jsx-spread
|
|
13
|
+
<SvgIcon viewBox="0 0 14 16" {...props} ref={ref}>
|
|
13
14
|
<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
15
|
</SvgIcon>
|
|
15
16
|
);
|
|
@@ -6,13 +6,17 @@ import {
|
|
|
6
6
|
CommonJS,
|
|
7
7
|
ES6Modules,
|
|
8
8
|
Earth,
|
|
9
|
+
FileBinary,
|
|
9
10
|
Git,
|
|
10
11
|
Law,
|
|
11
12
|
License,
|
|
12
13
|
NodeJS,
|
|
14
|
+
Npm,
|
|
15
|
+
Pnpm,
|
|
13
16
|
Time,
|
|
14
17
|
TypeScript,
|
|
15
18
|
Version,
|
|
19
|
+
Yarn,
|
|
16
20
|
} from '.';
|
|
17
21
|
|
|
18
22
|
export default {
|
|
@@ -21,16 +25,28 @@ export default {
|
|
|
21
25
|
|
|
22
26
|
export const Icons: any = () => (
|
|
23
27
|
<Box sx={{ width: '100%' }}>
|
|
24
|
-
<Stack spacing={2}>
|
|
28
|
+
<Stack direction="row" spacing={2}>
|
|
29
|
+
<Npm />
|
|
30
|
+
<Pnpm />
|
|
31
|
+
<Yarn />
|
|
32
|
+
</Stack>
|
|
33
|
+
<Stack direction="row" spacing={2}>
|
|
25
34
|
<NodeJS />
|
|
26
35
|
<Git />
|
|
27
|
-
|
|
36
|
+
</Stack>
|
|
37
|
+
<Stack direction="row" spacing={2}>
|
|
28
38
|
<TypeScript />
|
|
29
|
-
<Time />
|
|
30
|
-
<License />
|
|
31
|
-
<Law />
|
|
32
39
|
<ES6Modules />
|
|
33
40
|
<CommonJS />
|
|
41
|
+
</Stack>
|
|
42
|
+
<Stack direction="row" spacing={2}>
|
|
43
|
+
<Version />
|
|
44
|
+
<Time />
|
|
45
|
+
<FileBinary />
|
|
46
|
+
<Law />
|
|
47
|
+
</Stack>
|
|
48
|
+
<Stack direction="row" spacing={2}>
|
|
49
|
+
<License />
|
|
34
50
|
<Earth />
|
|
35
51
|
</Stack>
|
|
36
52
|
</Box>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from '../../test/test-react-testing-library';
|
|
4
|
+
import {
|
|
5
|
+
CommonJS,
|
|
6
|
+
ES6Modules,
|
|
7
|
+
Earth,
|
|
8
|
+
FileBinary,
|
|
9
|
+
Git,
|
|
10
|
+
Law,
|
|
11
|
+
License,
|
|
12
|
+
NodeJS,
|
|
13
|
+
Npm,
|
|
14
|
+
Pnpm,
|
|
15
|
+
Time,
|
|
16
|
+
TypeScript,
|
|
17
|
+
Version,
|
|
18
|
+
Yarn,
|
|
19
|
+
} from './';
|
|
20
|
+
import { SvgIcon } from './SvgIcon';
|
|
21
|
+
|
|
22
|
+
describe('Icon components', () => {
|
|
23
|
+
test('should render an SVG graphic', () => {
|
|
24
|
+
const { container } = render(
|
|
25
|
+
<>
|
|
26
|
+
<Earth />
|
|
27
|
+
<FileBinary />
|
|
28
|
+
<Law />
|
|
29
|
+
<License />
|
|
30
|
+
<Time />
|
|
31
|
+
<Version />
|
|
32
|
+
</>
|
|
33
|
+
);
|
|
34
|
+
expect(container.querySelectorAll('svg')).toHaveLength(6);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('should render an IMG graphic linking to and SVG', () => {
|
|
38
|
+
const { container } = render(
|
|
39
|
+
<>
|
|
40
|
+
<CommonJS />
|
|
41
|
+
<ES6Modules />
|
|
42
|
+
<Git />
|
|
43
|
+
<NodeJS />
|
|
44
|
+
<TypeScript />
|
|
45
|
+
<Npm />
|
|
46
|
+
<Pnpm />
|
|
47
|
+
<Yarn />
|
|
48
|
+
</>
|
|
49
|
+
);
|
|
50
|
+
expect(container.querySelectorAll('img')).toHaveLength(8);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('should render small graphic', () => {
|
|
54
|
+
const { container } = render(
|
|
55
|
+
<SvgIcon size={'sm'}>
|
|
56
|
+
<circle cx="7" cy="7" r="7" />
|
|
57
|
+
</SvgIcon>
|
|
58
|
+
);
|
|
59
|
+
expect(container.querySelector('svg')).toHaveStyle('width: 14px');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('should render medium graphic', () => {
|
|
63
|
+
const { container } = render(
|
|
64
|
+
<SvgIcon size={'md'}>
|
|
65
|
+
<circle cx="7" cy="7" r="7" />
|
|
66
|
+
</SvgIcon>
|
|
67
|
+
);
|
|
68
|
+
expect(container.querySelector('svg')).toHaveStyle('width: 18px');
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -6,7 +6,8 @@ type Props = React.ComponentProps<typeof SvgIcon>;
|
|
|
6
6
|
|
|
7
7
|
const Law = React.forwardRef(function Law(props: Props, ref: React.Ref<SVGSVGElement>) {
|
|
8
8
|
return (
|
|
9
|
-
|
|
9
|
+
// eslint-disable-next-line verdaccio/jsx-spread
|
|
10
|
+
<SvgIcon viewBox="0 0 14 16" {...props} ref={ref}>
|
|
10
11
|
<path
|
|
11
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"
|
|
12
13
|
fillRule="evenodd"
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import { Theme } from '@mui/material';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
|
|
5
3
|
const icon = require('./npm.svg');
|
|
6
4
|
|
|
7
|
-
const ImgIcon = styled.img<{ theme?: Theme }>(({ theme }) => ({
|
|
8
|
-
marginLeft: theme?.spacing(1),
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
5
|
export function Npm() {
|
|
12
|
-
return <
|
|
6
|
+
return <img alt="npm package manager" height="20" src={icon} width="20" />;
|
|
13
7
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import { Theme } from '@mui/material';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
|
|
5
3
|
const icon = require('./pnpm.svg');
|
|
6
4
|
|
|
7
|
-
const ImgIcon = styled.img<{ theme?: Theme }>(({ theme }) => ({
|
|
8
|
-
marginLeft: theme?.spacing(1),
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
5
|
export function Pnpm() {
|
|
12
|
-
return <
|
|
6
|
+
return <img alt="pnpm package manager" height="20" src={icon} width="20" />;
|
|
13
7
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import { Theme } from '@mui/material';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
|
|
5
3
|
const icon = require('./yarn.svg');
|
|
6
4
|
|
|
7
|
-
const ImgIcon = styled.img<{ theme?: Theme }>(({ theme }) => ({
|
|
8
|
-
marginLeft: theme?.spacing(1),
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
5
|
export function Yarn() {
|
|
12
|
-
return <
|
|
6
|
+
return <img alt="npm package manager" height="20" src={icon} width="20" />;
|
|
13
7
|
}
|