@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.
- 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 +3 -3
- 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.js +4 -1
- package/lib/components/Filter/FilterContent.js +10 -1
- 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/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 +2 -1
- package/lib/components/Tag/Tag.js +3 -3
- package/lib/components/Tag/styledVariables.js +30 -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 +76 -0
- package/lib/config.js +14 -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 +3 -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 +4 -1
- package/src/components/Filter/FilterContent.tsx +14 -3
- 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/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 +4 -3
- package/src/components/Tag/styledVariables.ts +30 -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 +18 -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
|
@@ -3,6 +3,7 @@ import { useLocation, useNavigate } from 'react-router-dom';
|
|
|
3
3
|
|
|
4
4
|
import type { Location } from 'react-router-dom';
|
|
5
5
|
|
|
6
|
+
import { telemetry } from '@portal/telemetry';
|
|
6
7
|
import type { ResolvedNavItem } from '@theme/types/portal';
|
|
7
8
|
import type {
|
|
8
9
|
CatalogItem,
|
|
@@ -45,6 +46,7 @@ export function useCatalog(items: ResolvedNavItem[], config: CatalogConfig): Fil
|
|
|
45
46
|
}
|
|
46
47
|
return [...prev.slice(0, filterIdx), newFilterOptions, ...prev.slice(filterIdx + 1)];
|
|
47
48
|
});
|
|
49
|
+
telemetry.send('catalog_filter_changed', { type: 'toggle' });
|
|
48
50
|
window.scrollTo(0, 0);
|
|
49
51
|
}, []);
|
|
50
52
|
|
|
@@ -68,6 +70,7 @@ export function useCatalog(items: ResolvedNavItem[], config: CatalogConfig): Fil
|
|
|
68
70
|
: f,
|
|
69
71
|
);
|
|
70
72
|
});
|
|
73
|
+
telemetry.send('catalog_filter_changed', { type: 'select' });
|
|
71
74
|
window.scrollTo(0, 0);
|
|
72
75
|
},
|
|
73
76
|
[filtersWithOptions],
|
|
@@ -153,7 +156,16 @@ export function useCatalog(items: ResolvedNavItem[], config: CatalogConfig): Fil
|
|
|
153
156
|
? groupByFirstFilter(resolvedFilters, filteredItems)
|
|
154
157
|
: [{ title: 'APIs', items: filteredItems }];
|
|
155
158
|
|
|
156
|
-
return {
|
|
159
|
+
return {
|
|
160
|
+
groups,
|
|
161
|
+
filters: resolvedFilters,
|
|
162
|
+
setFilterTerm: (newTerm) => {
|
|
163
|
+
setFilterTerm(newTerm);
|
|
164
|
+
|
|
165
|
+
telemetry.send('catalog_filter_changed', { type: 'term' });
|
|
166
|
+
},
|
|
167
|
+
filterTerm,
|
|
168
|
+
};
|
|
157
169
|
}, [
|
|
158
170
|
filtersWithOptions,
|
|
159
171
|
normalizedItems,
|
|
@@ -10,12 +10,13 @@ export const CodeBlockContainer = styled.pre.attrs<{ className?: string }>(({ cl
|
|
|
10
10
|
overflow-x: auto;
|
|
11
11
|
max-height: var(--code-block-max-height);
|
|
12
12
|
font-family: var(--code-block-font-family);
|
|
13
|
-
line-height: var(--code-line-height);
|
|
13
|
+
line-height: var(--code-block-line-height);
|
|
14
|
+
font-weight: var(--code-block-font-weight);
|
|
14
15
|
padding: var(--code-block-padding);
|
|
15
16
|
margin: var(--code-block-margin);
|
|
16
17
|
background-color: var(--code-block-background-color);
|
|
17
18
|
color: var(--code-block-text-color);
|
|
18
|
-
font-size: var(--code-font-size);
|
|
19
|
+
font-size: var(--code-block-font-size);
|
|
19
20
|
white-space: var(--code-wrap, pre);
|
|
20
21
|
max-height: var(--code-block-max-height, 600px);
|
|
21
22
|
word-break: var(--code-block-word-break, initial);
|
|
@@ -4,6 +4,7 @@ import styled from 'styled-components';
|
|
|
4
4
|
import { CodeBlockControlButton } from '@theme/components/CodeBlock';
|
|
5
5
|
import { CollapseIcon, DeselectIcon, ExpandIcon, ReportIcon, SelectIcon } from '@theme/icons';
|
|
6
6
|
import { useThemeConfig } from '@theme/hooks';
|
|
7
|
+
import { telemetry } from '@portal/telemetry';
|
|
7
8
|
|
|
8
9
|
import { CopyButton } from '../CopyButton';
|
|
9
10
|
|
|
@@ -68,7 +69,10 @@ export function CodeBlockControls({
|
|
|
68
69
|
toasterDuration={copy.toasterDuration}
|
|
69
70
|
buttonText={copy.label}
|
|
70
71
|
tooltipText={copy.tooltipText}
|
|
71
|
-
onCopyClick={
|
|
72
|
+
onCopyClick={() => {
|
|
73
|
+
copy?.onClick;
|
|
74
|
+
telemetry.send('code_snippet_copied', {});
|
|
75
|
+
}}
|
|
72
76
|
/>
|
|
73
77
|
) : null}
|
|
74
78
|
|
|
@@ -139,6 +143,7 @@ export function CodeBlockControls({
|
|
|
139
143
|
asIcon={controlsType === 'icon'}
|
|
140
144
|
title={report.tooltipText}
|
|
141
145
|
{...report.props}
|
|
146
|
+
onClick={() => telemetry.send('code_snippet_reported', {})}
|
|
142
147
|
>
|
|
143
148
|
{controlsType === 'icon' ? <ReportIcon /> : report.props?.buttonText || 'Report'}
|
|
144
149
|
</CodeBlockControlButton>
|
|
@@ -28,6 +28,8 @@ export const code = css`
|
|
|
28
28
|
*/
|
|
29
29
|
--code-block-font-size: var(--code-font-size); // @presenter FontSize
|
|
30
30
|
--code-block-font-family: var(--code-font-family); // @presenter FontFamily
|
|
31
|
+
--code-block-line-height: var(--code-line-height); // @presenter LineHeight
|
|
32
|
+
--code-block-font-weight: var(--code-font-weight); // @presenter FontWeight
|
|
31
33
|
--code-block-text-color: var(--text-secondary); // @presenter Color
|
|
32
34
|
--code-block-background-color: var(--bg-raised); // @presenter Color
|
|
33
35
|
--code-block-border-color: var(--border-primary); // @presenter Color
|
|
@@ -54,7 +56,7 @@ export const code = css`
|
|
|
54
56
|
* @tokens Code Block tokens
|
|
55
57
|
*/
|
|
56
58
|
--code-block-tokens-default-color: var(--text-secondary); // @presenter Color
|
|
57
|
-
--code-block-tokens-comment-color:
|
|
59
|
+
--code-block-tokens-comment-color: var(--text-placeholder); // @presenter Color
|
|
58
60
|
--code-block-tokens-prolog-color: var(--code-block-tokens-comment-color); // @presenter Color
|
|
59
61
|
--code-block-tokens-doctype-color: var(--code-block-tokens-comment-color); // @presenter Color
|
|
60
62
|
--code-block-tokens-cdata-color: var(--code-block-tokens-comment-color); // @presenter Color
|
|
@@ -64,8 +66,8 @@ export const code = css`
|
|
|
64
66
|
--code-block-tokens-constant-color: var(--code-block-tokens-default-color); // @presenter Color
|
|
65
67
|
--code-block-tokens-symbol-color: var(--code-block-tokens-default-color); // @presenter Color
|
|
66
68
|
--code-block-tokens-boolean-color: var(--color-geekblue-7); // @presenter Color
|
|
67
|
-
--code-block-tokens-string-color: var(--color-
|
|
68
|
-
--code-block-tokens-property-string-color: var(--
|
|
69
|
+
--code-block-tokens-string-color: var(--color-green-6); // @presenter Color
|
|
70
|
+
--code-block-tokens-property-string-color: var(--text-secondary); // @presenter Color
|
|
69
71
|
--code-block-tokens-selector-color: var(--code-block-tokens-string-color); // @presenter Color
|
|
70
72
|
--code-block-tokens-attr-name-color: var(--code-block-tokens-string-color); // @presenter Color
|
|
71
73
|
--code-block-tokens-char-color: var(--code-block-tokens-string-color); // @presenter Color
|
|
@@ -79,7 +81,7 @@ export const code = css`
|
|
|
79
81
|
--code-block-tokens-keyword-color: var(--color-magneta-6); // @presenter Color
|
|
80
82
|
--code-block-tokens-atrule-color: var(--code-block-tokens-keyword-color); // @presenter Color
|
|
81
83
|
--code-block-tokens-attr-value-color: var(--code-block-tokens-keyword-color); // @presenter Color
|
|
82
|
-
--code-block-tokens-regex-color: var(--color-gold-
|
|
84
|
+
--code-block-tokens-regex-color: var(--color-gold-5); // @presenter Color
|
|
83
85
|
--code-block-tokens-important-color: var(--code-block-tokens-regex-color); // @presenter Color
|
|
84
86
|
--code-block-tokens-deleted-color: var(--color-red-6); // @presenter Color
|
|
85
87
|
|
|
@@ -3,6 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import { ColorModeIcon } from '@theme/icons/ColorModeIcon';
|
|
5
5
|
import { useMount, useThemeConfig } from '@theme/hooks';
|
|
6
|
+
import { telemetry } from '@portal/telemetry';
|
|
6
7
|
|
|
7
8
|
interface ColorModeSwitcherProps {
|
|
8
9
|
className?: string;
|
|
@@ -34,6 +35,8 @@ export function ColorModeSwitcher(props: ColorModeSwitcherProps): JSX.Element |
|
|
|
34
35
|
window.requestAnimationFrame(() => {
|
|
35
36
|
document.documentElement.classList.remove('notransition');
|
|
36
37
|
});
|
|
38
|
+
|
|
39
|
+
telemetry.send('color_mode_switched', { from: activeColorMode, to: mode });
|
|
37
40
|
};
|
|
38
41
|
|
|
39
42
|
return (
|
|
@@ -5,7 +5,7 @@ import { ArrowIcon } from '@theme/icons';
|
|
|
5
5
|
import { useOutsideClick } from '@theme/hooks';
|
|
6
6
|
|
|
7
7
|
export interface DropdownProps {
|
|
8
|
-
children
|
|
8
|
+
children?: React.ReactNode;
|
|
9
9
|
items: JSX.Element[] | string[];
|
|
10
10
|
dataAttributes?: Record<string, string>;
|
|
11
11
|
className?: string;
|
|
@@ -14,6 +14,7 @@ export interface DropdownProps {
|
|
|
14
14
|
placement?: 'top' | 'bottom';
|
|
15
15
|
alignment?: 'start' | 'end';
|
|
16
16
|
onChange?: (value: React.ReactNode | string) => void;
|
|
17
|
+
icon?: React.ReactNode;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export const Dropdown = ({
|
|
@@ -26,6 +27,7 @@ export const Dropdown = ({
|
|
|
26
27
|
dataAttributes,
|
|
27
28
|
placement,
|
|
28
29
|
alignment,
|
|
30
|
+
icon,
|
|
29
31
|
}: DropdownProps) => {
|
|
30
32
|
const dropdownRef = useRef<HTMLDivElement | null>(null);
|
|
31
33
|
|
|
@@ -62,6 +64,7 @@ export const Dropdown = ({
|
|
|
62
64
|
>
|
|
63
65
|
<DropdownHeader>
|
|
64
66
|
{children}
|
|
67
|
+
{icon}
|
|
65
68
|
{withArrow ? isOpen ? <ArrowIcon direction="up" /> : <ArrowIcon direction="down" /> : null}
|
|
66
69
|
</DropdownHeader>
|
|
67
70
|
{isOpen && (
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import { Link } from '@portal/Link';
|
|
5
|
+
import { telemetry } from '@portal/telemetry';
|
|
5
6
|
|
|
6
7
|
export interface EditPageButtonProps {
|
|
7
8
|
text: string;
|
|
@@ -11,7 +12,7 @@ export interface EditPageButtonProps {
|
|
|
11
12
|
|
|
12
13
|
export const EditPageButton = ({ text, to, icon }: EditPageButtonProps): JSX.Element => {
|
|
13
14
|
return (
|
|
14
|
-
<EditButton to={to}>
|
|
15
|
+
<EditButton to={to} onClick={() => telemetry.send('edit_page_link_clicked', {})}>
|
|
15
16
|
{icon ? <ButtonIcon src={icon} /> : null}
|
|
16
17
|
<ButtonText>{text}</ButtonText>
|
|
17
18
|
</EditButton>
|
|
@@ -21,12 +22,16 @@ export const EditPageButton = ({ text, to, icon }: EditPageButtonProps): JSX.Ele
|
|
|
21
22
|
const EditButton = styled(Link)`
|
|
22
23
|
margin-left: auto;
|
|
23
24
|
display: inline-flex;
|
|
24
|
-
color: var(--
|
|
25
|
+
color: var(--text-secondary);
|
|
25
26
|
font-weight: var(--font-weight-bold);
|
|
26
27
|
font-size: var(--font-size-base);
|
|
27
28
|
font-family: var(--font-family-base);
|
|
28
29
|
text-decoration: none;
|
|
29
30
|
|
|
31
|
+
&:hover {
|
|
32
|
+
color: var(--text-primary);
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
@media print {
|
|
31
36
|
display: none;
|
|
32
37
|
}
|
|
@@ -67,6 +67,11 @@ const Wrapper = styled.div`
|
|
|
67
67
|
`;
|
|
68
68
|
|
|
69
69
|
const Label = styled.h3`
|
|
70
|
+
font-family: var(--h3-font-family);
|
|
71
|
+
font-weight: var(--h3-font-weight);
|
|
72
|
+
font-size: var(--h3-font-size);
|
|
73
|
+
line-height: var(--h3-line-height);
|
|
74
|
+
color: var(--h3-text-color);
|
|
70
75
|
margin-right: 15px;
|
|
71
76
|
`;
|
|
72
77
|
|
|
@@ -6,6 +6,7 @@ import type { FeedbackProps } from '@theme/types/portal/src/shared/types/feedbac
|
|
|
6
6
|
import { Rating, Sentiment, Comment } from '@theme/components/Feedback';
|
|
7
7
|
import { useThemeConfig } from '@theme/hooks';
|
|
8
8
|
import { useSubmitFeedback } from '@portal/Feedback/useSubmitFeedback';
|
|
9
|
+
import { telemetry } from '@portal/telemetry';
|
|
9
10
|
|
|
10
11
|
export const Feedback = (props: FeedbackProps & { path?: string }) => {
|
|
11
12
|
const { submitFeedback } = useSubmitFeedback();
|
|
@@ -20,7 +21,10 @@ export const Feedback = (props: FeedbackProps & { path?: string }) => {
|
|
|
20
21
|
<Wrapper>
|
|
21
22
|
<Rating
|
|
22
23
|
settings={settings}
|
|
23
|
-
onSubmit={(values) =>
|
|
24
|
+
onSubmit={(values) => {
|
|
25
|
+
submitFeedback({ type: 'rating', values, path });
|
|
26
|
+
telemetry.send('feedback_sent', { type: 'rating' });
|
|
27
|
+
}}
|
|
24
28
|
/>
|
|
25
29
|
</Wrapper>
|
|
26
30
|
);
|
|
@@ -29,7 +33,10 @@ export const Feedback = (props: FeedbackProps & { path?: string }) => {
|
|
|
29
33
|
<Wrapper>
|
|
30
34
|
<Sentiment
|
|
31
35
|
settings={settings}
|
|
32
|
-
onSubmit={(values) =>
|
|
36
|
+
onSubmit={(values) => {
|
|
37
|
+
submitFeedback({ type: 'sentiment', values, path });
|
|
38
|
+
telemetry.send('feedback_sent', { type: 'sentiment' });
|
|
39
|
+
}}
|
|
33
40
|
/>
|
|
34
41
|
</Wrapper>
|
|
35
42
|
);
|
|
@@ -38,7 +45,10 @@ export const Feedback = (props: FeedbackProps & { path?: string }) => {
|
|
|
38
45
|
<Wrapper>
|
|
39
46
|
<Comment
|
|
40
47
|
settings={settings}
|
|
41
|
-
onSubmit={(values) =>
|
|
48
|
+
onSubmit={(values) => {
|
|
49
|
+
submitFeedback({ type: 'comment', values, path });
|
|
50
|
+
telemetry.send('feedback_sent', { type: 'comment' });
|
|
51
|
+
}}
|
|
42
52
|
/>
|
|
43
53
|
</Wrapper>
|
|
44
54
|
);
|
|
@@ -116,5 +116,9 @@ const Star = styled.span`
|
|
|
116
116
|
|
|
117
117
|
const Label = styled.h3`
|
|
118
118
|
margin-right: 15px;
|
|
119
|
-
font-family: var(--font-family
|
|
119
|
+
font-family: var(--h3-font-family);
|
|
120
|
+
font-weight: var(--h3-font-weight);
|
|
121
|
+
font-size: var(--h3-font-size);
|
|
122
|
+
line-height: var(--h3-line-height);
|
|
123
|
+
color: var(--h3-text-color);
|
|
120
124
|
`;
|
|
@@ -77,6 +77,11 @@ const Wrapper = styled.div`
|
|
|
77
77
|
`;
|
|
78
78
|
|
|
79
79
|
const Label = styled.h3`
|
|
80
|
+
font-family: var(--h3-font-family);
|
|
81
|
+
font-weight: var(--h3-font-weight);
|
|
82
|
+
font-size: var(--h3-font-size);
|
|
83
|
+
line-height: var(--h3-line-height);
|
|
84
|
+
color: var(--h3-text-color);
|
|
80
85
|
margin-right: 15px;
|
|
81
86
|
`;
|
|
82
87
|
|
|
@@ -69,10 +69,18 @@ export const Sentiment = ({ settings, onSubmit, className }: SentimentProps): JS
|
|
|
69
69
|
<Label data-translation-key={translationKeys.label}>
|
|
70
70
|
{translate(translationKeys.label, label || 'Was this page helpful?')}
|
|
71
71
|
</Label>
|
|
72
|
-
<Vote
|
|
72
|
+
<Vote
|
|
73
|
+
onClick={() => {
|
|
74
|
+
setScore(1);
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
73
77
|
<ThumbUp text="Yes" />
|
|
74
78
|
</Vote>
|
|
75
|
-
<Vote
|
|
79
|
+
<Vote
|
|
80
|
+
onClick={() => {
|
|
81
|
+
setScore(-1);
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
76
84
|
<ThumbDown />
|
|
77
85
|
</Vote>
|
|
78
86
|
</Wrapper>
|
|
@@ -86,6 +94,11 @@ const Wrapper = styled.div`
|
|
|
86
94
|
`;
|
|
87
95
|
|
|
88
96
|
const Label = styled.h3`
|
|
97
|
+
font-family: var(--h3-font-family);
|
|
98
|
+
font-weight: var(--h3-font-weight);
|
|
99
|
+
font-size: var(--h3-font-size);
|
|
100
|
+
line-height: var(--h3-line-height);
|
|
101
|
+
color: var(--h3-text-color);
|
|
89
102
|
margin-right: 15px;
|
|
90
103
|
`;
|
|
91
104
|
|
|
@@ -108,12 +108,12 @@ export const ThumbDown = ({ text }: { text?: string }) => {
|
|
|
108
108
|
const Wrapper = styled.div`
|
|
109
109
|
font-family: var(--font-family-base);
|
|
110
110
|
display: flex;
|
|
111
|
-
color: var(--color-
|
|
111
|
+
color: var(--color-info-text);
|
|
112
112
|
&:hover {
|
|
113
|
-
color: var(--color-
|
|
113
|
+
color: var(--color-info-text-active);
|
|
114
114
|
svg {
|
|
115
115
|
> g {
|
|
116
|
-
fill: var(--color-
|
|
116
|
+
fill: var(--color-info-text-active);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
@@ -125,7 +125,7 @@ const Icon = styled.div`
|
|
|
125
125
|
margin-right: 5px;
|
|
126
126
|
> svg {
|
|
127
127
|
> g {
|
|
128
|
-
fill: var(--color-
|
|
128
|
+
fill: var(--color-info-text);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
`;
|
|
@@ -139,6 +139,9 @@ const FilterOptionLabel = styled.label`
|
|
|
139
139
|
font-weight: var(--filter-option-label-font-weight);
|
|
140
140
|
margin: var(--filter-option-label-margin);
|
|
141
141
|
color: var(--filter-option-label-color);
|
|
142
|
+
white-space: nowrap;
|
|
143
|
+
text-overflow: ellipsis;
|
|
144
|
+
overflow: hidden;
|
|
142
145
|
`;
|
|
143
146
|
|
|
144
147
|
const FilterOptionCount = styled.label`
|
|
@@ -162,7 +165,7 @@ const FilterTitle = styled.h4`
|
|
|
162
165
|
margin: var(--filter-title-margin);
|
|
163
166
|
`;
|
|
164
167
|
|
|
165
|
-
const FilterOption = styled.label`
|
|
168
|
+
const FilterOption = styled.label.attrs({ 'data-cy': 'Filter/FilterOption' })`
|
|
166
169
|
display: flex;
|
|
167
170
|
align-items: center;
|
|
168
171
|
cursor: pointer;
|
|
@@ -27,6 +27,14 @@ export function FilterContent({
|
|
|
27
27
|
clearAll: 'theme.catalog.filters.clearAll',
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
const hasActiveFilters = filters.some((filter) => {
|
|
31
|
+
if (filter.selectedOptions && filter.selectedOptions instanceof Set) {
|
|
32
|
+
return filter.selectedOptions.size;
|
|
33
|
+
} else if (filter.selectedOptions.from && filter.selectedOptions.to) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
30
38
|
const handleClearAll = () => {
|
|
31
39
|
filters.forEach((filter) => filter.selectOption(''));
|
|
32
40
|
};
|
|
@@ -45,14 +53,17 @@ export function FilterContent({
|
|
|
45
53
|
<Filter filter={filter} key={filter.property + '-' + idx} />
|
|
46
54
|
))}
|
|
47
55
|
</FilterItems>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
{hasActiveFilters && (
|
|
57
|
+
<Button size="small" onClick={handleClearAll}>
|
|
58
|
+
{translate(translationKeys.placeholder, 'Clear all filters')}
|
|
59
|
+
</Button>
|
|
60
|
+
)}
|
|
51
61
|
</FilterContentWrapper>
|
|
52
62
|
);
|
|
53
63
|
}
|
|
54
64
|
|
|
55
65
|
const FilterContentWrapper = styled.div<{ isMobile?: boolean }>`
|
|
66
|
+
width: var(--sidebar-width);
|
|
56
67
|
display: none;
|
|
57
68
|
|
|
58
69
|
${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);
|