@redocly/theme 0.2.2 → 0.4.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/Button/Button.js +3 -3
- package/CodeBlock/CodeBlock.js +1 -1
- package/ColorModeSwitcher/ColorModeSwitcher.d.ts +2 -0
- package/ColorModeSwitcher/ColorModeSwitcher.js +80 -0
- package/ColorModeSwitcher/index.d.ts +1 -0
- package/ColorModeSwitcher/index.js +17 -0
- package/CopyButton/CopyButtonWrapper.d.ts +2 -1
- package/CopyButton/CopyButtonWrapper.js +3 -2
- 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/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/Details.d.ts +6 -0
- package/Markdown/Details.js +22 -0
- package/Markdown/MarkdownLayout.d.ts +3 -1
- package/Markdown/MarkdownLayout.js +4 -4
- 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 +11 -7
- package/Navbar/NavbarDropdown.js +1 -1
- package/Navbar/NavbarItem.d.ts +3 -3
- package/Navbar/NavbarItem.js +17 -14
- package/Navbar/NavbarMenu.js +2 -2
- package/NavbarLogo/NavbarLogo.js +1 -1
- package/OperationBadge/OperationBadge.js +1 -1
- package/PageNavigation/PageNavigation.d.ts +6 -1
- package/PageNavigation/PageNavigation.js +4 -3
- package/Panel/Panel.d.ts +2 -1
- package/Panel/Panel.js +8 -3
- package/Panel/PanelBody.js +1 -1
- package/Panel/PanelComponent.d.ts +3 -2
- package/Panel/PanelComponent.js +3 -2
- 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/SourceCode/SourceCode.js +5 -5
- 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.d.ts +1 -0
- package/globalStyle.js +29 -25
- package/hooks/useActiveHeading.js +6 -5
- package/icons/ArrowIcon/ArrowIcon.js +1 -1
- package/icons/ColorModeIcon/ColorModeIcon.d.ts +10 -0
- package/icons/ColorModeIcon/ColorModeIcon.js +30 -0
- package/icons/ColorModeIcon/index.d.ts +2 -0
- package/icons/ColorModeIcon/index.js +5 -0
- package/icons/index.d.ts +1 -0
- package/icons/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/mocks/hooks/index.js +4 -0
- package/package.json +1 -1
- package/src/Button/Button.tsx +14 -6
- package/src/CodeBlock/CodeBlock.ts +2 -4
- package/src/ColorModeSwitcher/ColorModeSwitcher.tsx +48 -0
- package/src/ColorModeSwitcher/index.ts +1 -0
- package/src/CopyButton/CopyButtonWrapper.tsx +6 -3
- 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/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/Details.tsx +19 -0
- package/src/Markdown/MarkdownLayout.tsx +8 -4
- 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 +20 -9
- package/src/Navbar/NavbarDropdown.tsx +2 -1
- package/src/Navbar/NavbarItem.tsx +41 -24
- package/src/Navbar/NavbarMenu.tsx +3 -3
- package/src/NavbarLogo/NavbarLogo.tsx +4 -4
- package/src/OperationBadge/OperationBadge.ts +8 -9
- package/src/PageNavigation/PageNavigation.tsx +11 -3
- package/src/Panel/Panel.ts +17 -3
- package/src/Panel/PanelBody.ts +13 -5
- package/src/Panel/PanelComponent.tsx +3 -0
- 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/SourceCode/SourceCode.tsx +4 -4
- 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 +1424 -337
- package/src/hooks/useActiveHeading.ts +41 -34
- package/src/icons/ArrowIcon/ArrowIcon.tsx +3 -3
- package/src/icons/ColorModeIcon/ColorModeIcon.tsx +53 -0
- package/src/icons/ColorModeIcon/index.ts +2 -0
- package/src/icons/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/mocks/hooks/index.ts +4 -0
- package/src/settings.yaml +6 -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
|
@@ -71,28 +71,32 @@ export function TableOfContent(props: TableOfContentProps): JSX.Element | null {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
const TocHeader = styled.div`
|
|
74
|
-
font-
|
|
75
|
-
|
|
76
|
-
font-weight:
|
|
74
|
+
font-family: var(--toc-heading-font-family);
|
|
75
|
+
font-size: var(--toc-heading-font-size);
|
|
76
|
+
font-weight: var(--toc-heading-font-weight);
|
|
77
|
+
padding: var(--toc-item-padding-vertical) var(--toc-item-padding-horizontal);
|
|
78
|
+
color: var(--toc-heading-text-color);
|
|
77
79
|
text-transform: uppercase;
|
|
78
80
|
`;
|
|
79
81
|
|
|
80
82
|
const MenuItem = styled.a<{ depth: number }>`
|
|
81
83
|
display: block;
|
|
82
|
-
color: var(--color
|
|
84
|
+
color: var(--toc-item-text-color);
|
|
85
|
+
background-color: var(--toc-item-background-color);
|
|
83
86
|
cursor: pointer;
|
|
84
|
-
font-size:
|
|
85
|
-
|
|
86
|
-
padding
|
|
87
|
+
font-size: var(--toc-item-font-size);
|
|
88
|
+
font-family: var(--toc-item-font-family);
|
|
89
|
+
padding: var(--toc-item-padding-vertical) var(--toc-item-padding-horizontal);
|
|
90
|
+
padding-left: calc(var(--toc-item-nested-offset) * ${({ depth }) => depth});
|
|
87
91
|
transition: background-color 0.3s, color 0.3s;
|
|
88
92
|
text-decoration: none;
|
|
89
93
|
word-break: break-word;
|
|
90
|
-
font-family: var(--
|
|
94
|
+
font-family: var(--heading-font-family);
|
|
91
95
|
|
|
92
96
|
:hover,
|
|
93
97
|
&.active {
|
|
94
|
-
color: var(--
|
|
95
|
-
background-color: var(--
|
|
98
|
+
color: var(--toc-item-active-text-color);
|
|
99
|
+
background-color: var(--toc-item-active-background-color);
|
|
96
100
|
}
|
|
97
101
|
|
|
98
102
|
:empty {
|
|
@@ -101,11 +105,9 @@ const MenuItem = styled.a<{ depth: number }>`
|
|
|
101
105
|
`;
|
|
102
106
|
|
|
103
107
|
const TableOfContentMenu = styled.aside`
|
|
104
|
-
|
|
105
|
-
background-color: transparent;
|
|
108
|
+
background-color: var(--toc-background-color);
|
|
106
109
|
flex-shrink: 0;
|
|
107
110
|
display: none !important;
|
|
108
|
-
font-family: var(--font-family-base);
|
|
109
111
|
|
|
110
112
|
${({ theme }) => theme.mediaQueries.medium} {
|
|
111
113
|
width: var(--toc-width);
|
|
@@ -115,9 +117,9 @@ const TableOfContentMenu = styled.aside`
|
|
|
115
117
|
|
|
116
118
|
const TableOfContentItems = styled.div`
|
|
117
119
|
position: sticky;
|
|
118
|
-
top: calc(var(--navbar-height) +
|
|
119
|
-
max-height: calc(100vh - var(--navbar-height) -
|
|
120
|
-
border-left: 1px solid var(--
|
|
120
|
+
top: calc(var(--navbar-height) + var(--toc-offset-top));
|
|
121
|
+
max-height: calc(100vh - var(--navbar-height) - var(--toc-offset-top));
|
|
122
|
+
border-left: 1px solid var(--toc-border-color);
|
|
121
123
|
overflow-y: auto;
|
|
122
124
|
width: var(--toc-width); ;
|
|
123
125
|
`;
|
package/src/Tooltip/Tooltip.tsx
CHANGED
|
@@ -172,7 +172,7 @@ const TooltipBody = styled.span<
|
|
|
172
172
|
white-space: normal;
|
|
173
173
|
overflow-wrap: break-word;
|
|
174
174
|
|
|
175
|
-
border-radius: var(--
|
|
175
|
+
border-radius: var(--border-radius);
|
|
176
176
|
transition: opacity 0.3s ease-out;
|
|
177
177
|
|
|
178
178
|
font-size: 13px;
|
|
@@ -188,7 +188,7 @@ const TooltipBody = styled.span<
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
background: var(--tooltip-background-color);
|
|
191
|
-
color: var(--tooltip-color);
|
|
191
|
+
color: var(--tooltip-text-color);
|
|
192
192
|
box-shadow: rgb(0 0 0 / 25%) 0 2px 4px;
|
|
193
193
|
|
|
194
194
|
width: ${({ width }) => width || '120px'};
|
package/src/Typography/H1.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { typography } from '@theme/utils';
|
|
|
5
5
|
export const H1 = styled.h1.attrs(() => ({
|
|
6
6
|
'data-component-name': 'Typography/H1',
|
|
7
7
|
}))`
|
|
8
|
-
color: var(--color
|
|
9
|
-
margin:
|
|
8
|
+
color: var(--h1-text-color);
|
|
9
|
+
margin: var(--h1-margin-top) 0 var(--h1-margin-bottom);
|
|
10
10
|
|
|
11
11
|
${typography('h1', 'h')};
|
|
12
12
|
`;
|
package/src/Typography/H2.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { typography } from '@theme/utils';
|
|
|
5
5
|
export const H2 = styled.h2.attrs(() => ({
|
|
6
6
|
'data-component-name': 'Typography/H2',
|
|
7
7
|
}))`
|
|
8
|
-
color: var(--color
|
|
9
|
-
margin:
|
|
8
|
+
color: var(--h2-text-color);
|
|
9
|
+
margin: var(--h2-margin-top) 0 var(--h2-margin-bottom);
|
|
10
10
|
|
|
11
11
|
${typography('h2', 'h')};
|
|
12
12
|
`;
|
package/src/Typography/H3.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { typography } from '@theme/utils';
|
|
|
5
5
|
export const H3 = styled.h3.attrs(() => ({
|
|
6
6
|
'data-component-name': 'Typography/H3',
|
|
7
7
|
}))`
|
|
8
|
-
color: var(--color
|
|
8
|
+
color: var(--h3-text-color);
|
|
9
|
+
margin: var(--h3-margin-top) 0 var(--h3-margin-bottom);
|
|
9
10
|
|
|
10
11
|
${typography('h3', 'h')};
|
|
11
12
|
`;
|
|
@@ -3,11 +3,11 @@ import styled from 'styled-components';
|
|
|
3
3
|
export const SectionHeader = styled.h2.attrs(() => ({
|
|
4
4
|
'data-component-name': 'Typography/SectionHeader',
|
|
5
5
|
}))`
|
|
6
|
-
color: var(--
|
|
7
|
-
font-size:
|
|
8
|
-
font-weight: var(--font-weight
|
|
6
|
+
color: var(--h2-color);
|
|
7
|
+
font-size: var(--h2-font-size);
|
|
8
|
+
font-weight: var(--h2-font-weight);
|
|
9
9
|
text-align: center;
|
|
10
10
|
margin: 2.65em 0;
|
|
11
11
|
padding: 0 20px;
|
|
12
|
-
font-family: var(--
|
|
12
|
+
font-family: var(--h2-font-family);
|
|
13
13
|
`;
|
|
@@ -16,7 +16,7 @@ export interface TypographyProps {
|
|
|
16
16
|
export const Typography = styled.div.attrs(() => ({
|
|
17
17
|
'data-component-name': 'Typography/Typography',
|
|
18
18
|
}))<TypographyProps>`
|
|
19
|
-
color: ${({ color }) => color || 'var(--color
|
|
19
|
+
color: ${({ color }) => color || 'var(--text-color)'};
|
|
20
20
|
font-family: ${({ fontFamily }) => fontFamily || 'var(--font-family-base)'};
|
|
21
21
|
font-size: ${({ fontSize }) => fontSize || 'var(--font-size-base)'};
|
|
22
22
|
font-style: ${({ fontStyle }) => fontStyle};
|