@redocly/theme 0.42.3 → 0.44.0
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/Buttons/CopyButton.js +2 -2
- package/lib/components/Buttons/EditPageButton.js +1 -1
- package/lib/components/Catalog/CatalogActions.js +1 -1
- package/lib/components/Dropdown/DropdownMenu.d.ts +2 -0
- package/lib/components/Dropdown/DropdownMenu.js +3 -1
- package/lib/components/Feedback/Comment.js +6 -6
- package/lib/components/Feedback/Mood.js +7 -7
- package/lib/components/Feedback/Rating.js +4 -4
- package/lib/components/Feedback/Reasons.js +3 -3
- package/lib/components/Feedback/Scale.js +10 -10
- package/lib/components/Feedback/Sentiment.js +5 -5
- package/lib/components/Filter/FilterContent.js +2 -2
- package/lib/components/Filter/FilterInput.js +1 -1
- package/lib/components/Filter/FilterPopover.js +2 -2
- package/lib/components/Filter/FilterSelect.js +1 -1
- package/lib/components/Footer/FooterCopyright.js +2 -2
- package/lib/components/LastUpdated/LastUpdated.js +1 -1
- package/lib/components/Loaders/SpinnerLoader.d.ts +5 -0
- package/lib/components/Loaders/SpinnerLoader.js +32 -0
- package/lib/components/PageNavigation/NextButton.js +1 -1
- package/lib/components/PageNavigation/PreviousButton.js +1 -1
- package/lib/components/Product/ProductPicker.js +1 -1
- package/lib/components/Search/FilterFields/SearchFilterFieldSelect.d.ts +12 -0
- package/lib/components/Search/FilterFields/SearchFilterFieldSelect.js +113 -0
- package/lib/components/Search/FilterFields/SearchFilterFieldTags.d.ts +10 -0
- package/lib/components/Search/FilterFields/SearchFilterFieldTags.js +37 -0
- package/lib/components/Search/Search.js +1 -1
- package/lib/components/Search/SearchDialog.js +113 -31
- package/lib/components/Search/SearchFilter.d.ts +11 -0
- package/lib/components/Search/SearchFilter.js +71 -0
- package/lib/components/Search/SearchFilterField.d.ts +11 -0
- package/lib/components/Search/SearchFilterField.js +43 -0
- package/lib/components/Search/SearchGroups.d.ts +9 -0
- package/lib/components/Search/SearchGroups.js +69 -0
- package/lib/components/Search/SearchHighlight.d.ts +1 -1
- package/lib/components/Search/SearchHighlight.js +28 -5
- package/lib/components/Search/SearchInput.d.ts +1 -1
- package/lib/components/Search/SearchInput.js +5 -2
- package/lib/components/Search/SearchItem.d.ts +2 -2
- package/lib/components/Search/SearchItem.js +24 -15
- package/lib/components/Search/SearchRecent.js +1 -1
- package/lib/components/Search/SearchSuggestedPages.js +1 -1
- package/lib/components/Search/SearchTrigger.js +2 -2
- package/lib/components/Search/variables.js +48 -2
- package/lib/components/Segmented/Segmented.d.ts +2 -5
- package/lib/components/Select/Select.d.ts +2 -36
- package/lib/components/Select/Select.js +136 -98
- package/lib/components/Select/SelectInput.d.ts +23 -0
- package/lib/components/Select/SelectInput.js +129 -0
- package/lib/components/Select/variables.js +12 -1
- package/lib/components/SidebarActions/ChangeViewButton.js +1 -1
- package/lib/components/SidebarActions/SidebarActions.js +2 -2
- package/lib/components/TableOfContent/TableOfContent.js +1 -1
- package/lib/components/Tag/Tag.d.ts +4 -2
- package/lib/components/Tag/Tag.js +40 -4
- package/lib/components/Tag/variables.dark.js +20 -5
- package/lib/components/Tag/variables.js +49 -17
- package/lib/components/UserMenu/LoginButton.js +1 -1
- package/lib/components/UserMenu/LogoutMenuItem.js +1 -1
- package/lib/components/UserMenu/UserMenu.js +1 -1
- package/lib/components/VersionPicker/VersionPicker.d.ts +2 -3
- package/lib/components/VersionPicker/VersionPicker.js +14 -31
- package/lib/core/hooks/__mocks__/index.d.ts +2 -1
- package/lib/core/hooks/__mocks__/index.js +2 -1
- package/lib/core/hooks/__mocks__/search/use-search-filter.d.ts +9 -0
- package/lib/core/hooks/__mocks__/search/use-search-filter.js +14 -0
- package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +6 -1
- package/lib/core/hooks/__mocks__/use-theme-hooks.js +6 -1
- package/lib/core/hooks/feedback/use-report-dialog.js +3 -3
- package/lib/core/hooks/index.d.ts +2 -1
- package/lib/core/hooks/index.js +2 -1
- package/lib/core/hooks/menu/use-mobile-menu-items.js +1 -1
- package/lib/core/hooks/menu/use-mobile-menu-levels.js +2 -2
- package/lib/core/hooks/search/use-recent-searches.js +2 -0
- package/lib/core/hooks/{use-search.d.ts → search/use-search-dialog.d.ts} +1 -1
- package/lib/core/hooks/{use-search.js → search/use-search-dialog.js} +5 -5
- package/lib/core/hooks/search/use-search-filter.d.ts +9 -0
- package/lib/core/hooks/search/use-search-filter.js +50 -0
- package/lib/core/types/hooks.d.ts +17 -4
- package/lib/core/types/index.d.ts +1 -1
- package/lib/core/types/index.js +1 -1
- package/lib/core/types/l10n.d.ts +1 -2
- package/lib/core/types/search.d.ts +42 -2
- package/lib/core/types/select.d.ts +31 -0
- package/lib/core/types/{select-option.js → select.js} +1 -1
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/core/utils/menu.js +1 -1
- package/lib/core/utils/text-trimmer.d.ts +1 -0
- package/lib/core/utils/text-trimmer.js +16 -0
- package/lib/icons/ResetIcon/ResetIcon.d.ts +9 -0
- package/lib/icons/ResetIcon/ResetIcon.js +22 -0
- package/lib/icons/SettingsIcon/SettingsIcon.d.ts +9 -0
- package/lib/icons/SettingsIcon/SettingsIcon.js +23 -0
- package/lib/index.d.ts +8 -1
- package/lib/index.js +8 -1
- package/lib/layouts/Forbidden.js +2 -2
- package/lib/layouts/NotFound.js +3 -3
- package/lib/layouts/OIDCForbidden.js +1 -1
- package/lib/markdoc/tags/partial.js +1 -1
- package/package.json +9 -9
- package/src/components/Buttons/CopyButton.tsx +2 -2
- package/src/components/Buttons/EditPageButton.tsx +2 -2
- package/src/components/Catalog/CatalogActions.tsx +2 -2
- package/src/components/Dropdown/DropdownMenu.tsx +2 -1
- package/src/components/Feedback/Comment.tsx +8 -8
- package/src/components/Feedback/Mood.tsx +8 -8
- package/src/components/Feedback/Rating.tsx +5 -5
- package/src/components/Feedback/Reasons.tsx +4 -4
- package/src/components/Feedback/Scale.tsx +13 -13
- package/src/components/Feedback/Sentiment.tsx +6 -6
- package/src/components/Filter/FilterContent.tsx +3 -3
- package/src/components/Filter/FilterInput.tsx +1 -1
- package/src/components/Filter/FilterPopover.tsx +3 -3
- package/src/components/Filter/FilterSelect.tsx +5 -5
- package/src/components/Footer/FooterCopyright.tsx +3 -3
- package/src/components/LastUpdated/LastUpdated.tsx +1 -2
- package/src/components/Loaders/SpinnerLoader.tsx +31 -0
- package/src/components/PageNavigation/NextButton.tsx +1 -1
- package/src/components/PageNavigation/PreviousButton.tsx +1 -1
- package/src/components/Product/ProductPicker.tsx +2 -2
- package/src/components/Search/FilterFields/SearchFilterFieldSelect.tsx +135 -0
- package/src/components/Search/FilterFields/SearchFilterFieldTags.tsx +61 -0
- package/src/components/Search/Search.tsx +2 -2
- package/src/components/Search/SearchDialog.tsx +190 -51
- package/src/components/Search/SearchFilter.tsx +90 -0
- package/src/components/Search/SearchFilterField.tsx +84 -0
- package/src/components/Search/SearchGroups.tsx +81 -0
- package/src/components/Search/SearchHighlight.tsx +29 -2
- package/src/components/Search/SearchInput.tsx +9 -3
- package/src/components/Search/SearchItem.tsx +39 -24
- package/src/components/Search/SearchRecent.tsx +2 -2
- package/src/components/Search/SearchSuggestedPages.tsx +2 -2
- package/src/components/Search/SearchTrigger.tsx +2 -2
- package/src/components/Search/variables.ts +48 -2
- package/src/components/Segmented/Segmented.tsx +2 -2
- package/src/components/Select/Select.tsx +208 -157
- package/src/components/Select/SelectInput.tsx +201 -0
- package/src/components/Select/variables.ts +12 -1
- package/src/components/SidebarActions/ChangeViewButton.tsx +1 -1
- package/src/components/SidebarActions/SidebarActions.tsx +2 -2
- package/src/components/TableOfContent/TableOfContent.tsx +2 -2
- package/src/components/Tag/Tag.tsx +57 -6
- package/src/components/Tag/variables.dark.ts +20 -5
- package/src/components/Tag/variables.ts +49 -17
- package/src/components/UserMenu/LoginButton.tsx +2 -2
- package/src/components/UserMenu/LogoutMenuItem.tsx +2 -2
- package/src/components/UserMenu/UserMenu.tsx +2 -2
- package/src/components/VersionPicker/VersionPicker.tsx +18 -42
- package/src/core/hooks/__mocks__/index.ts +2 -1
- package/src/core/hooks/__mocks__/search/use-search-filter.ts +10 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +6 -1
- package/src/core/hooks/feedback/use-report-dialog.ts +3 -3
- package/src/core/hooks/index.ts +2 -1
- package/src/core/hooks/menu/use-mobile-menu-items.ts +1 -1
- package/src/core/hooks/menu/use-mobile-menu-levels.ts +2 -2
- package/src/core/hooks/search/use-recent-searches.ts +3 -0
- package/src/core/hooks/{use-search.ts → search/use-search-dialog.ts} +1 -1
- package/src/core/hooks/search/use-search-filter.ts +57 -0
- package/src/core/types/hooks.ts +25 -4
- package/src/core/types/index.ts +1 -1
- package/src/core/types/l10n.ts +169 -97
- package/src/core/types/search.ts +53 -2
- package/src/core/types/select.ts +33 -0
- package/src/core/utils/index.ts +1 -0
- package/src/core/utils/menu.ts +1 -1
- package/src/core/utils/text-trimmer.ts +7 -0
- package/src/icons/ResetIcon/ResetIcon.tsx +26 -0
- package/src/icons/SettingsIcon/SettingsIcon.tsx +30 -0
- package/src/index.ts +8 -1
- package/src/layouts/Forbidden.tsx +4 -9
- package/src/layouts/NotFound.tsx +6 -6
- package/src/layouts/OIDCForbidden.tsx +2 -2
- package/src/markdoc/tags/partial.ts +1 -1
- package/lib/core/types/select-option.d.ts +0 -4
- package/src/core/types/select-option.ts +0 -4
- /package/lib/components/{Loading → Loaders}/Loading.d.ts +0 -0
- /package/lib/components/{Loading → Loaders}/Loading.js +0 -0
- /package/src/components/{Loading → Loaders}/Loading.tsx +0 -0
|
@@ -48,7 +48,7 @@ function TableOfContent(props) {
|
|
|
48
48
|
return (React.createElement(React.Fragment, null,
|
|
49
49
|
React.createElement(TableOfContentMenu, { "data-component-name": "TableOfContent/TableOfContent", className: className },
|
|
50
50
|
React.createElement(TableOfContentItems, { ref: sidebar },
|
|
51
|
-
displayedHeadings.length ? (React.createElement(TableOfContentHeader, { "data-translation-key": "
|
|
51
|
+
displayedHeadings.length ? (React.createElement(TableOfContentHeader, { "data-translation-key": "toc.header" }, translate('toc.header', toc.header || 'On this page'))) : null,
|
|
52
52
|
displayedHeadings.map((heading, idx) => {
|
|
53
53
|
if (!heading) {
|
|
54
54
|
return null;
|
|
@@ -16,7 +16,9 @@ export type TagProps = {
|
|
|
16
16
|
statusDotColor?: string;
|
|
17
17
|
size?: string;
|
|
18
18
|
icon?: React.ReactNode;
|
|
19
|
-
|
|
19
|
+
active?: boolean;
|
|
20
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
21
|
+
onClose?: (event: React.MouseEvent) => void;
|
|
20
22
|
};
|
|
21
|
-
export declare function Tag({ children, color, icon, onClick, size, borderless, withStatusDot, statusDotColor, ...otherProps }: TagProps): JSX.Element;
|
|
23
|
+
export declare function Tag({ children, color, icon, active, closable, onClick, onClose, size, borderless, withStatusDot, statusDotColor, ...otherProps }: TagProps): JSX.Element;
|
|
22
24
|
export {};
|
|
@@ -17,14 +17,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.Tag = void 0;
|
|
18
18
|
const react_1 = __importDefault(require("react"));
|
|
19
19
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
20
|
+
const CloseIcon_1 = require("../../icons/CloseIcon/CloseIcon");
|
|
21
|
+
const CheckmarkFilledIcon_1 = require("../../icons/CheckmarkFilledIcon/CheckmarkFilledIcon");
|
|
20
22
|
function Tag(_a) {
|
|
21
|
-
var { children, color, icon, onClick, size, borderless, withStatusDot, statusDotColor = 'var(--tag-status-dot-color-default)' } = _a, otherProps = __rest(_a, ["children", "color", "icon", "onClick", "size", "borderless", "withStatusDot", "statusDotColor"]);
|
|
22
|
-
return (react_1.default.createElement(
|
|
23
|
+
var { children, color, icon, active, closable, onClick, onClose, size, borderless, withStatusDot, statusDotColor = 'var(--tag-status-dot-color-default)' } = _a, otherProps = __rest(_a, ["children", "color", "icon", "active", "closable", "onClick", "onClose", "size", "borderless", "withStatusDot", "statusDotColor"]);
|
|
24
|
+
return (react_1.default.createElement(TagWrapper, Object.assign({ "data-component-name": "Tag/Tag", borderless: borderless, color: color, size: size, onClick: onClick, hasCloseButton: closable }, otherProps),
|
|
23
25
|
withStatusDot ? react_1.default.createElement(StatusDot, { color: statusDotColor }) : icon ? icon : null,
|
|
24
|
-
children)
|
|
26
|
+
react_1.default.createElement(ContentWrapper, null, children),
|
|
27
|
+
closable && (react_1.default.createElement(CloseButton, { onClick: (event) => {
|
|
28
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(event);
|
|
29
|
+
} },
|
|
30
|
+
react_1.default.createElement(CloseIcon_1.CloseIcon, null))),
|
|
31
|
+
active && react_1.default.createElement(ActiveIcon, null)));
|
|
25
32
|
}
|
|
26
33
|
exports.Tag = Tag;
|
|
27
|
-
const
|
|
34
|
+
const ContentWrapper = styled_components_1.default.div `
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
text-wrap: nowrap;
|
|
39
|
+
|
|
40
|
+
padding: var(--tag-content-padding);
|
|
41
|
+
gap: var(--tag-content-gap);
|
|
42
|
+
`;
|
|
43
|
+
const CloseButton = styled_components_1.default.div `
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
align-self: stretch;
|
|
48
|
+
border-radius: 0 var(--tag-border-radius) var(--tag-border-radius) 0;
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
background: var(--tag-close-button-bg-color-hover);
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
const TagWrapper = styled_components_1.default.div.attrs(({ className, color, size }) => ({
|
|
28
55
|
className: (className || '') +
|
|
29
56
|
` tag-default ${color ? `tag-${color}` : ''} ${size ? `tag-size-${size}` : ''}`,
|
|
30
57
|
})) `
|
|
@@ -32,8 +59,10 @@ const TagContainer = styled_components_1.default.div.attrs(({ className, color,
|
|
|
32
59
|
align-items: center;
|
|
33
60
|
justify-content: center;
|
|
34
61
|
text-wrap: nowrap;
|
|
62
|
+
position: relative;
|
|
35
63
|
|
|
36
64
|
padding: var(--tag-padding);
|
|
65
|
+
${({ hasCloseButton }) => (hasCloseButton ? 'padding-right: 0;' : '')};
|
|
37
66
|
margin: var(--tag-margin);
|
|
38
67
|
|
|
39
68
|
&:last-child {
|
|
@@ -64,4 +93,11 @@ const StatusDot = styled_components_1.default.div `
|
|
|
64
93
|
border-radius: 50%;
|
|
65
94
|
background-color: ${({ color }) => color};
|
|
66
95
|
`;
|
|
96
|
+
const ActiveIcon = (0, styled_components_1.default)(CheckmarkFilledIcon_1.CheckmarkFilledIcon) `
|
|
97
|
+
width: 12px;
|
|
98
|
+
height: 12px;
|
|
99
|
+
position: absolute;
|
|
100
|
+
right: -4px;
|
|
101
|
+
top: -4px;
|
|
102
|
+
`;
|
|
67
103
|
//# sourceMappingURL=Tag.js.map
|
|
@@ -3,11 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.tagDarkMode = void 0;
|
|
4
4
|
const styled_components_1 = require("styled-components");
|
|
5
5
|
exports.tagDarkMode = (0, styled_components_1.css) `
|
|
6
|
-
--tag-operation-color-delete: #fa82a2;
|
|
7
|
-
--tag-operation-color-
|
|
8
|
-
|
|
9
|
-
--tag-operation-color-
|
|
10
|
-
--tag-operation-color-
|
|
6
|
+
--tag-operation-color-delete: #fa82a2; // @presenter Color
|
|
7
|
+
--tag-operation-bg-color-delete: #77214C; // @presenter Color
|
|
8
|
+
|
|
9
|
+
--tag-operation-color-get: #68cc97; // @presenter Color
|
|
10
|
+
--tag-operation-bg-color-get: #1F4D2D; // @presenter Color
|
|
11
|
+
|
|
12
|
+
--tag-operation-color-post: #90b0f0; // @presenter Color
|
|
13
|
+
--tag-operation-bg-color-post: #233061; // @presenter Color
|
|
14
|
+
|
|
15
|
+
--tag-operation-color-put: #e0a663; // @presenter Color
|
|
16
|
+
--tag-operation-bg-color-put: #612729; // @presenter Color
|
|
17
|
+
|
|
18
|
+
--tag-operation-color-patch: #e0c363; // @presenter Color
|
|
19
|
+
--tag-operation-bg-color-patch: #5C3721; // @presenter Color
|
|
20
|
+
|
|
21
|
+
--tag-operation-color-head: #e6e1fe; // @presenter Color
|
|
22
|
+
--tag-operation-bg-color-head: #5b4ccc; // @presenter Color
|
|
23
|
+
|
|
24
|
+
--tag-operation-color-options: #1a1c21; // @presenter Color
|
|
25
|
+
--tag-operation-bg-color-options: #2a2b33; // @presenter Color
|
|
11
26
|
|
|
12
27
|
.tag-grey,
|
|
13
28
|
.tag-draft,
|
|
@@ -9,7 +9,7 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
9
9
|
|
|
10
10
|
--tag-border-width: 1px; //@presenter Border
|
|
11
11
|
--tag-border-style: solid; //@presenter Border
|
|
12
|
-
--tag-border-radius: var(--border-radius
|
|
12
|
+
--tag-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
13
13
|
--tag-box-shadow: none; // @presenter Shadow
|
|
14
14
|
|
|
15
15
|
--tag-status-dot-color-default: var(--color-persian-green-7);
|
|
@@ -22,8 +22,17 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
22
22
|
* @tokens Tag spacing
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
--tag-padding: 1px
|
|
26
|
-
--tag-
|
|
25
|
+
--tag-padding-vertical: 1px; //@presenter Spacing
|
|
26
|
+
--tag-padding-horizontal: 8px; //@presenter Spacing
|
|
27
|
+
--tag-padding: 0 var(--tag-padding-horizontal); //@presenter Spacing
|
|
28
|
+
--tag-content-padding: var(--tag-padding-vertical) 0; //@presenter Spacing
|
|
29
|
+
--tag-content-gap: 4px; //@presenter Spacing
|
|
30
|
+
|
|
31
|
+
--tag-large-padding-vertical: 4px; //@presenter Spacing
|
|
32
|
+
--tag-large-padding-horizontal: 16px; //@presenter Spacing
|
|
33
|
+
--tag-large-padding: 0 var(--tag-large-padding-horizontal); //@presenter Spacing
|
|
34
|
+
--tag-large-content-padding: var(--tag-large-padding-vertical); //@presenter Spacing
|
|
35
|
+
|
|
27
36
|
--tag-margin: 0 5px 0 0; //@presenter Spacing
|
|
28
37
|
--tag-gap: 5px; //@presenter Spacing
|
|
29
38
|
|
|
@@ -33,6 +42,7 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
33
42
|
|
|
34
43
|
.tag-size-large {
|
|
35
44
|
--tag-padding: var(--tag-large-padding);
|
|
45
|
+
--tag-content-padding: var(--tag-large-content-padding);
|
|
36
46
|
--tag-font-size: var(--font-size-base);
|
|
37
47
|
}
|
|
38
48
|
|
|
@@ -67,6 +77,7 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
67
77
|
--tag-color: var(--text-color-primary); // @presenter Color
|
|
68
78
|
--tag-bg-color: var(--color-warm-grey-2); // @presenter Color
|
|
69
79
|
--tag-border-color: var(--border-color-primary); // @presenter Color
|
|
80
|
+
--tag-close-button-bg-color-hover: var(--color-warm-grey-3); // @presenter Color
|
|
70
81
|
}
|
|
71
82
|
|
|
72
83
|
.tag-green,
|
|
@@ -75,6 +86,7 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
75
86
|
--tag-color: var(--color-success-active); // @presenter Color
|
|
76
87
|
--tag-bg-color: var(--color-success-bg); // @presenter Color
|
|
77
88
|
--tag-border-color: var(--color-success-active); // @presenter Color
|
|
89
|
+
--tag-close-button-bg-color-hover: var(--color-success-bg-hover); // @presenter Color
|
|
78
90
|
}
|
|
79
91
|
|
|
80
92
|
.tag-red,
|
|
@@ -83,6 +95,7 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
83
95
|
--tag-color: var(--color-error-active); // @presenter Color
|
|
84
96
|
--tag-bg-color: var(--color-error-bg); // @presenter Color
|
|
85
97
|
--tag-border-color: var(--color-error-active); // @presenter Color
|
|
98
|
+
--tag-close-button-bg-color-hover: var(--color-error-hover); // @presenter Color
|
|
86
99
|
}
|
|
87
100
|
|
|
88
101
|
.tag-gold,
|
|
@@ -91,6 +104,7 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
91
104
|
--tag-color: var(--color-warning-active); // @presenter Color
|
|
92
105
|
--tag-bg-color: var(--color-warning-bg); // @presenter Color
|
|
93
106
|
--tag-border-color: var(--color-warning-active); // @presenter Color
|
|
107
|
+
--tag-close-button-bg-color-hover: var(--color-warning-hover); // @presenter Color
|
|
94
108
|
}
|
|
95
109
|
|
|
96
110
|
.tag-blue,
|
|
@@ -98,6 +112,7 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
98
112
|
--tag-color: var(--color-info-active); // @presenter Color
|
|
99
113
|
--tag-bg-color: var(--color-info-bg); // @presenter Color
|
|
100
114
|
--tag-border-color: var(--color-info-active); // @presenter Color
|
|
115
|
+
--tag-close-button-bg-color-hover: var(--color-info-hover); // @presenter Color
|
|
101
116
|
}
|
|
102
117
|
|
|
103
118
|
.tag-purple,
|
|
@@ -105,26 +120,24 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
105
120
|
--tag-color: var(--color-purple-7); // @presenter Color
|
|
106
121
|
--tag-bg-color: var(--color-purple-1); // @presenter Color
|
|
107
122
|
--tag-border-color: var(--color-purple-7); // @presenter Color
|
|
123
|
+
--tag-close-button-bg-color-hover: var(--color-purple-3); // @presenter Color
|
|
108
124
|
}
|
|
109
125
|
|
|
110
126
|
.tag-cyan,
|
|
111
|
-
.tag-option
|
|
127
|
+
.tag-option,
|
|
128
|
+
.tag-geekblue,
|
|
129
|
+
.tag-link {
|
|
112
130
|
--tag-color: var(--color-turquoise-7); // @presenter Color
|
|
113
131
|
--tag-bg-color: var(--color-turquoise-1); // @presenter Color
|
|
114
132
|
--tag-border-color: var(--color-turquoise-7); // @presenter Color
|
|
133
|
+
--tag-close-button-bg-color-hover: var(--color-turquoise-3); // @presenter Color
|
|
115
134
|
}
|
|
116
135
|
|
|
117
136
|
.tag-yellow {
|
|
118
137
|
--tag-color: var(--color-carrot-7); // @presenter Color
|
|
119
138
|
--tag-bg-color: var(--color-carrot-1); // @presenter Color
|
|
120
139
|
--tag-border-color: var(--color-carrot-7); // @presenter Color
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
.tag-geekblue,
|
|
124
|
-
.tag-link {
|
|
125
|
-
--tag-color: var(--color-turquoise-7); // @presenter Color
|
|
126
|
-
--tag-bg-color: var(--color-turquoise-1); // @presenter Color
|
|
127
|
-
--tag-border-color: var(--color-turquoise-7); // @presenter Color
|
|
140
|
+
--tag-close-button-bg-color-hover: var(--color-carrot-3); // @presenter Color
|
|
128
141
|
}
|
|
129
142
|
|
|
130
143
|
.tag-magenta,
|
|
@@ -132,18 +145,21 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
132
145
|
--tag-color: var(--color-magenta-7); // @presenter Color
|
|
133
146
|
--tag-bg-color: var(--color-magenta-1); // @presenter Color
|
|
134
147
|
--tag-border-color: var(--color-magenta-7); // @presenter Color
|
|
148
|
+
--tag-close-button-bg-color-hover: var(--color-magenta-3); // @presenter Color
|
|
135
149
|
}
|
|
136
150
|
|
|
137
151
|
.tag-lime {
|
|
138
152
|
--tag-color: var(--color-green-7); // @presenter Color
|
|
139
153
|
--tag-bg-color: none; // @presenter Color
|
|
140
154
|
--tag-border-color: var(--color-green-7); // @presenter Color
|
|
155
|
+
--tag-close-button-bg-color-hover: var(--color-green-3); // @presenter Color
|
|
141
156
|
}
|
|
142
157
|
|
|
143
158
|
.tag-product {
|
|
144
159
|
--tag-color: var(--color-warm-grey-7); // @presenter Color
|
|
145
160
|
--tag-bg-color: transparent; // @presenter Color
|
|
146
161
|
--tag-border-color: var(--color-warm-grey-4); // @presenter Color
|
|
162
|
+
--tag-close-button-bg-color-hover: var(--color-warm-grey-3); // @presenter Color
|
|
147
163
|
}
|
|
148
164
|
|
|
149
165
|
/**
|
|
@@ -158,12 +174,28 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
158
174
|
* @tokens Operation tag colors
|
|
159
175
|
*/
|
|
160
176
|
|
|
161
|
-
--tag-operation-color-delete: #
|
|
162
|
-
--tag-operation-color-
|
|
163
|
-
|
|
164
|
-
--tag-operation-color-
|
|
165
|
-
--tag-operation-color-
|
|
166
|
-
|
|
177
|
+
--tag-operation-color-delete: #e70b46; // @presenter Color
|
|
178
|
+
--tag-operation-bg-color-delete: #fee2e9; // @presenter Color
|
|
179
|
+
|
|
180
|
+
--tag-operation-color-get: #25b869; // @presenter Color
|
|
181
|
+
--tag-operation-bg-color-get: #e5faef; // @presenter Color
|
|
182
|
+
|
|
183
|
+
--tag-operation-color-post: #1e65f5; // @presenter Color
|
|
184
|
+
--tag-operation-bg-color-post: #e2ebfe; // @presenter Color
|
|
185
|
+
|
|
186
|
+
--tag-operation-color-put: #f5901d; // @presenter Color
|
|
187
|
+
--tag-operation-bg-color-put: #fef1e2; // @presenter Color
|
|
188
|
+
|
|
189
|
+
--tag-operation-color-patch: #f5c31d; // @presenter Color
|
|
190
|
+
--tag-operation-bg-color-patch: #fdf6dd; // @presenter Color
|
|
191
|
+
|
|
192
|
+
--tag-operation-color-head: #5b4ccc; // @presenter Color
|
|
193
|
+
--tag-operation-bg-color-head: #e6e1fe; // @presenter Color
|
|
194
|
+
|
|
195
|
+
--tag-operation-color-options: #1a1c21; // @presenter Color
|
|
196
|
+
--tag-operation-bg-color-options: #ededf2; // @presenter Color
|
|
197
|
+
|
|
198
|
+
--tag-operation-color-deprecated: var(--text-color-disabled); // @presenter Color
|
|
167
199
|
|
|
168
200
|
.tag-delete {
|
|
169
201
|
--tag-color: var(--tag-operation-color-delete); // @presenter Color
|
|
@@ -12,7 +12,7 @@ function LoginButton({ href, className }) {
|
|
|
12
12
|
const { translate } = useTranslate();
|
|
13
13
|
const telemetry = useTelemetry();
|
|
14
14
|
return (react_1.default.createElement("div", { "data-component-name": "UserMenu/LoginButton", className: className },
|
|
15
|
-
react_1.default.createElement(Button_1.Button, { "data-translation-key": "
|
|
15
|
+
react_1.default.createElement(Button_1.Button, { "data-translation-key": "userMenu.login", to: href, onClick: () => telemetry.send('login_button_clicked', {}), "data-testid": "login-btn", extraClass: className, variant: "primary", size: "medium" }, translate('userMenu.login', 'Login'))));
|
|
16
16
|
}
|
|
17
17
|
exports.LoginButton = LoginButton;
|
|
18
18
|
//# sourceMappingURL=LoginButton.js.map
|
|
@@ -17,7 +17,7 @@ function LogoutMenuItem({ iconOnly, className }) {
|
|
|
17
17
|
telemetry.send('logout_menu_item_clicked', {});
|
|
18
18
|
handleLogout();
|
|
19
19
|
};
|
|
20
|
-
return (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { className: className, dangerous: true, "data-component-name": "UserMenu/LogoutMenuItem", onAction: handleClick, "data-translation-key": "
|
|
20
|
+
return (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { className: className, dangerous: true, "data-component-name": "UserMenu/LogoutMenuItem", onAction: handleClick, "data-translation-key": "userMenu.logout", prefix: react_1.default.createElement(LogoutIcon_1.LogoutIcon, null), style: { width: iconOnly ? 'fit-content' : '100%' } }, iconOnly ? null : translate('userMenu.logout', 'Log out')));
|
|
21
21
|
}
|
|
22
22
|
exports.LogoutMenuItem = LogoutMenuItem;
|
|
23
23
|
//# sourceMappingURL=LogoutMenuItem.js.map
|
|
@@ -32,7 +32,7 @@ function UserMenu({ className }) {
|
|
|
32
32
|
}
|
|
33
33
|
const devOnboardingMenuItem = hasDeveloperOnboarding
|
|
34
34
|
? [
|
|
35
|
-
react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { key: "my-apps", to: "/apps", "data-translation-key": "
|
|
35
|
+
react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { key: "my-apps", to: "/apps", "data-translation-key": "userMenu.devOnboardingLabel", prefix: react_1.default.createElement(GridIcon_1.GridIcon, null) }, translate('userMenu.devOnboardingLabel')),
|
|
36
36
|
]
|
|
37
37
|
: [];
|
|
38
38
|
const menuItems = (userMenu === null || userMenu === void 0 ? void 0 : userMenu['menu']) || [];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { Version } from '@redocly/config';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
import type { SelectProps } from '../../core/types/select';
|
|
4
|
+
import { Select } from '../../components/Select/Select';
|
|
6
5
|
export declare function VersionPicker(props: {
|
|
7
6
|
versions?: Version[];
|
|
8
7
|
onChange: (v: Version) => void;
|
|
@@ -31,6 +31,7 @@ const React = __importStar(require("react"));
|
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
32
|
const hooks_1 = require("../../core/hooks");
|
|
33
33
|
const Select_1 = require("../../components/Select/Select");
|
|
34
|
+
const SelectInput_1 = require("../../components/Select/SelectInput");
|
|
34
35
|
function VersionPicker(props) {
|
|
35
36
|
var _a;
|
|
36
37
|
const themeConfig = (0, hooks_1.useThemeConfig)();
|
|
@@ -38,22 +39,24 @@ function VersionPicker(props) {
|
|
|
38
39
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
39
40
|
const { translate } = useTranslate();
|
|
40
41
|
const { versions = [], onChange } = props;
|
|
41
|
-
const options = versions.map((version) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
42
|
+
const options = versions.map(({ label, version, active }) => ({
|
|
43
|
+
element: label || version,
|
|
44
|
+
value: version,
|
|
45
|
+
active: active,
|
|
46
|
+
}));
|
|
47
|
+
const value = (_a = options.find((item) => item.active)) === null || _a === void 0 ? void 0 : _a.value;
|
|
48
48
|
if (versionPicker === null || versionPicker === void 0 ? void 0 : versionPicker.hide) {
|
|
49
49
|
return null;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const handleOnChange = (value) => {
|
|
52
|
+
const selectedVersion = versions.find((v) => v.version === value);
|
|
53
|
+
onChange(selectedVersion);
|
|
54
|
+
};
|
|
52
55
|
if (!options.length && !(versionPicker === null || versionPicker === void 0 ? void 0 : versionPicker.showForUnversioned))
|
|
53
56
|
return null;
|
|
54
57
|
return (React.createElement(VersionsPickerWrapper, { "data-component-name": "VersionPicker/VersionPicker" },
|
|
55
|
-
React.createElement(VersionPickerLabel, { "data-translation-key": "
|
|
56
|
-
React.createElement(exports.VersionPickerSelect, { placeholder: translate('
|
|
58
|
+
React.createElement(VersionPickerLabel, { "data-translation-key": "versionPicker.label" }, translate('versionPicker.label', 'Version:')),
|
|
59
|
+
React.createElement(exports.VersionPickerSelect, { placeholder: translate('versionPicker.unversioned', 'All versions'), disabled: !options.length, options: options, value: value, onChange: handleOnChange })));
|
|
57
60
|
}
|
|
58
61
|
exports.VersionPicker = VersionPicker;
|
|
59
62
|
const VersionPickerLabel = styled_components_1.default.label `
|
|
@@ -72,32 +75,12 @@ exports.VersionPickerSelect = (0, styled_components_1.default)(Select_1.Select)
|
|
|
72
75
|
line-height: var(--version-picker-line-height);
|
|
73
76
|
color: var(--version-picker-text-color);
|
|
74
77
|
|
|
75
|
-
${
|
|
78
|
+
${SelectInput_1.SelectInputWrapper} {
|
|
76
79
|
border: var(--version-picker-input-border);
|
|
77
80
|
border-radius: var(--version-picker-input-border-radius);
|
|
78
81
|
padding: var(--version-picker-input-padding-vertical)
|
|
79
82
|
var(--version-picker-input-padding-horizontal);
|
|
80
83
|
}
|
|
81
|
-
|
|
82
|
-
${Select_1.SelectList} {
|
|
83
|
-
right: 0;
|
|
84
|
-
width: 100%;
|
|
85
|
-
min-width: var(--version-picker-list-min-width);
|
|
86
|
-
max-width: var(--version-picker-list-max-width);
|
|
87
|
-
padding: var(--version-picker-list-padding);
|
|
88
|
-
background-color: var(--version-picker-list-bg-color);
|
|
89
|
-
border-radius: var(--version-picker-list-border-radius);
|
|
90
|
-
box-shadow: var(--version-picker-list-box-shadow);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
${Select_1.SelectListItem} {
|
|
94
|
-
border-radius: var(--version-picker-list-item-border-radius);
|
|
95
|
-
|
|
96
|
-
& > * {
|
|
97
|
-
padding: var(--version-picker-list-item-vertical-padding)
|
|
98
|
-
var(--version-picker-list-item-horizontal-padding);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
84
|
`;
|
|
102
85
|
const VersionsPickerWrapper = styled_components_1.default.div `
|
|
103
86
|
display: flex;
|
|
@@ -4,6 +4,7 @@ export * from '../../../core/hooks/__mocks__/use-mobile-menu';
|
|
|
4
4
|
export * from '../../../core/hooks/__mocks__/use-controlled-state';
|
|
5
5
|
export * from '../../../core/hooks/__mocks__/search/use-recent-searches';
|
|
6
6
|
export * from '../../../core/hooks/__mocks__/search/use-suggested-pages';
|
|
7
|
+
export * from '../../../core/hooks/__mocks__/search/use-search-filter';
|
|
7
8
|
export * from '../../../core/hooks/menu/__mocks__/use-mobile-menu-items';
|
|
8
9
|
export * from '../../../core/hooks/menu/use-collapse';
|
|
9
10
|
export * from '../../../core/hooks/use-active-heading';
|
|
@@ -20,5 +21,5 @@ export * from '../../../core/hooks/menu/use-menu-item-expanded';
|
|
|
20
21
|
export * from '../../../core/hooks/menu/use-mobile-menu-levels';
|
|
21
22
|
export * from '../../../core/hooks/feedback/use-report-dialog';
|
|
22
23
|
export * from '../../../core/hooks/use-product-picker';
|
|
23
|
-
export * from '../../../core/hooks/use-search';
|
|
24
|
+
export * from '../../../core/hooks/search/use-search-dialog';
|
|
24
25
|
export * from '../../../core/hooks/use-language-picker';
|
|
@@ -20,6 +20,7 @@ __exportStar(require("../../../core/hooks/__mocks__/use-mobile-menu"), exports);
|
|
|
20
20
|
__exportStar(require("../../../core/hooks/__mocks__/use-controlled-state"), exports);
|
|
21
21
|
__exportStar(require("../../../core/hooks/__mocks__/search/use-recent-searches"), exports);
|
|
22
22
|
__exportStar(require("../../../core/hooks/__mocks__/search/use-suggested-pages"), exports);
|
|
23
|
+
__exportStar(require("../../../core/hooks/__mocks__/search/use-search-filter"), exports);
|
|
23
24
|
__exportStar(require("../../../core/hooks/menu/__mocks__/use-mobile-menu-items"), exports);
|
|
24
25
|
__exportStar(require("../../../core/hooks/menu/use-collapse"), exports);
|
|
25
26
|
__exportStar(require("../../../core/hooks/use-active-heading"), exports);
|
|
@@ -36,6 +37,6 @@ __exportStar(require("../../../core/hooks/menu/use-menu-item-expanded"), exports
|
|
|
36
37
|
__exportStar(require("../../../core/hooks/menu/use-mobile-menu-levels"), exports);
|
|
37
38
|
__exportStar(require("../../../core/hooks/feedback/use-report-dialog"), exports);
|
|
38
39
|
__exportStar(require("../../../core/hooks/use-product-picker"), exports);
|
|
39
|
-
__exportStar(require("../../../core/hooks/use-search"), exports);
|
|
40
|
+
__exportStar(require("../../../core/hooks/search/use-search-dialog"), exports);
|
|
40
41
|
__exportStar(require("../../../core/hooks/use-language-picker"), exports);
|
|
41
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
export declare const useSearchFilter: jest.Mock<{
|
|
3
|
+
isFilterOpen: boolean;
|
|
4
|
+
onFacetReset: () => void;
|
|
5
|
+
onFilterChange: () => void;
|
|
6
|
+
onFilterToggle: () => void;
|
|
7
|
+
onFilterReset: () => void;
|
|
8
|
+
onTopFacetsReset: () => void;
|
|
9
|
+
}, [], any>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSearchFilter = void 0;
|
|
4
|
+
exports.useSearchFilter = jest.fn(() => {
|
|
5
|
+
return {
|
|
6
|
+
isFilterOpen: false,
|
|
7
|
+
onFacetReset: () => { },
|
|
8
|
+
onFilterChange: () => { },
|
|
9
|
+
onFilterToggle: () => { },
|
|
10
|
+
onFilterReset: () => { },
|
|
11
|
+
onTopFacetsReset: () => { },
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=use-search-filter.js.map
|
|
@@ -30,12 +30,17 @@ export declare const useThemeHooks: jest.Mock<{
|
|
|
30
30
|
}, [], any>;
|
|
31
31
|
useCurrentProduct: jest.Mock<any, any, any>;
|
|
32
32
|
useProducts: jest.Mock<never[], [], any>;
|
|
33
|
-
|
|
33
|
+
useSearch: jest.Mock<{
|
|
34
34
|
query: jest.Mock<any, any, any>;
|
|
35
35
|
setQuery: jest.Mock<any, any, any>;
|
|
36
36
|
items: never[];
|
|
37
37
|
isLoading: boolean;
|
|
38
38
|
}, [], any>;
|
|
39
|
+
useFacetQuery: jest.Mock<{
|
|
40
|
+
searchFacet: null;
|
|
41
|
+
setSearchFacet: jest.Mock<any, any, any>;
|
|
42
|
+
setSearchFacetQuery: jest.Mock<any, any, any>;
|
|
43
|
+
}, [], any>;
|
|
39
44
|
useUserMenu: jest.Mock<{
|
|
40
45
|
userData: {
|
|
41
46
|
isAuthenticated: boolean;
|
|
@@ -37,12 +37,17 @@ exports.useThemeHooks = jest.fn(() => ({
|
|
|
37
37
|
})),
|
|
38
38
|
useCurrentProduct: jest.fn(),
|
|
39
39
|
useProducts: jest.fn(() => []),
|
|
40
|
-
|
|
40
|
+
useSearch: jest.fn(() => ({
|
|
41
41
|
query: jest.fn().mockReturnValue(''),
|
|
42
42
|
setQuery: jest.fn(),
|
|
43
43
|
items: [],
|
|
44
44
|
isLoading: false,
|
|
45
45
|
})),
|
|
46
|
+
useFacetQuery: jest.fn(() => ({
|
|
47
|
+
searchFacet: null,
|
|
48
|
+
setSearchFacet: jest.fn(),
|
|
49
|
+
setSearchFacetQuery: jest.fn(),
|
|
50
|
+
})),
|
|
46
51
|
useUserMenu: jest.fn(() => ({
|
|
47
52
|
userData: {
|
|
48
53
|
isAuthenticated: true,
|
|
@@ -23,13 +23,13 @@ function useReportDialog() {
|
|
|
23
23
|
};
|
|
24
24
|
const reportButtonProps = {
|
|
25
25
|
onClick: showReportDialog,
|
|
26
|
-
buttonText: buttonText || translate('
|
|
27
|
-
tooltip: tooltipText || translate('
|
|
26
|
+
buttonText: buttonText || translate('codeSnippet.report.buttonText', 'Report'),
|
|
27
|
+
tooltip: tooltipText || translate('codeSnippet.report.tooltipText', 'Report a problem'),
|
|
28
28
|
hide: (report === null || report === void 0 ? void 0 : report.hide) === true,
|
|
29
29
|
};
|
|
30
30
|
const reportDialogProps = {
|
|
31
31
|
settings: {
|
|
32
|
-
label: label || translate('
|
|
32
|
+
label: label || translate('codeSnippet.report.label', 'What is wrong with this code?'),
|
|
33
33
|
},
|
|
34
34
|
onSubmit: hideReportDialog,
|
|
35
35
|
onCancel: closeReportDialog,
|
|
@@ -24,6 +24,7 @@ export * from '../../core/hooks/use-tabs';
|
|
|
24
24
|
export * from '../../core/hooks/use-focus-trap';
|
|
25
25
|
export * from '../../core/hooks/use-language-picker';
|
|
26
26
|
export * from '../../core/hooks/use-product-picker';
|
|
27
|
-
export * from '../../core/hooks/use-search';
|
|
27
|
+
export * from '../../core/hooks/search/use-search-dialog';
|
|
28
|
+
export * from '../../core/hooks/search/use-search-filter';
|
|
28
29
|
export * from '../../core/hooks/use-controlled-state';
|
|
29
30
|
export * from '../../core/hooks/use-codeblock-tabs-controls';
|
package/lib/core/hooks/index.js
CHANGED
|
@@ -40,7 +40,8 @@ __exportStar(require("../../core/hooks/use-tabs"), exports);
|
|
|
40
40
|
__exportStar(require("../../core/hooks/use-focus-trap"), exports);
|
|
41
41
|
__exportStar(require("../../core/hooks/use-language-picker"), exports);
|
|
42
42
|
__exportStar(require("../../core/hooks/use-product-picker"), exports);
|
|
43
|
-
__exportStar(require("../../core/hooks/use-search"), exports);
|
|
43
|
+
__exportStar(require("../../core/hooks/search/use-search-dialog"), exports);
|
|
44
|
+
__exportStar(require("../../core/hooks/search/use-search-filter"), exports);
|
|
44
45
|
__exportStar(require("../../core/hooks/use-controlled-state"), exports);
|
|
45
46
|
__exportStar(require("../../core/hooks/use-codeblock-tabs-controls"), exports);
|
|
46
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -55,7 +55,7 @@ const useMobileMenuItems = (menuType) => {
|
|
|
55
55
|
if (productMenuItems.length) {
|
|
56
56
|
menuItems.push({
|
|
57
57
|
type: 'separator',
|
|
58
|
-
label: translate('
|
|
58
|
+
label: translate('mobileMenu.products', 'Products'),
|
|
59
59
|
});
|
|
60
60
|
menuItems.push(...productMenuItems);
|
|
61
61
|
}
|
|
@@ -20,7 +20,7 @@ const useMobileMenuLevels = () => {
|
|
|
20
20
|
const menuLevels = (0, react_1.useMemo)(() => {
|
|
21
21
|
const menuLevels = [
|
|
22
22
|
{
|
|
23
|
-
label: translate('
|
|
23
|
+
label: translate('mobileMenu.mainMenu', 'Main Menu'),
|
|
24
24
|
type: constants_1.MobileMenuType.MAIN_MENU,
|
|
25
25
|
},
|
|
26
26
|
];
|
|
@@ -32,7 +32,7 @@ const useMobileMenuLevels = () => {
|
|
|
32
32
|
}
|
|
33
33
|
if (sidebarItems.length || activeVersion) {
|
|
34
34
|
menuLevels.push({
|
|
35
|
-
label: translate('
|
|
35
|
+
label: translate('mobileMenu.previous', 'Previous'),
|
|
36
36
|
type: constants_1.MobileMenuType.PAGE,
|
|
37
37
|
});
|
|
38
38
|
}
|
|
@@ -17,6 +17,8 @@ function updateRecentSearches(value, isAdd) {
|
|
|
17
17
|
if (!(0, utils_1.isBrowser)())
|
|
18
18
|
return [];
|
|
19
19
|
const recentSearches = getRecentSearches();
|
|
20
|
+
if (value === '')
|
|
21
|
+
return recentSearches;
|
|
20
22
|
const valueIndex = recentSearches.indexOf(value);
|
|
21
23
|
if (valueIndex !== -1)
|
|
22
24
|
recentSearches.splice(valueIndex, 1);
|
|
@@ -3,12 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.useSearchDialog = void 0;
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const react_router_dom_1 = require("react-router-dom");
|
|
9
9
|
const hotkeys_js_1 = __importDefault(require("hotkeys-js"));
|
|
10
|
-
const hooks_1 = require("
|
|
11
|
-
function
|
|
10
|
+
const hooks_1 = require("../../../core/hooks");
|
|
11
|
+
function useSearchDialog() {
|
|
12
12
|
var _a, _b;
|
|
13
13
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
14
14
|
const themeSettings = (0, hooks_1.useThemeConfig)();
|
|
@@ -40,5 +40,5 @@ function useSearch() {
|
|
|
40
40
|
(0, react_1.useEffect)(onClose, [location]);
|
|
41
41
|
return { isOpen, onOpen, onClose };
|
|
42
42
|
}
|
|
43
|
-
exports.
|
|
44
|
-
//# sourceMappingURL=use-search.js.map
|
|
43
|
+
exports.useSearchDialog = useSearchDialog;
|
|
44
|
+
//# sourceMappingURL=use-search-dialog.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SearchFilterItem } from '../../../core/types';
|
|
2
|
+
export declare function useSearchFilter(filter: SearchFilterItem[], setFilter: React.Dispatch<React.SetStateAction<SearchFilterItem[]>>): {
|
|
3
|
+
onFacetReset: (field: string) => void;
|
|
4
|
+
onTopFacetsReset: () => void;
|
|
5
|
+
onFilterChange: (field: string, value: string | string[] | undefined, isTop?: boolean) => void;
|
|
6
|
+
onFilterReset: () => void;
|
|
7
|
+
onFilterToggle: () => void;
|
|
8
|
+
isFilterOpen: boolean;
|
|
9
|
+
};
|