@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
|
@@ -8,8 +8,8 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Link_1 = require("../../mocks/Link");
|
|
10
10
|
const Breadcrumb = (props) => {
|
|
11
|
-
const { label, link, isActive } = props;
|
|
12
|
-
return (react_1.default.createElement(BreadcrumbWrapper, { "data-component-name": "Breadcrumbs/Breadcrumb", isLink: link != null, isActive: isActive }, link ? (react_1.default.createElement(BreadcrumbLink, { to: link }, label)) : (react_1.default.createElement(BreadcrumbText, null, label))));
|
|
11
|
+
const { label, link, isActive, onClick } = props;
|
|
12
|
+
return (react_1.default.createElement(BreadcrumbWrapper, { "data-component-name": "Breadcrumbs/Breadcrumb", isLink: link != null, isActive: isActive, onClick: onClick }, link ? (react_1.default.createElement(BreadcrumbLink, { to: link }, label)) : (react_1.default.createElement(BreadcrumbText, null, label))));
|
|
13
13
|
};
|
|
14
14
|
exports.Breadcrumb = Breadcrumb;
|
|
15
15
|
const BreadcrumbText = styled_components_1.default.div `
|
|
@@ -7,6 +7,7 @@ exports.Breadcrumbs = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const useBreadcrumbs_1 = require("../../mocks/Sidebar/useBreadcrumbs");
|
|
10
|
+
const telemetry_1 = require("../../mocks/telemetry");
|
|
10
11
|
const Breadcrumb_1 = require("./Breadcrumb");
|
|
11
12
|
const Breadcrumbs = (props) => {
|
|
12
13
|
const breadcrumbs = (0, useBreadcrumbs_1.useBreadcrumbs)();
|
|
@@ -16,7 +17,13 @@ const Breadcrumbs = (props) => {
|
|
|
16
17
|
return (react_1.default.createElement(Container, { "data-component-name": "Breadcrumbs/Breadcrumbs", className: props.className }, breadcrumbs.map((breadcrumb, idx) => {
|
|
17
18
|
const isLast = idx === breadcrumbs.length - 1;
|
|
18
19
|
return (react_1.default.createElement(react_1.default.Fragment, { key: idx },
|
|
19
|
-
react_1.default.createElement(Breadcrumb_1.Breadcrumb, { link: breadcrumb.link, label: breadcrumb.label, isActive: isLast
|
|
20
|
+
react_1.default.createElement(Breadcrumb_1.Breadcrumb, { link: breadcrumb.link, label: breadcrumb.label, isActive: isLast, onClick: () => {
|
|
21
|
+
telemetry_1.telemetry.send('breadcrumb_clicked', {
|
|
22
|
+
link: breadcrumb.link,
|
|
23
|
+
position: idx + 1,
|
|
24
|
+
total_breadcrumbs: breadcrumbs.length,
|
|
25
|
+
});
|
|
26
|
+
} }),
|
|
20
27
|
isLast ? null : react_1.default.createElement("div", null, "/")));
|
|
21
28
|
})));
|
|
22
29
|
};
|
|
@@ -99,12 +99,14 @@ const StyledButton = styled_components_1.default.button.attrs(({ color = 'defaul
|
|
|
99
99
|
`
|
|
100
100
|
: variant === 'text'
|
|
101
101
|
? (0, styled_components_1.css) `
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
color: var(--button-color);
|
|
103
|
+
border-color: var(--button-border-color);
|
|
104
|
+
background-color: var(--button-background-color);
|
|
104
105
|
|
|
105
106
|
&:hover {
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
color: var(--button-hover-color);
|
|
108
|
+
border-color: var(--button-hover-border-color);
|
|
109
|
+
background-color: var(--button-hover-background-color);
|
|
108
110
|
box-shadow: none;
|
|
109
111
|
}
|
|
110
112
|
`
|
|
@@ -3,26 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.button = void 0;
|
|
4
4
|
const styled_components_1 = require("styled-components");
|
|
5
5
|
exports.button = (0, styled_components_1.css) `
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Static classnames that can be used to override styles for components:
|
|
8
|
+
* download-specification-button, next-section-button, button-base
|
|
9
|
+
*/
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
* @tokens Button borders
|
|
13
|
+
*/
|
|
14
14
|
|
|
15
15
|
--button-border-width: 1px; //@presenter Border
|
|
16
16
|
--button-border-style: solid; //@presenter Border
|
|
17
17
|
--button-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
18
18
|
--button-margin: 5px; // @presenter Spacing
|
|
19
19
|
--button-box-shadow: none; // @presenter Shadow
|
|
20
|
-
--button-hover-box-shadow:
|
|
21
|
-
--button-active-box-shadow:
|
|
20
|
+
--button-hover-box-shadow: none; // @presenter Shadow
|
|
21
|
+
--button-active-box-shadow: none; // @presenter Shadow
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
* @tokens Button typography
|
|
25
|
+
*/
|
|
26
26
|
|
|
27
27
|
--button-font-size: var(--font-size-base); // @presenter FontSize
|
|
28
28
|
--button-font-family: inherit; // @presenter FontFamily
|
|
@@ -38,8 +38,8 @@ exports.button = (0, styled_components_1.css) `
|
|
|
38
38
|
--button-large-padding: 8px 16px;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
* @tokens Button icon
|
|
42
|
+
*/
|
|
43
43
|
--button-icon-width: 1em; // @presenter Spacing
|
|
44
44
|
--button-icon-height: 1em; // @presenter Spacing
|
|
45
45
|
|
|
@@ -89,6 +89,19 @@ exports.button = (0, styled_components_1.css) `
|
|
|
89
89
|
--button-background-color: transparent; // @presenter Color
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* @tokens Button text
|
|
94
|
+
*/
|
|
95
|
+
.button-text {
|
|
96
|
+
--button-color: var(--text-secondary); // @presenter Color
|
|
97
|
+
--button-border-color: transparent; // @presenter Color
|
|
98
|
+
--button-background-color: transparent; // @presenter Color
|
|
99
|
+
|
|
100
|
+
--button-hover-color: var(--text-primary); // @presenter Color
|
|
101
|
+
--button-hover-background-color: transparent; // @presenter Color
|
|
102
|
+
--button-hover-border-color: transparent; // @presenter Color
|
|
103
|
+
}
|
|
104
|
+
|
|
92
105
|
// @tokens End
|
|
93
106
|
`;
|
|
94
107
|
//# sourceMappingURL=styledVariables.js.map
|
|
@@ -31,7 +31,7 @@ function Catalog(props) {
|
|
|
31
31
|
react_1.default.createElement(Button_1.Button, { variant: "text", size: "small", icon: react_1.default.createElement(PlusIcon_1.PlusIcon, null), onClick: () => setIsAddingFilter(true) }, translate(translationKeys.addFilter, 'Add filter')),
|
|
32
32
|
react_1.default.createElement(FilterTags_1.FilterTags, { filters: filters })),
|
|
33
33
|
react_1.default.createElement(FilterContent_1.FilterContent, { setFilterTerm: setFilterTerm, filters: filters, filterTerm: filterTerm, isMobile: false }),
|
|
34
|
-
isAddingFilter && (react_1.default.createElement(FilterPopover_1.FilterPopover, { setIsAddingFilter: setIsAddingFilter,
|
|
34
|
+
isAddingFilter && (react_1.default.createElement(FilterPopover_1.FilterPopover, { setIsAddingFilter: setIsAddingFilter, filters: filters })),
|
|
35
35
|
react_1.default.createElement(CatalogPageContent, null,
|
|
36
36
|
react_1.default.createElement(CatalogPageDescriptionWrapper, null,
|
|
37
37
|
catalogConfig.title ? (react_1.default.createElement(CatalogTitle, null,
|
|
@@ -109,7 +109,7 @@ const CatalogDescription = styled_components_1.default.p `
|
|
|
109
109
|
margin: var(--catalog-description-margin-top) 0 var(--catalog-description-margin-bottom) 0;
|
|
110
110
|
`;
|
|
111
111
|
const CatalogPageWrapper = styled_components_1.default.div `
|
|
112
|
-
--sidebar-width: var(--catalog-sidebar-width,
|
|
112
|
+
--sidebar-width: var(--catalog-sidebar-width, 285px);
|
|
113
113
|
|
|
114
114
|
display: flex;
|
|
115
115
|
flex-direction: column;
|
|
@@ -138,7 +138,7 @@ const CatalogPageWrapper = styled_components_1.default.div `
|
|
|
138
138
|
flex-direction: row;
|
|
139
139
|
}
|
|
140
140
|
`;
|
|
141
|
-
const FilterTagsWrapper = styled_components_1.default.div `
|
|
141
|
+
const FilterTagsWrapper = styled_components_1.default.div.attrs({ 'data-cy': 'Catalog/FilterTags' }) `
|
|
142
142
|
padding: var(--filter-tags-wrapper-padding);
|
|
143
143
|
display: flex;
|
|
144
144
|
overflow-x: scroll;
|
|
@@ -33,17 +33,19 @@ const Link_1 = require("../../mocks/Link");
|
|
|
33
33
|
const Highlight_1 = require("../../ui/Highlight");
|
|
34
34
|
const Tag_1 = require("../../components/Tag");
|
|
35
35
|
const icons_1 = require("../../icons");
|
|
36
|
+
const telemetry_1 = require("../../mocks/telemetry");
|
|
37
|
+
const utils_1 = require("../../utils");
|
|
36
38
|
function CatalogCard({ item }) {
|
|
37
39
|
var _a;
|
|
38
40
|
return (React.createElement(Link_1.Link, { key: item.docsLink || item.link, to: item.docsLink || item.link },
|
|
39
|
-
React.createElement(StyledCard,
|
|
41
|
+
React.createElement(StyledCard, { onClick: () => telemetry_1.telemetry.send('catalog_item_clicked', {}) },
|
|
40
42
|
React.createElement(CardTitle, null,
|
|
41
43
|
React.createElement(Highlight_1.Highlight, null, item.title)),
|
|
42
44
|
React.createElement(CardContent, null,
|
|
43
45
|
React.createElement(CardDescription, null,
|
|
44
46
|
React.createElement(Highlight_1.Highlight, null, (_a = item.description) !== null && _a !== void 0 ? _a : '')),
|
|
45
47
|
React.createElement(CardFooter, null,
|
|
46
|
-
item.tags && (React.createElement(CardTags, null, item.tags.map((tag, index) => (React.createElement(
|
|
48
|
+
item.tags && (React.createElement(CardTags, null, item.tags.map((tag, index) => (React.createElement(CardTag, { key: tag + index, color: (0, utils_1.slug)(tag) },
|
|
47
49
|
React.createElement(Highlight_1.Highlight, null, tag)))))),
|
|
48
50
|
React.createElement(SelectButton, null,
|
|
49
51
|
React.createElement(icons_1.PointingArrowIcon, null)))))));
|
|
@@ -57,19 +59,20 @@ const SelectButton = styled_components_1.default.div `
|
|
|
57
59
|
display: flex;
|
|
58
60
|
align-items: center;
|
|
59
61
|
justify-content: center;
|
|
62
|
+
transition: all 0.2s ease-in-out;
|
|
60
63
|
|
|
61
64
|
svg {
|
|
62
65
|
fill: var(--catalog-card-icon-color);
|
|
63
66
|
}
|
|
64
67
|
`;
|
|
65
|
-
const StyledCard = styled_components_1.default.div `
|
|
68
|
+
const StyledCard = styled_components_1.default.div.attrs({ 'data-cy': 'Catalog/CatalogCard' }) `
|
|
66
69
|
min-height: var(--catalog-card-min-height);
|
|
67
70
|
height: 100%;
|
|
68
71
|
color: var(--catalog-card-text-color);
|
|
69
72
|
font-size: var(--catalog-card-font-size);
|
|
70
73
|
font-weight: var(--catalog-card-font-weight);
|
|
71
74
|
background-color: var(--catalog-card-background-color);
|
|
72
|
-
border:
|
|
75
|
+
border: var(--catalog-card-border-width) var(--catalog-card-border-style) var(--catalog-card-border-color);
|
|
73
76
|
transition: all 0.2s ease-in-out;
|
|
74
77
|
border-radius: var(--catalog-card-border-radius);
|
|
75
78
|
cursor: pointer;
|
|
@@ -119,5 +122,12 @@ const CardFooter = styled_components_1.default.div `
|
|
|
119
122
|
align-items: flex-end;
|
|
120
123
|
justify-content: space-between;
|
|
121
124
|
`;
|
|
122
|
-
const CardTags = styled_components_1.default.div
|
|
125
|
+
const CardTags = styled_components_1.default.div `
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-wrap: wrap;
|
|
128
|
+
gap: var(--spacing-xxs);
|
|
129
|
+
`;
|
|
130
|
+
const CardTag = (0, styled_components_1.default)(Tag_1.Tag) `
|
|
131
|
+
margin: 0;
|
|
132
|
+
`;
|
|
123
133
|
//# sourceMappingURL=CatalogCard.js.map
|
|
@@ -43,7 +43,7 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
43
43
|
--catalog-separator-label-margin: 0 var(--spacing-xs);
|
|
44
44
|
--catalog-separator-count-height: var(--control-height-xs);
|
|
45
45
|
--catalog-separator-count-padding: 0 var(--spacing-xxs);
|
|
46
|
-
--catalog-separator-count-border-radius: var(--
|
|
46
|
+
--catalog-separator-count-border-radius: var(--border-radius-xlg);
|
|
47
47
|
--catalog-separator-count-border-color: var(--border-secondary);
|
|
48
48
|
--catalog-separator-count-background: var(--bg-raised);
|
|
49
49
|
|
|
@@ -56,8 +56,10 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
56
56
|
--catalog-card-font-weight: var(--font-weight-regular);
|
|
57
57
|
--catalog-card-background-color: var(--bg-raised);
|
|
58
58
|
--catalog-card-border-color: var(--border-secondary);
|
|
59
|
+
--catalog-card-border-width: var(--border-width);
|
|
60
|
+
--catalog-card-border-style: var(--border-style);
|
|
59
61
|
--catalog-card-hover-border-color: var(--border-primary);
|
|
60
|
-
--catalog-card-border-radius: var(--
|
|
62
|
+
--catalog-card-border-radius: var(--border-radius-lg);
|
|
61
63
|
|
|
62
64
|
/**
|
|
63
65
|
* @tokens Catalog card button
|
|
@@ -86,7 +88,7 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
86
88
|
--catalog-card-description-line-clamp: 3;
|
|
87
89
|
--catalog-card-description-margin-bottom: var(--spacing-base);
|
|
88
90
|
--catalog-card-content-background-color: var(--bg-base);
|
|
89
|
-
--catalog-card-content-border-radius: var(--
|
|
91
|
+
--catalog-card-content-border-radius: var(--border-radius-lg);
|
|
90
92
|
--catalog-card-content-padding: var(--spacing-base);
|
|
91
93
|
|
|
92
94
|
// @tokens End
|
|
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.useCatalog = void 0;
|
|
27
27
|
const React = __importStar(require("react"));
|
|
28
28
|
const react_router_dom_1 = require("react-router-dom");
|
|
29
|
+
const telemetry_1 = require("../../mocks/telemetry");
|
|
29
30
|
const utils_1 = require("../../utils");
|
|
30
31
|
function useCatalog(items, config) {
|
|
31
32
|
const location = (0, react_router_dom_1.useLocation)();
|
|
@@ -60,6 +61,7 @@ function useCatalog(items, config) {
|
|
|
60
61
|
}
|
|
61
62
|
return [...prev.slice(0, filterIdx), newFilterOptions, ...prev.slice(filterIdx + 1)];
|
|
62
63
|
});
|
|
64
|
+
telemetry_1.telemetry.send('catalog_filter_changed', { type: 'toggle' });
|
|
63
65
|
window.scrollTo(0, 0);
|
|
64
66
|
}, []);
|
|
65
67
|
const selectOption = React.useCallback((filterIdx, option) => {
|
|
@@ -77,6 +79,7 @@ function useCatalog(items, config) {
|
|
|
77
79
|
? new Set()
|
|
78
80
|
: f);
|
|
79
81
|
});
|
|
82
|
+
telemetry_1.telemetry.send('catalog_filter_changed', { type: 'select' });
|
|
80
83
|
window.scrollTo(0, 0);
|
|
81
84
|
}, [filtersWithOptions]);
|
|
82
85
|
React.useEffect(() => {
|
|
@@ -136,7 +139,15 @@ function useCatalog(items, config) {
|
|
|
136
139
|
const groups = config.groupByFirstFilter && ((_a = filters[0].selectedOptions) === null || _a === void 0 ? void 0 : _a.size) > 0
|
|
137
140
|
? groupByFirstFilter(resolvedFilters, filteredItems)
|
|
138
141
|
: [{ title: 'APIs', items: filteredItems }];
|
|
139
|
-
return {
|
|
142
|
+
return {
|
|
143
|
+
groups,
|
|
144
|
+
filters: resolvedFilters,
|
|
145
|
+
setFilterTerm: (newTerm) => {
|
|
146
|
+
setFilterTerm(newTerm);
|
|
147
|
+
telemetry_1.telemetry.send('catalog_filter_changed', { type: 'term' });
|
|
148
|
+
},
|
|
149
|
+
filterTerm,
|
|
150
|
+
};
|
|
140
151
|
}, [
|
|
141
152
|
filtersWithOptions,
|
|
142
153
|
normalizedItems,
|
|
@@ -34,12 +34,13 @@ exports.CodeBlockContainer = styled_components_1.default.pre.attrs(({ className
|
|
|
34
34
|
overflow-x: auto;
|
|
35
35
|
max-height: var(--code-block-max-height);
|
|
36
36
|
font-family: var(--code-block-font-family);
|
|
37
|
-
line-height: var(--code-line-height);
|
|
37
|
+
line-height: var(--code-block-line-height);
|
|
38
|
+
font-weight: var(--code-block-font-weight);
|
|
38
39
|
padding: var(--code-block-padding);
|
|
39
40
|
margin: var(--code-block-margin);
|
|
40
41
|
background-color: var(--code-block-background-color);
|
|
41
42
|
color: var(--code-block-text-color);
|
|
42
|
-
font-size: var(--code-font-size);
|
|
43
|
+
font-size: var(--code-block-font-size);
|
|
43
44
|
white-space: var(--code-wrap, pre);
|
|
44
45
|
max-height: var(--code-block-max-height, 600px);
|
|
45
46
|
word-break: var(--code-block-word-break, initial);
|
|
@@ -9,6 +9,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
9
9
|
const CodeBlock_1 = require("../../components/CodeBlock");
|
|
10
10
|
const icons_1 = require("../../icons");
|
|
11
11
|
const hooks_1 = require("../../hooks");
|
|
12
|
+
const telemetry_1 = require("../../mocks/telemetry");
|
|
12
13
|
const CopyButton_1 = require("../CopyButton");
|
|
13
14
|
function CodeBlockControls({ children, className, title, controls, }) {
|
|
14
15
|
var _a, _b, _c, _d, _e;
|
|
@@ -20,12 +21,15 @@ function CodeBlockControls({ children, className, title, controls, }) {
|
|
|
20
21
|
const defaultControls = controls ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
21
22
|
react_1.default.createElement(Title, null, title),
|
|
22
23
|
react_1.default.createElement(ControlsWrapper, null,
|
|
23
|
-
copy && !((_a = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.copy) === null || _a === void 0 ? void 0 : _a.hide) ? (react_1.default.createElement(CopyButton_1.CopyButton, { data: copy.data, "data-source": copy.dataSource, "data-hash": copy.dataHash, type: controlsType, toasterPlacement: copy.toasterPlacement, toasterDuration: copy.toasterDuration, buttonText: copy.label, tooltipText: copy.tooltipText, onCopyClick:
|
|
24
|
+
copy && !((_a = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.copy) === null || _a === void 0 ? void 0 : _a.hide) ? (react_1.default.createElement(CopyButton_1.CopyButton, { data: copy.data, "data-source": copy.dataSource, "data-hash": copy.dataHash, type: controlsType, toasterPlacement: copy.toasterPlacement, toasterDuration: copy.toasterDuration, buttonText: copy.label, tooltipText: copy.tooltipText, onCopyClick: () => {
|
|
25
|
+
copy === null || copy === void 0 ? void 0 : copy.onClick;
|
|
26
|
+
telemetry_1.telemetry.send('code_snippet_copied', {});
|
|
27
|
+
} })) : null,
|
|
24
28
|
expand && !((_b = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.expand) === null || _b === void 0 ? void 0 : _b.hide) ? (react_1.default.createElement(CodeBlock_1.CodeBlockControlButton, { "data-cy": "expand-all", "data-testid": "expand-all", asIcon: controlsType === 'icon', onClick: expand === null || expand === void 0 ? void 0 : expand.onClick, title: (expand === null || expand === void 0 ? void 0 : expand.tooltipText) || 'Expand all' }, controlsType === 'icon' ? react_1.default.createElement(icons_1.ExpandIcon, null) : (expand === null || expand === void 0 ? void 0 : expand.label) ? expand.label : 'Expand all')) : null,
|
|
25
29
|
collapse && !((_c = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.collapse) === null || _c === void 0 ? void 0 : _c.hide) ? (react_1.default.createElement(CodeBlock_1.CodeBlockControlButton, { "data-cy": "collapse-all", "data-testid": "collapse-all", asIcon: controlsType === 'icon', onClick: collapse === null || collapse === void 0 ? void 0 : collapse.onClick, title: (collapse === null || collapse === void 0 ? void 0 : collapse.tooltipText) || 'Collapse all' }, controlsType === 'icon' ? (react_1.default.createElement(icons_1.CollapseIcon, null)) : (collapse === null || collapse === void 0 ? void 0 : collapse.label) ? (collapse.label) : ('Collapse all'))) : null,
|
|
26
30
|
select ? (react_1.default.createElement(CodeBlock_1.CodeBlockControlButton, { "data-cy": "select-all", "data-testid": "select-all", asIcon: controlsType === 'icon', onClick: select === null || select === void 0 ? void 0 : select.onClick, title: select === null || select === void 0 ? void 0 : select.tooltipText }, controlsType === 'icon' ? react_1.default.createElement(icons_1.SelectIcon, null) : (select === null || select === void 0 ? void 0 : select.label) ? select.label : 'Select all')) : null,
|
|
27
31
|
deselect ? (react_1.default.createElement(CodeBlock_1.CodeBlockControlButton, { "data-cy": "clear-all", "data-testid": "clear-all", asIcon: controlsType === 'icon', onClick: deselect === null || deselect === void 0 ? void 0 : deselect.onClick, title: deselect === null || deselect === void 0 ? void 0 : deselect.tooltipText }, controlsType === 'icon' ? (react_1.default.createElement(icons_1.DeselectIcon, null)) : (deselect === null || deselect === void 0 ? void 0 : deselect.label) ? (deselect.label) : ('Clear all'))) : null,
|
|
28
|
-
report && ((_d = report === null || report === void 0 ? void 0 : report.props) === null || _d === void 0 ? void 0 : _d.visible) ? (react_1.default.createElement(CodeBlock_1.CodeBlockControlButton, Object.assign({ "data-cy": "report-button", "data-testid": "report-button", asIcon: controlsType === 'icon', title: report.tooltipText }, report.props), controlsType === 'icon' ? react_1.default.createElement(icons_1.ReportIcon, null) : ((_e = report.props) === null || _e === void 0 ? void 0 : _e.buttonText) || 'Report')) : null))) : null;
|
|
32
|
+
report && ((_d = report === null || report === void 0 ? void 0 : report.props) === null || _d === void 0 ? void 0 : _d.visible) ? (react_1.default.createElement(CodeBlock_1.CodeBlockControlButton, Object.assign({ "data-cy": "report-button", "data-testid": "report-button", asIcon: controlsType === 'icon', title: report.tooltipText }, report.props, { onClick: () => telemetry_1.telemetry.send('code_snippet_reported', {}) }), controlsType === 'icon' ? react_1.default.createElement(icons_1.ReportIcon, null) : ((_e = report.props) === null || _e === void 0 ? void 0 : _e.buttonText) || 'Report')) : null))) : null;
|
|
29
33
|
return children || controls ? (react_1.default.createElement(ContainerWraper, { "data-component-name": "CodeBlock/CodeBlockControls", className: className }, children ? children : defaultControls)) : null;
|
|
30
34
|
}
|
|
31
35
|
exports.CodeBlockControls = CodeBlockControls;
|
|
@@ -30,6 +30,8 @@ exports.code = (0, styled_components_1.css) `
|
|
|
30
30
|
*/
|
|
31
31
|
--code-block-font-size: var(--code-font-size); // @presenter FontSize
|
|
32
32
|
--code-block-font-family: var(--code-font-family); // @presenter FontFamily
|
|
33
|
+
--code-block-line-height: var(--code-line-height); // @presenter LineHeight
|
|
34
|
+
--code-block-font-weight: var(--code-font-weight); // @presenter FontWeight
|
|
33
35
|
--code-block-text-color: var(--text-secondary); // @presenter Color
|
|
34
36
|
--code-block-background-color: var(--bg-raised); // @presenter Color
|
|
35
37
|
--code-block-border-color: var(--border-primary); // @presenter Color
|
|
@@ -56,7 +58,7 @@ exports.code = (0, styled_components_1.css) `
|
|
|
56
58
|
* @tokens Code Block tokens
|
|
57
59
|
*/
|
|
58
60
|
--code-block-tokens-default-color: var(--text-secondary); // @presenter Color
|
|
59
|
-
--code-block-tokens-comment-color:
|
|
61
|
+
--code-block-tokens-comment-color: var(--text-placeholder); // @presenter Color
|
|
60
62
|
--code-block-tokens-prolog-color: var(--code-block-tokens-comment-color); // @presenter Color
|
|
61
63
|
--code-block-tokens-doctype-color: var(--code-block-tokens-comment-color); // @presenter Color
|
|
62
64
|
--code-block-tokens-cdata-color: var(--code-block-tokens-comment-color); // @presenter Color
|
|
@@ -66,8 +68,8 @@ exports.code = (0, styled_components_1.css) `
|
|
|
66
68
|
--code-block-tokens-constant-color: var(--code-block-tokens-default-color); // @presenter Color
|
|
67
69
|
--code-block-tokens-symbol-color: var(--code-block-tokens-default-color); // @presenter Color
|
|
68
70
|
--code-block-tokens-boolean-color: var(--color-geekblue-7); // @presenter Color
|
|
69
|
-
--code-block-tokens-string-color: var(--color-
|
|
70
|
-
--code-block-tokens-property-string-color: var(--
|
|
71
|
+
--code-block-tokens-string-color: var(--color-green-6); // @presenter Color
|
|
72
|
+
--code-block-tokens-property-string-color: var(--text-secondary); // @presenter Color
|
|
71
73
|
--code-block-tokens-selector-color: var(--code-block-tokens-string-color); // @presenter Color
|
|
72
74
|
--code-block-tokens-attr-name-color: var(--code-block-tokens-string-color); // @presenter Color
|
|
73
75
|
--code-block-tokens-char-color: var(--code-block-tokens-string-color); // @presenter Color
|
|
@@ -81,7 +83,7 @@ exports.code = (0, styled_components_1.css) `
|
|
|
81
83
|
--code-block-tokens-keyword-color: var(--color-magneta-6); // @presenter Color
|
|
82
84
|
--code-block-tokens-atrule-color: var(--code-block-tokens-keyword-color); // @presenter Color
|
|
83
85
|
--code-block-tokens-attr-value-color: var(--code-block-tokens-keyword-color); // @presenter Color
|
|
84
|
-
--code-block-tokens-regex-color: var(--color-gold-
|
|
86
|
+
--code-block-tokens-regex-color: var(--color-gold-5); // @presenter Color
|
|
85
87
|
--code-block-tokens-important-color: var(--code-block-tokens-regex-color); // @presenter Color
|
|
86
88
|
--code-block-tokens-deleted-color: var(--color-red-6); // @presenter Color
|
|
87
89
|
|
|
@@ -31,6 +31,7 @@ const react_1 = __importStar(require("react"));
|
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
32
|
const ColorModeIcon_1 = require("../../icons/ColorModeIcon");
|
|
33
33
|
const hooks_1 = require("../../hooks");
|
|
34
|
+
const telemetry_1 = require("../../mocks/telemetry");
|
|
34
35
|
function ColorModeSwitcher(props) {
|
|
35
36
|
const { className } = props;
|
|
36
37
|
const themeSettings = (0, hooks_1.useThemeConfig)();
|
|
@@ -53,6 +54,7 @@ function ColorModeSwitcher(props) {
|
|
|
53
54
|
window.requestAnimationFrame(() => {
|
|
54
55
|
document.documentElement.classList.remove('notransition');
|
|
55
56
|
});
|
|
57
|
+
telemetry_1.telemetry.send('color_mode_switched', { from: activeColorMode, to: mode });
|
|
56
58
|
};
|
|
57
59
|
return (react_1.default.createElement(Wrapper, { "data-component-name": "ColorModeSwitcher/ColorModeSwitcher", onClick: handelChangeColorMode, modes: modes, role: "link", className: className }, modes.map((mode) => (react_1.default.createElement(ColorModeIcon_1.ColorModeIcon, { mode: mode, key: mode })))));
|
|
58
60
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface DropdownProps {
|
|
3
|
-
children
|
|
3
|
+
children?: React.ReactNode;
|
|
4
4
|
items: JSX.Element[] | string[];
|
|
5
5
|
dataAttributes?: Record<string, string>;
|
|
6
6
|
className?: string;
|
|
@@ -9,8 +9,9 @@ export interface DropdownProps {
|
|
|
9
9
|
placement?: 'top' | 'bottom';
|
|
10
10
|
alignment?: 'start' | 'end';
|
|
11
11
|
onChange?: (value: React.ReactNode | string) => void;
|
|
12
|
+
icon?: React.ReactNode;
|
|
12
13
|
}
|
|
13
|
-
export declare const Dropdown: ({ children, className, items, withArrow, triggerEvent, onChange, dataAttributes, placement, alignment, }: DropdownProps) => JSX.Element;
|
|
14
|
+
export declare const Dropdown: ({ children, className, items, withArrow, triggerEvent, onChange, dataAttributes, placement, alignment, icon, }: DropdownProps) => JSX.Element;
|
|
14
15
|
export declare const DropdownHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
16
|
export declare const DropdownList: import("styled-components").StyledComponent<"ul", any, {
|
|
16
17
|
placement?: string | undefined;
|
|
@@ -28,7 +28,7 @@ const react_1 = __importStar(require("react"));
|
|
|
28
28
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
29
29
|
const icons_1 = require("../../icons");
|
|
30
30
|
const hooks_1 = require("../../hooks");
|
|
31
|
-
const Dropdown = ({ children, className, items, withArrow, triggerEvent = 'click', onChange, dataAttributes, placement, alignment, }) => {
|
|
31
|
+
const Dropdown = ({ children, className, items, withArrow, triggerEvent = 'click', onChange, dataAttributes, placement, alignment, icon, }) => {
|
|
32
32
|
const dropdownRef = (0, react_1.useRef)(null);
|
|
33
33
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
34
34
|
const handleOpen = () => {
|
|
@@ -48,6 +48,7 @@ const Dropdown = ({ children, className, items, withArrow, triggerEvent = 'click
|
|
|
48
48
|
return (react_1.default.createElement(DropdownContainer, Object.assign({}, dataAttributes, { "data-testid": "dropdown", className: className, ref: dropdownRef, onPointerEnter: triggerEvent === 'hover' ? handleOpen : undefined, onPointerLeave: handleClose, onClick: triggerEvent === 'click' ? handleToggle : undefined }),
|
|
49
49
|
react_1.default.createElement(exports.DropdownHeader, null,
|
|
50
50
|
children,
|
|
51
|
+
icon,
|
|
51
52
|
withArrow ? isOpen ? react_1.default.createElement(icons_1.ArrowIcon, { direction: "up" }) : react_1.default.createElement(icons_1.ArrowIcon, { direction: "down" }) : null),
|
|
52
53
|
isOpen && (react_1.default.createElement(exports.DropdownList, { placement: placement, alignment: alignment }, items.map((item, index) => {
|
|
53
54
|
var _a;
|
|
@@ -7,8 +7,9 @@ exports.EditPageButton = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Link_1 = require("../../mocks/Link");
|
|
10
|
+
const telemetry_1 = require("../../mocks/telemetry");
|
|
10
11
|
const EditPageButton = ({ text, to, icon }) => {
|
|
11
|
-
return (react_1.default.createElement(EditButton, { to: to },
|
|
12
|
+
return (react_1.default.createElement(EditButton, { to: to, onClick: () => telemetry_1.telemetry.send('edit_page_link_clicked', {}) },
|
|
12
13
|
icon ? react_1.default.createElement(ButtonIcon, { src: icon }) : null,
|
|
13
14
|
react_1.default.createElement(ButtonText, null, text)));
|
|
14
15
|
};
|
|
@@ -16,12 +17,16 @@ exports.EditPageButton = EditPageButton;
|
|
|
16
17
|
const EditButton = (0, styled_components_1.default)(Link_1.Link) `
|
|
17
18
|
margin-left: auto;
|
|
18
19
|
display: inline-flex;
|
|
19
|
-
color: var(--
|
|
20
|
+
color: var(--text-secondary);
|
|
20
21
|
font-weight: var(--font-weight-bold);
|
|
21
22
|
font-size: var(--font-size-base);
|
|
22
23
|
font-family: var(--font-family-base);
|
|
23
24
|
text-decoration: none;
|
|
24
25
|
|
|
26
|
+
&:hover {
|
|
27
|
+
color: var(--text-primary);
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
@media print {
|
|
26
31
|
display: none;
|
|
27
32
|
}
|
|
@@ -70,6 +70,11 @@ const Wrapper = styled_components_1.default.div `
|
|
|
70
70
|
width: 100%;
|
|
71
71
|
`;
|
|
72
72
|
const Label = styled_components_1.default.h3 `
|
|
73
|
+
font-family: var(--h3-font-family);
|
|
74
|
+
font-weight: var(--h3-font-weight);
|
|
75
|
+
font-size: var(--h3-font-size);
|
|
76
|
+
line-height: var(--h3-line-height);
|
|
77
|
+
color: var(--h3-text-color);
|
|
73
78
|
margin-right: 15px;
|
|
74
79
|
`;
|
|
75
80
|
const TextArea = styled_components_1.default.textarea `
|
|
@@ -33,6 +33,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
33
33
|
const Feedback_1 = require("../../components/Feedback");
|
|
34
34
|
const hooks_1 = require("../../hooks");
|
|
35
35
|
const useSubmitFeedback_1 = require("../../mocks/Feedback/useSubmitFeedback");
|
|
36
|
+
const telemetry_1 = require("../../mocks/telemetry");
|
|
36
37
|
const Feedback = (props) => {
|
|
37
38
|
const { submitFeedback } = (0, useSubmitFeedback_1.useSubmitFeedback)();
|
|
38
39
|
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
@@ -42,13 +43,22 @@ const Feedback = (props) => {
|
|
|
42
43
|
switch (type) {
|
|
43
44
|
case 'rating':
|
|
44
45
|
return (React.createElement(Wrapper, null,
|
|
45
|
-
React.createElement(Feedback_1.Rating, { settings: settings, onSubmit: (values) =>
|
|
46
|
+
React.createElement(Feedback_1.Rating, { settings: settings, onSubmit: (values) => {
|
|
47
|
+
submitFeedback({ type: 'rating', values, path });
|
|
48
|
+
telemetry_1.telemetry.send('feedback_sent', { type: 'rating' });
|
|
49
|
+
} })));
|
|
46
50
|
case 'sentiment':
|
|
47
51
|
return (React.createElement(Wrapper, null,
|
|
48
|
-
React.createElement(Feedback_1.Sentiment, { settings: settings, onSubmit: (values) =>
|
|
52
|
+
React.createElement(Feedback_1.Sentiment, { settings: settings, onSubmit: (values) => {
|
|
53
|
+
submitFeedback({ type: 'sentiment', values, path });
|
|
54
|
+
telemetry_1.telemetry.send('feedback_sent', { type: 'sentiment' });
|
|
55
|
+
} })));
|
|
49
56
|
case 'comment':
|
|
50
57
|
return (React.createElement(Wrapper, null,
|
|
51
|
-
React.createElement(Feedback_1.Comment, { settings: settings, onSubmit: (values) =>
|
|
58
|
+
React.createElement(Feedback_1.Comment, { settings: settings, onSubmit: (values) => {
|
|
59
|
+
submitFeedback({ type: 'comment', values, path });
|
|
60
|
+
telemetry_1.telemetry.send('feedback_sent', { type: 'comment' });
|
|
61
|
+
} })));
|
|
52
62
|
default:
|
|
53
63
|
console.log(`No feedback with type ${type}!`);
|
|
54
64
|
break;
|
|
@@ -83,6 +83,10 @@ const Star = styled_components_1.default.span `
|
|
|
83
83
|
`;
|
|
84
84
|
const Label = styled_components_1.default.h3 `
|
|
85
85
|
margin-right: 15px;
|
|
86
|
-
font-family: var(--font-family
|
|
86
|
+
font-family: var(--h3-font-family);
|
|
87
|
+
font-weight: var(--h3-font-weight);
|
|
88
|
+
font-size: var(--h3-font-size);
|
|
89
|
+
line-height: var(--h3-line-height);
|
|
90
|
+
color: var(--h3-text-color);
|
|
87
91
|
`;
|
|
88
92
|
//# sourceMappingURL=Rating.js.map
|
|
@@ -67,6 +67,11 @@ const Wrapper = styled_components_1.default.div `
|
|
|
67
67
|
flex-direction: column;
|
|
68
68
|
`;
|
|
69
69
|
const Label = styled_components_1.default.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
|
const SendButton = (0, styled_components_1.default)(Button_1.Button).attrs(() => ({
|
|
@@ -66,9 +66,13 @@ const Sentiment = ({ settings, onSubmit, className }) => {
|
|
|
66
66
|
}
|
|
67
67
|
return (React.createElement(Wrapper, { "data-component-name": "Feedback/Sentiment", className: className },
|
|
68
68
|
React.createElement(Label, { "data-translation-key": translationKeys.label }, translate(translationKeys.label, label || 'Was this page helpful?')),
|
|
69
|
-
React.createElement(Vote, { onClick: () =>
|
|
69
|
+
React.createElement(Vote, { onClick: () => {
|
|
70
|
+
setScore(1);
|
|
71
|
+
} },
|
|
70
72
|
React.createElement(Thumbs_1.ThumbUp, { text: "Yes" })),
|
|
71
|
-
React.createElement(Vote, { onClick: () =>
|
|
73
|
+
React.createElement(Vote, { onClick: () => {
|
|
74
|
+
setScore(-1);
|
|
75
|
+
} },
|
|
72
76
|
React.createElement(Thumbs_1.ThumbDown, null))));
|
|
73
77
|
};
|
|
74
78
|
exports.Sentiment = Sentiment;
|
|
@@ -78,6 +82,11 @@ const Wrapper = styled_components_1.default.div `
|
|
|
78
82
|
align-items: center;
|
|
79
83
|
`;
|
|
80
84
|
const Label = styled_components_1.default.h3 `
|
|
85
|
+
font-family: var(--h3-font-family);
|
|
86
|
+
font-weight: var(--h3-font-weight);
|
|
87
|
+
font-size: var(--h3-font-size);
|
|
88
|
+
line-height: var(--h3-line-height);
|
|
89
|
+
color: var(--h3-text-color);
|
|
81
90
|
margin-right: 15px;
|
|
82
91
|
`;
|
|
83
92
|
const Vote = styled_components_1.default.div `
|
|
@@ -69,12 +69,12 @@ exports.ThumbDown = ThumbDown;
|
|
|
69
69
|
const Wrapper = styled_components_1.default.div `
|
|
70
70
|
font-family: var(--font-family-base);
|
|
71
71
|
display: flex;
|
|
72
|
-
color: var(--color-
|
|
72
|
+
color: var(--color-info-text);
|
|
73
73
|
&:hover {
|
|
74
|
-
color: var(--color-
|
|
74
|
+
color: var(--color-info-text-active);
|
|
75
75
|
svg {
|
|
76
76
|
> g {
|
|
77
|
-
fill: var(--color-
|
|
77
|
+
fill: var(--color-info-text-active);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -85,7 +85,7 @@ const Icon = styled_components_1.default.div `
|
|
|
85
85
|
margin-right: 5px;
|
|
86
86
|
> svg {
|
|
87
87
|
> g {
|
|
88
|
-
fill: var(--color-
|
|
88
|
+
fill: var(--color-info-text);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
`;
|
|
@@ -80,6 +80,9 @@ const FilterOptionLabel = styled_components_1.default.label `
|
|
|
80
80
|
font-weight: var(--filter-option-label-font-weight);
|
|
81
81
|
margin: var(--filter-option-label-margin);
|
|
82
82
|
color: var(--filter-option-label-color);
|
|
83
|
+
white-space: nowrap;
|
|
84
|
+
text-overflow: ellipsis;
|
|
85
|
+
overflow: hidden;
|
|
83
86
|
`;
|
|
84
87
|
const FilterOptionCount = styled_components_1.default.label `
|
|
85
88
|
cursor: pointer;
|
|
@@ -100,7 +103,7 @@ const FilterTitle = styled_components_1.default.h4 `
|
|
|
100
103
|
font-size: var(--filter-title-font-size);
|
|
101
104
|
margin: var(--filter-title-margin);
|
|
102
105
|
`;
|
|
103
|
-
const FilterOption = styled_components_1.default.label `
|
|
106
|
+
const FilterOption = styled_components_1.default.label.attrs({ 'data-cy': 'Filter/FilterOption' }) `
|
|
104
107
|
display: flex;
|
|
105
108
|
align-items: center;
|
|
106
109
|
cursor: pointer;
|
|
@@ -17,6 +17,14 @@ function FilterContent({ setFilterTerm, filters, filterTerm, isMobile, }) {
|
|
|
17
17
|
placeholder: 'theme.catalog.filters.placeholder',
|
|
18
18
|
clearAll: 'theme.catalog.filters.clearAll',
|
|
19
19
|
};
|
|
20
|
+
const hasActiveFilters = filters.some((filter) => {
|
|
21
|
+
if (filter.selectedOptions && filter.selectedOptions instanceof Set) {
|
|
22
|
+
return filter.selectedOptions.size;
|
|
23
|
+
}
|
|
24
|
+
else if (filter.selectedOptions.from && filter.selectedOptions.to) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
20
28
|
const handleClearAll = () => {
|
|
21
29
|
filters.forEach((filter) => filter.selectOption(''));
|
|
22
30
|
};
|
|
@@ -24,10 +32,11 @@ function FilterContent({ setFilterTerm, filters, filterTerm, isMobile, }) {
|
|
|
24
32
|
react_1.default.createElement(Catalog_1.FilterControls, null,
|
|
25
33
|
react_1.default.createElement(FilterPopover_1.StyledInput, { placeholder: translate(translationKeys.placeholder, 'Type to filter...'), value: filterTerm, onChange: (e) => setFilterTerm(e.target.value) })),
|
|
26
34
|
react_1.default.createElement(exports.FilterItems, null, filters.map((filter, idx) => (react_1.default.createElement(index_1.Filter, { filter: filter, key: filter.property + '-' + idx })))),
|
|
27
|
-
react_1.default.createElement(_theme_1.Button, { size: "small", onClick: handleClearAll }, translate(translationKeys.placeholder, 'Clear all filters'))));
|
|
35
|
+
hasActiveFilters && (react_1.default.createElement(_theme_1.Button, { size: "small", onClick: handleClearAll }, translate(translationKeys.placeholder, 'Clear all filters')))));
|
|
28
36
|
}
|
|
29
37
|
exports.FilterContent = FilterContent;
|
|
30
38
|
const FilterContentWrapper = styled_components_1.default.div `
|
|
39
|
+
width: var(--sidebar-width);
|
|
31
40
|
display: none;
|
|
32
41
|
|
|
33
42
|
${_theme_1.Button} {
|