@redocly/theme 0.31.3 → 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.
@@ -5,7 +5,7 @@ export interface CopyButtonProps {
5
5
  data: unknown;
6
6
  type?: ControlItemType;
7
7
  toasterPlacement?: TooltipProps['placement'];
8
- toasterText?: TooltipProps['tip'];
8
+ toasterText?: string;
9
9
  toasterDuration?: number;
10
10
  buttonText?: string;
11
11
  tooltipText?: string;
@@ -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 && (React.createElement(Item, { key: page.label },
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.31.3",
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.2",
25
- "react-dom": "^17.0.2",
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.7",
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": "^5.16.5",
44
- "@testing-library/react": "^12.1.4",
45
- "@testing-library/react-hooks": "^8.0.1",
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": "^17.0.43",
54
- "@types/react-dom": "^17.0.11",
55
- "@types/styled-components": "^5.1.26",
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.7",
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.0"
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?: TooltipProps['tip'];
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
- (page) =>
22
- page.link && (
23
- <Item key={page.label}>
24
- <PageLink to={page.link} {...page}>
25
- <Group>
26
- <ClockBackwardsIcon />
27
- {page.label}
28
- </Group>
29
- </PageLink>
30
- </Item>
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>