@redocly/theme 0.1.6 → 0.1.9
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/Footer/Footer.d.ts +3 -0
- package/Footer/Footer.js +35 -0
- package/Footer/FooterColumn.d.ts +7 -0
- package/Footer/FooterColumn.js +39 -0
- package/Footer/FooterColumns.d.ts +7 -0
- package/Footer/FooterColumns.js +44 -0
- package/Footer/FooterCopyright.d.ts +5 -0
- package/Footer/FooterCopyright.js +30 -0
- package/Footer/index.d.ts +4 -0
- package/Footer/index.js +20 -0
- package/JsonViewer/JsonViewer.js +1 -1
- package/JsonViewer/index.d.ts +1 -0
- package/JsonViewer/index.js +1 -0
- package/Layout/PageLayout.d.ts +6 -0
- package/Layout/PageLayout.js +31 -0
- package/Layout/RootLayout.d.ts +7 -0
- package/Layout/RootLayout.js +32 -0
- package/Layout/index.d.ts +2 -0
- package/Layout/index.js +18 -0
- package/Logo/Logo.d.ts +1 -6
- package/Logo/index.d.ts +1 -0
- package/Logo/index.js +17 -0
- package/Markdown/Admonition.d.ts +9 -0
- package/Markdown/Admonition.js +39 -0
- package/Markdown/CodeSample/CodeSample.d.ts +8 -0
- package/Markdown/CodeSample/CodeSample.js +30 -0
- package/Markdown/CodeSample/index.d.ts +3 -0
- package/Markdown/CodeSample/index.js +19 -0
- package/Markdown/CodeSample/styled.d.ts +5 -0
- package/Markdown/CodeSample/styled.js +109 -0
- package/Markdown/CodeSample/types.d.ts +9 -0
- package/Markdown/CodeSample/types.js +2 -0
- package/Markdown/ContentWrapper.d.ts +5 -0
- package/Markdown/ContentWrapper.js +21 -0
- package/Markdown/Heading.d.ts +5 -0
- package/Markdown/Heading.js +23 -0
- package/Markdown/MarkdownLayout.d.ts +7 -0
- package/Markdown/MarkdownLayout.js +23 -0
- package/Markdown/Mermaid.d.ts +6 -0
- package/Markdown/Mermaid.js +19 -0
- package/Markdown/PageWrapper.d.ts +3 -0
- package/Markdown/PageWrapper.js +15 -0
- package/Markdown/StyledMarkdown.d.ts +8 -0
- package/Markdown/StyledMarkdown.js +54 -0
- package/Markdown/Tabs/Tab.d.ts +8 -0
- package/Markdown/Tabs/Tab.js +35 -0
- package/Markdown/Tabs/Tabs.d.ts +10 -0
- package/Markdown/Tabs/Tabs.js +43 -0
- package/Markdown/Tabs/index.d.ts +2 -0
- package/Markdown/Tabs/index.js +18 -0
- package/Markdown/index.d.ts +9 -0
- package/Markdown/index.js +25 -0
- package/Navbar/Navbar.d.ts +2 -1
- package/Navbar/Navbar.js +9 -3
- package/Navbar/NavbarItem.d.ts +1 -1
- package/Navbar/NavbarItem.js +3 -3
- package/Navbar/NavbarMenu.d.ts +1 -1
- package/Navbar/NavbarMenu.js +8 -4
- package/OperationBadge/OperationBadge.d.ts +5 -0
- package/OperationBadge/OperationBadge.js +15 -0
- package/OperationBadge/index.d.ts +1 -0
- package/OperationBadge/index.js +17 -0
- package/PageNavigation/NextPageLink.d.ts +2 -0
- package/PageNavigation/NextPageLink.js +25 -0
- package/PageNavigation/PageNavigation.d.ts +2 -0
- package/PageNavigation/PageNavigation.js +31 -0
- package/PageNavigation/PreviousPageLink.d.ts +2 -0
- package/PageNavigation/PreviousPageLink.js +25 -0
- package/Panel/CodePanel.js +6 -6
- package/Panel/ContentPanel.js +4 -4
- package/Panel/Panel.d.ts +1 -1
- package/Panel/Panel.js +3 -3
- package/Panel/PanelComponent.d.ts +1 -1
- package/Panel/PanelComponent.js +3 -3
- package/Panel/index.d.ts +1 -0
- package/Panel/index.js +1 -0
- package/Search/Autocomplete.d.ts +13 -0
- package/Search/Autocomplete.js +79 -0
- package/Search/ClearIcon.d.ts +2 -0
- package/Search/ClearIcon.js +29 -0
- package/Search/Input.d.ts +3 -0
- package/Search/Input.js +15 -0
- package/Search/Parameters.d.ts +7 -0
- package/Search/Parameters.js +42 -0
- package/Search/Popover.d.ts +3 -0
- package/Search/Popover.js +15 -0
- package/Search/Search.d.ts +2 -0
- package/Search/Search.js +39 -0
- package/Search/SearchIcon.d.ts +2 -0
- package/Search/SearchIcon.js +29 -0
- package/Search/SearchItem.d.ts +7 -0
- package/Search/SearchItem.js +47 -0
- package/Search/index.d.ts +9 -0
- package/Search/index.js +25 -0
- package/Search/utils.d.ts +2 -0
- package/Search/utils.js +21 -0
- package/Sidebar/ApiCallItem.d.ts +8 -0
- package/Sidebar/ApiCallItem.js +35 -0
- package/Sidebar/ArrowBack.d.ts +4 -0
- package/Sidebar/ArrowBack.js +29 -0
- package/Sidebar/BackButton.d.ts +6 -0
- package/Sidebar/BackButton.js +31 -0
- package/Sidebar/Drilldown.d.ts +8 -0
- package/Sidebar/Drilldown.js +46 -0
- package/Sidebar/DrilldownMenu.d.ts +3 -0
- package/Sidebar/DrilldownMenu.js +55 -0
- package/Sidebar/DrilldownMenuItem.d.ts +3 -0
- package/Sidebar/DrilldownMenuItem.js +32 -0
- package/Sidebar/ExternalIcon.d.ts +4 -0
- package/Sidebar/ExternalIcon.js +29 -0
- package/Sidebar/Menu.d.ts +3 -0
- package/Sidebar/Menu.js +15 -0
- package/Sidebar/MenuContainer.d.ts +1 -0
- package/Sidebar/MenuContainer.js +13 -0
- package/Sidebar/MenuGroup.d.ts +9 -0
- package/Sidebar/MenuGroup.js +37 -0
- package/Sidebar/MenuItem.d.ts +3 -0
- package/Sidebar/MenuItem.js +34 -0
- package/Sidebar/MenuItemLabel.d.ts +5 -0
- package/Sidebar/MenuItemLabel.js +19 -0
- package/Sidebar/MenuLink.d.ts +5 -0
- package/Sidebar/MenuLink.js +16 -0
- package/Sidebar/MenuLinkItem.d.ts +3 -0
- package/Sidebar/MenuLinkItem.js +31 -0
- package/Sidebar/MobileSidebarButton.d.ts +5 -0
- package/Sidebar/MobileSidebarButton.js +21 -0
- package/Sidebar/Separator.d.ts +3 -0
- package/Sidebar/Separator.js +32 -0
- package/Sidebar/SeparatorItem.d.ts +5 -0
- package/Sidebar/SeparatorItem.js +14 -0
- package/Sidebar/SeparatorLine.d.ts +3 -0
- package/Sidebar/SeparatorLine.js +15 -0
- package/Sidebar/Sidebar.d.ts +8 -0
- package/Sidebar/Sidebar.js +24 -0
- package/Sidebar/SidebarLayout.d.ts +7 -0
- package/Sidebar/SidebarLayout.js +36 -0
- package/Sidebar/index.d.ts +19 -0
- package/Sidebar/index.js +35 -0
- package/Sidebar/types/DrilldownMenuProps.d.ts +6 -0
- package/Sidebar/types/DrilldownMenuProps.js +2 -0
- package/Sidebar/types/ItemState.d.ts +8 -0
- package/Sidebar/types/ItemState.js +2 -0
- package/Sidebar/types/MenuItemProps.d.ts +5 -0
- package/Sidebar/types/MenuItemProps.js +2 -0
- package/Sidebar/types/MenuStyle.d.ts +3 -0
- package/Sidebar/types/MenuStyle.js +8 -0
- package/Sidebar/types/NavItem.d.ts +26 -0
- package/Sidebar/types/NavItem.js +2 -0
- package/Sidebar/types/index.d.ts +5 -0
- package/Sidebar/types/index.js +21 -0
- package/SourceCode/SourceCode.js +2 -2
- package/TableOfContent/TableOfContent.d.ts +9 -0
- package/TableOfContent/TableOfContent.js +65 -0
- package/TableOfContent/index.d.ts +1 -0
- package/TableOfContent/index.js +17 -0
- package/globalStyle.js +1 -1
- package/hooks/index.d.ts +4 -0
- package/hooks/index.js +4 -0
- package/hooks/useActiveHeading.d.ts +2 -0
- package/hooks/useActiveHeading.js +34 -0
- package/hooks/useActiveSectionId.d.ts +3 -0
- package/hooks/useActiveSectionId.js +48 -0
- package/hooks/useFullHeight.d.ts +2 -0
- package/hooks/useFullHeight.js +47 -0
- package/hooks/useMobileMenu.d.ts +2 -0
- package/hooks/useMobileMenu.js +13 -0
- package/hooks/useNavbarHeight.d.ts +3 -0
- package/hooks/useNavbarHeight.js +20 -0
- package/icons/ShelfIcon/ShelfIcon.js +2 -2
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/mocks/hooks/usePageData.d.ts +5 -0
- package/mocks/hooks/usePageData.js +7 -0
- package/mocks/models.d.ts +3 -0
- package/mocks/models.js +2 -0
- package/mocks/search.d.ts +22 -0
- package/mocks/search.js +13 -0
- package/mocks/types/index.d.ts +1 -0
- package/mocks/types/index.js +2 -0
- package/mocks/usePreloadHistory.d.ts +3 -0
- package/mocks/usePreloadHistory.js +12 -0
- package/package.json +5 -2
- package/src/Button/Button.stories.tsx +1 -1
- package/src/Button/__tests__/Button.test.tsx +1 -1
- package/src/CodeBlock/__tests__/CodeBlock.test.tsx +1 -1
- package/src/CopyButton/CopyButton.stories.tsx +1 -1
- package/src/CopyButton/CopyButton.tsx +1 -1
- package/src/CopyButton/CopyButtonWrapper.tsx +4 -4
- package/src/CopyButton/__tests__/CopyButton.test.tsx +1 -1
- package/src/CopyButton/__tests__/CopyButtonWrapper.test.tsx +2 -1
- package/src/Footer/Footer.tsx +34 -0
- package/src/Footer/FooterColumn.tsx +62 -0
- package/src/Footer/FooterColumns.tsx +51 -0
- package/src/Footer/FooterCopyright.tsx +26 -0
- package/src/Footer/index.ts +4 -0
- package/src/Headings/Headings.stories.tsx +1 -1
- package/src/Headings/Headings.ts +1 -1
- package/src/Headings/__tests__/Headings.test.tsx +1 -1
- package/src/JsonViewer/JsonViewer.stories.tsx +1 -1
- package/src/JsonViewer/JsonViewer.tsx +6 -7
- package/src/JsonViewer/__tests__/JsonViewer.test.tsx +2 -1
- package/src/JsonViewer/index.ts +1 -0
- package/src/Layout/PageLayout.tsx +34 -0
- package/src/Layout/RootLayout.tsx +24 -0
- package/src/Layout/index.ts +2 -0
- package/src/Logo/Logo.tsx +1 -7
- package/src/Logo/index.ts +1 -0
- package/src/Markdown/Admonition.tsx +64 -0
- package/src/Markdown/CodeSample/CodeSample.tsx +39 -0
- package/src/Markdown/CodeSample/index.ts +3 -0
- package/src/Markdown/CodeSample/styled.ts +289 -0
- package/src/Markdown/CodeSample/types.ts +40 -0
- package/src/Markdown/ContentWrapper.tsx +20 -0
- package/src/Markdown/Heading.tsx +35 -0
- package/src/Markdown/MarkdownLayout.tsx +25 -0
- package/src/Markdown/Mermaid.tsx +23 -0
- package/src/Markdown/PageWrapper.tsx +9 -0
- package/src/Markdown/StyledMarkdown.tsx +312 -0
- package/src/Markdown/Tabs/Tab.tsx +37 -0
- package/src/Markdown/Tabs/Tabs.tsx +45 -0
- package/src/Markdown/Tabs/index.ts +2 -0
- package/src/Markdown/index.ts +9 -0
- package/src/Navbar/Navbar.stories.tsx +3 -13
- package/src/Navbar/Navbar.tsx +20 -26
- package/src/Navbar/NavbarItem.tsx +2 -2
- package/src/Navbar/NavbarMenu.tsx +6 -6
- package/src/OperationBadge/OperationBadge.stories.tsx +35 -0
- package/src/OperationBadge/OperationBadge.ts +59 -0
- package/src/OperationBadge/__tests__/OperationBadge.test.tsx +59 -0
- package/src/OperationBadge/__tests__/__snapshots__/OperationBadge.test.tsx.snap +651 -0
- package/src/OperationBadge/index.ts +1 -0
- package/src/PageNavigation/NextPageLink.tsx +22 -0
- package/src/PageNavigation/PageNavigation.tsx +20 -0
- package/src/PageNavigation/PreviousPageLink.tsx +22 -0
- package/src/Panel/CodePanel.stories.tsx +1 -2
- package/src/Panel/CodePanel.ts +8 -7
- package/src/Panel/ContentPanel.stories.tsx +1 -2
- package/src/Panel/ContentPanel.ts +5 -6
- package/src/Panel/Panel.stories.tsx +1 -3
- package/src/Panel/Panel.ts +3 -3
- package/src/Panel/PanelComponent.tsx +4 -5
- package/src/Panel/__tests__/CodePanel.test.tsx +1 -1
- package/src/Panel/__tests__/ContentPanel.test.tsx +1 -1
- package/src/Panel/__tests__/Panel.test.tsx +1 -2
- package/src/Panel/__tests__/__snapshots__/CodePanel.test.tsx.snap +8 -8
- package/src/Panel/__tests__/__snapshots__/ContentPanel.test.tsx.snap +22 -22
- package/src/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +16 -16
- package/src/Panel/index.ts +1 -0
- package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +1 -1
- package/src/SamplesPanelControls/SamplesPanelControls.ts +1 -1
- package/src/Search/Autocomplete.tsx +128 -0
- package/src/Search/ClearIcon.tsx +31 -0
- package/src/Search/Input.tsx +19 -0
- package/src/Search/Parameters.tsx +62 -0
- package/src/Search/Popover.tsx +20 -0
- package/src/Search/Search.tsx +52 -0
- package/src/Search/SearchIcon.tsx +32 -0
- package/src/Search/SearchItem.tsx +85 -0
- package/src/Search/index.ts +9 -0
- package/src/Search/utils.tsx +19 -0
- package/src/Sidebar/ApiCallItem.tsx +33 -0
- package/src/Sidebar/ArrowBack.tsx +22 -0
- package/src/Sidebar/BackButton.tsx +44 -0
- package/src/Sidebar/Drilldown.tsx +46 -0
- package/src/Sidebar/DrilldownMenu.tsx +58 -0
- package/src/Sidebar/DrilldownMenuItem.tsx +40 -0
- package/src/Sidebar/ExternalIcon.tsx +37 -0
- package/src/Sidebar/Menu.tsx +11 -0
- package/src/Sidebar/MenuContainer.tsx +8 -0
- package/src/Sidebar/MenuGroup.tsx +55 -0
- package/src/Sidebar/MenuItem.tsx +25 -0
- package/src/Sidebar/MenuItemLabel.tsx +41 -0
- package/src/Sidebar/MenuLink.tsx +14 -0
- package/src/Sidebar/MenuLinkItem.tsx +24 -0
- package/src/Sidebar/MobileSidebarButton.tsx +44 -0
- package/src/Sidebar/Separator.tsx +17 -0
- package/src/Sidebar/SeparatorItem.tsx +14 -0
- package/src/Sidebar/SeparatorLine.tsx +9 -0
- package/src/Sidebar/Sidebar.tsx +54 -0
- package/src/Sidebar/SidebarLayout.tsx +30 -0
- package/src/Sidebar/index.ts +19 -0
- package/src/Sidebar/types/DrilldownMenuProps.ts +7 -0
- package/src/Sidebar/types/ItemState.ts +9 -0
- package/src/Sidebar/types/MenuItemProps.ts +6 -0
- package/src/Sidebar/types/MenuStyle.ts +4 -0
- package/src/Sidebar/types/NavItem.ts +27 -0
- package/src/Sidebar/types/index.ts +5 -0
- package/src/SidebarLogo/SidebarLogo.stories.tsx +1 -1
- package/src/SidebarLogo/__tests__/SidebarLogo.test.tsx +1 -1
- package/src/SourceCode/SourceCode.stories.tsx +1 -1
- package/src/SourceCode/SourceCode.tsx +7 -3
- package/src/SourceCode/__tests__/SourceCode.test.tsx +2 -1
- package/src/TableOfContent/TableOfContent.stories.tsx +39 -0
- package/src/TableOfContent/TableOfContent.tsx +112 -0
- package/src/TableOfContent/index.ts +1 -0
- package/src/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/src/Tooltip/__tests__/Tooltip.test.tsx +1 -1
- package/src/globalStyle.ts +10 -73
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useActiveHeading.ts +46 -0
- package/src/hooks/useActiveSectionId.ts +53 -0
- package/src/hooks/useFullHeight.ts +47 -0
- package/src/hooks/useMobileMenu.ts +11 -0
- package/src/hooks/useNavbarHeight.ts +24 -0
- package/src/icons/ShelfIcon/ShelfIcon.stories.tsx +1 -1
- package/src/icons/ShelfIcon/ShelfIcon.tsx +1 -1
- package/src/icons/ShelfIcon/__tests__/ShelfIcon.test.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/mocks/hooks/usePageData.ts +8 -0
- package/src/mocks/models.ts +3 -0
- package/src/mocks/search.ts +31 -0
- package/src/mocks/types/index.ts +1 -0
- package/src/mocks/usePreloadHistory.ts +9 -0
- package/src/types/portal/index.d.ts +6 -0
- package/src/types/portal/src/client/app/Sidebar/types.d.ts +50 -0
- package/src/types/portal/src/client/app/media-css.d.ts +7 -0
- package/src/types/portal/src/client/styling/default.d.ts +407 -0
- package/src/types/portal/src/client/styling/index.d.ts +14 -0
- package/src/types/portal/src/client/styling/resolve.d.ts +1 -0
- package/src/types/portal/src/server/constants.d.ts +11 -0
- package/src/types/portal/src/server/plugins/markdown/types.d.ts +28 -0
- package/src/types/portal/src/server/plugins/nav-utils.d.ts +19 -0
- package/src/types/portal/src/server/plugins/portal-config/types.d.ts +23 -0
- package/src/types/portal/src/server/plugins/sidebars/index.d.ts +16 -0
- package/src/types/portal/src/server/plugins/versions/index.d.ts +15 -0
- package/src/types/portal/src/server/plugins/versions/types.d.ts +23 -0
- package/src/types/portal/src/server/plugins/versions/utils.d.ts +10 -0
- package/src/types/portal/src/server/store.d.ts +101 -0
- package/src/types/portal/src/server/utils/async.d.ts +5 -0
- package/src/types/portal/src/server/utils/crypto.d.ts +3 -0
- package/src/types/portal/src/server/utils/fs.d.ts +3 -0
- package/src/types/portal/src/server/utils/index.d.ts +6 -0
- package/src/types/portal/src/server/utils/paths.d.ts +16 -0
- package/src/types/portal/src/server/utils/reporter/formatter.d.ts +11 -0
- package/src/types/portal/src/server/utils/reporter/reporter.d.ts +17 -0
- package/src/types/portal/src/server/utils/watcher.d.ts +16 -0
- package/src/types/portal/src/server/utils/yaml.d.ts +1 -0
- package/src/types/portal/src/shared/constants.d.ts +8 -0
- package/src/types/portal/src/shared/types.d.ts +77 -0
- package/src/types/portal/src/shared/urls.d.ts +7 -0
- package/src/types/portal/src/shared/utils.d.ts +10 -0
- package/src/ui/AlertIcon.tsx +110 -0
- package/src/ui/Arrow.tsx +36 -0
- package/src/ui/Background.tsx +16 -0
- package/src/ui/Box.tsx +39 -0
- package/src/ui/Button.tsx +19 -0
- package/src/ui/Dropdown.tsx +132 -0
- package/src/ui/Flex.tsx +21 -0
- package/src/ui/Jumbotron.tsx +57 -0
- package/src/ui/Tiles/ThinTile.tsx +151 -0
- package/src/ui/Tiles/TileHeader.ts +13 -0
- package/src/ui/Tiles/TileText.tsx +12 -0
- package/src/ui/Tiles/WideTile.tsx +138 -0
- package/src/ui/Tiles/index.ts +4 -0
- package/src/ui/Typography.tsx +167 -0
- package/src/ui/UniversalLink.tsx +100 -0
- package/src/ui/index.tsx +17 -0
- package/src/utils/__tests__/ClipboardService.test.ts +1 -1
- package/src/utils/__tests__/css-variables.test.ts +1 -1
- package/src/utils/__tests__/highlight.test.ts +1 -1
- package/src/utils/__tests__/jsonToHtml.test.ts +1 -1
- package/src/utils/__tests__/media-css.test.ts +1 -1
- package/src/utils/__tests__/theme-helpers.test.ts +1 -1
- package/src/utils/getNavbarElement.ts +10 -0
- package/src/utils/isUrl.ts +42 -0
- package/src/utils/replaceHashInColor.ts +3 -0
- package/ui/AlertIcon.d.ts +9 -0
- package/ui/AlertIcon.js +45 -0
- package/ui/Arrow.d.ts +7 -0
- package/ui/Arrow.js +42 -0
- package/ui/Background.d.ts +7 -0
- package/ui/Background.js +16 -0
- package/ui/Box.d.ts +6 -0
- package/ui/Box.js +16 -0
- package/ui/Button.d.ts +7 -0
- package/ui/Button.js +27 -0
- package/ui/Dropdown.d.ts +8 -0
- package/ui/Dropdown.js +55 -0
- package/ui/Flex.d.ts +10 -0
- package/ui/Flex.js +31 -0
- package/ui/Jumbotron.d.ts +18 -0
- package/ui/Jumbotron.js +44 -0
- package/ui/Tiles/ThinTile.d.ts +21 -0
- package/ui/Tiles/ThinTile.js +98 -0
- package/ui/Tiles/TileHeader.d.ts +5 -0
- package/ui/Tiles/TileHeader.js +15 -0
- package/ui/Tiles/TileText.d.ts +5 -0
- package/ui/Tiles/TileText.js +15 -0
- package/ui/Tiles/WideTile.d.ts +7 -0
- package/ui/Tiles/WideTile.js +93 -0
- package/ui/Tiles/index.d.ts +4 -0
- package/ui/Tiles/index.js +20 -0
- package/ui/Typography.d.ts +110 -0
- package/ui/Typography.js +137 -0
- package/ui/UniversalLink.d.ts +17 -0
- package/ui/UniversalLink.js +62 -0
- package/ui/index.d.ts +14 -0
- package/ui/index.js +34 -0
- package/utils/getNavbarElement.d.ts +1 -0
- package/utils/getNavbarElement.js +14 -0
- package/utils/isUrl.d.ts +12 -0
- package/utils/isUrl.js +36 -0
- package/utils/replaceHashInColor.d.ts +1 -0
- package/utils/replaceHashInColor.js +7 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Config, RenderNodes } from '@markdoc/markdoc/dist/src/types';
|
|
2
|
+
import type { Page } from '../../store';
|
|
3
|
+
import type { VersionsConfigType } from '../versions/types';
|
|
4
|
+
export declare type MarkdownOptions = {
|
|
5
|
+
contentDir: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
versionsConfig: Map<string, VersionsConfigType>;
|
|
8
|
+
pages: Map<string, Page>;
|
|
9
|
+
allPagesPaths: string[];
|
|
10
|
+
outdir: string;
|
|
11
|
+
};
|
|
12
|
+
export interface MdHeading {
|
|
13
|
+
id: string;
|
|
14
|
+
value: string;
|
|
15
|
+
depth: number;
|
|
16
|
+
}
|
|
17
|
+
export interface MdCompilationResult {
|
|
18
|
+
result: RenderNodes;
|
|
19
|
+
headings: MdHeading[];
|
|
20
|
+
}
|
|
21
|
+
export declare type MdCompilationContext = {
|
|
22
|
+
absolutePath: string;
|
|
23
|
+
content: string;
|
|
24
|
+
contentHash: string;
|
|
25
|
+
} & MarkdownOptions;
|
|
26
|
+
export interface ExtendedMarkdocConfig extends Config {
|
|
27
|
+
currentProcessedPage?: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Page, Store } from '../store.js';
|
|
2
|
+
import type { ResolvedNavItem, NavItem, RawNavItem } from '../../shared/types.js';
|
|
3
|
+
export declare function normalizeItems(items: RawNavItem[]): NavItem[];
|
|
4
|
+
export declare function resolveVersionItems(
|
|
5
|
+
items: RawNavItem[],
|
|
6
|
+
store: Store,
|
|
7
|
+
versions?: any,
|
|
8
|
+
): RawNavItem[];
|
|
9
|
+
export declare function resolvePage(pagePath: string, fromFile: string, store: Store): Page;
|
|
10
|
+
export declare function resolveItems(
|
|
11
|
+
items: NavItem[],
|
|
12
|
+
fromFile: string,
|
|
13
|
+
store: Store,
|
|
14
|
+
): Promise<ResolvedNavItem[]>;
|
|
15
|
+
export declare function resolveItem(
|
|
16
|
+
item: NavItem,
|
|
17
|
+
fromFile: string,
|
|
18
|
+
store: Store,
|
|
19
|
+
): Promise<ResolvedNavItem | ResolvedNavItem[]>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LogoConfig, RawNavItem, ResolvedNavItem } from '../../../shared/types.js';
|
|
2
|
+
export interface PortalConfig extends Record<string, any> {
|
|
3
|
+
nav?: RawNavItem[];
|
|
4
|
+
logo?: LogoConfig;
|
|
5
|
+
themes?: CustomTheme[];
|
|
6
|
+
footer?: FooterConfig;
|
|
7
|
+
}
|
|
8
|
+
export interface CustomTheme {
|
|
9
|
+
name: string;
|
|
10
|
+
settings?: any;
|
|
11
|
+
themeStyles?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FooterConfig {
|
|
14
|
+
copyrightText?: string;
|
|
15
|
+
columns?: FooterColumn[];
|
|
16
|
+
}
|
|
17
|
+
export interface FooterColumn {
|
|
18
|
+
group: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
items: ResolvedNavItem[];
|
|
21
|
+
}
|
|
22
|
+
export declare type CustomEntryPropertyType = Record<string, string | boolean>;
|
|
23
|
+
export declare type ScriptOrStylesheetConfig = string | CustomEntryPropertyType;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NavItem, RawNavItem, ResolvedNavItem } from '../../../shared/types.js';
|
|
2
|
+
import { Page, Store } from '../../store.js';
|
|
3
|
+
import { Watcher } from '../../utils/index.js';
|
|
4
|
+
export declare function sidebarsPlugin(watcher: Watcher, store: Store): void;
|
|
5
|
+
export declare class Sidebar {
|
|
6
|
+
absolutePath: string;
|
|
7
|
+
id: string;
|
|
8
|
+
store: Store;
|
|
9
|
+
hash: string;
|
|
10
|
+
dirname: string;
|
|
11
|
+
items: NavItem[];
|
|
12
|
+
constructor(absolutePath: string, items: RawNavItem[], id: string, store: Store);
|
|
13
|
+
resolve(): Promise<ResolvedNavItem[]>;
|
|
14
|
+
getDependentPages(): Set<Page>;
|
|
15
|
+
private collectDependentPages;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AllFilesType } from './types.js';
|
|
2
|
+
import { Watcher } from '../../utils/index.js';
|
|
3
|
+
import type { Store } from '../../store.js';
|
|
4
|
+
export declare function allFilesPaths(): AllFilesType;
|
|
5
|
+
export declare const existingVersionPages: Set<string>;
|
|
6
|
+
export declare function initVersionPlugin(
|
|
7
|
+
contentDir: string,
|
|
8
|
+
store: Store,
|
|
9
|
+
allFiles: AllFilesType,
|
|
10
|
+
): void;
|
|
11
|
+
export declare function versionsPlugin(
|
|
12
|
+
watcher: Watcher,
|
|
13
|
+
store: Store,
|
|
14
|
+
allFiles: AllFilesType,
|
|
15
|
+
): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare type Version = {
|
|
2
|
+
version: string;
|
|
3
|
+
label: string;
|
|
4
|
+
link: string;
|
|
5
|
+
default: boolean;
|
|
6
|
+
active: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare type VersionConfigItem = {
|
|
9
|
+
version: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type VersionsConfigType = {
|
|
13
|
+
versions: VersionConfigItem[];
|
|
14
|
+
default?: string;
|
|
15
|
+
missingBehavior?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare type AllFilesType = {
|
|
18
|
+
addPath: (path: string) => string[];
|
|
19
|
+
addPaths: (paths: string[]) => void;
|
|
20
|
+
removePath: (path: string) => void;
|
|
21
|
+
getAll: () => string[];
|
|
22
|
+
hasPath: (path: string) => void;
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Version, VersionsConfigType } from './types.js';
|
|
2
|
+
export declare function getVersionConfigByBasePath(
|
|
3
|
+
versionsConfigMap: Map<string, VersionsConfigType>,
|
|
4
|
+
basePath: string,
|
|
5
|
+
): VersionsConfigType | null;
|
|
6
|
+
export declare function getPageVersions(
|
|
7
|
+
pathname: string,
|
|
8
|
+
currentVersion: string,
|
|
9
|
+
versionsConfig: VersionsConfigType,
|
|
10
|
+
): Version[];
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Sidebar } from './plugins/sidebars/index.js';
|
|
2
|
+
import { PageType } from './constants.js';
|
|
3
|
+
import type { Version, VersionsConfigType } from './plugins/versions/types.js';
|
|
4
|
+
import type { ResolvedNavItem } from '../shared/types.js';
|
|
5
|
+
export interface PageProps {
|
|
6
|
+
id: string;
|
|
7
|
+
seo: {
|
|
8
|
+
title: string;
|
|
9
|
+
};
|
|
10
|
+
versions?: Version[];
|
|
11
|
+
[k: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface Page {
|
|
14
|
+
type: PageType;
|
|
15
|
+
basePath: string;
|
|
16
|
+
relativePath: string;
|
|
17
|
+
id: string;
|
|
18
|
+
pathname: string;
|
|
19
|
+
absolutePath: string;
|
|
20
|
+
hash: string;
|
|
21
|
+
sidebarId: string | null;
|
|
22
|
+
version: string;
|
|
23
|
+
versions: Version[] | null;
|
|
24
|
+
dataDependencies?: string[];
|
|
25
|
+
getPageProps(): Promise<PageProps>;
|
|
26
|
+
getSidebarLabel(): Promise<string>;
|
|
27
|
+
getTemplateId(): string;
|
|
28
|
+
getSidebar?(): ResolvedNavItem[];
|
|
29
|
+
getSidebarPages?(): Page[];
|
|
30
|
+
clone(version: string, versionsConfig: Map<string, VersionsConfigType>): Page;
|
|
31
|
+
}
|
|
32
|
+
export declare class Template {
|
|
33
|
+
absolutePath: string;
|
|
34
|
+
id: string;
|
|
35
|
+
hash: string;
|
|
36
|
+
constructor(absolutePath: string, id: string);
|
|
37
|
+
}
|
|
38
|
+
export declare class Store {
|
|
39
|
+
contentDir: string;
|
|
40
|
+
outdir: string;
|
|
41
|
+
renderMode: 'thread_worker' | 'main';
|
|
42
|
+
isReady: boolean;
|
|
43
|
+
allAbsolutePaths: string[];
|
|
44
|
+
pages: Map<string, Page>;
|
|
45
|
+
sidebars: Map<string, Sidebar>;
|
|
46
|
+
sharedData: Map<string, any>;
|
|
47
|
+
templates: Map<string, Template>;
|
|
48
|
+
esbuildPlugins: any[];
|
|
49
|
+
listeners: Map<string, Set<Function>>;
|
|
50
|
+
globalData: Record<string, unknown>;
|
|
51
|
+
cliOptions: Record<string, unknown>;
|
|
52
|
+
globalConfig: Record<string, unknown>;
|
|
53
|
+
readyPromise: Promise<void>;
|
|
54
|
+
versionsConfig: Map<string, VersionsConfigType>;
|
|
55
|
+
private _resolveReady;
|
|
56
|
+
sidebarUpdatesFrozen: boolean;
|
|
57
|
+
ignoredContentPaths: string[];
|
|
58
|
+
currentProcessedPage: string;
|
|
59
|
+
constructor(contentDir: string, outdir?: string, renderMode?: 'thread_worker' | 'main');
|
|
60
|
+
on(type: 'page-updated', cb: (page: Page) => void | any): void;
|
|
61
|
+
on(type: 'sidebar-updated', cb: (sidebar: Sidebar) => void | any): void;
|
|
62
|
+
on(type: 'template-updated', cb: (template: Template) => void | any): void;
|
|
63
|
+
on(type: 'ready', cb: (pathname: string) => void | any): void;
|
|
64
|
+
on(type: 'shared-data-updated', cb: (id: string, data: any) => void): any;
|
|
65
|
+
on(
|
|
66
|
+
type: 'global-data-updated',
|
|
67
|
+
cb: (pathname: string, data: Record<string, unknown>) => void | any,
|
|
68
|
+
): void;
|
|
69
|
+
on(type: 'versions-config-updated', cb: any): void;
|
|
70
|
+
runListeners<T extends Array<unknown>>(
|
|
71
|
+
type:
|
|
72
|
+
| 'ready'
|
|
73
|
+
| 'page-updated'
|
|
74
|
+
| 'template-updated'
|
|
75
|
+
| 'sidebar-updated'
|
|
76
|
+
| 'global-data-updated'
|
|
77
|
+
| 'shared-data-updated'
|
|
78
|
+
| 'versions-config-updated',
|
|
79
|
+
...args: T
|
|
80
|
+
): void;
|
|
81
|
+
ready(): void;
|
|
82
|
+
addEsbuildPlugin(plugin: any): void;
|
|
83
|
+
setVersionsConfig(id: string, data: VersionsConfigType): void;
|
|
84
|
+
setGlobalData(data: Record<string, unknown>): void;
|
|
85
|
+
setCliOptions(data: Record<string, unknown>): void;
|
|
86
|
+
setGlobalConfig(data: Record<string, unknown>): void;
|
|
87
|
+
setAllAbsolutePaths(paths: any): void;
|
|
88
|
+
setVersionConfigUpdated(): void;
|
|
89
|
+
getPageByPathname(pathname: string): Page;
|
|
90
|
+
getSidebarById(id: string): Sidebar;
|
|
91
|
+
getPageByFsPath(absolutePath: string): Page;
|
|
92
|
+
createSidebar(sidebar: Sidebar): void;
|
|
93
|
+
removeSidebar(id: string): void;
|
|
94
|
+
createSharedData(id: string, data: any): string;
|
|
95
|
+
createPage(page: Page): Promise<void>;
|
|
96
|
+
deletePage(pathname: string): void;
|
|
97
|
+
getTemplate(id: string): Template;
|
|
98
|
+
createTemplate(template: Template): void;
|
|
99
|
+
private verifyVersionsLink;
|
|
100
|
+
private assignPagesSidebars;
|
|
101
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function getDataFromRelativePath(relativePath: string): {
|
|
2
|
+
pathVersion: string;
|
|
3
|
+
basePath: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function generatePagePathname(
|
|
6
|
+
currentVersion?: string | null,
|
|
7
|
+
defaultVersion?: string | null,
|
|
8
|
+
...combineParts: string[]
|
|
9
|
+
): string;
|
|
10
|
+
export declare function fromCurrentDir(moduleUrl: string, path: string): string;
|
|
11
|
+
export declare function excludeVersion<T extends string[] | string>(
|
|
12
|
+
arg: T,
|
|
13
|
+
): {
|
|
14
|
+
version?: string;
|
|
15
|
+
data: T;
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const formatter: {
|
|
2
|
+
success(message: string, ...args: any[]): string;
|
|
3
|
+
info(message: string, ...args: any[]): string;
|
|
4
|
+
warn(message: string, ...args: any[]): string;
|
|
5
|
+
error(message: string, ...args: any[]): string;
|
|
6
|
+
verbose(message: string, ...args: any[]): string;
|
|
7
|
+
formatMs(ms: number): string;
|
|
8
|
+
withTime(message: any, reporter: any): string;
|
|
9
|
+
format(pattern: string, ...args: any[]): string;
|
|
10
|
+
};
|
|
11
|
+
export default formatter;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const reporter: {
|
|
2
|
+
now(): number;
|
|
3
|
+
startTiming(): void;
|
|
4
|
+
getTimeSpan(): number;
|
|
5
|
+
success(message: string, ...args: any[]): void;
|
|
6
|
+
successTime(message: string, ...args: any[]): void;
|
|
7
|
+
info(message: string, ...args: any[]): void;
|
|
8
|
+
infoTime(message: string, ...args: any[]): void;
|
|
9
|
+
warn(message: string, ...args: any[]): void;
|
|
10
|
+
warnTime(message: string, ...args: any[]): void;
|
|
11
|
+
error(message: string, ...args: any[]): void;
|
|
12
|
+
verbose(message: string, ...args: any[]): void;
|
|
13
|
+
verboseTime(message: string, ...args: any[]): void;
|
|
14
|
+
panic(message: string, ...args: any[]): never;
|
|
15
|
+
panicOnBuild(message: string, ...args: any[]): void;
|
|
16
|
+
flushErrors(): void;
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as chokidar from 'chokidar';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
declare type WatchCb = (event: 'add' | 'change' | 'unlink', path: string, stats?: fs.Stats) => void;
|
|
5
|
+
export declare class Watcher {
|
|
6
|
+
cwd: string;
|
|
7
|
+
private _readyPromise;
|
|
8
|
+
private listeners;
|
|
9
|
+
constructor(cwd: string);
|
|
10
|
+
watch(test: RegExp, cb: WatchCb): void;
|
|
11
|
+
emit(event: 'add' | 'change' | 'unlink', path: string, stats?: fs.Stats): void;
|
|
12
|
+
stop(): Promise<void>;
|
|
13
|
+
start(): void;
|
|
14
|
+
ready(): Promise<chokidar.FSWatcher>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseYaml<T = unknown>(raw: string): T;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const RUNTIME_RESOURCES_DIR = 'runtime';
|
|
2
|
+
export declare const REDOC_OVERVIEW_ITEM_ID = 'overview';
|
|
3
|
+
export declare const PORTAL_CUSTOM_THEMES_FOLDER = '@theme';
|
|
4
|
+
export declare const USER_THEME_ALIAS = '@theme';
|
|
5
|
+
export declare const PUBLIC_STATIC_FOLDER = '/static';
|
|
6
|
+
export declare enum FsErrors {
|
|
7
|
+
NotExist = 'ENOENT',
|
|
8
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PageProps } from '../server/store';
|
|
3
|
+
export declare type ResolvedNavLinkItem = {
|
|
4
|
+
type: 'link';
|
|
5
|
+
link: string;
|
|
6
|
+
label: string;
|
|
7
|
+
items?: ResolvedNavItem[];
|
|
8
|
+
external?: boolean;
|
|
9
|
+
version?: string;
|
|
10
|
+
default?: string;
|
|
11
|
+
httpVerb?: string;
|
|
12
|
+
separatorLine?: boolean;
|
|
13
|
+
active?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare type ResolvedNavGroupItem = {
|
|
16
|
+
type: 'group';
|
|
17
|
+
link?: string;
|
|
18
|
+
label: string;
|
|
19
|
+
items: ResolvedNavItem[];
|
|
20
|
+
version?: string;
|
|
21
|
+
default?: string;
|
|
22
|
+
menuStyle?: MenuStyle;
|
|
23
|
+
separatorLine?: boolean;
|
|
24
|
+
active?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare type ResolvedNavItem =
|
|
27
|
+
| ResolvedNavLinkItem
|
|
28
|
+
| ResolvedNavGroupItem
|
|
29
|
+
| {
|
|
30
|
+
type: 'separator';
|
|
31
|
+
label?: string;
|
|
32
|
+
separatorLine?: boolean;
|
|
33
|
+
}
|
|
34
|
+
| {
|
|
35
|
+
type: 'error';
|
|
36
|
+
label: string;
|
|
37
|
+
};
|
|
38
|
+
export declare type ResolvedSidebar = ResolvedNavItem[];
|
|
39
|
+
export interface PageData {
|
|
40
|
+
templateId: string;
|
|
41
|
+
sidebarId?: string;
|
|
42
|
+
dataDependencies?: string[];
|
|
43
|
+
props: PageProps;
|
|
44
|
+
}
|
|
45
|
+
export interface CachedPageData extends PageData {
|
|
46
|
+
Template: React.ComponentType<{
|
|
47
|
+
pageProps: PageProps;
|
|
48
|
+
resolvedDataDependencies?: Record<string, unknown>[];
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
export interface ResolvedPageData extends CachedPageData {
|
|
52
|
+
sidebar: ResolvedSidebar;
|
|
53
|
+
resolvedDataDependencies?: Record<string, unknown>[];
|
|
54
|
+
}
|
|
55
|
+
export declare enum MenuStyle {
|
|
56
|
+
Drilldown = 'drilldown',
|
|
57
|
+
}
|
|
58
|
+
export declare type NavItem = {
|
|
59
|
+
page?: string;
|
|
60
|
+
directory?: string;
|
|
61
|
+
group?: string;
|
|
62
|
+
label?: string;
|
|
63
|
+
href?: never;
|
|
64
|
+
items?: NavItem[];
|
|
65
|
+
separator?: string;
|
|
66
|
+
separatorLine?: boolean;
|
|
67
|
+
version?: string;
|
|
68
|
+
menuStyle?: MenuStyle;
|
|
69
|
+
external?: boolean;
|
|
70
|
+
};
|
|
71
|
+
export declare type RawNavItem = string | NavItem;
|
|
72
|
+
export interface LogoConfig {
|
|
73
|
+
image?: string;
|
|
74
|
+
altText?: string;
|
|
75
|
+
link?: string;
|
|
76
|
+
favicon?: string;
|
|
77
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function getPageDataUrl(normalizedRoute: string): string;
|
|
2
|
+
export declare function getClientPageDataUrl(normalizedRoute: string): string;
|
|
3
|
+
export declare function getSidebarUrl(id: string): string;
|
|
4
|
+
export declare function getSharedDataUrl(id: string): string;
|
|
5
|
+
export declare const GLOBAL_DATA_URL = '/app-data.json';
|
|
6
|
+
export declare function combineUrls(baseURL: string, ...relativeURLs: string[]): string;
|
|
7
|
+
export declare function withPathPrefix(url: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const isLocalLink: (path: string) => boolean;
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @returns url with leading and without trailing slash or empty string, e.g. '/prefix'
|
|
5
|
+
*/
|
|
6
|
+
export declare function getPathPrefix(): string;
|
|
7
|
+
export declare function normalizePathPrefix(prefix: string): string;
|
|
8
|
+
export declare function addLeadingSlash(url: string): string;
|
|
9
|
+
export declare function removeTrailingSlash(url: string): string;
|
|
10
|
+
export declare function getGlobMatcher(glob: string, options?: {}): (file: string) => boolean;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React, { HTMLProps } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
interface IconProps extends HTMLProps<HTMLElement> {
|
|
5
|
+
type: 'warning' | 'success' | 'danger' | 'attention' | 'info';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function Icon({ type, className }: IconProps) {
|
|
9
|
+
switch (type) {
|
|
10
|
+
case 'warning':
|
|
11
|
+
return (
|
|
12
|
+
<svg
|
|
13
|
+
className={className}
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
version="1.1"
|
|
16
|
+
id="Layer_1"
|
|
17
|
+
x="0"
|
|
18
|
+
y="0"
|
|
19
|
+
viewBox="0 0 500.6 500.6"
|
|
20
|
+
enableBackground="new 0 0 500.6 500.6"
|
|
21
|
+
>
|
|
22
|
+
<path d="M250.3 15.1c-132.5 0-239.8 107.2-239.8 239.8 0 132.5 107.2 239.8 239.8 239.8 132.5 0 239.8-107.2 239.8-239.8C490.1 122.3 382.8 15.1 250.3 15.1zM250.3 457.1C138.5 457.1 48 366.7 48 254.8 48 143 138.5 52.5 250.3 52.5c111.8 0 202.3 90.5 202.3 202.3C452.6 366.7 362.1 457.1 250.3 457.1z" />
|
|
23
|
+
<path d="M250.3 135.8c-10.3 0-18.7 8.4-18.7 18.7v120.6c0 10.3 8.4 18.7 18.7 18.7s18.7-8.4 18.7-18.7V154.5C269 144.2 260.7 135.8 250.3 135.8z" />
|
|
24
|
+
<circle cx="250.3" cy="342.1" r="25.3" />
|
|
25
|
+
</svg>
|
|
26
|
+
);
|
|
27
|
+
case 'success':
|
|
28
|
+
return (
|
|
29
|
+
<svg
|
|
30
|
+
className={className}
|
|
31
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
32
|
+
version="1.1"
|
|
33
|
+
id="Layer_1"
|
|
34
|
+
x="0"
|
|
35
|
+
y="0"
|
|
36
|
+
viewBox="0 0 500.6 500.6"
|
|
37
|
+
enableBackground="new 0 0 500.6 500.6"
|
|
38
|
+
>
|
|
39
|
+
<path d="M250.3 490.1c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 382.8 117.8 490.1 250.3 490.1zM250.3 48c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 452.6 48 362.1 48 250.3 48 138.5 138.5 48 250.3 48z" />
|
|
40
|
+
<path d="M224.7 349.6c8.5 5.9 20.2 3.8 26.1-4.6L355 195.7c5.9-8.5 3.8-20.2-4.6-26.1s-20.2-3.8-26.1 4.6L220 323.5C214.1 332 216.2 343.7 224.7 349.6z" />
|
|
41
|
+
<path d="M247.1 346.2c7.3-7.3 7.3-19.2 0-26.5l-55.9-55.9c-7.3-7.3-19.2-7.3-26.5 0s-7.3 19.2 0 26.5l55.9 55.9C228 353.5 239.8 353.5 247.1 346.2z" />
|
|
42
|
+
</svg>
|
|
43
|
+
);
|
|
44
|
+
case 'danger':
|
|
45
|
+
return (
|
|
46
|
+
<svg
|
|
47
|
+
className={className}
|
|
48
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
49
|
+
version="1.1"
|
|
50
|
+
id="Layer_1"
|
|
51
|
+
x="0"
|
|
52
|
+
y="0"
|
|
53
|
+
viewBox="0 0 500.6 500.6"
|
|
54
|
+
enableBackground="new 0 0 500.6 500.6"
|
|
55
|
+
>
|
|
56
|
+
<path d="M250.3 490.1c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 382.8 117.8 490.1 250.3 490.1zM250.3 48c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 452.6 48 362.1 48 250.3 48 138.5 138.5 48 250.3 48z" />
|
|
57
|
+
<path d="M168.4 332.2c7.3 7.3 19.2 7.3 26.5 0l137.3-137.3c7.3-7.3 7.3-19.2 0-26.5 -7.3-7.3-19.2-7.3-26.5 0L168.4 305.7C161.1 313 161.1 324.9 168.4 332.2z" />
|
|
58
|
+
<path d="M168.4 168.4c-7.3 7.3-7.3 19.2 0 26.5l137.3 137.3c7.3 7.3 19.2 7.3 26.5 0 7.3-7.3 7.3-19.2 0-26.5L194.9 168.4C187.6 161.1 175.7 161.1 168.4 168.4z" />
|
|
59
|
+
</svg>
|
|
60
|
+
);
|
|
61
|
+
case 'attention':
|
|
62
|
+
return (
|
|
63
|
+
<svg
|
|
64
|
+
className={className}
|
|
65
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
66
|
+
version="1.1"
|
|
67
|
+
id="Layer_1"
|
|
68
|
+
x="0"
|
|
69
|
+
y="0"
|
|
70
|
+
viewBox="0 0 500.6 500.6"
|
|
71
|
+
enableBackground="new 0 0 500.6 500.6"
|
|
72
|
+
>
|
|
73
|
+
<path d="M250.3 301.8c-8.3 0-15-6.7-15-15V181.9c0-8.3 6.7-15 15-15 8.3 0 15 6.7 15 15v104.9C265.3 295.1 258.6 301.8 250.3 301.8zM483.7 377L297.2 66.1c-21.2-35.3-72.6-35.4-93.8 0L16.9 377c-17.6 29.4 3.6 67.1 38 67.1h390.8C480.1 444.1 501.4 406.4 483.7 377L483.7 377zM445.7 414.1H54.9c-11.2 0-18-12.2-12.3-21.7L229.1 81.5c9.6-16 32.8-16 42.4 0L458 392.4C463.7 401.9 456.9 414.1 445.7 414.1z" />
|
|
74
|
+
<circle cx="250.3" cy="339.2" r="22.5" />
|
|
75
|
+
</svg>
|
|
76
|
+
);
|
|
77
|
+
default:
|
|
78
|
+
return (
|
|
79
|
+
<svg
|
|
80
|
+
className={className}
|
|
81
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
82
|
+
version="1.1"
|
|
83
|
+
id="Layer_1"
|
|
84
|
+
x="0"
|
|
85
|
+
y="0"
|
|
86
|
+
viewBox="0 0 500.6 500.6"
|
|
87
|
+
enableBackground="new 0 0 500.6 500.6"
|
|
88
|
+
>
|
|
89
|
+
<path d="M250.3 490.7c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 383.5 117.8 490.7 250.3 490.7zM250.3 48.6c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 453.2 48 362.7 48 250.9 48 139.1 138.5 48.6 250.3 48.6z" />
|
|
90
|
+
<path d="M250.3 370c10.3 0 18.7-8.4 18.7-18.7V230.6c0-10.3-8.4-18.7-18.7-18.7 -10.3 0-18.7 8.4-18.7 18.7v120.6C231.6 361.6 240 370 250.3 370z" />
|
|
91
|
+
<circle cx="250.3" cy="163.7" r="25.3" />
|
|
92
|
+
</svg>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const AlertIcon = styled(Icon).attrs(() => ({
|
|
98
|
+
'data-component-name': 'ui/AlertIcon',
|
|
99
|
+
}))`
|
|
100
|
+
position: absolute;
|
|
101
|
+
left: var(--alert-padding-horizontal);
|
|
102
|
+
top: 50%;
|
|
103
|
+
transform: translateY(-50%);
|
|
104
|
+
width: var(--alert-icon-size);
|
|
105
|
+
height: var(--alert-icon-size);
|
|
106
|
+
margin-right: var(--alert-padding-horizontal);
|
|
107
|
+
flex-shrink: 0;
|
|
108
|
+
|
|
109
|
+
fill: ${({ type }) => `var(--alert-${type}-icon-color)`};
|
|
110
|
+
`;
|
package/src/ui/Arrow.tsx
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export interface ArrowProps {
|
|
5
|
+
direction?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function directionToTransform({ direction }: ArrowProps) {
|
|
9
|
+
switch (direction) {
|
|
10
|
+
case 'up':
|
|
11
|
+
return 180;
|
|
12
|
+
case 'right':
|
|
13
|
+
return -90;
|
|
14
|
+
case 'left':
|
|
15
|
+
return 90;
|
|
16
|
+
default:
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const Icon = ({ className }: { className?: string }) => (
|
|
22
|
+
<span data-component-name="ui/Arrow/Arrow">
|
|
23
|
+
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 7 5" className={className}>
|
|
24
|
+
<path d="M3.5 2.51L5.806.205a.7.7 0 01.99.99l-2.8 2.8a.698.698 0 01-.99 0l-2.8-2.8a.7.7 0 11.99-.99L3.5 2.51z" />
|
|
25
|
+
</svg>
|
|
26
|
+
</span>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const Arrow = styled(Icon)`
|
|
30
|
+
width: var(--sidebar-chevron-size);
|
|
31
|
+
height: var(--sidebar-chevron-size);
|
|
32
|
+
fill: var(--sidebar-chevron-color);
|
|
33
|
+
transform: rotate(${directionToTransform}deg);
|
|
34
|
+
|
|
35
|
+
vertical-align: middle;
|
|
36
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import { Flex } from '@theme/ui/Flex';
|
|
4
|
+
|
|
5
|
+
export const Background = styled(Flex).attrs(() => ({
|
|
6
|
+
'data-component-name': 'ui/Background',
|
|
7
|
+
}))`
|
|
8
|
+
background: var(--navbar-color-background);
|
|
9
|
+
color: var(--color-primary-contrast);
|
|
10
|
+
font-family: var(--h-font-family);
|
|
11
|
+
|
|
12
|
+
a:not([role='button']),
|
|
13
|
+
a:not([role='button']):hover {
|
|
14
|
+
color: var(--color-primary-contrast);
|
|
15
|
+
}
|
|
16
|
+
`;
|
package/src/ui/Box.tsx
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
space,
|
|
3
|
+
position,
|
|
4
|
+
flex,
|
|
5
|
+
textAlign,
|
|
6
|
+
color,
|
|
7
|
+
border,
|
|
8
|
+
layout,
|
|
9
|
+
SpaceProps,
|
|
10
|
+
LayoutProps,
|
|
11
|
+
TextAlignProps,
|
|
12
|
+
ColorProps,
|
|
13
|
+
PositionProps,
|
|
14
|
+
FlexProps,
|
|
15
|
+
BordersProps,
|
|
16
|
+
} from 'styled-system';
|
|
17
|
+
import styled from 'styled-components';
|
|
18
|
+
|
|
19
|
+
export interface BoxProps
|
|
20
|
+
extends SpaceProps,
|
|
21
|
+
LayoutProps,
|
|
22
|
+
PositionProps,
|
|
23
|
+
FlexProps,
|
|
24
|
+
TextAlignProps,
|
|
25
|
+
ColorProps,
|
|
26
|
+
BordersProps {}
|
|
27
|
+
|
|
28
|
+
export const Box = styled.div.attrs(() => ({
|
|
29
|
+
'data-component-name': 'ui/Box',
|
|
30
|
+
}))<BoxProps>`
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
${space}
|
|
33
|
+
${layout}
|
|
34
|
+
${position}
|
|
35
|
+
${flex}
|
|
36
|
+
${textAlign}
|
|
37
|
+
${color}
|
|
38
|
+
${border}
|
|
39
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LinkProps } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
import { Button as RefDocsButton, ButtonProps } from '@theme/Button';
|
|
5
|
+
import { Link } from '@portal/Link';
|
|
6
|
+
|
|
7
|
+
const StyledButtonAsLink = RefDocsButton.withComponent(Link);
|
|
8
|
+
|
|
9
|
+
export function Button(
|
|
10
|
+
props: ButtonProps & Partial<LinkProps<never>> & { ref?: any; external?: boolean },
|
|
11
|
+
): JSX.Element {
|
|
12
|
+
if (props.to) {
|
|
13
|
+
return <StyledButtonAsLink {...props} role="button" data-component-name="ui/Button" />;
|
|
14
|
+
} else {
|
|
15
|
+
return (
|
|
16
|
+
<RefDocsButton {...(props as ButtonProps)} role="button" data-component-name="ui/Button" />
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|