@redocly/theme 0.18.3-patch.0 → 0.18.3-patch.1

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 (141) hide show
  1. package/lib/components/Breadcrumbs/Breadcrumb.d.ts +1 -0
  2. package/lib/components/Breadcrumbs/Breadcrumb.js +2 -2
  3. package/lib/components/Breadcrumbs/Breadcrumbs.js +8 -1
  4. package/lib/components/Button/Button.js +6 -4
  5. package/lib/components/Button/styledVariables.js +25 -12
  6. package/lib/components/Catalog/Catalog.js +3 -3
  7. package/lib/components/Catalog/CatalogCard.js +15 -5
  8. package/lib/components/Catalog/styledVariables.js +5 -3
  9. package/lib/components/Catalog/useCatalog.js +12 -1
  10. package/lib/components/CodeBlock/CodeBlockContainer.js +3 -2
  11. package/lib/components/CodeBlock/CodeBlockControls.js +6 -2
  12. package/lib/components/CodeBlock/styledVariables.js +6 -4
  13. package/lib/components/ColorModeSwitcher/ColorModeSwitcher.js +2 -0
  14. package/lib/components/Dropdown/Dropdown.d.ts +3 -2
  15. package/lib/components/Dropdown/Dropdown.js +2 -1
  16. package/lib/components/EditPageButton/EditPageButton.js +7 -2
  17. package/lib/components/Feedback/Comment.js +5 -0
  18. package/lib/components/Feedback/Feedback.js +13 -3
  19. package/lib/components/Feedback/Rating.js +5 -1
  20. package/lib/components/Feedback/Reasons.js +5 -0
  21. package/lib/components/Feedback/Sentiment.js +11 -2
  22. package/lib/components/Feedback/Thumbs.js +4 -4
  23. package/lib/components/Filter/Filter.js +4 -1
  24. package/lib/components/Filter/FilterContent.js +10 -1
  25. package/lib/components/Filter/FilterPopover.d.ts +4 -4
  26. package/lib/components/Filter/FilterPopover.js +14 -4
  27. package/lib/components/Filter/FilterTag.js +1 -1
  28. package/lib/components/Footer/FooterColumn.js +2 -1
  29. package/lib/components/LastUpdated/index.d.ts +1 -0
  30. package/lib/components/LastUpdated/index.js +18 -0
  31. package/lib/components/LastUpdated/styledVariables.d.ts +1 -0
  32. package/lib/components/LastUpdated/styledVariables.js +11 -0
  33. package/lib/components/Menu/MenuItemLabel.js +2 -0
  34. package/lib/components/Menu/MenuLinkItem.js +2 -1
  35. package/lib/components/Menu/MobileMenu.js +5 -5
  36. package/lib/components/Menu/styledVariables.js +18 -7
  37. package/lib/components/Navbar/NavbarItem.d.ts +1 -1
  38. package/lib/components/Navbar/NavbarItem.js +9 -3
  39. package/lib/components/Navbar/styledVariables.js +5 -2
  40. package/lib/components/NavbarLogo/NavbarLogo.js +2 -1
  41. package/lib/components/NavbarLogo/index.d.ts +1 -0
  42. package/lib/components/NavbarLogo/index.js +1 -0
  43. package/lib/components/NavbarLogo/styledVariables.d.ts +1 -0
  44. package/lib/components/NavbarLogo/styledVariables.js +18 -0
  45. package/lib/components/Panel/styledVariables.js +3 -11
  46. package/lib/components/Profile/LoginLink.js +4 -1
  47. package/lib/components/Profile/MobileUserProfile.js +16 -5
  48. package/lib/components/Profile/UserProfile.js +5 -1
  49. package/lib/components/Search/ProductTag.js +1 -1
  50. package/lib/components/Separator/Separator.js +11 -3
  51. package/lib/components/Separator/SeparatorItem.js +1 -7
  52. package/lib/components/Separator/SeparatorLine.js +7 -3
  53. package/lib/components/Sidebar/ApiCallItem.js +5 -3
  54. package/lib/components/Sidebar/SidebarLayout.js +2 -1
  55. package/lib/components/Sidebar/styledVariables.js +12 -7
  56. package/lib/components/Sidebar/types.d.ts +1 -0
  57. package/lib/components/SidebarActions/CollapseSidebarButton.js +4 -0
  58. package/lib/components/SidebarActions/SidebarActions.js +15 -3
  59. package/lib/components/SidebarActions/styled.js +14 -8
  60. package/lib/components/TableOfContent/TableOfContent.js +2 -1
  61. package/lib/components/Tag/Tag.d.ts +2 -1
  62. package/lib/components/Tag/Tag.js +3 -3
  63. package/lib/components/Tag/styledVariables.js +30 -30
  64. package/lib/components/Tiles/ThinTile.js +7 -5
  65. package/lib/components/Tiles/WideTile.js +10 -8
  66. package/lib/components/Typography/SectionHeader.js +2 -2
  67. package/lib/config.d.ts +76 -0
  68. package/lib/config.js +14 -1
  69. package/lib/globalStyle.js +43 -56
  70. package/lib/icons/PlusIcon/PlusIcon.js +1 -1
  71. package/lib/ui/ArrowBack.js +0 -1
  72. package/lib/ui/darkColors.js +5 -4
  73. package/lib/utils/index.d.ts +1 -0
  74. package/lib/utils/index.js +1 -0
  75. package/lib/utils/tags-parser.d.ts +1 -0
  76. package/lib/utils/tags-parser.js +10 -0
  77. package/package.json +2 -2
  78. package/src/components/Breadcrumbs/Breadcrumb.tsx +8 -2
  79. package/src/components/Breadcrumbs/Breadcrumbs.tsx +13 -1
  80. package/src/components/Button/Button.tsx +6 -4
  81. package/src/components/Button/styledVariables.ts +25 -12
  82. package/src/components/Catalog/Catalog.tsx +3 -8
  83. package/src/components/Catalog/CatalogCard.tsx +17 -6
  84. package/src/components/Catalog/styledVariables.ts +5 -3
  85. package/src/components/Catalog/useCatalog.ts +13 -1
  86. package/src/components/CodeBlock/CodeBlockContainer.tsx +3 -2
  87. package/src/components/CodeBlock/CodeBlockControls.tsx +6 -1
  88. package/src/components/CodeBlock/styledVariables.ts +6 -4
  89. package/src/components/ColorModeSwitcher/ColorModeSwitcher.tsx +3 -0
  90. package/src/components/Dropdown/Dropdown.tsx +4 -1
  91. package/src/components/EditPageButton/EditPageButton.tsx +7 -2
  92. package/src/components/Feedback/Comment.tsx +5 -0
  93. package/src/components/Feedback/Feedback.tsx +13 -3
  94. package/src/components/Feedback/Rating.tsx +5 -1
  95. package/src/components/Feedback/Reasons.tsx +5 -0
  96. package/src/components/Feedback/Sentiment.tsx +15 -2
  97. package/src/components/Feedback/Thumbs.tsx +4 -4
  98. package/src/components/Filter/Filter.tsx +4 -1
  99. package/src/components/Filter/FilterContent.tsx +14 -3
  100. package/src/components/Filter/FilterPopover.tsx +19 -11
  101. package/src/components/Filter/FilterTag.tsx +1 -1
  102. package/src/components/Footer/FooterColumn.tsx +2 -0
  103. package/src/components/LastUpdated/index.ts +1 -0
  104. package/src/components/LastUpdated/styledVariables.ts +8 -0
  105. package/src/components/Menu/MenuItemLabel.tsx +2 -0
  106. package/src/components/Menu/MenuLinkItem.tsx +6 -1
  107. package/src/components/Menu/MobileMenu.tsx +5 -5
  108. package/src/components/Menu/styledVariables.ts +18 -7
  109. package/src/components/Navbar/NavbarItem.tsx +10 -1
  110. package/src/components/Navbar/styledVariables.ts +5 -2
  111. package/src/components/NavbarLogo/NavbarLogo.tsx +12 -1
  112. package/src/components/NavbarLogo/index.ts +1 -0
  113. package/src/components/NavbarLogo/styledVariables.ts +15 -0
  114. package/src/components/Panel/styledVariables.ts +3 -11
  115. package/src/components/Profile/LoginLink.tsx +8 -1
  116. package/src/components/Profile/MobileUserProfile.tsx +22 -5
  117. package/src/components/Profile/UserProfile.tsx +5 -1
  118. package/src/components/Search/ProductTag.tsx +1 -1
  119. package/src/components/Separator/Separator.tsx +17 -3
  120. package/src/components/Separator/SeparatorItem.tsx +1 -7
  121. package/src/components/Separator/SeparatorLine.tsx +7 -3
  122. package/src/components/Sidebar/ApiCallItem.tsx +4 -2
  123. package/src/components/Sidebar/SidebarLayout.tsx +6 -1
  124. package/src/components/Sidebar/styledVariables.ts +12 -7
  125. package/src/components/Sidebar/types.ts +1 -0
  126. package/src/components/SidebarActions/CollapseSidebarButton.tsx +4 -0
  127. package/src/components/SidebarActions/SidebarActions.tsx +18 -3
  128. package/src/components/SidebarActions/styled.tsx +14 -8
  129. package/src/components/TableOfContent/TableOfContent.tsx +2 -0
  130. package/src/components/Tag/Tag.tsx +4 -3
  131. package/src/components/Tag/styledVariables.ts +30 -30
  132. package/src/components/Tiles/ThinTile.tsx +7 -5
  133. package/src/components/Tiles/WideTile.tsx +10 -8
  134. package/src/components/Typography/SectionHeader.ts +2 -2
  135. package/src/config.ts +18 -1
  136. package/src/globalStyle.ts +41 -57
  137. package/src/icons/PlusIcon/PlusIcon.tsx +7 -1
  138. package/src/ui/ArrowBack.tsx +0 -1
  139. package/src/ui/darkColors.tsx +5 -4
  140. package/src/utils/index.ts +1 -0
  141. package/src/utils/tags-parser.ts +8 -0
@@ -20,16 +20,19 @@ export const navbar = css`
20
20
 
21
21
  --navbar-item-active-text-color: var(--text-primary);
22
22
  --navbar-item-active-text-decoration: none;
23
+ --navbar-item-active-bottom-border: 2px solid var(--navbar-item-active-text-color);
23
24
 
24
25
  --navbar-item-padding-vertical: var(--spacing-xxs);
25
26
  --navbar-item-padding-horizontal: var(--spacing-sm);
26
27
  --navbar-item-line-height: var(--line-height-base);
27
- --navbar-item-border-radius: 32px;
28
- --navbar-item-active-background-color: var(--bg-sunken);
28
+ --navbar-item-active-background-color: none;
29
+ --navbar-item-border-radius: 0;
30
+ --navbar-item-bottom-border: 2px solid transparent;
29
31
 
30
32
  --navbar-item-hover-text-color: var(--text-primary);
31
33
  --navbar-item-hover-text-decoration: none;
32
34
  --navbar-item-hover-background-color: none;
35
+ --navbar-item-hover-bottom-border: 2px solid var(--border-primary);
33
36
 
34
37
  --navbar-item-icon-width: 1.5em; // @presenter Spacing
35
38
  --navbar-item-icon-height: 1.5em; // @presenter Spacing
@@ -4,6 +4,7 @@ import styled from 'styled-components';
4
4
  import { Link } from '@portal/Link';
5
5
  import type { LogoConfig } from '@theme/types/portal';
6
6
  import { Image } from '@theme/components/Image/Image';
7
+ import { telemetry } from '@portal/telemetry';
7
8
 
8
9
  export type NavbarLogoProps = {
9
10
  logo: Pick<LogoConfig, 'image' | 'link' | 'altText' | 'srcSet'>;
@@ -18,7 +19,17 @@ export function NavbarLogo({ logo, className }: NavbarLogoProps): JSX.Element |
18
19
  <Image className={className} src={logo.image} srcSet={logo.srcSet} alt={logo.altText} />
19
20
  );
20
21
 
21
- return <LogoContainer>{logo.link ? <Link to={logo.link}>{img}</Link> : img}</LogoContainer>;
22
+ return (
23
+ <LogoContainer>
24
+ {logo.link ? (
25
+ <Link to={logo.link} onClick={() => telemetry.send('logo_clicked', {})}>
26
+ {img}
27
+ </Link>
28
+ ) : (
29
+ img
30
+ )}
31
+ </LogoContainer>
32
+ );
22
33
  }
23
34
 
24
35
  export const LogoContainer = styled.div.attrs({
@@ -1 +1,2 @@
1
1
  export * from '@theme/components/NavbarLogo/NavbarLogo';
2
+ export * from '@theme/components/NavbarLogo/styledVariables';
@@ -0,0 +1,15 @@
1
+ import { css } from "styled-components";
2
+
3
+ export const logo = css`
4
+ /**
5
+ * @tokens Logo
6
+ */
7
+
8
+ --navbar-logo-height: 2rem; // @presenter Spacing
9
+ --navbar-logo-width: auto;
10
+ --navbar-logo-margin: 16px; // @presenter Spacing
11
+ --navbar-logo-max-width: 285px; // @presenter Spacing
12
+ --navbar-logo-max-height: 285px; // @presenter Spacing
13
+
14
+ // @tokens End
15
+ `;
@@ -195,7 +195,7 @@ export const apiReferencePanels = css`
195
195
  --panel-heading-font-family: var(--font-family-base); // @presenter FontFamily
196
196
  --panel-heading-font-size: 18px; // @presenter FontSize
197
197
  --panel-heading-font-weight: var(--font-weight-bold); // @presenter FontWeight
198
- --panel-heading-text-color: vat(--text-primary);
198
+ --panel-heading-text-color: var(--text-primary);
199
199
  --panel-heading-padding: var(--spacing-base);
200
200
  --panel-heading-line-height: 1; // @presenter LineHeight
201
201
  --panel-heading-white-space: 'nowrap';
@@ -208,7 +208,7 @@ export const apiReferencePanels = css`
208
208
  --panel-body-font-family: var(--font-family-base); // @presenter FontFamily
209
209
  --panel-body-font-size: var(--font-size-base); // @presenter FontSize
210
210
  --panel-body-font-weight: var(--font-weight-regular); // @presenter FontWeight
211
- --panel-body-text-color: vat(--text-secondary);
211
+ --panel-body-text-color: var(--text-secondary);
212
212
  --panel-body-padding: var(--spacing-base);
213
213
  --panel-body-border: 1px solid var(--border-primary);
214
214
 
@@ -431,7 +431,7 @@ export const apiReferencePanels = css`
431
431
  --panel-try-it-tabs-disabled-text-color: var(--text-placeholder); // @presenter Color
432
432
 
433
433
  --panel-try-it-tabs-background-color: none; // @presenter Color
434
- --panel-try-it-tabs-hover-background-color: var(--bg-raised);; // @presenter Color
434
+ --panel-try-it-tabs-hover-background-color: var(--bg-raised); // @presenter Color
435
435
  --panel-try-it-tabs-active-background-color: var(--bg-base); // @presenter Color
436
436
  --panel-try-it-tabs-disabled-background-color: none; // @presenter Color
437
437
 
@@ -476,12 +476,4 @@ export const apiReferencePanels = css`
476
476
  --panel-try-it-border: 1px solid var(--border-primary); // @presenter Border
477
477
 
478
478
  // @tokens End
479
-
480
- // TODO PUL RIGHT section - related to pull right - fix later
481
-
482
- --samples-panel-markdown-background-color: #3c4c5a;
483
- --samples-panel-markdown-border-color: #46596a;
484
-
485
- --layout-right-rail-width: 50%;
486
- --layout-right-rail-background-color: transparent;
487
479
  `;
@@ -3,6 +3,7 @@ import styled from 'styled-components';
3
3
 
4
4
  import { useThemeConfig } from '@theme/hooks/useThemeConfig';
5
5
  import { useTranslate } from '@portal/hooks';
6
+ import { telemetry } from '@portal/telemetry';
6
7
 
7
8
  export interface LoginLinkProps {
8
9
  href: string;
@@ -16,7 +17,13 @@ export function LoginLink({ href }: LoginLinkProps): JSX.Element {
16
17
  };
17
18
 
18
19
  return (
19
- <StyledLink href={href} data-translation-key={translationKeys.login}>
20
+ <StyledLink
21
+ href={href}
22
+ data-translation-key={translationKeys.login}
23
+ onClick={() => {
24
+ telemetry.send('login_button_clicked', {});
25
+ }}
26
+ >
20
27
  {translate(translationKeys.login, userProfile?.loginLabel || 'Login')}
21
28
  </StyledLink>
22
29
  );
@@ -6,6 +6,7 @@ import { LogoutIcon } from '@theme/icons/LogoutIcon';
6
6
  import { useThemeConfig } from '@theme/hooks/useThemeConfig';
7
7
  import { useTranslate } from '@portal/hooks';
8
8
  import { UserProfileData } from '@theme/components/Profile/UserProfileData';
9
+ import { telemetry } from '@portal/telemetry';
9
10
 
10
11
  export function MobileUserProfile() {
11
12
  const { userProfile } = useThemeConfig();
@@ -20,13 +21,22 @@ export function MobileUserProfile() {
20
21
  return (
21
22
  <MobileProfileWrapper data-component-name="Navbar/MobileUserProfile">
22
23
  {!userData?.isAuthenticated ? (
23
- <LoginButton href={loginUrl} data-cy="login-btn">
24
+ <LoginButton
25
+ href={loginUrl}
26
+ data-cy="login-btn"
27
+ onClick={() => telemetry.send('login_button_clicked', {})}
28
+ >
24
29
  {translate(translationKeys.login, userProfile?.loginLabel || 'Login')}
25
30
  </LoginButton>
26
31
  ) : (
27
32
  <>
28
33
  <UserProfileData userData={userData} />
29
- <LogoutButton onClick={() => handleLogout()}>
34
+ <LogoutButton
35
+ onClick={() => {
36
+ handleLogout();
37
+ telemetry.send('logout_menu_item_clicked', {});
38
+ }}
39
+ >
30
40
  <LogoutIcon />
31
41
  </LogoutButton>
32
42
  </>
@@ -36,16 +46,23 @@ export function MobileUserProfile() {
36
46
  }
37
47
  const LoginButton = styled.a`
38
48
  background: var(--mobile-menu-login-button-background);
39
- border-radius: 6px;
49
+ border-radius: var(--mobile-menu-login-button-border-radius);
40
50
  width: 100%;
41
51
  margin: 0;
42
52
  padding: 5px 0;
43
53
  color: var(--mobile-menu-login-button-color);
44
- font-size: var(--font-size-base);
54
+ border: 1px solid var(--mobile-menu-login-button-border-color);
55
+ font-size: var(--mobile-menu-login-button-font-size);
56
+ font-family: var(--mobile-menu-login-button-font-family);
57
+ font-weight: var(--mobile-menu-login-button-font-weight);
45
58
  text-align: center;
46
- line-height: 22px;
59
+ line-height: var(--mobile-menu-login-button-line-height);
47
60
  cursor: pointer;
48
61
  text-decoration: none;
62
+
63
+ &:hover {
64
+ color: var(--mobile-menu-login-button-hover-color);
65
+ }
49
66
  `;
50
67
 
51
68
  const MobileProfileWrapper = styled.div`
@@ -7,6 +7,7 @@ import { Profile } from '@theme/components/Profile/Profile';
7
7
  import { Link } from '@portal/Link';
8
8
  import { useThemeConfig } from '@theme/hooks/useThemeConfig';
9
9
  import { useTranslate } from '@portal/hooks';
10
+ import { telemetry } from '@portal/telemetry';
10
11
  import { Dropdown, DropdownList, DropdownListItem } from '@theme/components/Dropdown';
11
12
  import { UserProfileData } from '@theme/components/Profile/UserProfileData';
12
13
  import { LogoutIcon } from '@theme/icons';
@@ -51,7 +52,10 @@ export function UserProfile({
51
52
 
52
53
  menuItems.push(
53
54
  <Logout
54
- onClick={() => handleLogout()}
55
+ onClick={() => {
56
+ handleLogout();
57
+ telemetry.send('logout_menu_item_clicked', {});
58
+ }}
55
59
  data-translation-key={translationKeys.logout}
56
60
  role="link"
57
61
  >
@@ -29,7 +29,7 @@ const Wrapper = styled.div`
29
29
  background: var(--bg-overlay);
30
30
  border: 1px solid var(--border-secondary);
31
31
  border-radius: var(--border-radius-xlg);
32
- margin-right: 16px;
32
+ margin-right: var(--spacing-base);
33
33
  `;
34
34
 
35
35
  const Label = styled.span`
@@ -5,16 +5,30 @@ import { SeparatorLine } from '@theme/components/Separator/SeparatorLine';
5
5
  import { SeparatorItem } from '@theme/components/Separator/SeparatorItem';
6
6
  import type { MenuItemProps } from '@theme/components/Sidebar/types';
7
7
  import { useTranslate } from '@portal/hooks';
8
+ import { useThemeConfig } from '@theme/hooks';
8
9
 
9
10
  export function Separator({ item, className }: MenuItemProps): JSX.Element {
10
11
  const { translate } = useTranslate();
12
+ const { sidebar } = useThemeConfig();
13
+
14
+ const separatorLine = item.separatorLine || sidebar?.separatorLine;
15
+ const linePosition = item.linePosition || sidebar?.linePosition || 'bottom';
11
16
 
12
17
  return (
13
- <Wrapper data-component-name="Sidebar/Separator" className={className}>
18
+ <Wrapper
19
+ data-component-name="Sidebar/Separator"
20
+ className={className}
21
+ linePosition={linePosition}
22
+ withLabel={!!item.label}
23
+ >
14
24
  <SeparatorItem>{translate(item.labelTranslationKey, item.label)}</SeparatorItem>
15
- {item.separatorLine ? <SeparatorLine /> : null}
25
+ {separatorLine ? <SeparatorLine /> : null}
16
26
  </Wrapper>
17
27
  );
18
28
  }
19
29
 
20
- const Wrapper = styled.div``;
30
+ const Wrapper = styled.div<{ linePosition: 'top' | 'bottom'; withLabel?: boolean }>`
31
+ display: flex;
32
+ flex-direction: ${({ linePosition }) => (linePosition === 'top' ? 'column-reverse' : 'column')};
33
+ margin-top: ${({ withLabel }) => (withLabel ? 'var(--sidebar-item-separator-offset)' : '0')};
34
+ `;
@@ -15,18 +15,12 @@ export const SeparatorItem = styled(MenuItemLabel).attrs<{ className?: string }>
15
15
  text-transform: var(--sidebar-item-separator-text-transform);
16
16
  background: var(--mobile-menu-background);
17
17
  border-radius: 0;
18
- border-top: var(--sidebar-item-separator-border-width) solid
19
- var(--sidebar-item-separator-border-color);
20
- padding-top: var(--sidebar-item-separator-padding-top);
18
+ padding: var(--sidebar-item-separator-padding);
21
19
 
22
20
  ${({ theme }) => theme.mediaQueries.medium} {
23
21
  background: var(--sidebar-item-separator-background-color);
24
22
  }
25
23
 
26
- *:not(:first-child) > & {
27
- margin-top: var(--sidebar-item-separator-offset);
28
- }
29
-
30
24
  :hover {
31
25
  color: var(--sidebar-item-separator-text-color);
32
26
  }
@@ -4,7 +4,11 @@ export const SeparatorLine = styled.div.attrs<{ className?: string }>(({ classNa
4
4
  'data-component-name': 'Sidebar/SeparatorLine',
5
5
  className,
6
6
  }))`
7
- height: 1px;
8
- background-color: var(--sidebar-item-separator-line-color);
9
- margin: var(--sidebar-item-separator-offset) 0 var(--sidebar-item-padding-vertical) 0;
7
+ height: var(--sidebar-item-separator-border-width);
8
+ background-color: var(--sidebar-item-separator-border-color);
9
+ margin: var(--mobile-sidebar-item-separator-line-offset);
10
+
11
+ ${({ theme }) => theme.mediaQueries.medium} {
12
+ margin: var(--sidebar-item-separator-line-offset);
13
+ }
10
14
  `;
@@ -12,10 +12,10 @@ export function ApiCallItem({ item, className }: MenuItemProps): JSX.Element {
12
12
  <Wrapper data-component-name="Sidebar/ApiCallItem" className={className}>
13
13
  <MenuLinkItem item={item}>
14
14
  <Label active={item.active}>
15
+ {item.label}
15
16
  <HttpTag color={item.httpVerb || ''}>
16
17
  {item.httpVerb === 'hook' ? 'event' : item.httpVerb}
17
18
  </HttpTag>
18
- {item.label}
19
19
  </Label>
20
20
  </MenuLinkItem>
21
21
 
@@ -25,6 +25,8 @@ export function ApiCallItem({ item, className }: MenuItemProps): JSX.Element {
25
25
  }
26
26
 
27
27
  const Label = styled(MenuItemLabel)`
28
+ display: flex;
29
+ justify-content: space-between;
28
30
  color: var(--mobile-menu-item-text-color);
29
31
 
30
32
  ${({ theme }) => theme.mediaQueries.medium} {
@@ -36,7 +38,7 @@ const Wrapper = styled.div``;
36
38
 
37
39
  export const HttpTag = styled(Tag)`
38
40
  flex-shrink: 0;
39
- margin-top: 0;
41
+ margin: var(--sidebar-item-http-tag-margin);
40
42
  text-transform: uppercase;
41
43
 
42
44
  width: var(--sidebar-item-http-tag-width);
@@ -9,6 +9,7 @@ import { MobileSidebarButton } from '@theme/components/Sidebar/MobileSidebarButt
9
9
  import { MenuContainer } from '@theme/components/Menu/MenuContainer';
10
10
  import { SidebarSearch } from '@theme/components/Search/SidebarSearch';
11
11
  import { useThemeConfig } from '@theme/hooks/useThemeConfig';
12
+ import { telemetry } from '@portal/telemetry';
12
13
 
13
14
  import { MobileSidebarIcon } from './MobileSidebarIcon';
14
15
 
@@ -81,7 +82,11 @@ export function SidebarLayout({
81
82
  <Wrapper data-component-name="Sidebar/SidebarLayout" className={className}>
82
83
  {!search?.hide && search?.placement === 'sidebar' ? <SidebarSearch /> : null}
83
84
  <Sidebar animate={true} opened={isOpen}>
84
- {header ? <HeaderWrapper>{header}</HeaderWrapper> : null}
85
+ {header ? (
86
+ <HeaderWrapper onClick={() => telemetry.send('back_to_catalog_button_clicked', {})}>
87
+ {header}
88
+ </HeaderWrapper>
89
+ ) : null}
85
90
  {versions ? <>{versions}</> : null}
86
91
  <MenuContainer growContent={growContent}>{menu}</MenuContainer>
87
92
  {footer && !isOpen ? (
@@ -45,6 +45,7 @@ export const sidebar = css`
45
45
  --sidebar-item-font-family: var(--font-family-base); // @presenter FontFamily
46
46
  --sidebar-item-font-size: var(--font-size-base); // @presenter FontSize
47
47
  --sidebar-item-font-weight: var(--font-weight-regular); // @presenter FontSize
48
+ --sidebar-item-line-height: var(--line-height-base); // @presenter LineHeight
48
49
 
49
50
  /**
50
51
  * @tokens Sidebar item colors
@@ -54,8 +55,9 @@ export const sidebar = css`
54
55
  --sidebar-item-background-color: transparent; // @presenter Color
55
56
 
56
57
  --sidebar-item-active-color: var(--text-primary); // @presenter Color
57
- --sidebar-item-active-background-color: var(--bg-raised); // @presenter Color
58
+ --sidebar-item-active-background-color: var(--bg-overlay); // @presenter Color
58
59
 
60
+ --sidebar-item-hover-background-color: var(--bg-raised); // @presenter Color
59
61
  --sidebar-item-hover-color: var(--text-primary); // @presenter Color
60
62
 
61
63
  /**
@@ -125,21 +127,24 @@ export const sidebar = css`
125
127
 
126
128
  --sidebar-item-separator-background-color: var(--sidebar-background-color); // @presenter Color
127
129
  --sidebar-item-separator-line-color: var(--border-primary); // @presenter Color
128
- --sidebar-item-separator-offset: var(--spacing-lg); // @presenter Spacing
130
+ --sidebar-item-separator-offset: var(--spacing-sm); // @presenter Spacing
131
+ --sidebar-item-separator-line-offset: var(--spacing-xxs) var(--sidebar-margin-horizontal); // @presenter Spacing
132
+ --mobile-sidebar-item-separator-line-offset: var(--spacing-xxs) var(--spacing-xs); // @presenter Spacing
129
133
  --sidebar-item-separator-border-width: 1px; // @presenter Spacing
130
134
  --sidebar-item-separator-border-color: var(--border-primary); // @presenter Color
131
- --sidebar-item-separator-padding-top: var(--spacing-xxs); // @presenter Spacing
135
+ --sidebar-item-separator-padding: var(--spacing-xxs) var(--sidebar-item-padding-horizontal); // @presenter Spacing
132
136
 
133
137
  /**
134
138
  * @tokens Sidebar item http tag
135
139
  */
136
140
 
137
- --sidebar-item-http-tag-width: 36px;
138
- --sidebar-item-http-tag-height: 14px;
141
+ --sidebar-item-http-tag-width: auto;
142
+ --sidebar-item-http-tag-height: 20px;
139
143
  --sidebar-item-http-tag-font-family: var(--code-font-family); // @presenter FontFamily
140
- --sidebar-item-http-tag-font-size: 8px; // @presenter FontSize
144
+ --sidebar-item-http-tag-font-size: var(--font-size-sm); // @presenter FontSize
141
145
  --sidebar-item-http-tag-font-weight: normal; //@presenter FontWeight
142
- --sidebar-item-http-tag-border-radius: var(--border-radius-lg); // @presenter BorderRadius
146
+ --sidebar-item-http-tag-border-radius: var(--border-radius-xlg); // @presenter BorderRadius
147
+ --sidebar-item-http-tag-margin: 0 0 0 5px;
143
148
 
144
149
  /**
145
150
  * @tokens Sidebar back button
@@ -47,6 +47,7 @@ export interface NavItem {
47
47
  requiredPermission?: string;
48
48
  menuStyle?: MenuStyle;
49
49
  separatorLine?: boolean;
50
+ linePosition?: 'top' | 'bottom';
50
51
  version?: string;
51
52
  default?: boolean;
52
53
  }
@@ -31,6 +31,10 @@ const ToggleButton = styled(StyledToggleRightPanelButton)<{ collapsed?: boolean
31
31
  fill: var(--sidebar-collapse-button-icon-color);
32
32
  margin-right: ${({ collapsed }) => (collapsed ? 0 : 'calc(var(--spacing-unit) * -9)')};
33
33
  border: 1px solid var(--sidebar-collapse-button-border-color);
34
+ border-radius: var(--border-radius-md);
35
+ padding: var(--spacing-xxs);
36
+ height: var(--control-height-sm);
37
+ width: var(--control-height-sm);
34
38
 
35
39
  ${({ collapsed }) =>
36
40
  collapsed &&
@@ -7,6 +7,7 @@ import {
7
7
  ControlsWrap,
8
8
  ControlsWrapChangeLayoutButtons,
9
9
  } from '@theme/components/SidebarActions/styled';
10
+ import { telemetry } from '@portal/telemetry';
10
11
 
11
12
  export enum LayoutVariant {
12
13
  STACKED = 'stacked',
@@ -54,11 +55,20 @@ export const SidebarActions = ({
54
55
  {initialShowRightPanelToggle && (
55
56
  <ToggleRightPanelButton
56
57
  showRightPanelToggle={showRightPanelToggle}
57
- onClick={onChangeRightPanelViewClick}
58
+ onClick={() => {
59
+ onChangeRightPanelViewClick();
60
+ telemetry.send('sidebar_samples_button_clicked', {});
61
+ }}
58
62
  />
59
63
  )}
60
64
  {showChangeLayoutButton && showRightPanelToggle && (
61
- <ChangeViewButton layout={layout} onClick={onChangeViewClick} />
65
+ <ChangeViewButton
66
+ layout={layout}
67
+ onClick={() => {
68
+ onChangeViewClick();
69
+ telemetry.send('change_layout_button_clicked', {});
70
+ }}
71
+ />
62
72
  )}
63
73
  </ControlsWrapChangeLayoutButtons>
64
74
  )}
@@ -66,7 +76,12 @@ export const SidebarActions = ({
66
76
  {!hideCollapseSidebarButton && (
67
77
  <CollapseSidebarButton
68
78
  initialValue={collapsedSidebar}
69
- onClick={onChangeCollapseSidebarClick}
79
+ onClick={() => {
80
+ onChangeCollapseSidebarClick();
81
+ collapsedSidebar
82
+ ? telemetry.send('sidebar_item_expanded', {})
83
+ : telemetry.send('sidebar_item_collapsed', {});
84
+ }}
70
85
  />
71
86
  )}
72
87
  </ControlsWrap>
@@ -30,11 +30,14 @@ export const StyledToggleRightPanelButton = styled.a`
30
30
  cursor: pointer;
31
31
  z-index: 1;
32
32
  /* Rectangle 201 */
33
- border-radius: var(--border-radius);
34
- padding: var(--spacing-unit);
33
+ border-radius: var(--border-radius-md);
34
+ padding: var(--spacing-xs);
35
+ height: var(--control-height-base);
36
+ width: var(--control-height-base);
37
+ border: 1px solid var(--border-primary);
35
38
 
36
39
  &:hover {
37
- background-color: var(--sidebar-item-active-background-color);
40
+ background-color: var(--sidebar-item-hover-background-color);
38
41
  }
39
42
  `;
40
43
 
@@ -66,13 +69,16 @@ export const StyledChangeViewButton = styled.a`
66
69
  justify-content: center;
67
70
  align-items: center;
68
71
  cursor: pointer;
69
- border-radius: var(--border-radius);
72
+ border-radius: var(--border-radius-md);
73
+ background: var(--bg-overlay);
70
74
  z-index: 1;
71
75
  /* Rectangle 201 */
72
- padding: var(--spacing-unit);
76
+ padding: var(--spacing-xs);
77
+ height: var(--control-height-base);
78
+ width: var(--control-height-base);
73
79
 
74
80
  &:hover {
75
- background-color: var(--sidebar-item-active-background-color);
81
+ background-color: var(--sidebar-item-hover-background-color);
76
82
  }
77
83
  `;
78
84
 
@@ -114,7 +120,7 @@ export const ControlsWrap = styled.span<{
114
120
  justify-content: ${({ isOpenapiDocs }) => (isOpenapiDocs ? 'space-between' : 'flex-end')};
115
121
  bottom: 0;
116
122
  flex-direction: row;
117
- gap: var(--spacing-xxs);
123
+ gap: var(--spacing-xs);
118
124
  align-items: center;
119
125
  margin-left: var(--sidebar-controls-margin-left);
120
126
  z-index: 2;
@@ -145,6 +151,6 @@ export const ControlsWrapChangeLayoutButtons = styled.span<{ isCollapsed?: boole
145
151
  display: flex;
146
152
  bottom: 0;
147
153
  flex-direction: ${({ isCollapsed }) => (isCollapsed ? 'column-reverse' : 'row')};
148
- gap: ${({ isCollapsed }) => (isCollapsed ? '10px' : 'var(--spacing-unit)')};
154
+ gap: ${({ isCollapsed }) => (isCollapsed ? '10px' : 'var(--spacing-xs)')};
149
155
  align-items: center;
150
156
  `;
@@ -11,6 +11,7 @@ import {
11
11
  getDisplayedHeadings,
12
12
  getLeastDepth,
13
13
  } from '@theme/components/TableOfContent/utils';
14
+ import { telemetry } from '@portal/telemetry';
14
15
 
15
16
  interface TableOfContentProps {
16
17
  headings?: Array<MdHeading | null> | null | undefined;
@@ -64,6 +65,7 @@ export function TableOfContent(props: TableOfContentProps): JSX.Element | null {
64
65
  className={activeHeadingId === heading.id ? 'active' : ''}
65
66
  dangerouslySetInnerHTML={{ __html: heading.value || '' }}
66
67
  data-cy={`toc-${heading.value}`}
68
+ onClick={() => telemetry.send('toc_item_clicked', {})}
67
69
  />
68
70
  );
69
71
  })}
@@ -25,11 +25,12 @@ interface TagProps {
25
25
  closable?: boolean;
26
26
  color?: StatusColor | Color | string;
27
27
  icon?: React.ReactNode;
28
+ onClick?: () => void;
28
29
  }
29
30
 
30
- export function Tag({ children, className, color = 'default', icon }: TagProps): JSX.Element {
31
+ export function Tag({ children, className, color, icon, onClick }: TagProps): JSX.Element {
31
32
  return (
32
- <TagContainer className={className} color={color}>
33
+ <TagContainer className={className} color={color} onClick={onClick}>
33
34
  {icon ? icon : null}
34
35
  {children}
35
36
  </TagContainer>
@@ -38,7 +39,7 @@ export function Tag({ children, className, color = 'default', icon }: TagProps):
38
39
 
39
40
  const TagContainer = styled.div.attrs(({ className, color }: TagProps) => ({
40
41
  'data-component-name': 'Tag/Tag',
41
- className: className + ` tag-${color}`,
42
+ className: (className || '') + ` tag-default ${color ? `tag-${color}` : ''}`,
42
43
  }))<TagProps>`
43
44
  display: inline-flex;
44
45
  align-items: center;