@verdaccio/ui-theme 6.0.0-6-next.12 → 6.0.0-6-next.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +1 -1
- package/.eslintrc +0 -15
- package/CHANGELOG.md +6 -0
- package/jest/setup-env.ts +4 -1
- package/jest/unit/components/__mocks__/token.ts +0 -1
- package/jest/unit/components/store/login.ts +1 -0
- package/package.json +34 -37
- package/src/App/App.test.tsx +4 -6
- package/src/App/App.tsx +3 -5
- package/src/App/AppRoute.tsx +1 -1
- package/src/App/Footer/Footer.test.tsx +0 -1
- package/src/App/Footer/Footer.tsx +3 -3
- package/src/App/Footer/__snapshots__/Footer.test.tsx.snap +25 -9
- package/src/App/Footer/styles.ts +2 -3
- package/src/App/Header/Header.test.tsx +3 -5
- package/src/App/Header/Header.tsx +3 -5
- package/src/App/Header/HeaderGreetings.tsx +0 -1
- package/src/App/Header/HeaderLeft.tsx +0 -1
- package/src/App/Header/HeaderMenu.tsx +3 -3
- package/src/App/Header/HeaderRight.tsx +1 -2
- package/src/App/Header/HeaderToolTip.tsx +0 -1
- package/src/App/Header/HeaderToolTipIcon.tsx +10 -10
- package/src/App/Header/LanguageSwitch.tsx +4 -5
- package/src/App/Header/LoginDialog/LoginDialog.test.tsx +4 -7
- package/src/App/Header/LoginDialog/LoginDialog.tsx +2 -4
- package/src/App/Header/LoginDialog/LoginDialogCloseButton.tsx +1 -2
- package/src/App/Header/LoginDialog/LoginDialogForm.tsx +0 -1
- package/src/App/Header/LoginDialog/LoginDialogFormError.tsx +1 -2
- package/src/App/Header/LoginDialog/LoginDialogHeader.tsx +4 -4
- package/src/App/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +1 -2
- package/src/App/Header/RegistryInfoContent/RegistryInfoContent.tsx +9 -10
- package/src/App/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +1 -2
- package/src/App/Header/RegistryInfoDialog/styles.ts +0 -1
- package/src/App/Header/Search/Search.test.tsx +32 -41
- package/src/App/Header/Search/Search.tsx +15 -58
- package/src/App/Header/Search/__snapshots__/Search.test.tsx.snap +392 -28
- package/src/App/Header/styles.ts +2 -3
- package/src/App/utils/loadable.tsx +2 -1
- package/src/components/ActionBar/ActionBar.test.tsx +5 -13
- package/src/components/ActionBar/ActionBar.tsx +0 -2
- package/src/components/ActionBar/ActionBarAction.tsx +6 -7
- package/src/components/ActionBar/__snapshots__/ActionBar.test.tsx.snap +198 -53
- package/src/components/AppBar.tsx +1 -1
- package/src/components/Author/Author.test.tsx +1 -3
- package/src/components/Author/Author.tsx +2 -4
- package/src/components/Author/__snapshots__/Author.test.tsx.snap +804 -48
- package/src/components/Author/styles.ts +0 -1
- package/src/components/AutoComplete/AutoComplete.tsx +85 -163
- package/src/components/AutoComplete/AutoCompleteV2.tsx +7 -9
- package/src/components/AutoComplete/styles.tsx +0 -15
- package/src/components/Avatar.tsx +1 -1
- package/src/components/Box.tsx +1 -1
- package/src/components/Button.tsx +1 -1
- package/src/components/Card.tsx +1 -1
- package/src/components/CardActions.tsx +1 -1
- package/src/components/CardContent.tsx +1 -1
- package/src/components/Chip.tsx +1 -1
- package/src/components/CircularProgress.tsx +2 -2
- package/src/components/CopyToClipBoard.tsx +2 -3
- package/src/components/Dialog.tsx +1 -1
- package/src/components/DialogActions.tsx +2 -2
- package/src/components/DialogContent.tsx +2 -2
- package/src/components/DialogTitle.tsx +1 -1
- package/src/components/Divider.tsx +1 -1
- package/src/components/FloatingActionButton.tsx +1 -1
- package/src/components/FormControl.tsx +1 -1
- package/src/components/FormHelperText.tsx +2 -2
- package/src/components/Grid.tsx +1 -1
- package/src/components/Heading.tsx +1 -1
- package/src/components/IconButton.tsx +1 -1
- package/src/components/Input.tsx +1 -1
- package/src/components/InputAdornment/InputAdornment.tsx +2 -2
- package/src/components/InputLabel.tsx +1 -1
- package/src/components/Label/Label.test.tsx +0 -1
- package/src/components/Label/Label.tsx +1 -2
- package/src/components/List.tsx +1 -1
- package/src/components/ListItem.tsx +1 -1
- package/src/components/ListItemText.tsx +1 -4
- package/src/components/Loading/Loading.test.tsx +0 -1
- package/src/components/Loading/Loading.tsx +1 -2
- package/src/components/Loading/Spinner/Spinner.test.tsx +1 -2
- package/src/components/Loading/Spinner/Spinner.tsx +1 -2
- package/src/components/Loading/Spinner/__snapshots__/Spinner.test.tsx.snap +114 -16
- package/src/components/Loading/__snapshots__/Loading.test.tsx.snap +63 -11
- package/src/components/Loading/styles.ts +1 -2
- package/src/components/Logo/Logo.test.tsx +0 -1
- package/src/components/Logo/Logo.tsx +1 -2
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +2 -0
- package/src/components/Menu.tsx +1 -1
- package/src/components/MenuItem.tsx +1 -1
- package/src/components/NotFound/NotFound.tsx +1 -3
- package/src/components/NotFound/Notfound.test.tsx +1 -2
- package/src/components/NotFound/__snapshots__/Notfound.test.tsx.snap +138 -11
- package/src/components/NotFound/styles.ts +0 -1
- package/src/components/Paper.tsx +1 -1
- package/src/components/SnackbarContent.tsx +1 -1
- package/src/components/SvgIcon.tsx +1 -1
- package/src/components/Tab.tsx +1 -1
- package/src/components/Tabs.tsx +1 -1
- package/src/components/Text/Text.tsx +1 -1
- package/src/components/Text/TextConfig.ts +1 -1
- package/src/components/TextField/TextField.test.tsx +0 -1
- package/src/components/TextField/TextField.tsx +2 -2
- package/src/components/TextField/__snapshots__/TextField.test.tsx.snap +216 -3
- package/src/components/Toolbar.tsx +1 -1
- package/src/components/Tooltip.tsx +1 -1
- package/src/design-tokens/ResetStyles.tsx +1 -1
- package/src/design-tokens/StyleBaseline.tsx +2 -2
- package/src/design-tokens/ThemeProvider.tsx +15 -12
- package/src/design-tokens/theme.ts +28 -26
- package/src/design-tokens/useTheme.ts +1 -1
- package/src/{design-tokens → hooks}/useLocalStorage.ts +0 -0
- package/src/{design-tokens → hooks}/useOnClickOutside.ts +0 -0
- package/src/i18n/__mocks__/loadTranslationFile.ts +5 -0
- package/src/i18n/config.ts +1 -15
- package/src/i18n/download_translations/es-ES/ui.json +17 -17
- package/src/i18n/download_translations/it-IT/ui.json +77 -77
- package/src/i18n/download_translations/tr-TR/ui.json +6 -6
- package/src/i18n/download_translations/vi-VN/ui.json +2 -2
- package/src/i18n/loadTranslationFile.ts +14 -0
- package/src/index.tsx +2 -1
- package/src/pages/Version/DetailContainer/Dependencies/Dependencies.test.tsx +0 -2
- package/src/pages/Version/DetailContainer/Dependencies/Dependencies.tsx +1 -3
- package/src/pages/Version/DetailContainer/Dependencies/styles.ts +0 -1
- package/src/pages/Version/DetailContainer/Deprecated/Deprecated.test.tsx +1 -3
- package/src/pages/Version/DetailContainer/Deprecated/Deprecated.tsx +2 -3
- package/src/pages/Version/DetailContainer/DetailContainer.test.tsx +0 -1
- package/src/pages/Version/DetailContainer/DetailContainer.tsx +1 -3
- package/src/pages/Version/DetailContainer/DetailContainerContent.tsx +0 -1
- package/src/pages/Version/DetailContainer/DetailContainerContentReadme.tsx +0 -1
- package/src/pages/Version/DetailContainer/DetailContainerTabs.tsx +0 -1
- package/src/pages/Version/DetailContainer/NoItems/NoItems.tsx +0 -1
- package/src/pages/Version/DetailContainer/NoItems/Noitems.test.tsx +0 -1
- package/src/pages/Version/DetailContainer/NoItems/__snapshots__/Noitems.test.tsx.snap +10 -1
- package/src/pages/Version/DetailContainer/Readme/Readme.spec.tsx +1 -2
- package/src/pages/Version/DetailContainer/Readme/Readme.tsx +1 -2
- package/src/pages/Version/DetailContainer/UpLinks/UpLinks.test.tsx +1 -3
- package/src/pages/Version/DetailContainer/UpLinks/UpLinks.tsx +1 -3
- package/src/pages/Version/DetailContainer/UpLinks/__snapshots__/UpLinks.test.tsx.snap +184 -26
- package/src/pages/Version/DetailContainer/UpLinks/styles.ts +2 -3
- package/src/pages/Version/DetailContainer/Versions/Versions.test.tsx +2 -4
- package/src/pages/Version/DetailContainer/Versions/Versions.tsx +1 -2
- package/src/pages/Version/DetailContainer/Versions/VersionsHistoryList.tsx +2 -4
- package/src/pages/Version/DetailContainer/Versions/VersionsTagList.tsx +1 -3
- package/src/pages/Version/DetailContainer/Versions/styles.ts +2 -3
- package/src/pages/Version/DetailContainer/__snapshots__/DetailContainer.test.tsx.snap +168 -34
- package/src/pages/Version/DetailSidebar/DetailSidebar.tsx +0 -2
- package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.test.tsx +0 -2
- package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.tsx +1 -2
- package/src/pages/Version/DetailSidebar/DetailSidebarTitle.tsx +0 -1
- package/src/pages/Version/DetailSidebar/Developers/Developers.test.tsx +3 -5
- package/src/pages/Version/DetailSidebar/Developers/Developers.tsx +3 -5
- package/src/pages/Version/DetailSidebar/Developers/DevelopersTitle.tsx +0 -1
- package/src/pages/Version/DetailSidebar/Developers/__snapshots__/Developers.test.tsx.snap +328 -40
- package/src/pages/Version/DetailSidebar/Developers/styles.ts +0 -1
- package/src/pages/Version/DetailSidebar/Dist/Dist.test.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Dist/Dist.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Dist/__snapshots__/Dist.test.tsx.snap +1436 -74
- package/src/pages/Version/DetailSidebar/Dist/styles.ts +2 -1
- package/src/pages/Version/DetailSidebar/Engines/Engines.test.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Engines/Engines.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Engines/styles.ts +0 -1
- package/src/pages/Version/DetailSidebar/Install/Install.test.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Install/Install.tsx +0 -2
- package/src/pages/Version/DetailSidebar/Install/InstallListItem.tsx +0 -1
- package/src/pages/Version/DetailSidebar/Repository/Repository.test.tsx +1 -3
- package/src/pages/Version/DetailSidebar/Repository/Repository.tsx +1 -3
- package/src/pages/Version/Version.test.tsx +1 -3
- package/src/pages/Version/Version.tsx +1 -3
- package/src/pages/Version/VersionContextProvider.tsx +0 -1
- package/src/pages/Version/VersionLayout.tsx +1 -1
- package/src/pages/Version/context.ts +1 -1
- package/src/pages/home/Home.tsx +0 -2
- package/src/pages/home/PackageList/Help/Help.test.tsx +0 -1
- package/src/pages/home/PackageList/Help/Help.tsx +0 -1
- package/src/pages/home/PackageList/Help/__snapshots__/Help.test.tsx.snap +295 -56
- package/src/pages/home/PackageList/Help/styles.ts +0 -1
- package/src/pages/home/PackageList/Package/Package.test.tsx +1 -3
- package/src/pages/home/PackageList/Package/Package.tsx +14 -19
- package/src/pages/home/PackageList/Package/Tag/Tag.test.tsx +0 -1
- package/src/pages/home/PackageList/Package/styles.ts +5 -6
- package/src/pages/home/PackageList/PackageList.tsx +0 -1
- package/src/pages/home/PackageList/Packagelist.test.tsx +1 -3
- package/src/providers/API/api.ts +1 -1
- package/src/providers/config/AppConfigurationProvider.tsx +3 -3
- package/src/store/models/configuration.ts +2 -3
- package/src/store/models/download.ts +1 -2
- package/src/store/models/index.ts +1 -0
- package/src/store/models/login.ts +4 -2
- package/src/store/models/manifest.ts +2 -2
- package/src/store/models/packages.ts +2 -2
- package/src/store/models/search.ts +5 -5
- package/src/store/store.ts +2 -2
- package/src/utils/login.test.ts +2 -3
- package/src/utils/package.test.ts +2 -3
- package/src/utils/package.ts +2 -1
- package/src/utils/sec-utils.ts +1 -1
- package/src/utils/test-react-testing-library.tsx +11 -7
- package/src/utils/url.test.ts +1 -1
- package/src/utils/url.ts +1 -0
- package/static/Dependencies.15768a14646212b71166.js +2 -0
- package/static/Dependencies.15768a14646212b71166.js.LICENSE.txt +78 -0
- package/static/Dist.15768a14646212b71166.js +2 -0
- package/static/Dist.15768a14646212b71166.js.LICENSE.txt +60 -0
- package/static/Engines.15768a14646212b71166.js +2 -0
- package/static/Engines.15768a14646212b71166.js.LICENSE.txt +66 -0
- package/static/Home.15768a14646212b71166.js +2 -0
- package/static/Home.15768a14646212b71166.js.LICENSE.txt +222 -0
- package/static/Install.15768a14646212b71166.js +2 -0
- package/static/Install.15768a14646212b71166.js.LICENSE.txt +66 -0
- package/static/NotFound.15768a14646212b71166.js +2 -0
- package/static/NotFound.15768a14646212b71166.js.LICENSE.txt +40 -0
- package/static/Provider.15768a14646212b71166.js +2 -0
- package/static/Provider.15768a14646212b71166.js.LICENSE.txt +32 -0
- package/static/Repository.15768a14646212b71166.js +2 -0
- package/static/Repository.15768a14646212b71166.js.LICENSE.txt +50 -0
- package/static/UpLinks.15768a14646212b71166.js +2 -0
- package/static/UpLinks.15768a14646212b71166.js.LICENSE.txt +56 -0
- package/static/Version.15768a14646212b71166.js +2 -0
- package/static/Version.15768a14646212b71166.js.LICENSE.txt +380 -0
- package/static/Versions.15768a14646212b71166.js +2 -0
- package/static/Versions.15768a14646212b71166.js.LICENSE.txt +64 -0
- package/static/index.html +1 -1
- package/static/main.15768a14646212b71166.js +2 -0
- package/static/{main.87dd0a7ff6e306a24166.js.LICENSE.txt → main.15768a14646212b71166.js.LICENSE.txt} +63 -663
- package/static/manifest.json +17 -3
- package/static/runtime.15768a14646212b71166.js +2 -0
- package/static/{runtime.87dd0a7ff6e306a24166.js.LICENSE.txt → runtime.15768a14646212b71166.js.LICENSE.txt} +2 -2
- package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-123400.15768a14646212b71166.js +2 -0
- package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-123400.15768a14646212b71166.js.LICENSE.txt +148 -0
- package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-d2b578.15768a14646212b71166.js +2 -0
- package/static/vendors-node_modules_pnpm_mui_icons-material_5_0_5_d1eeebd4022867ee03864a00e16c7901_node_modu-d2b578.15768a14646212b71166.js.LICENSE.txt +218 -0
- package/static/vendors-node_modules_pnpm_mui_material_5_0_6_033766d34292bd5d464212fd95cb4b6d_node_modules_mu-1fb115.15768a14646212b71166.js +2 -0
- package/static/vendors-node_modules_pnpm_mui_material_5_0_6_033766d34292bd5d464212fd95cb4b6d_node_modules_mu-1fb115.15768a14646212b71166.js.LICENSE.txt +316 -0
- package/static/vendors.15768a14646212b71166.js +103 -0
- package/static/{vendors.87dd0a7ff6e306a24166.js.LICENSE.txt → vendors.15768a14646212b71166.js.LICENSE.txt} +1261 -1035
- package/tools/dev.server.js +0 -1
- package/tools/webpack.dev.config.babel.js +1 -3
- package/tsconfig.json +0 -2
- package/types/index.ts +1 -0
- package/src/App/Header/Search/SearchAdornment.tsx +0 -18
- package/src/design-tokens/emotion.ts +0 -5
- package/src/lib/constants.ts +0 -9
- package/static/main.87dd0a7ff6e306a24166.js +0 -2
- package/static/runtime.87dd0a7ff6e306a24166.js +0 -2
- package/static/vendors.87dd0a7ff6e306a24166.js +0 -2
|
@@ -1,179 +1,101 @@
|
|
|
1
|
-
/* eslint-disable react/jsx-no-bind */
|
|
2
1
|
import styled from '@emotion/styled';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
InputProps,
|
|
9
|
-
ChangeEvent,
|
|
10
|
-
SuggestionsFetchRequested,
|
|
11
|
-
GetSuggestionValue,
|
|
12
|
-
RenderSuggestion,
|
|
13
|
-
RenderSuggestionsContainer,
|
|
14
|
-
RenderInputComponent,
|
|
15
|
-
} from 'react-autosuggest';
|
|
2
|
+
import Search from '@mui/icons-material/Search';
|
|
3
|
+
import { Theme } from '@mui/material';
|
|
4
|
+
import Autocomplete from '@mui/material/Autocomplete';
|
|
5
|
+
import InputAdornment from '@mui/material/InputAdornment';
|
|
6
|
+
import React, { FC, useState } from 'react';
|
|
16
7
|
import { useTranslation } from 'react-i18next';
|
|
17
8
|
|
|
18
|
-
import {
|
|
9
|
+
import { SearchResultWeb } from '@verdaccio/types';
|
|
19
10
|
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
import { Wrapper, InputField, SuggestionContainer } from './styles';
|
|
23
|
-
|
|
24
|
-
const StyledAnchor = styled('a')<{ highlight: boolean; theme?: Theme }>((props) => ({
|
|
25
|
-
fontWeight:
|
|
26
|
-
props.theme && props.highlight ? props.theme.fontWeight.semiBold : props.theme.fontWeight.light,
|
|
27
|
-
}));
|
|
28
|
-
|
|
29
|
-
const StyledMenuItem = styled(MenuItem)({
|
|
30
|
-
cursor: 'pointer',
|
|
31
|
-
});
|
|
11
|
+
import { StyledTextField } from './styles';
|
|
12
|
+
import { Wrapper } from './styles';
|
|
32
13
|
|
|
14
|
+
export type OnSelecItem = (
|
|
15
|
+
event: React.SyntheticEvent,
|
|
16
|
+
value: SearchResultWeb,
|
|
17
|
+
reason: string,
|
|
18
|
+
details?: string
|
|
19
|
+
) => void;
|
|
33
20
|
interface Props {
|
|
34
|
-
suggestions:
|
|
35
|
-
suggestionsLoading
|
|
36
|
-
|
|
37
|
-
suggestionsError?: boolean;
|
|
38
|
-
apiLoading?: boolean;
|
|
39
|
-
value?: string;
|
|
40
|
-
placeholder?: string;
|
|
21
|
+
suggestions: SearchResultWeb[];
|
|
22
|
+
suggestionsLoading: boolean;
|
|
23
|
+
placeholder: string;
|
|
41
24
|
startAdornment?: JSX.Element;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
onCleanSuggestions?: () => void;
|
|
46
|
-
onClick?: (
|
|
47
|
-
event: React.FormEvent<HTMLInputElement>,
|
|
48
|
-
data: SuggestionSelectedEventData<unknown>
|
|
49
|
-
) => void;
|
|
50
|
-
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
51
|
-
onBlur?: (event: React.FormEvent<HTMLInputElement>) => void;
|
|
25
|
+
onSuggestionsFetch: any;
|
|
26
|
+
onCleanSuggestions: (event: React.SyntheticEvent) => void;
|
|
27
|
+
onSelectItem: OnSelecItem;
|
|
52
28
|
}
|
|
53
29
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* eslint-disable react/jsx-sort-props */
|
|
59
|
-
/* eslint-disable verdaccio/jsx-spread */
|
|
60
|
-
const renderInputComponent: RenderInputComponent<Suggestion> = (inputProps) => {
|
|
61
|
-
// @ts-ignore
|
|
62
|
-
const { ref, startAdornment, disableUnderline, onKeyDown, ...others } = inputProps;
|
|
63
|
-
return (
|
|
64
|
-
<InputField
|
|
65
|
-
fullWidth={true}
|
|
66
|
-
InputProps={{
|
|
67
|
-
inputRef: (node: any) => {
|
|
68
|
-
// @ts-ignore
|
|
69
|
-
ref(node);
|
|
70
|
-
},
|
|
71
|
-
startAdornment,
|
|
72
|
-
disableUnderline,
|
|
73
|
-
onKeyDown,
|
|
74
|
-
}}
|
|
75
|
-
{...others}
|
|
76
|
-
/>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const getSuggestionValue: GetSuggestionValue<Suggestion> = (suggestion): string => suggestion.name;
|
|
30
|
+
const StyledInputAdornment = styled(InputAdornment)<{ theme?: Theme }>((props) => ({
|
|
31
|
+
color: props.theme?.palette.white,
|
|
32
|
+
}));
|
|
81
33
|
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
34
|
+
const AutoComplete: FC<Props> = ({
|
|
35
|
+
suggestions,
|
|
36
|
+
startAdornment,
|
|
37
|
+
onSuggestionsFetch,
|
|
38
|
+
onCleanSuggestions,
|
|
39
|
+
placeholder = '',
|
|
40
|
+
onSelectItem,
|
|
41
|
+
suggestionsLoading = false,
|
|
42
|
+
}: Props) => {
|
|
43
|
+
const { t } = useTranslation();
|
|
44
|
+
const [inputValue, setInputValue] = useState('');
|
|
45
|
+
|
|
46
|
+
const handleOnInputChange = (event: React.SyntheticEvent, value: string, reason: string) => {
|
|
47
|
+
if (reason === 'input') {
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
onSuggestionsFetch({ value });
|
|
50
|
+
setInputValue(value);
|
|
51
|
+
} else if (reason === 'clear') {
|
|
52
|
+
onCleanSuggestions(event);
|
|
53
|
+
setInputValue('');
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const handleOnClose = (event) => {
|
|
58
|
+
onCleanSuggestions(event);
|
|
59
|
+
setInputValue('');
|
|
60
|
+
};
|
|
102
61
|
|
|
103
|
-
const renderMessage = (message: string): JSX.Element => {
|
|
104
62
|
return (
|
|
105
|
-
<
|
|
106
|
-
<
|
|
107
|
-
|
|
63
|
+
<Wrapper>
|
|
64
|
+
<Autocomplete
|
|
65
|
+
disablePortal={true}
|
|
66
|
+
freeSolo={true}
|
|
67
|
+
onChange={onSelectItem}
|
|
68
|
+
autoHighlight={true}
|
|
69
|
+
id="search-header-suggest"
|
|
70
|
+
options={suggestions}
|
|
71
|
+
inputValue={inputValue}
|
|
72
|
+
clearOnBlur={true}
|
|
73
|
+
loading={suggestionsLoading}
|
|
74
|
+
renderTags={() => null}
|
|
75
|
+
onClose={handleOnClose}
|
|
76
|
+
loadingText={t('autoComplete.loading')}
|
|
77
|
+
onInputChange={handleOnInputChange}
|
|
78
|
+
getOptionLabel={(option) => option.name}
|
|
79
|
+
fullWidth={true}
|
|
80
|
+
renderInput={(params) => (
|
|
81
|
+
<StyledTextField
|
|
82
|
+
{...params}
|
|
83
|
+
placeholder={placeholder}
|
|
84
|
+
InputProps={{
|
|
85
|
+
...params.InputProps,
|
|
86
|
+
startAdornment: startAdornment || (
|
|
87
|
+
<StyledInputAdornment position="start">
|
|
88
|
+
<Search />
|
|
89
|
+
</StyledInputAdornment>
|
|
90
|
+
),
|
|
91
|
+
}}
|
|
92
|
+
label=""
|
|
93
|
+
variant="standard"
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
96
|
+
/>
|
|
97
|
+
</Wrapper>
|
|
108
98
|
);
|
|
109
99
|
};
|
|
110
100
|
|
|
111
|
-
const AutoComplete = memo(
|
|
112
|
-
({
|
|
113
|
-
suggestions,
|
|
114
|
-
startAdornment,
|
|
115
|
-
onChange,
|
|
116
|
-
onSuggestionsFetch,
|
|
117
|
-
onCleanSuggestions,
|
|
118
|
-
value = '',
|
|
119
|
-
placeholder = '',
|
|
120
|
-
disableUnderline = false,
|
|
121
|
-
onClick,
|
|
122
|
-
onKeyDown,
|
|
123
|
-
onBlur,
|
|
124
|
-
suggestionsLoading = false,
|
|
125
|
-
suggestionsLoaded = false,
|
|
126
|
-
suggestionsError = false,
|
|
127
|
-
}: Props) => {
|
|
128
|
-
const { t } = useTranslation();
|
|
129
|
-
|
|
130
|
-
const inputProps: InputProps<Suggestion> = {
|
|
131
|
-
value,
|
|
132
|
-
onChange,
|
|
133
|
-
placeholder,
|
|
134
|
-
// material-ui@4.5.1 introduce better types for TextInput, check readme
|
|
135
|
-
// @ts-ignore
|
|
136
|
-
startAdornment,
|
|
137
|
-
disableUnderline,
|
|
138
|
-
onKeyDown,
|
|
139
|
-
onBlur,
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
// this format avoid arrow function eslint rule
|
|
143
|
-
const renderSuggestionsContainer: RenderSuggestionsContainer = function ({
|
|
144
|
-
containerProps,
|
|
145
|
-
children,
|
|
146
|
-
query,
|
|
147
|
-
}): JSX.Element {
|
|
148
|
-
return (
|
|
149
|
-
<SuggestionContainer {...containerProps} square={true}>
|
|
150
|
-
{suggestionsLoaded &&
|
|
151
|
-
children === null &&
|
|
152
|
-
query &&
|
|
153
|
-
renderMessage(t('autoComplete.no-results-found'))}
|
|
154
|
-
{suggestionsLoading && query && renderMessage(t('autoComplete.loading'))}
|
|
155
|
-
{suggestionsError && renderMessage(t('error.unspecific'))}
|
|
156
|
-
{children}
|
|
157
|
-
</SuggestionContainer>
|
|
158
|
-
);
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
return (
|
|
162
|
-
<Wrapper>
|
|
163
|
-
<Autosuggest<Suggestion>
|
|
164
|
-
renderInputComponent={renderInputComponent}
|
|
165
|
-
suggestions={suggestions}
|
|
166
|
-
getSuggestionValue={getSuggestionValue}
|
|
167
|
-
renderSuggestion={renderSuggestion}
|
|
168
|
-
onSuggestionsFetchRequested={onSuggestionsFetch}
|
|
169
|
-
onSuggestionsClearRequested={onCleanSuggestions}
|
|
170
|
-
inputProps={inputProps}
|
|
171
|
-
onSuggestionSelected={onClick}
|
|
172
|
-
renderSuggestionsContainer={renderSuggestionsContainer}
|
|
173
|
-
/>
|
|
174
|
-
</Wrapper>
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
);
|
|
178
|
-
|
|
179
101
|
export default AutoComplete;
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
3
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
4
|
+
import withStyles from '@mui/styles/withStyles';
|
|
5
5
|
import React, {
|
|
6
|
-
memo,
|
|
7
|
-
useState,
|
|
8
6
|
ChangeEvent,
|
|
9
7
|
KeyboardEvent,
|
|
8
|
+
memo,
|
|
9
|
+
useCallback,
|
|
10
10
|
useEffect,
|
|
11
11
|
useRef,
|
|
12
|
-
|
|
12
|
+
useState,
|
|
13
13
|
} from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
|
-
|
|
16
15
|
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
17
|
-
import { useOnClickOutside } from 'verdaccio-ui/design-tokens/useOnClickOutside';
|
|
18
16
|
|
|
17
|
+
import { useOnClickOutside } from '../../hooks/useOnClickOutside';
|
|
19
18
|
import IconButton from '../IconButton';
|
|
20
19
|
import MenuItem from '../MenuItem';
|
|
21
20
|
import Paper from '../Paper';
|
|
22
21
|
import TextField from '../TextField';
|
|
23
|
-
|
|
24
22
|
import { createFilterOptions } from './useAutoComplete';
|
|
25
23
|
|
|
26
24
|
const defaultFilterOptions = createFilterOptions();
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
2
|
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
5
3
|
|
|
6
|
-
import Paper from '../Paper';
|
|
7
4
|
import TextField from '../TextField';
|
|
8
5
|
|
|
9
6
|
export interface InputFieldProps {
|
|
@@ -12,7 +9,6 @@ export interface InputFieldProps {
|
|
|
12
9
|
|
|
13
10
|
export const Wrapper = styled('div')({
|
|
14
11
|
width: '100%',
|
|
15
|
-
height: '32px',
|
|
16
12
|
position: 'relative',
|
|
17
13
|
zIndex: 1,
|
|
18
14
|
});
|
|
@@ -45,14 +41,3 @@ export const StyledTextField = styled(TextField)<{ theme?: Theme }>((props) => (
|
|
|
45
41
|
},
|
|
46
42
|
},
|
|
47
43
|
}));
|
|
48
|
-
|
|
49
|
-
/* eslint-disable verdaccio/jsx-spread */
|
|
50
|
-
// @ts-ignore types of color are incompatible
|
|
51
|
-
export const InputField: React.FC<InputFieldProps & TextFieldProps> = ({ ...others }) => (
|
|
52
|
-
<StyledTextField {...others} />
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
export const SuggestionContainer = styled(Paper)({
|
|
56
|
-
maxHeight: '500px',
|
|
57
|
-
overflowY: 'auto',
|
|
58
|
-
});
|
package/src/components/Box.tsx
CHANGED
package/src/components/Card.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as MaterialUICardActions
|
|
1
|
+
import { CardActionsProps, default as MaterialUICardActions } from '@mui/material/CardActions';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
type CardActionsRef = HTMLDivElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as MaterialUICardContent
|
|
1
|
+
import { CardContentProps, default as MaterialUICardContent } from '@mui/material/CardContent';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
type CardContentRef = HTMLElementTagNameMap[keyof HTMLElementTagNameMap];
|
package/src/components/Chip.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
default as MaterialUICircularProgress,
|
|
3
2
|
CircularProgressProps,
|
|
4
|
-
|
|
3
|
+
default as MaterialUICircularProgress,
|
|
4
|
+
} from '@mui/material/CircularProgress';
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
type CircularProgressRef = HTMLDivElement;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
import FileCopy from '@
|
|
2
|
+
import FileCopy from '@mui/icons-material/FileCopy';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
|
|
6
5
|
import { copyToClipBoardUtility } from 'verdaccio-ui/utils/cli-utils';
|
|
7
6
|
|
|
8
7
|
import IconButton from './IconButton';
|
|
@@ -19,7 +18,7 @@ function CopyToClipBoard({ text, children, ...props }: Props) {
|
|
|
19
18
|
<Wrapper {...props}>
|
|
20
19
|
<Content>{children ?? text}</Content>
|
|
21
20
|
<Tooltip disableFocusListener={true} title={t('copy-to-clipboard')}>
|
|
22
|
-
<IconButton onClick={copyToClipBoardUtility(text)} data-testid="copy-icon">
|
|
21
|
+
<IconButton onClick={copyToClipBoardUtility(text)} data-testid="copy-icon" size="large">
|
|
23
22
|
<FileCopy />
|
|
24
23
|
</IconButton>
|
|
25
24
|
</Tooltip>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
default as MaterialUIDialogActions,
|
|
3
2
|
DialogActionsProps,
|
|
4
|
-
|
|
3
|
+
default as MaterialUIDialogActions,
|
|
4
|
+
} from '@mui/material/DialogActions';
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
type DialogActionsRef = HTMLDivElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
default as MaterialUIDialogContent,
|
|
3
2
|
DialogContentProps,
|
|
4
|
-
|
|
3
|
+
default as MaterialUIDialogContent,
|
|
4
|
+
} from '@mui/material/DialogContent';
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
type DialogContentRef = HTMLDivElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as MaterialUIDialogTitle
|
|
1
|
+
import { DialogTitleProps, default as MaterialUIDialogTitle } from '@mui/material/DialogTitle';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
type DialogTitleRef = HTMLDivElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as MaterialUIDivider
|
|
1
|
+
import { DividerProps, default as MaterialUIDivider } from '@mui/material/Divider';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
type DividerRef = HTMLElementTagNameMap[keyof HTMLElementTagNameMap];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as MaterialUIFormControl
|
|
1
|
+
import { FormControlProps, default as MaterialUIFormControl } from '@mui/material/FormControl';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
type FormControlRef = HTMLElementTagNameMap[keyof HTMLElementTagNameMap];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
default as MaterialUIFormHelperText,
|
|
3
2
|
FormHelperTextProps,
|
|
4
|
-
|
|
3
|
+
default as MaterialUIFormHelperText,
|
|
4
|
+
} from '@mui/material/FormHelperText';
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
type FormHelperTextRef = HTMLParagraphElement;
|
package/src/components/Grid.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as MaterialUITypography, TypographyProps } from '@material
|
|
1
|
+
import { default as MaterialUITypography, TypographyProps } from '@mui/material/Typography';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
type HeadingType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as MaterialUIIconButton
|
|
1
|
+
import { IconButtonProps, default as MaterialUIIconButton } from '@mui/material/IconButton';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
type IconButtonRef = HTMLButtonElement;
|
package/src/components/Input.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
default as MaterialUIInputAdornment,
|
|
3
2
|
InputAdornmentProps,
|
|
4
|
-
|
|
3
|
+
default as MaterialUIInputAdornment,
|
|
4
|
+
} from '@mui/material/InputAdornment';
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
type InputAdornmentRef = HTMLDivElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as MaterialUIInputLabel
|
|
1
|
+
import { InputLabelProps, default as MaterialUIInputLabel } from '@mui/material/InputLabel';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
type InputLabelRef = HTMLLabelElement;
|
package/src/components/List.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as MaterialUIListItem
|
|
1
|
+
import { ListItemProps, default as MaterialUIListItem } from '@mui/material/ListItem';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
type ListItemRef<T extends boolean = false> = T extends true ? HTMLDivElement : HTMLLIElement;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
default as MaterialUIListItemText,
|
|
3
|
-
ListItemTextProps,
|
|
4
|
-
} from '@material-ui/core/ListItemText';
|
|
1
|
+
import { ListItemTextProps, default as MaterialUIListItemText } from '@mui/material/ListItemText';
|
|
5
2
|
import React, { forwardRef } from 'react';
|
|
6
3
|
|
|
7
4
|
type ListItemTextRef = HTMLDivElement;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
3
|
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
5
4
|
|
|
6
5
|
import CircularProgress from '../../CircularProgress';
|
|
@@ -31,5 +30,5 @@ const Wrapper = styled('div')<Pick<Props, 'centered'>>(({ centered }) => ({
|
|
|
31
30
|
}));
|
|
32
31
|
|
|
33
32
|
const Circular = styled(CircularProgress)<{ theme?: Theme }>(({ theme }) => ({
|
|
34
|
-
color: theme?.palette.
|
|
33
|
+
color: theme?.palette.mode === 'dark' ? theme?.palette.white : theme?.palette.primary.main,
|
|
35
34
|
}));
|