@verdaccio/ui-components 4.0.0-next-8.0 → 4.0.0-next-8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/build/AppTest/pages/Version/Version.js +1 -4
  3. package/build/Theme/ResetStyles.js +4 -6
  4. package/build/Theme/ThemeProvider.js +1 -2
  5. package/build/components/ActionBar/ActionBar.js +3 -3
  6. package/build/components/ActionBar/ActionBarAction.js +5 -8
  7. package/build/components/Author/styles.js +4 -7
  8. package/build/components/CopyClipboard/CopyToClipBoard.js +4 -4
  9. package/build/components/Dependencies/DependencyBlock.js +4 -4
  10. package/build/components/Developers/Developers.js +6 -9
  11. package/build/components/Developers/Title.js +2 -2
  12. package/build/components/Distribution/Dist.js +3 -3
  13. package/build/components/Distribution/styles.js +6 -9
  14. package/build/components/Engines/Engines.js +1 -2
  15. package/build/components/Engines/styles.js +5 -8
  16. package/build/components/Forbidden/Forbidden.js +3 -3
  17. package/build/components/FundButton/FundButton.js +7 -8
  18. package/build/components/Install/Install.js +8 -12
  19. package/build/components/Install/InstallListItem.js +5 -6
  20. package/build/components/Keywords/Keywords.js +2 -3
  21. package/build/components/Label/Label.js +4 -7
  22. package/build/components/LinkExternal/LinkExternal.js +1 -1
  23. package/build/components/Loading/Spinner/Spinner.js +3 -3
  24. package/build/components/Loading/styles.js +3 -3
  25. package/build/components/LoginDialog/LoginDialogForm.js +2 -3
  26. package/build/components/LoginDialog/LoginDialogFormError.js +5 -5
  27. package/build/components/LoginDialog/LoginDialogHeader.js +8 -8
  28. package/build/components/Logo/Logo.js +5 -5
  29. package/build/components/NotFound/NotFound.js +3 -3
  30. package/build/components/Package/Package.js +10 -13
  31. package/build/components/Package/styles.js +23 -26
  32. package/build/components/RawViewer/RawViewer.js +2 -2
  33. package/build/components/RegistryInfoDialog/styles.js +8 -8
  34. package/build/components/Repository/Repository.js +8 -12
  35. package/build/components/Search/Search.js +13 -17
  36. package/build/components/Search/SearchItem.js +29 -32
  37. package/build/components/Search/styles.js +28 -34
  38. package/build/components/SettingsMenu/SettingsMenu.js +9 -12
  39. package/build/components/SideBarTitle/SideBarTitle.js +7 -7
  40. package/build/components/UpLinks/UpLinks.js +1 -1
  41. package/build/components/UpLinks/styles.js +7 -10
  42. package/build/components/Versions/HistoryList.js +26 -29
  43. package/build/components/Versions/Versions.js +1 -1
  44. package/build/components/Versions/styles.js +4 -4
  45. package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +3 -5
  46. package/build/providers/TranslatorProvider/TranslatorProvider.js +1 -2
  47. package/build/providers/VersionProvider/VersionProvider.js +1 -4
  48. package/build/sections/Detail/Detail.js +2 -3
  49. package/build/sections/Footer/Footer.js +8 -8
  50. package/build/sections/Footer/styles.js +12 -12
  51. package/build/sections/Header/Header.js +2 -2
  52. package/build/sections/Header/HeaderSettingsDialog.js +2 -2
  53. package/build/sections/Header/LanguageSwitch.js +6 -8
  54. package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +3 -4
  55. package/build/sections/Header/RegistryInfoContent/styles.js +3 -3
  56. package/build/sections/Header/styles.js +29 -35
  57. package/build/sections/Home/Home.js +1 -4
  58. package/build/sections/SideBar/Sidebar.js +4 -5
  59. package/build/src/Theme/theme.d.ts +14 -2
  60. package/build/src/components/Dependencies/DependencyBlock.d.ts +2 -1
  61. package/build/src/components/Loading/styles.d.ts +2 -1
  62. package/build/src/components/Package/styles.d.ts +4 -3
  63. package/build/src/components/RegistryInfoDialog/styles.d.ts +3 -2
  64. package/build/src/components/Search/styles.d.ts +2 -1
  65. package/build/src/components/UpLinks/styles.d.ts +3 -2
  66. package/build/src/components/Versions/styles.d.ts +3 -2
  67. package/build/src/sections/Footer/styles.d.ts +6 -5
  68. package/build/src/sections/Header/RegistryInfoContent/styles.d.ts +3 -2
  69. package/build/src/sections/Header/styles.d.ts +3 -2
  70. package/build/store/api.js +5 -6
  71. package/build/store/models/configuration.js +1 -2
  72. package/build/store/models/search.js +1 -1
  73. package/build/utils/utils.js +2 -2
  74. package/package.json +3 -3
  75. package/src/Theme/ResetStyles.tsx +4 -4
  76. package/src/Theme/theme.ts +15 -4
  77. package/src/components/ActionBar/ActionBarAction.tsx +3 -3
  78. package/src/components/Author/styles.ts +1 -1
  79. package/src/components/CopyClipboard/CopyToClipBoard.tsx +1 -1
  80. package/src/components/Dependencies/DependencyBlock.tsx +2 -2
  81. package/src/components/Deprecated/Deprecated.tsx +3 -1
  82. package/src/components/Developers/Developers.tsx +2 -2
  83. package/src/components/Developers/Title.tsx +1 -1
  84. package/src/components/Distribution/styles.ts +1 -1
  85. package/src/components/Engines/styles.ts +1 -1
  86. package/src/components/Forbidden/Forbidden.tsx +1 -1
  87. package/src/components/FundButton/FundButton.tsx +3 -3
  88. package/src/components/Install/Install.tsx +1 -1
  89. package/src/components/Install/InstallListItem.tsx +2 -1
  90. package/src/components/Keywords/Keywords.tsx +2 -1
  91. package/src/components/Label/Label.tsx +1 -1
  92. package/src/components/Loading/Spinner/Spinner.tsx +1 -1
  93. package/src/components/Loading/styles.ts +1 -1
  94. package/src/components/LoginDialog/LoginDialogFormError.tsx +3 -3
  95. package/src/components/LoginDialog/LoginDialogHeader.tsx +6 -6
  96. package/src/components/Logo/Logo.tsx +3 -3
  97. package/src/components/NotFound/NotFound.tsx +1 -1
  98. package/src/components/Package/Package.tsx +1 -1
  99. package/src/components/Package/styles.ts +8 -8
  100. package/src/components/RawViewer/RawViewer.tsx +5 -3
  101. package/src/components/RegistryInfoDialog/styles.ts +5 -5
  102. package/src/components/Repository/Repository.tsx +2 -2
  103. package/src/components/Search/SearchItem.tsx +6 -6
  104. package/src/components/Search/styles.ts +5 -5
  105. package/src/components/SideBarTitle/SideBarTitle.tsx +3 -3
  106. package/src/components/UpLinks/styles.ts +3 -3
  107. package/src/components/Versions/HistoryList.tsx +2 -1
  108. package/src/components/Versions/Versions.tsx +1 -1
  109. package/src/components/Versions/styles.ts +2 -2
  110. package/src/sections/Footer/Footer.tsx +2 -2
  111. package/src/sections/Footer/styles.ts +7 -7
  112. package/src/sections/Header/HeaderSettingsDialog.tsx +1 -1
  113. package/src/sections/Header/LanguageSwitch.tsx +3 -3
  114. package/src/sections/Header/RegistryInfoContent/styles.ts +1 -1
  115. package/src/sections/Header/styles.ts +9 -9
@@ -28,19 +28,19 @@ const Wrapper = styled.div({
28
28
 
29
29
  export const Description = styled('div')<{ theme?: Theme }>(({ theme }) => ({
30
30
  display: 'none',
31
- color: theme?.palette?.greyLight2,
31
+ color: theme.palette.greyLight2,
32
32
  lineHeight: '1.5rem',
33
33
  whiteSpace: 'nowrap',
34
34
  textOverflow: 'ellipsis',
35
35
  alignItems: 'center',
36
36
  overflow: 'hidden',
37
37
  paddingLeft: theme.spacing(),
38
- fontSize: theme?.fontSize.ssm,
39
- [`@media (min-width: ${theme?.breakPoints.medium}px)`]: {
38
+ fontSize: theme.fontSize.ssm,
39
+ [`@media (min-width: ${theme.breakPoints.medium}px)`]: {
40
40
  display: 'block',
41
41
  width: '300px',
42
42
  },
43
- [`@media (min-width: ${theme?.breakPoints.large}px)`]: {
43
+ [`@media (min-width: ${theme.breakPoints.large}px)`]: {
44
44
  display: 'block',
45
45
  width: '500px',
46
46
  },
@@ -57,11 +57,11 @@ const NameGroup = styled.span({
57
57
 
58
58
  const Name = styled('span')<{ theme?: Theme }>(({ theme }) => ({
59
59
  fontWeight: '700',
60
- fontSize: theme?.fontSize.sm,
60
+ fontSize: theme.fontSize.sm,
61
61
  }));
62
62
 
63
63
  const Version = styled('span')<{ theme?: Theme }>(({ theme }) => ({
64
- fontSize: theme?.fontSize.ssm,
64
+ fontSize: theme.fontSize.ssm,
65
65
  }));
66
66
 
67
67
  const SearchItem: React.FC<SearchItemProps> = ({
@@ -14,7 +14,7 @@ export const StyledTextField = styled(TextField)<{ theme?: Theme }>((props) => (
14
14
  border: 'none',
15
15
  },
16
16
  ':after': {
17
- borderColor: props.theme?.palette.white,
17
+ borderColor: props.theme.palette.white,
18
18
  },
19
19
  ':hover:before': {
20
20
  content: 'none',
@@ -23,19 +23,19 @@ export const StyledTextField = styled(TextField)<{ theme?: Theme }>((props) => (
23
23
  content: 'none',
24
24
  transform: 'scaleX(1)',
25
25
  },
26
- [`@media screen and (min-width: ${props.theme?.breakPoints.medium}px)`]: {
26
+ [`@media screen and (min-width: ${props.theme.breakPoints.medium}px)`]: {
27
27
  ':hover:after': {
28
28
  content: "''",
29
29
  },
30
30
  },
31
31
  },
32
32
  '& .MuiInputBase-input': {
33
- [`@media screen and (min-width: ${props.theme?.breakPoints.medium}px)`]: {
34
- color: props.theme?.palette.white,
33
+ [`@media screen and (min-width: ${props.theme.breakPoints.medium}px)`]: {
34
+ color: props.theme.palette.white,
35
35
  },
36
36
  },
37
37
  }));
38
38
 
39
39
  export const StyledInputAdornment = styled(InputAdornment)<{ theme?: Theme }>((props) => ({
40
- color: props.theme?.palette.white,
40
+ color: props.theme.palette.white,
41
41
  }));
@@ -21,7 +21,7 @@ interface Props {
21
21
  }
22
22
 
23
23
  const Icon = styled.div<{ theme?: Theme }>(({ theme }) => ({
24
- marginLeft: theme?.spacing(1),
24
+ marginLeft: theme.spacing(1),
25
25
  }));
26
26
 
27
27
  const ModuleJS: React.FC<{ module: ModuleType | void }> = ({ module }) => {
@@ -93,6 +93,6 @@ const StyledHeading = styled(Heading)({
93
93
  });
94
94
 
95
95
  const StyledBoxVersion = styled(Box)<{ theme?: Theme }>(({ theme }) => ({
96
- color: theme?.palette.text.secondary,
97
- fontSize: theme?.fontSize.sm,
96
+ color: theme.palette.text.secondary,
97
+ fontSize: theme.fontSize.sm,
98
98
  }));
@@ -5,13 +5,13 @@ import Typography from '@mui/material/Typography';
5
5
  import { Theme } from '../../Theme';
6
6
 
7
7
  export const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({
8
- fontWeight: props.theme?.fontWeight.bold,
8
+ fontWeight: props.theme.fontWeight.bold,
9
9
  }));
10
10
 
11
11
  export const Spacer = styled('div')<{ theme?: Theme }>(({ theme }) => ({
12
12
  flex: '1 1 auto',
13
13
  borderBottom: `1px dotted ${
14
- theme?.palette.mode == 'light' ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'
14
+ theme.palette.mode == 'light' ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'
15
15
  } `,
16
16
  whiteSpace: 'nowrap',
17
17
  height: '0.5em',
@@ -20,6 +20,6 @@ export const Spacer = styled('div')<{ theme?: Theme }>(({ theme }) => ({
20
20
 
21
21
  export const ListItemText = styled(MuiListItemText)<{ theme?: Theme }>(({ theme }) => ({
22
22
  flex: 'none',
23
- color: theme?.palette.mode == 'light' ? theme?.palette.black : theme?.palette.white,
23
+ color: theme.palette.mode == 'light' ? theme.palette.black : theme.palette.white,
24
24
  opacity: 0.6,
25
25
  }));
@@ -5,6 +5,7 @@ import { useTheme } from '@mui/styles';
5
5
  import React from 'react';
6
6
  import { useTranslation } from 'react-i18next';
7
7
 
8
+ import { Theme } from '../../Theme';
8
9
  import { useConfig } from '../../providers';
9
10
  import { Time, Versions } from '../../types/packageMeta';
10
11
  import { Route, utils } from '../../utils';
@@ -31,7 +32,7 @@ export function filterDeprecated(versions: Versions) {
31
32
  const VersionsHistoryList: React.FC<Props> = ({ versions, packageName, time }) => {
32
33
  const { t } = useTranslation();
33
34
  const { configOptions } = useConfig();
34
- const theme = useTheme();
35
+ const theme: Theme = useTheme();
35
36
  const hideDeprecatedVersions = configOptions.hideDeprecatedVersions;
36
37
  const listVersions = hideDeprecatedVersions ? filterDeprecated(versions) : versions;
37
38
 
@@ -26,7 +26,7 @@ export const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({
26
26
  const Versions: React.FC<Props> = ({ packageMeta, packageName }) => {
27
27
  const { t } = useTranslation();
28
28
  const { configOptions } = useConfig();
29
- const theme = useTheme();
29
+ const theme: Theme = useTheme();
30
30
  const { versions = {}, time = {}, ['dist-tags']: distTags = {} } = packageMeta;
31
31
 
32
32
  const [packageVersions, setPackageVersions] = useState(versions);
@@ -6,7 +6,7 @@ import { Theme } from '../../Theme';
6
6
  export const Spacer = styled('div')<{ theme?: Theme }>(({ theme }) => ({
7
7
  flex: '1 1 auto',
8
8
  borderBottom: `1px dotted ${
9
- theme?.palette.mode == 'light' ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'
9
+ theme.palette.mode == 'light' ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'
10
10
  } `,
11
11
  whiteSpace: 'nowrap',
12
12
  height: '0.5em',
@@ -16,5 +16,5 @@ export const Spacer = styled('div')<{ theme?: Theme }>(({ theme }) => ({
16
16
  export const ListItemText = styled(MuiListItemText)<{ theme?: Theme }>(({ theme }) => ({
17
17
  flex: 'none',
18
18
  opacity: 0.6,
19
- color: theme?.palette.mode == 'light' ? theme?.palette.black : theme?.palette.white,
19
+ color: theme.palette.mode == 'light' ? theme.palette.black : theme.palette.white,
20
20
  }));
@@ -92,7 +92,7 @@ const Flags = styled('span')<{ theme?: Theme }>(({ theme }) => ({
92
92
  gridTemplateColumns: 'repeat(10, max-content)',
93
93
  gridGap: theme.spacing(0, 1),
94
94
  position: 'absolute',
95
- background: theme?.palette.greyAthens,
95
+ background: theme.palette.greyAthens,
96
96
  padding: '1px 4px',
97
97
  borderRadius: 3,
98
98
  height: 20,
@@ -106,7 +106,7 @@ const Flags = styled('span')<{ theme?: Theme }>(({ theme }) => ({
106
106
  left: -4,
107
107
  marginLeft: -5,
108
108
  border: '5px solid',
109
- borderColor: `${theme?.palette.greyAthens} transparent transparent transparent`,
109
+ borderColor: `${theme.palette.greyAthens} transparent transparent transparent`,
110
110
  transform: 'rotate(90deg)',
111
111
  },
112
112
  }));
@@ -3,9 +3,9 @@ import styled from '@emotion/styled';
3
3
  import { Theme } from '../../';
4
4
 
5
5
  export const Wrapper = styled('div')<{ theme?: Theme }>(({ theme }) => ({
6
- background: theme?.palette.mode === 'light' ? theme?.palette.snow : theme?.palette.cyanBlue,
7
- borderTop: `1px solid ${theme?.palette.greyGainsboro}`,
8
- color: theme?.palette.mode === 'dark' ? theme?.palette.white : theme?.palette.nobel01,
6
+ background: theme.palette.mode === 'light' ? theme.palette.snow : theme.palette.cyanBlue,
7
+ borderTop: `1px solid ${theme.palette.greyGainsboro}`,
8
+ color: theme.palette.mode === 'dark' ? theme.palette.white : theme.palette.nobel01,
9
9
  fontSize: '14px',
10
10
  padding: '20px',
11
11
  }));
@@ -17,13 +17,13 @@ export const Inner = styled('div')<{ theme?: Theme }>(({ theme }) => ({
17
17
  paddingLeft: 16,
18
18
  paddingRight: 16,
19
19
  width: '100%',
20
- [`@media (min-width: ${theme?.breakPoints.medium}px)`]: {
20
+ [`@media (min-width: ${theme.breakPoints.medium}px)`]: {
21
21
  minWidth: 400,
22
22
  maxWidth: 800,
23
23
  margin: 'auto',
24
24
  justifyContent: 'space-between',
25
25
  },
26
- [`@media (min-width: ${theme?.breakPoints.large}px)`]: {
26
+ [`@media (min-width: ${theme.breakPoints.large}px)`]: {
27
27
  maxWidth: 1240,
28
28
  },
29
29
  }));
@@ -31,7 +31,7 @@ export const Inner = styled('div')<{ theme?: Theme }>(({ theme }) => ({
31
31
  export const Left = styled('div')<{ theme?: Theme }>(({ theme }) => ({
32
32
  alignItems: 'center',
33
33
  display: 'none',
34
- [`@media (min-width: ${theme?.breakPoints.medium}px)`]: {
34
+ [`@media (min-width: ${theme.breakPoints.medium}px)`]: {
35
35
  display: 'flex',
36
36
  },
37
37
  marginLeft: 1,
@@ -43,6 +43,6 @@ export const Right = styled(Left)({
43
43
  });
44
44
 
45
45
  export const Love = styled('span')<{ theme?: Theme }>(({ theme }) => ({
46
- color: theme?.palette.love,
46
+ color: theme.palette.love,
47
47
  padding: '0 5px',
48
48
  }));
@@ -43,7 +43,7 @@ function TabPanel(props) {
43
43
 
44
44
  const TextContent = styled('div')<{ theme?: Theme }>(({ theme }) => ({
45
45
  padding: '10px 0',
46
- backgroundColor: theme?.palette.background.default,
46
+ backgroundColor: theme.palette.background.default,
47
47
  }));
48
48
 
49
49
  const HeaderSettingsDialog: React.FC<Props> = ({ onCloseDialog, isOpen }) => {
@@ -12,9 +12,9 @@ import { Theme, useLanguage } from '../../';
12
12
 
13
13
  export const CardSelected = styled(Card)<{ theme?: Theme }>(({ theme }) => {
14
14
  return {
15
- backgroundColor: theme?.palette?.grey['600'],
15
+ backgroundColor: theme.palette.grey['600'],
16
16
  opacity: '0.9',
17
- color: theme?.palette?.error.contrastText,
17
+ color: theme.palette.error.contrastText,
18
18
  fontWeight: 'bold',
19
19
  };
20
20
  });
@@ -23,7 +23,7 @@ export const CardUnSelected = styled(Card)<{ theme?: Theme }>(({ theme }) => {
23
23
  return {
24
24
  cursor: 'pointer',
25
25
  ':hover': {
26
- backgroundColor: theme?.palette.greyGainsboro,
26
+ backgroundColor: theme.palette.greyGainsboro,
27
27
  },
28
28
  };
29
29
  });
@@ -4,7 +4,7 @@ import { Theme } from '../../../';
4
4
 
5
5
  export const TextContent = styled('div')<{ theme?: Theme }>(({ theme }) => ({
6
6
  paddingBottom: '10px',
7
- backgroundColor: theme?.palette.background.default,
7
+ backgroundColor: theme.palette.background.default,
8
8
  }));
9
9
 
10
10
  export const Description = styled('div')<{ theme?: Theme }>(() => ({
@@ -19,15 +19,15 @@ export const Greetings = styled('span')({
19
19
  export const MobileNavBar = styled('div')<{ theme?: Theme }>((props) => ({
20
20
  alignItems: 'center',
21
21
  display: 'flex',
22
- borderBottom: `1px solid ${props.theme?.palette.greyLight}`,
22
+ borderBottom: `1px solid ${props.theme.palette.greyLight}`,
23
23
  padding: '8px',
24
24
  position: 'relative',
25
25
  }));
26
26
 
27
27
  export const InnerMobileNavBar = styled('div')<{ theme?: Theme }>((props) => ({
28
28
  borderRadius: '4px',
29
- backgroundColor: props.theme?.palette.greyLight,
30
- color: props.theme?.palette.white,
29
+ backgroundColor: props.theme.palette.greyLight,
30
+ color: props.theme.palette.white,
31
31
  width: '100%',
32
32
  padding: '0 5px',
33
33
  margin: '0 10px 0 0',
@@ -46,12 +46,12 @@ export const SearchWrapper = styled('div')({
46
46
 
47
47
  export const NavBar = styled(AppBar)<{ theme?: Theme }>(({ theme }) => ({
48
48
  backgroundColor:
49
- theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue,
50
- color: theme?.palette.white,
49
+ theme.palette.mode === 'light' ? theme.palette.primary.main : theme.palette.cyanBlue,
50
+ color: theme.palette.white,
51
51
  minHeight: 60,
52
52
  display: 'flex',
53
53
  justifyContent: 'center',
54
- [`@media (max-width: ${theme?.breakPoints.xsmall}px)`]: css`
54
+ [`@media (max-width: ${theme.breakPoints.xsmall}px)`]: css`
55
55
  ${InfoButton} {
56
56
  display: none;
57
57
  }
@@ -62,7 +62,7 @@ export const NavBar = styled(AppBar)<{ theme?: Theme }>(({ theme }) => ({
62
62
  display: none;
63
63
  }
64
64
  `,
65
- [`@media (min-width: ${theme?.breakPoints.medium}px)`]: css`
65
+ [`@media (min-width: ${theme.breakPoints.medium}px)`]: css`
66
66
  ${SearchWrapper} {
67
67
  display: flex;
68
68
  }
@@ -73,12 +73,12 @@ export const NavBar = styled(AppBar)<{ theme?: Theme }>(({ theme }) => ({
73
73
  display: none;
74
74
  }
75
75
  `,
76
- [`@media (min-width: ${theme?.breakPoints.large}px)`]: css`
76
+ [`@media (min-width: ${theme.breakPoints.large}px)`]: css`
77
77
  ${InnerNavBar} {
78
78
  padding: 0 16px;
79
79
  }
80
80
  `,
81
- [`@media (min-width: ${theme?.breakPoints.xlarge}px)`]: css`
81
+ [`@media (min-width: ${theme.breakPoints.xlarge}px)`]: css`
82
82
  ${InnerNavBar} {
83
83
  max-width: 1240px;
84
84
  width: 100%;