@redocly/theme 0.1.21 → 0.1.24

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.
Files changed (94) hide show
  1. package/Button/Button.d.ts +2 -2
  2. package/Button/Button.js +3 -3
  3. package/CodeBlock/CodeBlock.d.ts +3 -1
  4. package/CodeBlock/CodeBlock.js +3 -1
  5. package/CopyButton/CopyButton.js +1 -1
  6. package/Footer/Footer.js +4 -1
  7. package/JsonViewer/JsonViewer.d.ts +6 -2
  8. package/JsonViewer/JsonViewer.js +3 -1
  9. package/Markdown/{StyledMarkdown.d.ts → MarkdownWrapper.d.ts} +1 -1
  10. package/Markdown/{StyledMarkdown.js → MarkdownWrapper.js} +3 -3
  11. package/Markdown/index.d.ts +1 -1
  12. package/Markdown/index.js +1 -1
  13. package/Navbar/Navbar.d.ts +1 -1
  14. package/Navbar/Navbar.js +6 -3
  15. package/OperationBadge/OperationBadge.d.ts +2 -1
  16. package/OperationBadge/OperationBadge.js +1 -0
  17. package/PageNavigation/NextPageLink.js +2 -3
  18. package/PageNavigation/PreviousPageLink.js +2 -3
  19. package/Panel/CodePanel.d.ts +5 -1
  20. package/Panel/CodePanel.js +3 -1
  21. package/Panel/ContentPanel.d.ts +5 -1
  22. package/Panel/ContentPanel.js +3 -1
  23. package/Panel/Panel.d.ts +3 -1
  24. package/Panel/Panel.js +3 -1
  25. package/Panel/PanelBody.d.ts +3 -1
  26. package/Panel/PanelBody.js +3 -1
  27. package/Panel/PanelComponent.js +1 -1
  28. package/Panel/PanelHeader.d.ts +3 -1
  29. package/Panel/PanelHeader.js +3 -1
  30. package/Panel/PanelHeaderTitle.d.ts +3 -1
  31. package/Panel/PanelHeaderTitle.js +3 -1
  32. package/SamplesPanelControls/SamplesPanelControls.d.ts +6 -2
  33. package/SamplesPanelControls/SamplesPanelControls.js +3 -1
  34. package/Search/ClearIcon.d.ts +3 -1
  35. package/Search/ClearIcon.js +3 -1
  36. package/Search/SearchIcon.d.ts +3 -1
  37. package/Search/SearchIcon.js +3 -1
  38. package/Search/SidebarSearch.d.ts +3 -1
  39. package/Search/SidebarSearch.js +3 -1
  40. package/Sidebar/ApiCallItem.d.ts +2 -1
  41. package/Sidebar/MenuContainer.d.ts +3 -1
  42. package/Sidebar/MenuContainer.js +3 -1
  43. package/Sidebar/SeparatorItem.d.ts +2 -0
  44. package/Sidebar/SeparatorItem.js +3 -1
  45. package/Sidebar/SidebarLayout.d.ts +1 -1
  46. package/Sidebar/SidebarLayout.js +5 -2
  47. package/SidebarLogo/SidebarLogo.js +1 -1
  48. package/SourceCode/SourceCode.js +2 -2
  49. package/Tooltip/Tooltip.js +1 -1
  50. package/Typography/H1.js +1 -1
  51. package/Typography/H2.js +1 -1
  52. package/Typography/H3.js +1 -1
  53. package/Typography/SectionHeader.d.ts +3 -1
  54. package/Typography/SectionHeader.js +3 -1
  55. package/icons/ShelfIcon/ShelfIcon.d.ts +3 -1
  56. package/icons/ShelfIcon/ShelfIcon.js +3 -1
  57. package/mocks/hooks/index.d.ts +9 -0
  58. package/mocks/hooks/index.js +16 -1
  59. package/package.json +1 -1
  60. package/settings.yaml +6 -0
  61. package/src/Button/Button.tsx +4 -2
  62. package/src/CodeBlock/CodeBlock.ts +3 -1
  63. package/src/CopyButton/CopyButton.tsx +6 -1
  64. package/src/Footer/Footer.tsx +5 -1
  65. package/src/JsonViewer/JsonViewer.tsx +3 -1
  66. package/src/Markdown/{StyledMarkdown.tsx → MarkdownWrapper.tsx} +2 -2
  67. package/src/Markdown/index.ts +1 -1
  68. package/src/Navbar/Navbar.tsx +8 -4
  69. package/src/OperationBadge/OperationBadge.ts +1 -0
  70. package/src/PageNavigation/NextPageLink.tsx +11 -7
  71. package/src/PageNavigation/PreviousPageLink.tsx +10 -6
  72. package/src/Panel/CodePanel.ts +3 -1
  73. package/src/Panel/ContentPanel.ts +3 -1
  74. package/src/Panel/Panel.ts +3 -1
  75. package/src/Panel/PanelBody.ts +3 -1
  76. package/src/Panel/PanelComponent.tsx +1 -0
  77. package/src/Panel/PanelHeader.ts +3 -1
  78. package/src/Panel/PanelHeaderTitle.ts +3 -1
  79. package/src/SamplesPanelControls/SamplesPanelControls.ts +3 -1
  80. package/src/Search/ClearIcon.tsx +3 -1
  81. package/src/Search/SearchIcon.tsx +3 -1
  82. package/src/Search/SidebarSearch.tsx +3 -1
  83. package/src/Sidebar/MenuContainer.tsx +3 -1
  84. package/src/Sidebar/SeparatorItem.tsx +3 -1
  85. package/src/Sidebar/SidebarLayout.tsx +9 -5
  86. package/src/SidebarLogo/SidebarLogo.tsx +5 -1
  87. package/src/SourceCode/SourceCode.tsx +9 -2
  88. package/src/Tooltip/Tooltip.tsx +1 -0
  89. package/src/Typography/H1.ts +1 -1
  90. package/src/Typography/H2.ts +1 -1
  91. package/src/Typography/H3.ts +1 -1
  92. package/src/Typography/SectionHeader.ts +3 -1
  93. package/src/icons/ShelfIcon/ShelfIcon.tsx +3 -1
  94. package/src/mocks/hooks/index.ts +21 -0
@@ -50,6 +50,7 @@ export function TooltipComponent({
50
50
  onMouseLeave={isControlled ? undefined : handleLeave}
51
51
  onClick={isControlled ? undefined : handleLeave}
52
52
  className={`tooltip-${className}`}
53
+ data-component-name="Tooltip/Tooltip"
53
54
  >
54
55
  {children}
55
56
  {isOpened && (
@@ -3,7 +3,7 @@ import styled from 'styled-components';
3
3
  import { typography } from '@theme/utils';
4
4
 
5
5
  export const H1 = styled.h1.attrs(() => ({
6
- 'data-component-name': 'Headings/H1',
6
+ 'data-component-name': 'Typography/H1',
7
7
  }))`
8
8
  color: var(--color-content);
9
9
  margin: 0 0 25px;
@@ -3,7 +3,7 @@ import styled from 'styled-components';
3
3
  import { typography } from '@theme/utils';
4
4
 
5
5
  export const H2 = styled.h2.attrs(() => ({
6
- 'data-component-name': 'Headings/H2',
6
+ 'data-component-name': 'Typography/H2',
7
7
  }))`
8
8
  color: var(--color-content);
9
9
  margin: 0 0 20px;
@@ -3,7 +3,7 @@ import styled from 'styled-components';
3
3
  import { typography } from '@theme/utils';
4
4
 
5
5
  export const H3 = styled.h3.attrs(() => ({
6
- 'data-component-name': 'Headings/H3',
6
+ 'data-component-name': 'Typography/H3',
7
7
  }))`
8
8
  color: var(--color-content);
9
9
 
@@ -1,6 +1,8 @@
1
1
  import styled from 'styled-components';
2
2
 
3
- export const SectionHeader = styled.h2`
3
+ export const SectionHeader = styled.h2.attrs(() => ({
4
+ 'data-component-name': 'Typography/SectionHeader',
5
+ }))`
4
6
  color: var(--h-color);
5
7
  font-size: 1.75em;
6
8
  font-weight: var(--font-weight-regular);
@@ -32,7 +32,9 @@ const IntShelfIcon = ({ className, style }: ShelfIconProps): JSX.Element => (
32
32
  </svg>
33
33
  );
34
34
 
35
- export const ShelfIcon = styled(IntShelfIcon)`
35
+ export const ShelfIcon = styled(IntShelfIcon).attrs(() => ({
36
+ 'data-component-name': 'icons/ShelfIcon/ShelfIcon',
37
+ }))`
36
38
  ${({ size = '9px', float = '', direction, color }) => css`
37
39
  height: ${size};
38
40
  width: ${size};
@@ -3,6 +3,12 @@ interface RawTheme {
3
3
  settings?: any;
4
4
  }
5
5
 
6
+ interface PageLink {
7
+ label: string;
8
+ link: string;
9
+ type: 'link';
10
+ }
11
+
6
12
  export function useThemeSettings(name: string): RawTheme['settings'] {
7
13
  return {
8
14
  name,
@@ -15,3 +21,18 @@ export function useThemeSettings(name: string): RawTheme['settings'] {
15
21
  },
16
22
  };
17
23
  }
24
+
25
+ export function useSidebarSiblingsData(): { nextPage: PageLink; prevPage: PageLink } {
26
+ return {
27
+ nextPage: {
28
+ type: 'link',
29
+ label: 'Page',
30
+ link: '#next',
31
+ },
32
+ prevPage: {
33
+ type: 'link',
34
+ label: 'Page',
35
+ link: '#prev',
36
+ },
37
+ };
38
+ }