@redocly/theme 0.9.0-beta.3 → 0.9.0-beta.5

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 (126) hide show
  1. package/lib/Button/Button.d.ts +1 -1
  2. package/lib/Button/Button.js +14 -2
  3. package/lib/Cards/Card.d.ts +1 -0
  4. package/lib/Catalog/Catalog.d.ts +1 -0
  5. package/lib/Catalog/CatalogCard.d.ts +1 -0
  6. package/lib/Catalog/Filter.d.ts +1 -0
  7. package/lib/Catalog/Filter.js +1 -3
  8. package/lib/Catalog/Tags.d.ts +1 -0
  9. package/lib/ColorModeSwitcher/ColorModeSwitcher.d.ts +1 -0
  10. package/lib/CopyButton/CopyButton.d.ts +1 -0
  11. package/lib/EditPageButton/EditPageButton.d.ts +1 -0
  12. package/lib/Feedback/Comment.d.ts +1 -0
  13. package/lib/Feedback/Rating.d.ts +1 -0
  14. package/lib/Feedback/Reasons.d.ts +1 -0
  15. package/lib/Feedback/ReportDialog.d.ts +1 -0
  16. package/lib/Feedback/Sentiment.d.ts +1 -0
  17. package/lib/Feedback/Thumbs.d.ts +1 -0
  18. package/lib/Footer/CustomFooter.d.ts +1 -0
  19. package/lib/Footer/CustomFooterNavItem.d.ts +1 -0
  20. package/lib/Footer/Footer.d.ts +1 -0
  21. package/lib/Footer/FooterColumn.d.ts +1 -0
  22. package/lib/Footer/FooterColumns.d.ts +1 -0
  23. package/lib/Footer/FooterCopyright.d.ts +1 -0
  24. package/lib/LastUpdated/LastUpdated.d.ts +1 -0
  25. package/lib/Markdown/Admonition.d.ts +4 -1
  26. package/lib/Markdown/Admonition.js +2 -2
  27. package/lib/Markdown/CodeSample/CodeSample.d.ts +4 -1
  28. package/lib/Markdown/CodeSample/CodeSample.js +2 -2
  29. package/lib/Markdown/Heading.d.ts +3 -1
  30. package/lib/Markdown/Heading.js +6 -4
  31. package/lib/Markdown/Mermaid.d.ts +4 -1
  32. package/lib/Markdown/Mermaid.js +2 -2
  33. package/lib/Markdown/Tabs/Tab.d.ts +1 -0
  34. package/lib/Navbar/MobileNavbarDropdown.d.ts +1 -0
  35. package/lib/Navbar/MobileNavbarItem.d.ts +1 -0
  36. package/lib/Navbar/MobileNavbarMenuButton.d.ts +1 -0
  37. package/lib/Navbar/NavbarDropdown.d.ts +1 -0
  38. package/lib/Navbar/NavbarItem.d.ts +1 -0
  39. package/lib/Navbar/NavbarMenu.d.ts +1 -0
  40. package/lib/NavbarLogo/NavbarLogo.d.ts +1 -0
  41. package/lib/PageNavigation/NextButton.d.ts +1 -0
  42. package/lib/PageNavigation/PageNavigation.d.ts +1 -0
  43. package/lib/PageNavigation/PreviousButton.d.ts +1 -0
  44. package/lib/Pages/Forbidden.d.ts +1 -0
  45. package/lib/Pages/NotFound.d.ts +1 -0
  46. package/lib/Profile/LoginLink.d.ts +1 -0
  47. package/lib/Profile/Profile.js +1 -1
  48. package/lib/Profile/UserProfile.d.ts +1 -0
  49. package/lib/ReferenceDocs/ClearButton.d.ts +8 -0
  50. package/lib/ReferenceDocs/ClearButton.js +48 -0
  51. package/lib/ReferenceDocs/DevOnboardingTryItSecurity.d.ts +3 -0
  52. package/lib/ReferenceDocs/DevOnboardingTryItSecurity.js +158 -0
  53. package/lib/ReferenceDocs/Dropdown.d.ts +28 -0
  54. package/lib/ReferenceDocs/Dropdown.js +150 -0
  55. package/lib/ReferenceDocs/TryItSecurity.d.ts +7 -2
  56. package/lib/ReferenceDocs/TryItSecurity.js +11 -1
  57. package/lib/ReferenceDocs/index.d.ts +1 -0
  58. package/lib/ReferenceDocs/index.js +18 -0
  59. package/lib/Search/Parameters.d.ts +1 -0
  60. package/lib/Search/Search.d.ts +1 -0
  61. package/lib/Search/SearchItem.d.ts +1 -0
  62. package/lib/Search/ShortcutKey.d.ts +1 -0
  63. package/lib/Search/utils.d.ts +1 -0
  64. package/lib/Sidebar/ApiCallItem.d.ts +1 -0
  65. package/lib/Sidebar/ArrowBack.d.ts +1 -0
  66. package/lib/Sidebar/DrilldownMenuItem.d.ts +1 -0
  67. package/lib/Sidebar/ExternalIcon.d.ts +1 -0
  68. package/lib/Sidebar/FooterWrapper.d.ts +3 -0
  69. package/lib/Sidebar/FooterWrapper.js +15 -0
  70. package/lib/Sidebar/HeaderWrapper.d.ts +3 -0
  71. package/lib/Sidebar/HeaderWrapper.js +15 -0
  72. package/lib/Sidebar/MenuGroup.js +1 -1
  73. package/lib/Sidebar/MenuItem.d.ts +1 -0
  74. package/lib/Sidebar/Separator.d.ts +1 -0
  75. package/lib/Sidebar/SidebarLayout.d.ts +1 -1
  76. package/lib/Sidebar/SidebarLayout.js +5 -42
  77. package/lib/Sidebar/index.d.ts +2 -0
  78. package/lib/Sidebar/index.js +2 -0
  79. package/lib/SidebarLogo/SidebarLogo.d.ts +1 -0
  80. package/lib/SourceCode/SourceCode.d.ts +1 -0
  81. package/lib/TableOfContent/TableOfContent.d.ts +1 -0
  82. package/lib/globalStyle.js +2 -1
  83. package/lib/icons/AlertIcon/AlertIcon.d.ts +1 -0
  84. package/lib/icons/AnchorIcon/AnchorIcon.d.ts +7 -0
  85. package/lib/icons/AnchorIcon/AnchorIcon.js +23 -0
  86. package/lib/icons/AnchorIcon/index.d.ts +2 -0
  87. package/lib/icons/AnchorIcon/index.js +6 -0
  88. package/lib/icons/ArrowIcon/ArrowIcon.d.ts +2 -0
  89. package/lib/icons/ArrowIcon/ArrowIcon.js +1 -0
  90. package/lib/icons/ColorModeIcon/ColorModeIcon.d.ts +1 -0
  91. package/lib/icons/index.d.ts +1 -0
  92. package/lib/icons/index.js +1 -0
  93. package/lib/index.d.ts +2 -0
  94. package/lib/index.js +2 -0
  95. package/lib/mocks/Link.d.ts +1 -0
  96. package/lib/mocks/hooks/index.d.ts +1 -1
  97. package/lib/mocks/hooks/index.js +3 -1
  98. package/lib/mocks/useGlobalData.d.ts +1 -0
  99. package/lib/mocks/useGlobalData.js +9 -0
  100. package/lib/ui/Dropdown.d.ts +1 -0
  101. package/package.json +1 -1
  102. package/src/Button/Button.tsx +22 -5
  103. package/src/Catalog/Filter.tsx +1 -1
  104. package/src/Markdown/Admonition.tsx +13 -1
  105. package/src/Markdown/CodeSample/CodeSample.tsx +15 -2
  106. package/src/Markdown/Heading.tsx +12 -18
  107. package/src/Markdown/Mermaid.tsx +9 -1
  108. package/src/Profile/Profile.tsx +1 -1
  109. package/src/ReferenceDocs/ClearButton.tsx +30 -0
  110. package/src/ReferenceDocs/DevOnboardingTryItSecurity.tsx +161 -0
  111. package/src/ReferenceDocs/Dropdown.tsx +202 -0
  112. package/src/ReferenceDocs/TryItSecurity.tsx +16 -3
  113. package/src/ReferenceDocs/index.ts +1 -0
  114. package/src/Sidebar/FooterWrapper.tsx +9 -0
  115. package/src/Sidebar/HeaderWrapper.tsx +9 -0
  116. package/src/Sidebar/MenuGroup.tsx +4 -1
  117. package/src/Sidebar/SidebarLayout.tsx +2 -46
  118. package/src/Sidebar/index.ts +2 -0
  119. package/src/globalStyle.ts +2 -1
  120. package/src/icons/AnchorIcon/AnchorIcon.tsx +36 -0
  121. package/src/icons/AnchorIcon/index.ts +2 -0
  122. package/src/icons/ArrowIcon/ArrowIcon.tsx +2 -0
  123. package/src/icons/index.ts +1 -0
  124. package/src/index.ts +2 -0
  125. package/src/mocks/hooks/index.ts +2 -0
  126. package/src/mocks/useGlobalData.tsx +4 -0
@@ -2,14 +2,13 @@ import React from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import { Sidebar } from '@theme/Sidebar/Sidebar';
5
+ import { FooterWrapper } from '@theme/Sidebar/FooterWrapper';
6
+ import { HeaderWrapper } from '@theme/Sidebar/HeaderWrapper';
5
7
  import { useMobileMenu } from '@theme/hooks/useMobileMenu';
6
8
  import { MobileSidebarButton } from '@theme/Sidebar/MobileSidebarButton';
7
9
  import { MenuContainer } from '@theme/Sidebar/MenuContainer';
8
10
  import { SidebarSearch } from '@theme/Search/SidebarSearch';
9
11
  import { useThemeConfig } from '@theme/hooks/useThemeConfig';
10
- import { ArrowBack } from '@theme/Sidebar/ArrowBack';
11
- import { Link } from '@portal/Link';
12
- import { Button } from '@theme/Button/Button';
13
12
 
14
13
  interface SidebarLayoutProps {
15
14
  versions: React.ReactNode;
@@ -28,7 +27,6 @@ interface SidebarLayoutProps {
28
27
  export function SidebarLayout({
29
28
  versions,
30
29
  menu,
31
- backLink,
32
30
  footer,
33
31
  header,
34
32
  growContent,
@@ -49,15 +47,6 @@ export function SidebarLayout({
49
47
  {!search?.hide && search?.placement === 'sidebar' ? <SidebarSearch /> : null}
50
48
  <Sidebar animate={true} opened={isOpen} hasNavbar={hasNavbar}>
51
49
  {header ? <HeaderWrapper>{header}</HeaderWrapper> : null}
52
- {(backLink && (
53
- <BackLinkWrapper>
54
- <Link to={backLink.slug}>
55
- <ArrowBack />
56
- Back to {backLink.label}
57
- </Link>
58
- </BackLinkWrapper>
59
- )) ||
60
- null}
61
50
  {versions}
62
51
  <MenuContainer growContent={growContent}>{menu}</MenuContainer>
63
52
  {footer ? <FooterWrapper>{footer}</FooterWrapper> : null}
@@ -66,37 +55,4 @@ export function SidebarLayout({
66
55
  );
67
56
  }
68
57
 
69
- const FooterWrapper = styled.div`
70
- padding: var(--sidebar-offset-top) var(--sidebar-item-padding-horizontal)
71
- var(--sidebar-item-padding-horizontal) var(--sidebar-offset-left);
72
-
73
- ${Button} {
74
- width: 100%;
75
- margin: 0;
76
- }
77
- `;
78
-
79
- const HeaderWrapper = styled.div`
80
- padding: var(--sidebar-offset-top) var(--sidebar-item-padding-horizontal)
81
- var(--sidebar-item-padding-horizontal) var(--sidebar-offset-left);
82
- `;
83
-
84
- const BackLinkWrapper = styled.div`
85
- padding: var(--sidebar-offset-top) var(--sidebar-item-padding-horizontal)
86
- var(--sidebar-item-padding-horizontal)
87
- calc(var(--sidebar-offset-left) + var(--sidebar-item-padding-horizontal));
88
-
89
- a {
90
- color: var(--sidebar-back-button-text-color);
91
- font-size: var(--sidebar-back-button-font-size);
92
- font-family: var(--sidebar-back-button-font-family);
93
- text-decoration: none;
94
- &:hover {
95
- color: var(--sidebar-back-button-hover-text-color);
96
- }
97
- }
98
-
99
- border-bottom: 1px solid var(--sidebar-border-color);
100
- `;
101
-
102
58
  const Wrapper = styled.div``;
@@ -17,3 +17,5 @@ export * from '@theme/Sidebar/Separator';
17
17
  export * from '@theme/Sidebar/SeparatorItem';
18
18
  export * from '@theme/Sidebar/Sidebar';
19
19
  export * from '@theme/Sidebar/SidebarLayout';
20
+ export * from '@theme/Sidebar/FooterWrapper';
21
+ export * from '@theme/Sidebar/HeaderWrapper';
@@ -880,6 +880,7 @@ const apiReferencePanels = css`
880
880
  */
881
881
 
882
882
  .panel-try-it,
883
+ .panel-pull-right,
883
884
  .panel-request-samples,
884
885
  .panel-response-samples,
885
886
  .panel-callback-samples {
@@ -1677,7 +1678,7 @@ const loadProgressBar = css`
1677
1678
  #nprogress .peg {
1678
1679
  display: block;
1679
1680
  position: absolute;
1680
- right: 0px;
1681
+ right: 0;
1681
1682
  width: 100px;
1682
1683
  height: 100%;
1683
1684
  box-shadow: var(--load-progress-bar-shadow);
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ export interface AnchorIconProps {
5
+ className?: string;
6
+ }
7
+
8
+ const Icon = ({ className }: AnchorIconProps) => (
9
+ <svg
10
+ aria-hidden="true"
11
+ focusable="false"
12
+ height="16"
13
+ version="1.1"
14
+ viewBox="0 0 16 16"
15
+ width="16"
16
+ className={className}
17
+ >
18
+ <path
19
+ fillRule="evenodd"
20
+ d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"
21
+ />
22
+ </svg>
23
+ );
24
+
25
+ export const AnchorIcon = styled(Icon).attrs(() => ({
26
+ 'data-component-name': 'icons/AnchorIcon/AnchorIcon',
27
+ }))`
28
+ fill: var(--heading-anchor-color);
29
+ visibility: hidden;
30
+ cursor: pointer;
31
+
32
+ background-image: var(--heading-anchor-icon);
33
+ background-size: contain;
34
+ background-repeat: no-repeat;
35
+ background-position: center;
36
+ `;
@@ -0,0 +1,2 @@
1
+ export { AnchorIcon } from '@theme/icons/AnchorIcon/AnchorIcon';
2
+ export type { AnchorIconProps } from '@theme/icons/AnchorIcon/AnchorIcon';
@@ -3,6 +3,7 @@ import styled from 'styled-components';
3
3
 
4
4
  export interface ArrowIconProps {
5
5
  direction?: 'up' | 'right' | 'left' | 'down';
6
+ visibility?: 'visible' | 'hidden';
6
7
  }
7
8
 
8
9
  function directionToTransform({ direction }: ArrowIconProps) {
@@ -31,6 +32,7 @@ export const ArrowIcon = styled(Icon)`
31
32
  height: var(--sidebar-group-item-chevron-size);
32
33
  fill: var(--sidebar-group-item-chevron-color);
33
34
  transform: rotate(${directionToTransform}deg);
35
+ visibility: ${({ visibility = 'visible' }) => visibility};
34
36
 
35
37
  vertical-align: middle;
36
38
  `;
@@ -2,3 +2,4 @@ export * from '@theme/icons/ShelfIcon';
2
2
  export * from '@theme/icons/AlertIcon';
3
3
  export * from '@theme/icons/ArrowIcon';
4
4
  export * from '@theme/icons/ColorModeIcon';
5
+ export * from '@theme/icons/AnchorIcon';
package/src/index.ts CHANGED
@@ -22,3 +22,5 @@ export * from './Sidebar';
22
22
  export * from './types/config';
23
23
  export * from './config';
24
24
  export * from './Pages';
25
+ export * from './Markdown';
26
+ export * from './ReferenceDocs';
@@ -74,3 +74,5 @@ export function usePageSharedData<T = unknown>(_id: string): T {
74
74
  export function useCatalog(_items: ResolvedNavItem[], _config: CatalogConfig): FilteredCatalog {
75
75
  throw new Error('Mock not implemented yet.');
76
76
  }
77
+
78
+ export { useGlobalData } from '../useGlobalData';
@@ -0,0 +1,4 @@
1
+ export function useGlobalData(): Record<string, unknown> {
2
+ console.log('>>>> mock');
3
+ return {};
4
+ }