@redocly/theme 0.3.0 → 0.4.2
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/Button/Button.js +3 -3
- package/CodeBlock/CodeBlock.js +1 -1
- package/ColorModeSwitcher/ColorModeSwitcher.js +1 -1
- package/Footer/Footer.js +1 -1
- package/Footer/FooterColumn.js +4 -4
- package/Footer/FooterColumns.js +1 -1
- package/Footer/FooterCopyright.js +1 -1
- package/JsonViewer/JsonViewer.js +1 -1
- package/LastUpdated/LastUpdated.d.ts +5 -0
- package/LastUpdated/LastUpdated.js +28 -0
- package/Markdown/Admonition.js +3 -3
- package/Markdown/CodeSample/CodeSample.js +3 -3
- package/Markdown/ContainerWrapper.d.ts +5 -0
- package/Markdown/ContainerWrapper.js +21 -0
- package/Markdown/MarkdownLayout.js +2 -2
- package/Markdown/MarkdownWrapper.js +3 -3
- package/Markdown/index.d.ts +1 -1
- package/Markdown/index.js +1 -1
- package/Navbar/MobileNavbarItem.js +1 -1
- package/Navbar/MobileNavbarMenu.js +6 -6
- package/Navbar/Navbar.d.ts +1 -0
- package/Navbar/Navbar.js +10 -8
- package/Navbar/NavbarDropdown.js +1 -1
- package/Navbar/NavbarItem.d.ts +3 -3
- package/Navbar/NavbarItem.js +17 -14
- package/Navbar/NavbarMenu.js +1 -1
- package/NavbarLogo/NavbarLogo.js +1 -1
- package/OperationBadge/OperationBadge.js +1 -1
- package/Panel/Panel.d.ts +2 -1
- package/Panel/Panel.js +8 -3
- package/Panel/PanelBody.js +1 -1
- package/Panel/PanelComponent.d.ts +4 -2
- package/Panel/PanelComponent.js +6 -5
- package/Panel/PanelHeader.d.ts +1 -1
- package/Panel/PanelHeader.js +3 -3
- package/Panel/PanelHeaderTitle.js +1 -1
- package/Panel/index.d.ts +0 -3
- package/Panel/index.js +0 -3
- package/Profile/Profile.js +1 -1
- package/SamplesPanelControls/SamplesPanelControls.js +6 -4
- package/Search/Autocomplete.js +1 -1
- package/Search/Input.js +1 -1
- package/Search/Parameters.js +1 -1
- package/Search/Popover.js +1 -1
- package/Search/Search.js +1 -1
- package/Search/SearchItem.js +3 -3
- package/Search/utils.js +1 -1
- package/Sidebar/ApiCallItem.js +1 -1
- package/Sidebar/ArrowBack.js +1 -1
- package/Sidebar/BackButton.js +1 -1
- package/Sidebar/Drilldown.js +1 -1
- package/Sidebar/DrilldownMenu.js +2 -2
- package/Sidebar/DrilldownMenuItem.js +3 -3
- package/Sidebar/ExternalIcon.js +1 -1
- package/Sidebar/Menu.js +1 -1
- package/Sidebar/MenuContainer.js +1 -1
- package/Sidebar/MenuGroup.js +6 -2
- package/Sidebar/MenuItemLabel.js +1 -1
- package/Sidebar/MenuLink.js +1 -1
- package/Sidebar/SeparatorItem.js +1 -1
- package/Sidebar/SeparatorLine.js +1 -1
- package/Sidebar/Sidebar.js +1 -1
- package/SidebarLogo/SidebarLogo.js +1 -1
- package/TableOfContent/TableOfContent.js +5 -5
- package/Tooltip/Tooltip.js +1 -1
- package/Typography/H1.js +1 -1
- package/Typography/H2.js +1 -1
- package/Typography/H3.js +1 -1
- package/Typography/SectionHeader.js +1 -1
- package/Typography/Typography.js +1 -1
- package/globalStyle.js +28 -25
- package/icons/ArrowIcon/ArrowIcon.js +1 -1
- package/package.json +1 -1
- package/src/Button/Button.tsx +14 -6
- package/src/CodeBlock/CodeBlock.ts +2 -4
- package/src/ColorModeSwitcher/ColorModeSwitcher.tsx +1 -1
- package/src/Footer/Footer.tsx +3 -2
- package/src/Footer/FooterColumn.tsx +13 -9
- package/src/Footer/FooterColumns.tsx +2 -2
- package/src/Footer/FooterCopyright.tsx +1 -1
- package/src/JsonViewer/JsonViewer.tsx +5 -5
- package/src/LastUpdated/LastUpdated.tsx +32 -0
- package/src/Markdown/Admonition.tsx +3 -2
- package/src/Markdown/CodeSample/CodeSample.tsx +18 -17
- package/src/Markdown/{ContentWrapper.tsx → ContainerWrapper.tsx} +4 -4
- package/src/Markdown/MarkdownLayout.tsx +3 -3
- package/src/Markdown/MarkdownWrapper.tsx +87 -47
- package/src/Markdown/index.ts +1 -1
- package/src/Navbar/MobileNavbarItem.tsx +1 -3
- package/src/Navbar/MobileNavbarMenu.tsx +19 -17
- package/src/Navbar/Navbar.tsx +19 -10
- package/src/Navbar/NavbarDropdown.tsx +2 -1
- package/src/Navbar/NavbarItem.tsx +41 -24
- package/src/Navbar/NavbarMenu.tsx +1 -1
- package/src/NavbarLogo/NavbarLogo.tsx +4 -4
- package/src/OperationBadge/OperationBadge.ts +8 -9
- package/src/Panel/Panel.ts +17 -3
- package/src/Panel/PanelBody.ts +13 -5
- package/src/Panel/PanelComponent.tsx +6 -1
- package/src/Panel/PanelHeader.ts +13 -6
- package/src/Panel/PanelHeaderTitle.ts +6 -4
- package/src/Panel/index.ts +0 -3
- package/src/Profile/Profile.tsx +1 -1
- package/src/SamplesPanelControls/SamplesPanelControls.ts +9 -9
- package/src/Search/Autocomplete.tsx +1 -1
- package/src/Search/Input.tsx +7 -2
- package/src/Search/Parameters.tsx +1 -1
- package/src/Search/Popover.tsx +3 -3
- package/src/Search/Search.tsx +3 -1
- package/src/Search/SearchItem.tsx +14 -9
- package/src/Search/utils.tsx +1 -1
- package/src/Sidebar/ApiCallItem.tsx +7 -0
- package/src/Sidebar/ArrowBack.tsx +1 -1
- package/src/Sidebar/BackButton.tsx +10 -5
- package/src/Sidebar/Drilldown.tsx +1 -3
- package/src/Sidebar/DrilldownMenu.tsx +2 -2
- package/src/Sidebar/DrilldownMenuItem.tsx +12 -8
- package/src/Sidebar/ExternalIcon.tsx +1 -1
- package/src/Sidebar/Menu.tsx +1 -1
- package/src/Sidebar/MenuContainer.tsx +1 -1
- package/src/Sidebar/MenuGroup.tsx +12 -2
- package/src/Sidebar/MenuItemLabel.tsx +7 -7
- package/src/Sidebar/MenuLink.tsx +1 -1
- package/src/Sidebar/SeparatorItem.tsx +5 -1
- package/src/Sidebar/SeparatorLine.tsx +2 -2
- package/src/Sidebar/Sidebar.tsx +4 -4
- package/src/SidebarLogo/SidebarLogo.tsx +3 -3
- package/src/TableOfContent/TableOfContent.tsx +18 -16
- package/src/Tooltip/Tooltip.tsx +2 -2
- package/src/Typography/H1.ts +2 -2
- package/src/Typography/H2.ts +2 -2
- package/src/Typography/H3.ts +2 -1
- package/src/Typography/SectionHeader.ts +4 -4
- package/src/Typography/Typography.ts +1 -1
- package/src/globalStyle.ts +1359 -348
- package/src/icons/ArrowIcon/ArrowIcon.tsx +3 -3
- package/src/settings.yaml +2 -0
- package/src/ui/Background.tsx +1 -1
- package/src/ui/Dropdown.tsx +6 -6
- package/src/ui/Jumbotron.tsx +1 -1
- package/src/ui/Tiles/TileHeader.ts +5 -5
- package/src/ui/Tiles/TileText.tsx +1 -1
- package/src/ui/UniversalLink.tsx +1 -1
- package/src/utils/theme-helpers.ts +1 -1
- package/ui/Background.js +1 -1
- package/ui/Dropdown.js +4 -4
- package/ui/Jumbotron.js +1 -1
- package/ui/Tiles/TileHeader.js +1 -1
- package/ui/Tiles/TileText.js +1 -1
- package/ui/UniversalLink.js +1 -1
- package/utils/theme-helpers.js +1 -1
- package/Markdown/ContentWrapper.d.ts +0 -5
- package/Markdown/ContentWrapper.js +0 -21
- package/Panel/CodePanel.d.ts +0 -5
- package/Panel/CodePanel.js +0 -21
- package/Panel/ContentPanel.d.ts +0 -5
- package/Panel/ContentPanel.js +0 -20
- package/Panel/DarkHeader.d.ts +0 -1
- package/Panel/DarkHeader.js +0 -10
- package/src/Panel/CodePanel.ts +0 -34
- package/src/Panel/ContentPanel.ts +0 -44
- package/src/Panel/DarkHeader.ts +0 -8
|
@@ -72,12 +72,10 @@ export const NavMenuItem = styled.li<{ active?: boolean }>`
|
|
|
72
72
|
display: flex;
|
|
73
73
|
justify-content: space-between;
|
|
74
74
|
align-items: center;
|
|
75
|
-
padding:
|
|
75
|
+
padding: var(--navbar-item-padding-horizontal);
|
|
76
76
|
text-align: left;
|
|
77
77
|
line-height: 1;
|
|
78
78
|
font-size: var(--navbar-item-font-size);
|
|
79
|
-
margin-left: var(--navbar-item-margin-horizontal);
|
|
80
|
-
margin-right: var(--navbar-item-margin-horizontal);
|
|
81
79
|
font-weight: var(--navbar-item-font-weight);
|
|
82
80
|
background: ${({ active }) => (active ? 'var(--navbar-item-active-background-color)' : 'none')};
|
|
83
81
|
&:not(:last-child) {
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import type { ResolvedConfigLinks, ResolvedNavItem } from '@theme/types/portal';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { NavbarMenuItem, NavbarMenuItemWithDropdownWrapper } from '@theme/Navbar/NavbarItem';
|
|
7
7
|
import { MobileNavbarItem } from '@theme/Navbar/MobileNavbarItem';
|
|
8
8
|
import { DropdownWrapper } from '@theme/Navbar/NavbarDropdown';
|
|
9
9
|
import { isPrimitive, isEmptyArray } from '@theme/utils';
|
|
@@ -20,8 +20,8 @@ export function MobileNavbarMenu({
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
|
-
<
|
|
24
|
-
<
|
|
23
|
+
<NavbarItemsWrapper data-component-name="Navbar/MobileNavbarMenu">
|
|
24
|
+
<NavbarItemsContainer>
|
|
25
25
|
{(menuItems as ResolvedNavItem[]).map((navItem, index) => {
|
|
26
26
|
return (
|
|
27
27
|
<MobileNavbarItem
|
|
@@ -31,13 +31,13 @@ export function MobileNavbarMenu({
|
|
|
31
31
|
/>
|
|
32
32
|
);
|
|
33
33
|
})}
|
|
34
|
-
</
|
|
35
|
-
<
|
|
36
|
-
</
|
|
34
|
+
</NavbarItemsContainer>
|
|
35
|
+
<NavbarItemsClosableArea onClick={closeMenu} />
|
|
36
|
+
</NavbarItemsWrapper>
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const
|
|
40
|
+
const NavbarItemsWrapper = styled.div`
|
|
41
41
|
height: 100%;
|
|
42
42
|
width: 100%;
|
|
43
43
|
position: fixed;
|
|
@@ -63,7 +63,7 @@ const NavItemsWrapper = styled.div`
|
|
|
63
63
|
}
|
|
64
64
|
`;
|
|
65
65
|
|
|
66
|
-
const
|
|
66
|
+
const NavbarItemsClosableArea = styled.div`
|
|
67
67
|
display: flex;
|
|
68
68
|
flex: 1;
|
|
69
69
|
min-width: 50px;
|
|
@@ -71,7 +71,7 @@ const NavItemsClosableArea = styled.div`
|
|
|
71
71
|
background-color: rgba(255, 255, 255, 0.4);
|
|
72
72
|
`;
|
|
73
73
|
|
|
74
|
-
const
|
|
74
|
+
const NavbarItemsContainer = styled.ul`
|
|
75
75
|
width: 70%;
|
|
76
76
|
list-style: none;
|
|
77
77
|
margin: 0;
|
|
@@ -80,26 +80,28 @@ const NavItemsContainer = styled.ul`
|
|
|
80
80
|
flex-direction: column;
|
|
81
81
|
background: var(--navbar-background-color);
|
|
82
82
|
|
|
83
|
-
${
|
|
84
|
-
&:not(:last-child){
|
|
83
|
+
${NavbarMenuItem} {
|
|
84
|
+
&:not(:last-child) {
|
|
85
85
|
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
86
86
|
}
|
|
87
87
|
border-radius: 0;
|
|
88
88
|
padding: 1em 0;
|
|
89
|
-
width: 100%;
|
|
89
|
+
width: 100%;
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
${
|
|
91
|
+
|
|
92
|
+
${NavbarMenuItemWithDropdownWrapper} {
|
|
93
93
|
display: block;
|
|
94
|
-
&:not(:last-child){
|
|
94
|
+
&:not(:last-child) {
|
|
95
95
|
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
96
96
|
border-radius: 0;
|
|
97
97
|
}
|
|
98
|
-
${
|
|
98
|
+
${NavbarMenuItem} {
|
|
99
99
|
border-bottom: none;
|
|
100
100
|
}
|
|
101
|
+
}
|
|
102
|
+
|
|
101
103
|
${DropdownWrapper} {
|
|
102
|
-
background-color: var(--navbar-background-color);
|
|
104
|
+
background-color: var(--navbar-background-color);
|
|
103
105
|
width: 100%;
|
|
104
106
|
padding: 0;
|
|
105
107
|
position: relative;
|
package/src/Navbar/Navbar.tsx
CHANGED
|
@@ -34,11 +34,13 @@ export function Navbar({ menu, logo, search, profile }: NavbarProps): JSX.Elemen
|
|
|
34
34
|
<NavbarContainer data-component-name="Navbar/Navbar">
|
|
35
35
|
<MobileNavbarMenuButton onClick={openMobileMenu} />
|
|
36
36
|
{isOpen && <MobileNavbarMenu closeMenu={closeMobileMenu} menuItems={menu} />}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
<NavbarRow>
|
|
38
|
+
{logo}
|
|
39
|
+
<NavbarMenu menuItems={menu} />
|
|
40
|
+
{hideSearch ? null : search}
|
|
41
|
+
{profile}
|
|
42
|
+
<ColorModeSwitcher />
|
|
43
|
+
</NavbarRow>
|
|
42
44
|
</NavbarContainer>
|
|
43
45
|
);
|
|
44
46
|
}
|
|
@@ -47,21 +49,18 @@ export const NavbarContainer = styled.nav`
|
|
|
47
49
|
height: var(--navbar-height);
|
|
48
50
|
box-sizing: border-box;
|
|
49
51
|
display: flex;
|
|
50
|
-
color: var(--navbar-text-color);
|
|
51
52
|
align-items: center;
|
|
52
|
-
justify-content: space-between;
|
|
53
53
|
flex-shrink: 0;
|
|
54
54
|
|
|
55
55
|
font-size: 0.875rem;
|
|
56
56
|
position: sticky;
|
|
57
57
|
top: 0;
|
|
58
58
|
z-index: 200;
|
|
59
|
-
padding:
|
|
59
|
+
padding: var(--navbar-item-paddin-vertical) var(--navbar-item-padding-horizontal);
|
|
60
60
|
background: var(--navbar-background-color);
|
|
61
|
-
font-family: var(--
|
|
61
|
+
font-family: var(--navbar-item-font-family);
|
|
62
62
|
|
|
63
63
|
${({ theme }) => theme.mediaQueries.medium} {
|
|
64
|
-
padding: 10px var(--sidebar-margin-left);
|
|
65
64
|
font-size: 1rem;
|
|
66
65
|
}
|
|
67
66
|
|
|
@@ -77,3 +76,13 @@ export const NavbarContainer = styled.nav`
|
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
`;
|
|
79
|
+
|
|
80
|
+
export const NavbarRow = styled.div`
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
margin: 0 auto;
|
|
85
|
+
width: 100%;
|
|
86
|
+
|
|
87
|
+
max-width: var(--navbar-container-max-width);
|
|
88
|
+
`;
|
|
@@ -24,7 +24,8 @@ export function NavbarDropdown({ items }: NavbarDropdownProps): JSX.Element {
|
|
|
24
24
|
export const DropdownWrapper = styled.div`
|
|
25
25
|
display: none;
|
|
26
26
|
position: absolute;
|
|
27
|
-
background: var(--navbar-
|
|
27
|
+
background: var(--navbar-dropdown-background);
|
|
28
|
+
border: var(--navbar-item-border);
|
|
28
29
|
border-radius: var(--navbar-item-border-radius);
|
|
29
30
|
padding: 10px 15px;
|
|
30
31
|
width: max-content;
|
|
@@ -24,30 +24,38 @@ export function NavbarItem({ navItem, className }: NavbarItemProps): JSX.Element
|
|
|
24
24
|
const item = navItem as ResolvedNavLinkItem;
|
|
25
25
|
const isActive = pathname === withPathPrefix(item.link);
|
|
26
26
|
return (
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
<NavbarMenuItem
|
|
28
|
+
active={isActive}
|
|
29
|
+
data-component-name="Navbar/NavbarItem"
|
|
30
|
+
className={className}
|
|
31
|
+
>
|
|
32
|
+
<NavbarLink to={item.link} active={isActive}>
|
|
33
|
+
<NavbarLabel>{item.label}</NavbarLabel>
|
|
34
|
+
</NavbarLink>
|
|
35
|
+
</NavbarMenuItem>
|
|
32
36
|
);
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
if ((navItem as ResolvedNavGroupItem).items) {
|
|
36
40
|
const item = navItem as ResolvedNavGroupItem;
|
|
37
41
|
return (
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
<NavbarMenuItemWithDropdownWrapper>
|
|
43
|
+
<NavbarMenuItem
|
|
44
|
+
active={false}
|
|
45
|
+
data-component-name="Navbar/NavbarItem"
|
|
46
|
+
className={className}
|
|
47
|
+
>
|
|
48
|
+
<NavbarLabel>{item.label}</NavbarLabel>
|
|
49
|
+
</NavbarMenuItem>
|
|
42
50
|
<NavbarDropdown items={item.items as ResolvedNavLinkItem[]} />
|
|
43
|
-
</
|
|
51
|
+
</NavbarMenuItemWithDropdownWrapper>
|
|
44
52
|
);
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
return null;
|
|
48
56
|
}
|
|
49
57
|
|
|
50
|
-
export const
|
|
58
|
+
export const NavbarMenuItemWithDropdownWrapper = styled.div`
|
|
51
59
|
display: inline-block;
|
|
52
60
|
position: relative;
|
|
53
61
|
border-radius: var(--navbar-item-border-radius);
|
|
@@ -59,27 +67,36 @@ export const NavMenuItemWithDropdownWrapper = styled.div`
|
|
|
59
67
|
}
|
|
60
68
|
`;
|
|
61
69
|
|
|
62
|
-
export const
|
|
70
|
+
export const NavbarLink = styled(Link)`
|
|
71
|
+
color: ${({ active }) =>
|
|
72
|
+
active ? 'var(--navbar-item-active-text-color)' : 'var(--navbar-text-color)'};
|
|
73
|
+
text-decoration: ${({ active }) =>
|
|
74
|
+
active ? 'var(--navbar-item-active-text-decoration)' : 'none'};
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
export const NavbarMenuItem = styled.li<{ active?: boolean }>`
|
|
63
78
|
display: inline-block;
|
|
64
|
-
padding:
|
|
79
|
+
padding: var(--navbar-item-paddin-vertical) var(--navbar-item-padding-horizontal);
|
|
80
|
+
margin-left: var(--navbar-item-margin-horizontal);
|
|
65
81
|
text-align: center;
|
|
66
82
|
line-height: 1;
|
|
67
83
|
font-size: var(--navbar-item-font-size);
|
|
68
|
-
margin-left: var(--navbar-item-margin-horizontal);
|
|
69
|
-
margin-right: var(--navbar-item-margin-horizontal);
|
|
70
84
|
border-radius: var(--navbar-item-border-radius);
|
|
71
85
|
font-weight: var(--navbar-item-font-weight);
|
|
72
|
-
background: ${({ active }) =>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
background: ${({ active }) => active && 'var(--navbar-item-active-background-color)'};
|
|
87
|
+
color: ${({ active }) => active && 'var(--navbar-item-active-text-color)'};
|
|
88
|
+
&:hover {
|
|
89
|
+
color: var(--navbar-item-hover-text-color);
|
|
90
|
+
text-decoration: var(--navbar-item-hover-text-decoration);
|
|
91
|
+
background: var(--navbar-item-hover-background-color);
|
|
92
|
+
${NavbarLink} {
|
|
93
|
+
color: var(--navbar-item-hover-text-color);
|
|
94
|
+
text-decoration: var(--navbar-item-hover-text-decoration);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
80
97
|
`;
|
|
81
98
|
|
|
82
|
-
const
|
|
99
|
+
const NavbarLabel = styled.span`
|
|
83
100
|
cursor: pointer;
|
|
84
101
|
vertical-align: middle;
|
|
85
102
|
`;
|
|
@@ -24,7 +24,7 @@ export function NavbarMenu({ menuItems }: { menuItems: ResolvedConfigLinks }): J
|
|
|
24
24
|
|
|
25
25
|
const NavItemsContainer = styled.ul`
|
|
26
26
|
list-style: none;
|
|
27
|
-
margin: 0
|
|
27
|
+
margin: 0 var(--navbar-item-margin-horizontal);
|
|
28
28
|
padding: 0;
|
|
29
29
|
display: none;
|
|
30
30
|
flex-wrap: nowrap;
|
|
@@ -17,8 +17,8 @@ export function NavbarLogo({ logo }: NavbarLogoProps): JSX.Element | null {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const NavLogo = styled.img`
|
|
20
|
-
max-width: var(--logo-max-width);
|
|
21
|
-
max-height: var(--logo-max-height);
|
|
22
|
-
height: var(--logo-height);
|
|
23
|
-
margin: var(--logo-margin);
|
|
20
|
+
max-width: var(--navbar-logo-max-width);
|
|
21
|
+
max-height: var(--navbar-logo-max-height);
|
|
22
|
+
height: var(--navbar-logo-height);
|
|
23
|
+
margin: var(--navbar-logo-margin);
|
|
24
24
|
`;
|
|
@@ -7,15 +7,14 @@ export const OperationBadge = styled.span.attrs((props: { type: string }) => ({
|
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
align-items: center;
|
|
9
9
|
justify-content: center;
|
|
10
|
-
font-size: var(--
|
|
11
|
-
font-family: var(--http-
|
|
12
|
-
font-weight: var(--http-
|
|
13
|
-
line-height: var(--
|
|
14
|
-
color: var(--http-
|
|
15
|
-
background-color:
|
|
16
|
-
border-radius: var(--http-
|
|
17
|
-
width:
|
|
18
|
-
height: 14px;
|
|
10
|
+
font-size: var(--badge-http-font-size);
|
|
11
|
+
font-family: var(--badge-http-font-family);
|
|
12
|
+
font-weight: var(--badge-http-font-weight);
|
|
13
|
+
line-height: var(--badge-http-line-height);
|
|
14
|
+
color: var(--badge-http-text-color);
|
|
15
|
+
background-color: var(--badge-background-color);
|
|
16
|
+
border-radius: var(--badge-http-border-radius);
|
|
17
|
+
width: 58px;
|
|
19
18
|
text-transform: uppercase;
|
|
20
19
|
text-align: center;
|
|
21
20
|
margin-right: 6px;
|
package/src/Panel/Panel.ts
CHANGED
|
@@ -3,18 +3,32 @@ import styled from 'styled-components';
|
|
|
3
3
|
import { PanelHeader } from '@theme/Panel/PanelHeader';
|
|
4
4
|
import { PanelBody } from '@theme/Panel/PanelBody';
|
|
5
5
|
import { PanelComponent } from '@theme/Panel/PanelComponent';
|
|
6
|
+
import { ShelfIcon } from '@theme/icons/ShelfIcon';
|
|
6
7
|
|
|
7
|
-
export const Panel = styled(PanelComponent).attrs(() => ({
|
|
8
|
+
export const Panel = styled(PanelComponent).attrs(({ className }) => ({
|
|
8
9
|
'data-component-name': 'Panel/Panel',
|
|
10
|
+
className: className || 'panel-default',
|
|
9
11
|
}))`
|
|
10
|
-
|
|
12
|
+
background-color: var(--panel-background-color);
|
|
13
|
+
color: var(--panel-text-color);
|
|
14
|
+
font-family: var(--panel-font-family-local);
|
|
15
|
+
font-size: var(--panel-font-size-local);
|
|
16
|
+
font-weight: var(--panel-font-weight-local);
|
|
17
|
+
border: var(--panel-border-local);
|
|
18
|
+
border-radius: var(--panel-border-radius);
|
|
11
19
|
|
|
12
20
|
${PanelHeader} + ${PanelBody} {
|
|
13
21
|
border-top-left-radius: 0;
|
|
14
22
|
border-top-right-radius: 0;
|
|
15
23
|
}
|
|
16
24
|
|
|
25
|
+
${PanelHeader} {
|
|
26
|
+
${ShelfIcon} {
|
|
27
|
+
fill: var(--panel-chevron-icon-color); // ?????
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
17
31
|
&:not(:last-child) {
|
|
18
|
-
margin-bottom:
|
|
32
|
+
margin-bottom: var(--panel-gap-vertical);
|
|
19
33
|
}
|
|
20
34
|
`;
|
package/src/Panel/PanelBody.ts
CHANGED
|
@@ -24,9 +24,17 @@ export const PanelBody = styled.div.attrs(() => ({
|
|
|
24
24
|
${({ animate }) => animate && showPanelAnimation};
|
|
25
25
|
${({ hidden }) => hidden && 'visibility: hidden'};
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
background-color: var(--panel-body-background-color);
|
|
28
|
+
|
|
29
|
+
font-family: var(--panel-body-font-family-local);
|
|
30
|
+
font-size: var(--panel-body-font-size-local);
|
|
31
|
+
font-weight: var(--panel-body-font-weight-local);
|
|
32
|
+
border: var(--panel-body-border-local);
|
|
33
|
+
padding: var(--panel-body-padding-local);
|
|
34
|
+
color: var(--panel-body-text-color);
|
|
35
|
+
|
|
36
|
+
border-top-left-radius: var(--panel-border-radius);
|
|
37
|
+
border-top-right-radius: var(--panel-border-radius);
|
|
38
|
+
border-bottom-right-radius: var(--panel-border-radius);
|
|
39
|
+
border-bottom-left-radius: var(--panel-border-radius);
|
|
32
40
|
`;
|
|
@@ -15,16 +15,20 @@ import { PanelHeaderTitle } from '@theme/Panel/PanelHeaderTitle';
|
|
|
15
15
|
export interface PanelComponentProps {
|
|
16
16
|
expanded?: boolean;
|
|
17
17
|
className?: string;
|
|
18
|
+
renderChildrenHidden?: boolean;
|
|
18
19
|
header?: ReactNode | ((props: PanelHeaderProps) => ReactNode);
|
|
19
20
|
onToggle?: (expanded: boolean) => void;
|
|
21
|
+
description?: React.ReactNode;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
export function PanelComponent({
|
|
23
25
|
expanded = true,
|
|
26
|
+
renderChildrenHidden = false,
|
|
24
27
|
header,
|
|
25
28
|
className,
|
|
26
29
|
children,
|
|
27
30
|
onToggle,
|
|
31
|
+
description,
|
|
28
32
|
}: PropsWithChildren<PanelComponentProps>): JSX.Element {
|
|
29
33
|
const [isExpanded, setExpanded] = useState(expanded);
|
|
30
34
|
const [animate, setAnimate] = useState(false);
|
|
@@ -54,11 +58,12 @@ export function PanelComponent({
|
|
|
54
58
|
<InlineBox>
|
|
55
59
|
<PanelHeaderTitle data-cy="title">{header}</PanelHeaderTitle>
|
|
56
60
|
<ShelfIcon direction={isExpanded ? 'down' : 'right'} />
|
|
61
|
+
{description}
|
|
57
62
|
</InlineBox>
|
|
58
63
|
</PanelHeader>
|
|
59
64
|
))}
|
|
60
65
|
|
|
61
|
-
{isExpanded && (
|
|
66
|
+
{(isExpanded || renderChildrenHidden) && (
|
|
62
67
|
<PanelBody data-cy="panel-body" hidden={!isExpanded} animate={animate}>
|
|
63
68
|
{children}
|
|
64
69
|
</PanelBody>
|
package/src/Panel/PanelHeader.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BaseSyntheticEvent } from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
export interface PanelHeaderProps {
|
|
5
|
-
expanded
|
|
5
|
+
expanded?: boolean;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
toggle?: (e: BaseSyntheticEvent) => void;
|
|
8
8
|
}
|
|
@@ -15,13 +15,20 @@ export const PanelHeader = styled.div.attrs(() => ({
|
|
|
15
15
|
display: flex;
|
|
16
16
|
align-items: center;
|
|
17
17
|
justify-content: space-between;
|
|
18
|
-
white-space:
|
|
18
|
+
white-space: var(--panel-heading-white-space-local);
|
|
19
|
+
|
|
19
20
|
cursor: pointer;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
border
|
|
22
|
+
line-height: var(--panel-heading-line-height-local);
|
|
23
|
+
font-size: var(--panel-heading-font-size-local);
|
|
24
|
+
padding: var(--panel-heading-padding-local);
|
|
25
|
+
border: var(--panel-heading-border);
|
|
26
|
+
background-color: var(--panel-heading-background-color);
|
|
27
|
+
|
|
28
|
+
border-top-left-radius: var(--panel-border-radius);
|
|
29
|
+
border-top-right-radius: var(--panel-border-radius);
|
|
30
|
+
border-bottom-right-radius: ${({ expanded }) => (expanded ? '0' : 'var(--panel-border-radius)')};
|
|
31
|
+
border-bottom-left-radius: ${({ expanded }) => (expanded ? '0' : 'var(--panel-border-radius)')};
|
|
25
32
|
|
|
26
33
|
pointer-events: ${({ disabled }) => (disabled ? 'none' : 'auto')};
|
|
27
34
|
`;
|
|
@@ -3,11 +3,13 @@ import styled from 'styled-components';
|
|
|
3
3
|
export const PanelHeaderTitle = styled.span.attrs(() => ({
|
|
4
4
|
'data-component-name': 'Panel/PanelHeaderTitle',
|
|
5
5
|
}))`
|
|
6
|
-
line-height: 1;
|
|
7
6
|
margin-right: 5px;
|
|
8
|
-
font-weight:
|
|
9
|
-
|
|
7
|
+
font-weight: var(--panel-heading-font-weight-local);
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
text-overflow: ellipsis;
|
|
10
|
+
|
|
11
|
+
/* changed from var(--text-color-inverse) to var(--text-color)
|
|
10
12
|
should change several components in openapi/graphql reference-docs to use inverse color
|
|
11
13
|
*/
|
|
12
|
-
color: var(--color
|
|
14
|
+
color: var(--panel-heading-text-color);
|
|
13
15
|
`;
|
package/src/Panel/index.ts
CHANGED
package/src/Profile/Profile.tsx
CHANGED
|
@@ -5,25 +5,25 @@ import { CodeBlock } from '@theme/CodeBlock';
|
|
|
5
5
|
export const SamplesControlButton = styled.button.attrs(() => ({
|
|
6
6
|
'data-component-name': 'SamplesPanelControls/SamplesPanelControls',
|
|
7
7
|
}))`
|
|
8
|
-
background-color: var(--samples-
|
|
8
|
+
background-color: var(--panel-samples-controls-background-color);
|
|
9
9
|
border: 0;
|
|
10
10
|
outline: 0;
|
|
11
|
-
border-radius: var(--
|
|
11
|
+
border-radius: var(--border-radius);
|
|
12
12
|
height: 20px;
|
|
13
|
-
color: var(--
|
|
13
|
+
color: var(--panel-samples-controls-text-color);
|
|
14
14
|
font-size: 12px;
|
|
15
15
|
line-height: 12px;
|
|
16
16
|
cursor: pointer;
|
|
17
17
|
padding: 1px 6px;
|
|
18
18
|
min-width: 90px;
|
|
19
19
|
|
|
20
|
-
${({ theme }) => theme.mediaQueries
|
|
20
|
+
${({ theme }) => theme.mediaQueries?.small} {
|
|
21
21
|
padding: 2px 20px;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
:hover,
|
|
25
25
|
:focus {
|
|
26
|
-
background-color: var(--samples-
|
|
26
|
+
background-color: var(--panel-samples-controls-hover-background-color);
|
|
27
27
|
}
|
|
28
28
|
`;
|
|
29
29
|
|
|
@@ -43,7 +43,7 @@ export const SampleControls = styled.div`
|
|
|
43
43
|
margin-top: 5px;
|
|
44
44
|
margin-left: 10px;
|
|
45
45
|
|
|
46
|
-
${({ theme }) => theme.mediaQueries
|
|
46
|
+
${({ theme }) => theme.mediaQueries?.small} {
|
|
47
47
|
margin-top: 0;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -64,9 +64,9 @@ export const PreformattedCodeBlock = styled(CodeBlock.withComponent('pre'))`
|
|
|
64
64
|
margin: 0;
|
|
65
65
|
font-family: var(--code-font-family);
|
|
66
66
|
padding: 20px;
|
|
67
|
-
border-radius: var(--
|
|
68
|
-
background-color: var(--samples-
|
|
69
|
-
color: var(--color-
|
|
67
|
+
border-radius: var(--border-radius);
|
|
68
|
+
background-color: var(--panel-samples-controls-background-color);
|
|
69
|
+
color: var(--text-color-inverse);
|
|
70
70
|
font-size: var(--code-font-size);
|
|
71
71
|
white-space: var(--code-wrap, pre);
|
|
72
72
|
`;
|
package/src/Search/Input.tsx
CHANGED
|
@@ -6,7 +6,7 @@ export const FormInput = styled.input.attrs(() => ({
|
|
|
6
6
|
padding: 1em 2.5em 1em 1em;
|
|
7
7
|
background-color: var(--search-input-background-color);
|
|
8
8
|
border-radius: var(--search-input-border-radius);
|
|
9
|
-
border:
|
|
9
|
+
border: var(--search-input-border);
|
|
10
10
|
outline: none;
|
|
11
11
|
color: var(--search-input-text-color);
|
|
12
12
|
font-size: var(--search-input-font-size);
|
|
@@ -14,6 +14,11 @@ export const FormInput = styled.input.attrs(() => ({
|
|
|
14
14
|
line-height: var(--search-input-line-height);
|
|
15
15
|
|
|
16
16
|
::placeholder {
|
|
17
|
-
color: var(--search-input-
|
|
17
|
+
color: var(--search-input-placeholder-color);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:hover {
|
|
21
|
+
background-color: var(--search-input-hover-background-color);
|
|
22
|
+
border: var(--search-input-hover-border);
|
|
18
23
|
}
|
|
19
24
|
`;
|
|
@@ -39,7 +39,7 @@ export function Parameters({ parameters = [] }: ParametersProps): JSX.Element {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
const Wrapper = styled.div`
|
|
42
|
-
border-left: 1px solid var(--
|
|
42
|
+
border-left: 1px solid var(--border-color);
|
|
43
43
|
padding: 0 12px;
|
|
44
44
|
margin-top: 8px;
|
|
45
45
|
margin-bottom: 4px;
|
package/src/Search/Popover.tsx
CHANGED
|
@@ -12,9 +12,9 @@ export const Popover = styled.div.attrs(() => ({
|
|
|
12
12
|
max-width: 90vw;
|
|
13
13
|
max-height: 400px;
|
|
14
14
|
overflow-y: auto;
|
|
15
|
-
box-shadow:
|
|
16
|
-
|
|
17
|
-
background: var(--search-popover-backgrond-color);
|
|
15
|
+
box-shadow: var(--search-popover-shadow);
|
|
16
|
+
background: var(--search-popover-background-color);
|
|
18
17
|
list-style: none;
|
|
19
18
|
border-radius: var(--search-popover-border-radius);
|
|
19
|
+
border: var(--search-popover-border);
|
|
20
20
|
`;
|
package/src/Search/Search.tsx
CHANGED
|
@@ -41,18 +41,31 @@ export function SearchItem({ item }: SearchItemProps): JSX.Element {
|
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
const Title = styled.div`
|
|
45
|
+
font-weight: var(--font-weight-bold);
|
|
46
|
+
color: var(--search-item-title-text-color);
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
text-overflow: ellipsis;
|
|
49
|
+
line-height: var(--line-height-base);
|
|
50
|
+
`;
|
|
51
|
+
|
|
44
52
|
const SearchLink = styled(Link)`
|
|
45
53
|
display: block;
|
|
46
54
|
text-decoration: none;
|
|
47
|
-
padding:
|
|
55
|
+
padding: var(--search-item-padding);
|
|
48
56
|
transition: background-color 0.3s ease;
|
|
49
57
|
outline: none;
|
|
50
58
|
white-space: nowrap;
|
|
51
59
|
color: var(--search-item-text-color);
|
|
60
|
+
background-color: var(--search-item-background-color);
|
|
52
61
|
|
|
53
62
|
&:hover,
|
|
54
63
|
&:focus {
|
|
64
|
+
color: var(--search-item-active-text-color);
|
|
55
65
|
background-color: var(--search-item-active-background-color);
|
|
66
|
+
${Title} {
|
|
67
|
+
color: var(--search-item-active-title-text-color);
|
|
68
|
+
}
|
|
56
69
|
}
|
|
57
70
|
`;
|
|
58
71
|
|
|
@@ -64,14 +77,6 @@ const Operation = styled.div`
|
|
|
64
77
|
text-overflow: ellipsis;
|
|
65
78
|
`;
|
|
66
79
|
|
|
67
|
-
const Title = styled.div`
|
|
68
|
-
font-weight: var(--font-weight-bold);
|
|
69
|
-
color: var(--search-item-title-text-color);
|
|
70
|
-
overflow: hidden;
|
|
71
|
-
text-overflow: ellipsis;
|
|
72
|
-
line-height: var(--line-height-base);
|
|
73
|
-
`;
|
|
74
|
-
|
|
75
80
|
const Description = styled.div`
|
|
76
81
|
font-size: var(--font-size-base);
|
|
77
82
|
overflow: hidden;
|