@redocly/theme 0.18.3-patch.0 → 0.18.3-patch.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.
- package/lib/components/Breadcrumbs/Breadcrumb.d.ts +1 -0
- package/lib/components/Breadcrumbs/Breadcrumb.js +2 -2
- package/lib/components/Breadcrumbs/Breadcrumbs.js +8 -1
- package/lib/components/Button/Button.js +6 -4
- package/lib/components/Button/styledVariables.js +25 -12
- package/lib/components/Catalog/Catalog.js +4 -4
- package/lib/components/Catalog/CatalogCard.js +15 -5
- package/lib/components/Catalog/styledVariables.js +5 -3
- package/lib/components/Catalog/useCatalog.js +12 -1
- package/lib/components/CodeBlock/CodeBlockContainer.js +3 -2
- package/lib/components/CodeBlock/CodeBlockControls.js +6 -2
- package/lib/components/CodeBlock/styledVariables.js +6 -4
- package/lib/components/ColorModeSwitcher/ColorModeSwitcher.js +2 -0
- package/lib/components/Dropdown/Dropdown.d.ts +3 -2
- package/lib/components/Dropdown/Dropdown.js +2 -1
- package/lib/components/EditPageButton/EditPageButton.js +7 -2
- package/lib/components/Feedback/Comment.js +5 -0
- package/lib/components/Feedback/Feedback.js +13 -3
- package/lib/components/Feedback/Rating.js +5 -1
- package/lib/components/Feedback/Reasons.js +5 -0
- package/lib/components/Feedback/Sentiment.js +11 -2
- package/lib/components/Feedback/Thumbs.js +4 -4
- package/lib/components/Filter/Filter.d.ts +2 -1
- package/lib/components/Filter/Filter.js +14 -5
- package/lib/components/Filter/FilterContent.d.ts +2 -1
- package/lib/components/Filter/FilterContent.js +12 -3
- package/lib/components/Filter/FilterPopover.d.ts +4 -4
- package/lib/components/Filter/FilterPopover.js +14 -4
- package/lib/components/Filter/FilterTag.js +1 -1
- package/lib/components/Footer/FooterColumn.js +2 -1
- package/lib/components/LastUpdated/index.d.ts +1 -0
- package/lib/components/LastUpdated/index.js +18 -0
- package/lib/components/LastUpdated/styledVariables.d.ts +1 -0
- package/lib/components/LastUpdated/styledVariables.js +11 -0
- package/lib/components/Menu/MenuItemLabel.js +2 -0
- package/lib/components/Menu/MenuLinkItem.js +2 -1
- package/lib/components/Menu/MobileMenu.js +5 -5
- package/lib/components/Menu/styledVariables.js +18 -7
- package/lib/components/Navbar/NavbarItem.d.ts +1 -1
- package/lib/components/Navbar/NavbarItem.js +9 -3
- package/lib/components/Navbar/styledVariables.js +5 -2
- package/lib/components/NavbarLogo/NavbarLogo.js +2 -1
- package/lib/components/NavbarLogo/index.d.ts +1 -0
- package/lib/components/NavbarLogo/index.js +1 -0
- package/lib/components/NavbarLogo/styledVariables.d.ts +1 -0
- package/lib/components/NavbarLogo/styledVariables.js +18 -0
- package/lib/components/Panel/styledVariables.js +3 -11
- package/lib/components/Profile/LoginLink.js +4 -1
- package/lib/components/Profile/MobileUserProfile.js +16 -5
- package/lib/components/Profile/UserProfile.js +5 -1
- package/lib/components/Search/ProductTag.js +1 -1
- package/lib/components/Select/Select.d.ts +1 -3
- package/lib/components/Select/Select.js +5 -2
- package/lib/components/Separator/Separator.js +11 -3
- package/lib/components/Separator/SeparatorItem.js +1 -7
- package/lib/components/Separator/SeparatorLine.js +7 -3
- package/lib/components/Sidebar/ApiCallItem.js +5 -3
- package/lib/components/Sidebar/SidebarLayout.js +2 -1
- package/lib/components/Sidebar/styledVariables.js +12 -7
- package/lib/components/Sidebar/types.d.ts +1 -0
- package/lib/components/SidebarActions/CollapseSidebarButton.js +4 -0
- package/lib/components/SidebarActions/SidebarActions.js +15 -3
- package/lib/components/SidebarActions/styled.js +14 -8
- package/lib/components/TableOfContent/TableOfContent.js +2 -1
- package/lib/components/Tag/Tag.d.ts +3 -1
- package/lib/components/Tag/Tag.js +10 -4
- package/lib/components/Tag/styledVariables.js +35 -30
- package/lib/components/Tiles/ThinTile.js +7 -5
- package/lib/components/Tiles/WideTile.js +10 -8
- package/lib/components/Typography/SectionHeader.js +2 -2
- package/lib/config.d.ts +84 -0
- package/lib/config.js +15 -1
- package/lib/globalStyle.js +43 -56
- package/lib/icons/PlusIcon/PlusIcon.js +1 -1
- package/lib/ui/ArrowBack.js +0 -1
- package/lib/ui/darkColors.js +5 -4
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/tags-parser.d.ts +1 -0
- package/lib/utils/tags-parser.js +10 -0
- package/package.json +2 -2
- package/src/components/Breadcrumbs/Breadcrumb.tsx +8 -2
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +13 -1
- package/src/components/Button/Button.tsx +6 -4
- package/src/components/Button/styledVariables.ts +25 -12
- package/src/components/Catalog/Catalog.tsx +4 -8
- package/src/components/Catalog/CatalogCard.tsx +17 -6
- package/src/components/Catalog/styledVariables.ts +5 -3
- package/src/components/Catalog/useCatalog.ts +13 -1
- package/src/components/CodeBlock/CodeBlockContainer.tsx +3 -2
- package/src/components/CodeBlock/CodeBlockControls.tsx +6 -1
- package/src/components/CodeBlock/styledVariables.ts +6 -4
- package/src/components/ColorModeSwitcher/ColorModeSwitcher.tsx +3 -0
- package/src/components/Dropdown/Dropdown.tsx +4 -1
- package/src/components/EditPageButton/EditPageButton.tsx +7 -2
- package/src/components/Feedback/Comment.tsx +5 -0
- package/src/components/Feedback/Feedback.tsx +13 -3
- package/src/components/Feedback/Rating.tsx +5 -1
- package/src/components/Feedback/Reasons.tsx +5 -0
- package/src/components/Feedback/Sentiment.tsx +15 -2
- package/src/components/Feedback/Thumbs.tsx +4 -4
- package/src/components/Filter/Filter.tsx +25 -4
- package/src/components/Filter/FilterContent.tsx +21 -4
- package/src/components/Filter/FilterPopover.tsx +19 -11
- package/src/components/Filter/FilterTag.tsx +1 -1
- package/src/components/Footer/FooterColumn.tsx +2 -0
- package/src/components/LastUpdated/index.ts +1 -0
- package/src/components/LastUpdated/styledVariables.ts +8 -0
- package/src/components/Menu/MenuItemLabel.tsx +2 -0
- package/src/components/Menu/MenuLinkItem.tsx +6 -1
- package/src/components/Menu/MobileMenu.tsx +5 -5
- package/src/components/Menu/styledVariables.ts +18 -7
- package/src/components/Navbar/NavbarItem.tsx +10 -1
- package/src/components/Navbar/styledVariables.ts +5 -2
- package/src/components/NavbarLogo/NavbarLogo.tsx +12 -1
- package/src/components/NavbarLogo/index.ts +1 -0
- package/src/components/NavbarLogo/styledVariables.ts +15 -0
- package/src/components/Panel/styledVariables.ts +3 -11
- package/src/components/Profile/LoginLink.tsx +8 -1
- package/src/components/Profile/MobileUserProfile.tsx +22 -5
- package/src/components/Profile/UserProfile.tsx +5 -1
- package/src/components/Search/ProductTag.tsx +1 -1
- package/src/components/Select/Select.tsx +6 -5
- package/src/components/Separator/Separator.tsx +17 -3
- package/src/components/Separator/SeparatorItem.tsx +1 -7
- package/src/components/Separator/SeparatorLine.tsx +7 -3
- package/src/components/Sidebar/ApiCallItem.tsx +4 -2
- package/src/components/Sidebar/SidebarLayout.tsx +6 -1
- package/src/components/Sidebar/styledVariables.ts +12 -7
- package/src/components/Sidebar/types.ts +1 -0
- package/src/components/SidebarActions/CollapseSidebarButton.tsx +4 -0
- package/src/components/SidebarActions/SidebarActions.tsx +18 -3
- package/src/components/SidebarActions/styled.tsx +14 -8
- package/src/components/TableOfContent/TableOfContent.tsx +2 -0
- package/src/components/Tag/Tag.tsx +13 -4
- package/src/components/Tag/styledVariables.ts +35 -30
- package/src/components/Tiles/ThinTile.tsx +7 -5
- package/src/components/Tiles/WideTile.tsx +10 -8
- package/src/components/Typography/SectionHeader.ts +2 -2
- package/src/config.ts +19 -1
- package/src/globalStyle.ts +41 -57
- package/src/icons/PlusIcon/PlusIcon.tsx +7 -1
- package/src/ui/ArrowBack.tsx +0 -1
- package/src/ui/darkColors.tsx +5 -4
- package/src/utils/index.ts +1 -0
- package/src/utils/tags-parser.ts +8 -0
|
@@ -13,6 +13,7 @@ interface FilterContentProps {
|
|
|
13
13
|
filters: ResolvedFilter[];
|
|
14
14
|
filterTerm: string;
|
|
15
15
|
isMobile: boolean;
|
|
16
|
+
filterValuesCasing?: 'sentence';
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export function FilterContent({
|
|
@@ -20,6 +21,7 @@ export function FilterContent({
|
|
|
20
21
|
filters,
|
|
21
22
|
filterTerm,
|
|
22
23
|
isMobile,
|
|
24
|
+
filterValuesCasing,
|
|
23
25
|
}: FilterContentProps) {
|
|
24
26
|
const { translate } = useTranslate();
|
|
25
27
|
const translationKeys = {
|
|
@@ -27,6 +29,14 @@ export function FilterContent({
|
|
|
27
29
|
clearAll: 'theme.catalog.filters.clearAll',
|
|
28
30
|
};
|
|
29
31
|
|
|
32
|
+
const hasActiveFilters = filters.some((filter) => {
|
|
33
|
+
if (filter.selectedOptions && filter.selectedOptions instanceof Set) {
|
|
34
|
+
return filter.selectedOptions.size;
|
|
35
|
+
} else if (filter.selectedOptions.from && filter.selectedOptions.to) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
30
40
|
const handleClearAll = () => {
|
|
31
41
|
filters.forEach((filter) => filter.selectOption(''));
|
|
32
42
|
};
|
|
@@ -42,17 +52,24 @@ export function FilterContent({
|
|
|
42
52
|
</FilterControls>
|
|
43
53
|
<FilterItems>
|
|
44
54
|
{filters.map((filter, idx) => (
|
|
45
|
-
<Filter
|
|
55
|
+
<Filter
|
|
56
|
+
filter={filter}
|
|
57
|
+
key={filter.property + '-' + idx}
|
|
58
|
+
filterValuesCasing={filterValuesCasing}
|
|
59
|
+
/>
|
|
46
60
|
))}
|
|
47
61
|
</FilterItems>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
62
|
+
{hasActiveFilters && (
|
|
63
|
+
<Button size="small" onClick={handleClearAll}>
|
|
64
|
+
{translate(translationKeys.placeholder, 'Clear all filters')}
|
|
65
|
+
</Button>
|
|
66
|
+
)}
|
|
51
67
|
</FilterContentWrapper>
|
|
52
68
|
);
|
|
53
69
|
}
|
|
54
70
|
|
|
55
71
|
const FilterContentWrapper = styled.div<{ isMobile?: boolean }>`
|
|
72
|
+
width: var(--sidebar-width);
|
|
56
73
|
display: none;
|
|
57
74
|
|
|
58
75
|
${Button} {
|
|
@@ -8,17 +8,23 @@ import type { ResolvedFilter } from '@theme/types/portal/src/shared/types/catalo
|
|
|
8
8
|
|
|
9
9
|
interface FilterPopoverProps {
|
|
10
10
|
setIsAddingFilter: (value: boolean) => void;
|
|
11
|
-
setFilterTerm: (value: string) => void;
|
|
12
11
|
filters: ResolvedFilter[];
|
|
13
|
-
filterTerm: string;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
export function FilterPopover({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
export function FilterPopover({ setIsAddingFilter, filters }: FilterPopoverProps) {
|
|
15
|
+
const [filterTerm, setFilterTerm] = React.useState('');
|
|
16
|
+
const filteredFilters = filters
|
|
17
|
+
.map((filter) => {
|
|
18
|
+
const options = filter.options.filter((option) => option.value.includes(filterTerm));
|
|
19
|
+
return options.length
|
|
20
|
+
? {
|
|
21
|
+
...filter,
|
|
22
|
+
filteredOptions: options,
|
|
23
|
+
}
|
|
24
|
+
: null;
|
|
25
|
+
})
|
|
26
|
+
.filter(Boolean) as ResolvedFilter[];
|
|
27
|
+
|
|
22
28
|
const translationKeys = {
|
|
23
29
|
placeholder: 'theme.catalog.filters.placeholder',
|
|
24
30
|
done: 'theme.catalog.filters.done',
|
|
@@ -47,7 +53,7 @@ export function FilterPopover({
|
|
|
47
53
|
/>
|
|
48
54
|
</FilterControls>
|
|
49
55
|
<FilterItems>
|
|
50
|
-
{
|
|
56
|
+
{filteredFilters.map((filter, idx) => (
|
|
51
57
|
<Filter filter={filter} key={filter.property + '-' + idx} />
|
|
52
58
|
))}
|
|
53
59
|
</FilterItems>
|
|
@@ -89,7 +95,9 @@ const FilterPopoverHeaderLabel = styled.div`
|
|
|
89
95
|
font-weight: var(--filter-popover-header-label-font-weight);
|
|
90
96
|
`;
|
|
91
97
|
|
|
92
|
-
const FilterPopoverHeaderButton = styled.div
|
|
98
|
+
const FilterPopoverHeaderButton = styled.div.attrs({
|
|
99
|
+
'data-cy': 'FilterPopover/DoneButton',
|
|
100
|
+
})`
|
|
93
101
|
color: var(--filter-popover-header-button-color);
|
|
94
102
|
justify-self: end;
|
|
95
103
|
font-size: var(--filter-popover-header-button-font-size);
|
|
@@ -98,7 +106,7 @@ const FilterPopoverHeaderButton = styled.div`
|
|
|
98
106
|
line-height: var(--filter-popover-header-button-height);
|
|
99
107
|
`;
|
|
100
108
|
|
|
101
|
-
export const StyledInput = styled.input`
|
|
109
|
+
export const StyledInput = styled.input.attrs({ 'data-cy': 'FilterPopover/Input' })`
|
|
102
110
|
border: var(--filter-input-border);
|
|
103
111
|
min-width: var(--filter-input-min-width);
|
|
104
112
|
width: 100%;
|
|
@@ -5,6 +5,7 @@ import { Link } from '@portal/Link';
|
|
|
5
5
|
import type { ResolvedNavItem } from '@theme/types/portal';
|
|
6
6
|
import { useTranslate } from '@portal/hooks';
|
|
7
7
|
import { Image } from '@theme/components/Image/Image';
|
|
8
|
+
import { telemetry } from '@portal/telemetry';
|
|
8
9
|
|
|
9
10
|
interface FooterColumnProps {
|
|
10
11
|
column: ResolvedNavItem;
|
|
@@ -38,6 +39,7 @@ export function FooterColumn({ column, className }: FooterColumnProps): JSX.Elem
|
|
|
38
39
|
target={columnItem.target}
|
|
39
40
|
data-cy={columnItem.label}
|
|
40
41
|
iconsOnly={iconsOnly}
|
|
42
|
+
onClick={() => telemetry.send('footer_item_clicked', {})}
|
|
41
43
|
>
|
|
42
44
|
{columnItem.icon || columnItem.srcSet ? (
|
|
43
45
|
<FooterLinkIcon>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@theme/components/LastUpdated/styledVariables';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { css } from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const lastUpdated = css`
|
|
4
|
+
--last-updated-text-color: var(--text-secondary);
|
|
5
|
+
--last-updated-font-size: var(--font-size-sm);
|
|
6
|
+
--last-updated-font-family: var(--font-family-base);
|
|
7
|
+
--last-updated-line-height: var(--line-height-base);
|
|
8
|
+
`;
|
|
@@ -14,6 +14,7 @@ export const MenuItemLabel = styled.li.attrs<{ className?: string }>(({ classNam
|
|
|
14
14
|
font-family: var(--sidebar-item-font-family);
|
|
15
15
|
font-size: var(--sidebar-item-font-size);
|
|
16
16
|
font-weight: var(--sidebar-item-font-weight);
|
|
17
|
+
line-height: var(--sidebar-item-line-height);
|
|
17
18
|
margin: var(--menu-item-label-margin);
|
|
18
19
|
padding: var(--menu-item-label-padding);
|
|
19
20
|
border-radius: var(--sidebar-item-border-radius);
|
|
@@ -35,6 +36,7 @@ export const MenuItemLabel = styled.li.attrs<{ className?: string }>(({ classNam
|
|
|
35
36
|
|
|
36
37
|
${({ theme }) => theme.mediaQueries.medium} {
|
|
37
38
|
color: var(--sidebar-item-hover-color);
|
|
39
|
+
background: var(--sidebar-item-hover-background-color);
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -3,6 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import { MenuLink } from '@theme/components/Menu/MenuLink';
|
|
5
5
|
import type { MenuItemProps } from '@theme/components/Sidebar/types';
|
|
6
|
+
import { telemetry } from '@portal/telemetry';
|
|
6
7
|
|
|
7
8
|
export function MenuLinkItem({
|
|
8
9
|
item,
|
|
@@ -10,7 +11,11 @@ export function MenuLinkItem({
|
|
|
10
11
|
className,
|
|
11
12
|
}: React.PropsWithChildren<MenuItemProps>): JSX.Element {
|
|
12
13
|
return (
|
|
13
|
-
<Wrapper
|
|
14
|
+
<Wrapper
|
|
15
|
+
data-component-name="Sidebar/MenuLinkItem"
|
|
16
|
+
className={className}
|
|
17
|
+
onClick={() => telemetry.send('sidebar_item_clicked', { label: item.label, type: item.type })}
|
|
18
|
+
>
|
|
14
19
|
{item.link ? (
|
|
15
20
|
<MenuLink to={item.link} {...item}>
|
|
16
21
|
{children}
|
|
@@ -143,9 +143,9 @@ const ControlButtonLabel = styled.span<{ paddingDirection: 'right' | 'left' }>`
|
|
|
143
143
|
`;
|
|
144
144
|
|
|
145
145
|
const ProductNameWrapper = styled.div`
|
|
146
|
-
color: var(--menu-product-name-color);
|
|
147
|
-
border-radius: var(--menu-product-name-border-radius);
|
|
148
|
-
border:
|
|
149
|
-
padding: var(--menu-product-name-padding);
|
|
150
|
-
margin: var(--menu-product-name-margin);
|
|
146
|
+
color: var(--mobile-menu-product-name-color);
|
|
147
|
+
border-radius: var(--mobile-menu-product-name-border-radius);
|
|
148
|
+
border: var(--mobile-menu-product-name-border);
|
|
149
|
+
padding: var(--mobile-menu-product-name-padding);
|
|
150
|
+
margin: var(--mobile-menu-product-name-margin);
|
|
151
151
|
`;
|
|
@@ -5,7 +5,7 @@ export const mobileMenu = css`
|
|
|
5
5
|
* @tokens Mobile Menu icons
|
|
6
6
|
*/
|
|
7
7
|
--mobile-menu-icons-size: var(--spacing-md); // @presenter Spacing
|
|
8
|
-
--mobile-menu-search-icon-size:
|
|
8
|
+
--mobile-menu-search-icon-size: var(--spacing-md); // @presenter Spacing
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @tokens Mobile Menu wrapper
|
|
@@ -58,9 +58,25 @@ export const mobileMenu = css`
|
|
|
58
58
|
/**
|
|
59
59
|
* @tokens Mobile Menu Login button
|
|
60
60
|
* */
|
|
61
|
-
--mobile-menu-login-button-background: var(--color-primary-
|
|
61
|
+
--mobile-menu-login-button-background: var(--color-primary-bg); // @presenter Color
|
|
62
62
|
--mobile-menu-login-button-color: var(--color-primary-text); // @presenter Color
|
|
63
|
+
--mobile-menu-login-button-hover-color: var(--text-primary); // @presenter Color
|
|
64
|
+
--mobile-menu-login-button-border-color: var(--color-primary-border); // @presenter Color
|
|
65
|
+
--mobile-menu-login-button-border-radius: var(--border-radius-md); // @presenter Spacing
|
|
66
|
+
--mobile-menu-login-button-font-size: var(--font-size-base); // @presenter FontSize
|
|
67
|
+
--mobile-menu-login-button-font-family: inherit; // @presenter FontFamily
|
|
68
|
+
--mobile-menu-login-button-font-weight: var(--font-weight-bold); // @presenter FontWeight
|
|
69
|
+
--mobile-menu-login-button-line-height: var(--line-height-base); // @presenter LineHeight
|
|
63
70
|
|
|
71
|
+
/**
|
|
72
|
+
* @tokens Mobile Menu Product
|
|
73
|
+
* */
|
|
74
|
+
--mobile-menu-product-name-color: var(--mobile-menu-item-text-color);
|
|
75
|
+
--mobile-menu-product-name-border-radius: var(--mobile-menu-item-radius);
|
|
76
|
+
--mobile-menu-product-name-border: 1px solid var(--border-secondary);
|
|
77
|
+
--mobile-menu-product-name-padding: var(--sidebar-item-padding-vertical) var(--sidebar-item-padding-horizontal);
|
|
78
|
+
--mobile-menu-product-name-margin: var(--spacing-sm) var(--spacing-xs) 0 var(--spacing-xs);
|
|
79
|
+
|
|
64
80
|
// @tokens End
|
|
65
81
|
`;
|
|
66
82
|
|
|
@@ -79,10 +95,5 @@ export const menu = css`
|
|
|
79
95
|
--menu-item-label-margin: 0 var(--sidebar-margin-horizontal);
|
|
80
96
|
--menu-item-label-padding: var(--sidebar-item-padding-vertical) var(--sidebar-item-padding-horizontal);
|
|
81
97
|
|
|
82
|
-
--menu-product-name-color: var(--mobile-menu-item-text-color);
|
|
83
|
-
--menu-product-name-border-radius: var(--mobile-menu-item-radius);
|
|
84
|
-
--menu-product-name-border-color: 1px solid rgba(0, 0, 0, 0.06);
|
|
85
|
-
--menu-product-name-padding: var(--sidebar-item-padding-vertical) var(--sidebar-item-padding-horizontal);
|
|
86
|
-
--menu-product-name-margin: var(--spacing-sm) var(--spacing-xs) 0 var(--spacing-xs);
|
|
87
98
|
// @tokens End
|
|
88
99
|
`;
|
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
} from '@theme/types/portal';
|
|
12
12
|
import { useI18nConfig, useTranslate } from '@portal/hooks';
|
|
13
13
|
import { withPathPrefix } from '@theme/utils';
|
|
14
|
+
import { telemetry } from '@portal/telemetry';
|
|
14
15
|
import { Dropdown } from '@theme/components/Dropdown';
|
|
15
16
|
|
|
16
17
|
export interface NavbarItemProps {
|
|
@@ -34,6 +35,7 @@ export function NavbarItem({ navItem, className }: NavbarItemProps): JSX.Element
|
|
|
34
35
|
active={isActive}
|
|
35
36
|
data-component-name="Navbar/NavbarItem"
|
|
36
37
|
className={className}
|
|
38
|
+
onClick={() => telemetry.send('navbar_menu_item_clicked', { type: 'link' })}
|
|
37
39
|
>
|
|
38
40
|
<NavbarLink to={item.link} external={item.external} target={item.target} active={isActive}>
|
|
39
41
|
{item.icon ? <NavbarIcon url={item.icon} /> : null}
|
|
@@ -58,6 +60,7 @@ export function NavbarItem({ navItem, className }: NavbarItemProps): JSX.Element
|
|
|
58
60
|
active={false}
|
|
59
61
|
data-component-name="Navbar/NavbarItem"
|
|
60
62
|
className={className}
|
|
63
|
+
onClick={() => telemetry.send('navbar_menu_item_clicked', { type: 'group' })}
|
|
61
64
|
>
|
|
62
65
|
<NavbarIcon url={item.icon} />
|
|
63
66
|
<NavbarLabel>{translate(item.labelTranslationKey, item.label)}</NavbarLabel>
|
|
@@ -92,19 +95,25 @@ export const NavbarMenuItem = styled.li<{ active?: boolean }>`
|
|
|
92
95
|
padding: var(--navbar-item-padding-vertical) var(--navbar-item-padding-horizontal);
|
|
93
96
|
text-align: center;
|
|
94
97
|
line-height: var(--navbar-item-line-height);
|
|
95
|
-
border-radius: var(--navbar-item-border-radius);
|
|
96
98
|
font-weight: var(--navbar-item-font-weight);
|
|
97
99
|
|
|
100
|
+
border-radius: var(--navbar-item-border-radius);
|
|
101
|
+
border-bottom: ${({ active }) =>
|
|
102
|
+
active ? 'var(--navbar-item-active-bottom-border)' : 'var(--navbar-item-bottom-border)'};
|
|
103
|
+
|
|
98
104
|
background: ${({ active }) => active && 'var(--navbar-item-active-background-color)'};
|
|
99
105
|
color: ${({ active }) =>
|
|
100
106
|
active ? 'var(--navbar-item-active-text-color)' : 'var(--navbar-text-color)'};
|
|
107
|
+
|
|
101
108
|
&:hover {
|
|
102
109
|
color: var(--navbar-item-hover-text-color);
|
|
103
110
|
text-decoration: var(--navbar-item-hover-text-decoration);
|
|
111
|
+
border-bottom: ${({ active }) => !active && 'var(--navbar-item-hover-bottom-border)'};
|
|
104
112
|
background: ${({ active }) =>
|
|
105
113
|
active
|
|
106
114
|
? 'var(--navbar-item-active-background-color)'
|
|
107
115
|
: 'var(--navbar-item-hover-background-color)'};
|
|
116
|
+
|
|
108
117
|
${NavbarLink} {
|
|
109
118
|
color: var(--navbar-item-hover-text-color);
|
|
110
119
|
text-decoration: var(--navbar-item-hover-text-decoration);
|
|
@@ -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-
|
|
28
|
-
--navbar-item-
|
|
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
|
|
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({
|
|
@@ -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:
|
|
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:
|
|
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)
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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={() =>
|
|
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
|
>
|
|
@@ -72,9 +72,7 @@ export const Select = ({
|
|
|
72
72
|
onClick={triggerEvent === 'click' ? handleToggle : undefined}
|
|
73
73
|
>
|
|
74
74
|
<SelectInput>
|
|
75
|
-
{!onlyIcon &&
|
|
76
|
-
<SelectInputValue withIcon={withArrow || !!icon}>{_selected}</SelectInputValue>
|
|
77
|
-
)}
|
|
75
|
+
{!onlyIcon && <SelectInputValue>{_selected}</SelectInputValue>}
|
|
78
76
|
{icon}
|
|
79
77
|
{withArrow ? isOpen ? <ArrowIcon direction="up" /> : <ArrowIcon direction="down" /> : null}
|
|
80
78
|
</SelectInput>
|
|
@@ -113,11 +111,12 @@ export const SelectInput = styled.div`
|
|
|
113
111
|
border-radius: var(--select-input-border-radius);
|
|
114
112
|
padding: var(--select-input-padding-vertical) var(--select-input-padding-horizontal);
|
|
115
113
|
cursor: pointer;
|
|
114
|
+
gap: 8px;
|
|
116
115
|
`;
|
|
117
116
|
|
|
118
|
-
export const SelectInputValue = styled.div
|
|
117
|
+
export const SelectInputValue = styled.div`
|
|
119
118
|
pointer-events: none;
|
|
120
|
-
|
|
119
|
+
min-width: 0;
|
|
121
120
|
`;
|
|
122
121
|
|
|
123
122
|
export const SelectList = styled.ul<{ placement?: string; alignment?: string }>`
|
|
@@ -128,7 +127,9 @@ export const SelectList = styled.ul<{ placement?: string; alignment?: string }>`
|
|
|
128
127
|
right: ${({ alignment }) => (alignment === 'end' ? '0' : 'auto')};
|
|
129
128
|
margin: 0;
|
|
130
129
|
min-width: var(--select-list-min-width);
|
|
130
|
+
width: 100%;
|
|
131
131
|
max-width: var(--select-list-max-width);
|
|
132
|
+
${({ placement }) => (!placement || placement === 'bottom' ? 'margin-top: 2px' : '')};
|
|
132
133
|
padding: var(--select-list-padding);
|
|
133
134
|
background-color: var(--select-list-background-color);
|
|
134
135
|
border-radius: var(--select-list-border-radius);
|
|
@@ -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
|
|
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
|
-
{
|
|
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
|
-
|
|
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:
|
|
8
|
-
background-color: var(--sidebar-item-separator-
|
|
9
|
-
margin: var(--sidebar-item-separator-offset)
|
|
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
|
`;
|