@redocly/theme 0.31.2 → 0.32.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/CopyButton/CopyButton.d.ts +1 -1
- package/lib/components/Search/SuggestedPages.js +2 -2
- package/lib/globalStyle.js +2 -2
- package/package.json +12 -14
- package/src/components/Catalog/useCatalog.ts +2 -2
- package/src/components/CopyButton/CopyButton.tsx +1 -1
- package/src/components/Search/SuggestedPages.tsx +11 -12
- package/src/globalStyle.ts +1 -1
|
@@ -40,11 +40,11 @@ function SuggestedPages({ className }) {
|
|
|
40
40
|
return null;
|
|
41
41
|
return (React.createElement(Wrapper, { "data-component-name": "Search/SuggestedPages", className: className },
|
|
42
42
|
React.createElement(Title, { "data-translation-key": "theme.search.suggested" }, translate('theme.search.suggested', 'Suggested pages')),
|
|
43
|
-
React.createElement(SuggestedItems, null, pages.map((page) => page.link
|
|
43
|
+
React.createElement(SuggestedItems, null, pages.map((page) => page.link ? (React.createElement(Item, { key: page.label },
|
|
44
44
|
React.createElement(PageLink, Object.assign({ to: page.link }, page),
|
|
45
45
|
React.createElement(Group, null,
|
|
46
46
|
React.createElement(ClockBackwardsIcon, null),
|
|
47
|
-
page.label))))))));
|
|
47
|
+
page.label)))) : null))));
|
|
48
48
|
}
|
|
49
49
|
exports.SuggestedPages = SuggestedPages;
|
|
50
50
|
const Wrapper = styled_components_1.default.div `
|
package/lib/globalStyle.js
CHANGED
|
@@ -12,7 +12,7 @@ const Tag_1 = require("./components/Tag");
|
|
|
12
12
|
const TableOfContent_1 = require("./components/TableOfContent");
|
|
13
13
|
const Navbar_1 = require("./components/Navbar");
|
|
14
14
|
const Search_1 = require("./components/Search");
|
|
15
|
-
const
|
|
15
|
+
const styledVariables_1 = require("./components/Catalog/styledVariables"); // NOTE: For some reason only direct import works here
|
|
16
16
|
const Filter_1 = require("./components/Filter");
|
|
17
17
|
const Menu_1 = require("./components/Menu");
|
|
18
18
|
const Panel_1 = require("./components/Panel");
|
|
@@ -927,7 +927,7 @@ exports.styles = (0, styled_components_1.css) `
|
|
|
927
927
|
${borders}
|
|
928
928
|
${Breadcrumbs_1.breadcrumbs}
|
|
929
929
|
${Button_1.button}
|
|
930
|
-
${
|
|
930
|
+
${styledVariables_1.catalog}
|
|
931
931
|
${CodeBlock_1.code}
|
|
932
932
|
${docsDropdown}
|
|
933
933
|
${Dropdown_1.dropdown}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"lodash.throttle": "^4.1.1",
|
|
23
23
|
"prismjs": "^1.28.0",
|
|
24
|
-
"react": "^17.0.
|
|
25
|
-
"react-dom": "^17.0.
|
|
24
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
25
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
26
26
|
"react-router-dom": "^6.10.0",
|
|
27
|
-
"styled-components": "^5.3.
|
|
27
|
+
"styled-components": "^4.1.1 || ^5.3.11",
|
|
28
28
|
"styled-system": "^5.1.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
@@ -40,21 +40,19 @@
|
|
|
40
40
|
"@storybook/react-webpack5": "^7.5.0",
|
|
41
41
|
"@storybook/testing-library": "^0.2.2",
|
|
42
42
|
"@storybook/theming": "^7.5.0",
|
|
43
|
-
"@testing-library/jest-dom": "^
|
|
44
|
-
"@testing-library/react": "^
|
|
45
|
-
"@testing-library/
|
|
46
|
-
"@testing-library/user-event": "^13.5.0",
|
|
43
|
+
"@testing-library/jest-dom": "^6.1.4",
|
|
44
|
+
"@testing-library/react": "^14.0.0",
|
|
45
|
+
"@testing-library/user-event": "^14.5.1",
|
|
47
46
|
"@types/highlight-words-core": "^1.2.1",
|
|
48
47
|
"@types/jest": "^29.2.1",
|
|
49
48
|
"@types/jest-when": "^3.5.2",
|
|
50
49
|
"@types/lodash.throttle": "^4.1.7",
|
|
51
50
|
"@types/node": "^18.11.18",
|
|
52
51
|
"@types/prismjs": "^1.26.0",
|
|
53
|
-
"@types/react": "^
|
|
54
|
-
"@types/react-dom": "^
|
|
55
|
-
"@types/styled-components": "^5.1.
|
|
52
|
+
"@types/react": "^18.2.31",
|
|
53
|
+
"@types/react-dom": "^18.2.14",
|
|
54
|
+
"@types/styled-components": "^5.1.30",
|
|
56
55
|
"@types/styled-system": "^5.1.13",
|
|
57
|
-
"@types/testing-library__jest-dom": "^5.14.5",
|
|
58
56
|
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
|
59
57
|
"@typescript-eslint/parser": "^5.23.0",
|
|
60
58
|
"chromatic": "^6.10.2",
|
|
@@ -71,7 +69,7 @@
|
|
|
71
69
|
"storybook": "^7.5.0",
|
|
72
70
|
"storybook-addon-pseudo-states": "^2.1.2",
|
|
73
71
|
"storybook-design-token": "3.0.0-beta.6",
|
|
74
|
-
"styled-components": "^5.3.
|
|
72
|
+
"styled-components": "^5.3.11",
|
|
75
73
|
"styled-system": "^5.1.5",
|
|
76
74
|
"ts-jest": "^29.0.3",
|
|
77
75
|
"ts-node": "^10.7.0",
|
|
@@ -81,7 +79,7 @@
|
|
|
81
79
|
"tsconfig-paths-webpack-plugin": "^3.5.2",
|
|
82
80
|
"typescript": "^5.2.2",
|
|
83
81
|
"webpack": "^5.72.0",
|
|
84
|
-
"@redocly/portal-types": "1.2.
|
|
82
|
+
"@redocly/portal-types": "1.2.1"
|
|
85
83
|
},
|
|
86
84
|
"dependencies": {
|
|
87
85
|
"@redocly/ajv": "^8.11.0",
|
|
@@ -42,7 +42,7 @@ export function useCatalog(items: ResolvedNavItem[], config: CatalogConfig): Fil
|
|
|
42
42
|
[items, config, customFields],
|
|
43
43
|
);
|
|
44
44
|
|
|
45
|
-
const toggleOption = React.useCallback((filterIdx, option) => {
|
|
45
|
+
const toggleOption = React.useCallback((filterIdx: number, option: any) => {
|
|
46
46
|
setFiltersState((prev) => {
|
|
47
47
|
const newFilterOptions = prev[filterIdx] ? prev[filterIdx] : new Set<string>();
|
|
48
48
|
if (!(newFilterOptions instanceof Set)) return prev;
|
|
@@ -58,7 +58,7 @@ export function useCatalog(items: ResolvedNavItem[], config: CatalogConfig): Fil
|
|
|
58
58
|
}, []);
|
|
59
59
|
|
|
60
60
|
const selectOption = React.useCallback(
|
|
61
|
-
(filterIdx, option) => {
|
|
61
|
+
(filterIdx: number, option: any) => {
|
|
62
62
|
setFiltersState((prev) => {
|
|
63
63
|
const newFilterOptions =
|
|
64
64
|
prev[filterIdx] instanceof Set
|
|
@@ -13,7 +13,7 @@ export interface CopyButtonProps {
|
|
|
13
13
|
data: unknown;
|
|
14
14
|
type?: ControlItemType;
|
|
15
15
|
toasterPlacement?: TooltipProps['placement'];
|
|
16
|
-
toasterText?:
|
|
16
|
+
toasterText?: string;
|
|
17
17
|
toasterDuration?: number;
|
|
18
18
|
buttonText?: string;
|
|
19
19
|
tooltipText?: string;
|
|
@@ -17,18 +17,17 @@ export function SuggestedPages({ className }: { className?: string }) {
|
|
|
17
17
|
{translate('theme.search.suggested', 'Suggested pages')}
|
|
18
18
|
</Title>
|
|
19
19
|
<SuggestedItems>
|
|
20
|
-
{pages.map(
|
|
21
|
-
|
|
22
|
-
page.
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
),
|
|
20
|
+
{pages.map((page) =>
|
|
21
|
+
page.link ? (
|
|
22
|
+
<Item key={page.label}>
|
|
23
|
+
<PageLink to={page.link} {...page}>
|
|
24
|
+
<Group>
|
|
25
|
+
<ClockBackwardsIcon />
|
|
26
|
+
{page.label}
|
|
27
|
+
</Group>
|
|
28
|
+
</PageLink>
|
|
29
|
+
</Item>
|
|
30
|
+
) : null,
|
|
32
31
|
)}
|
|
33
32
|
</SuggestedItems>
|
|
34
33
|
</Wrapper>
|
package/src/globalStyle.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { tag } from '@theme/components/Tag';
|
|
|
10
10
|
import { toc } from '@theme/components/TableOfContent';
|
|
11
11
|
import { navbar } from '@theme/components/Navbar';
|
|
12
12
|
import { search } from '@theme/components/Search';
|
|
13
|
-
import { catalog } from '@theme/components/Catalog';
|
|
13
|
+
import { catalog } from '@theme/components/Catalog/styledVariables'; // NOTE: For some reason only direct import works here
|
|
14
14
|
import { filter } from '@theme/components/Filter';
|
|
15
15
|
import { menu, mobileMenu } from '@theme/components/Menu';
|
|
16
16
|
import { apiReferencePanels, responsePanelColors } from '@theme/components/Panel';
|