@elastic/eui-docusaurus-theme 2.0.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/LICENSE.txt +6 -0
- package/README.md +292 -0
- package/lib/.tsbuildinfo-client +1 -0
- package/lib/components/badge/index.d.ts +1 -0
- package/lib/components/badge/index.js +9 -0
- package/lib/components/codesandbox_icon/codesandbox_icon.d.ts +4 -0
- package/lib/components/codesandbox_icon/codesandbox_icon.js +2 -0
- package/lib/components/codesandbox_icon/index.d.ts +1 -0
- package/lib/components/codesandbox_icon/index.js +8 -0
- package/lib/components/demo/actions_bar/actions_bar.d.ts +10 -0
- package/lib/components/demo/actions_bar/actions_bar.js +34 -0
- package/lib/components/demo/actions_bar/index.d.ts +1 -0
- package/lib/components/demo/actions_bar/index.js +8 -0
- package/lib/components/demo/code_transformer.d.ts +18 -0
- package/lib/components/demo/code_transformer.js +39 -0
- package/lib/components/demo/codesandbox/find_external_dependencies.d.ts +5 -0
- package/lib/components/demo/codesandbox/find_external_dependencies.js +30 -0
- package/lib/components/demo/codesandbox/index.d.ts +1 -0
- package/lib/components/demo/codesandbox/index.js +8 -0
- package/lib/components/demo/codesandbox/open_action.d.ts +16 -0
- package/lib/components/demo/codesandbox/open_action.js +91 -0
- package/lib/components/demo/context.d.ts +14 -0
- package/lib/components/demo/context.js +13 -0
- package/lib/components/demo/create_demo.d.ts +5 -0
- package/lib/components/demo/create_demo.js +13 -0
- package/lib/components/demo/demo.d.ts +23 -0
- package/lib/components/demo/demo.js +61 -0
- package/lib/components/demo/editor/editor.d.ts +1 -0
- package/lib/components/demo/editor/editor.js +39 -0
- package/lib/components/demo/editor/index.d.ts +1 -0
- package/lib/components/demo/editor/index.js +8 -0
- package/lib/components/demo/index.d.ts +3 -0
- package/lib/components/demo/index.js +10 -0
- package/lib/components/demo/preview/index.d.ts +1 -0
- package/lib/components/demo/preview/index.js +8 -0
- package/lib/components/demo/preview/preview.d.ts +7 -0
- package/lib/components/demo/preview/preview.js +36 -0
- package/lib/components/demo/scope.d.ts +1 -0
- package/lib/components/demo/scope.js +12 -0
- package/lib/components/demo/source/get_source_from_children.d.ts +11 -0
- package/lib/components/demo/source/get_source_from_children.js +42 -0
- package/lib/components/demo/source/index.d.ts +1 -0
- package/lib/components/demo/source/index.js +8 -0
- package/lib/components/demo/source/source.d.ts +6 -0
- package/lib/components/demo/source/source.js +25 -0
- package/lib/components/figma_embed/index.d.ts +5 -0
- package/lib/components/figma_embed/index.js +36 -0
- package/lib/components/guideline/guideline.d.ts +10 -0
- package/lib/components/guideline/guideline.js +68 -0
- package/lib/components/guideline/guideline_text.d.ts +6 -0
- package/lib/components/guideline/guideline_text.js +28 -0
- package/lib/components/guideline/index.d.ts +2 -0
- package/lib/components/guideline/index.js +9 -0
- package/lib/components/guideline/types.d.ts +1 -0
- package/lib/components/guideline/types.js +8 -0
- package/lib/components/high_contrast_mode_toggle/index.d.ts +1 -0
- package/lib/components/high_contrast_mode_toggle/index.js +15 -0
- package/lib/components/icon/index.d.ts +1 -0
- package/lib/components/icon/index.js +9 -0
- package/lib/components/index.d.ts +7 -0
- package/lib/components/index.js +14 -0
- package/lib/components/navbar_item/index.d.ts +19 -0
- package/lib/components/navbar_item/index.js +84 -0
- package/lib/components/prop_table/definition_types.d.ts +43 -0
- package/lib/components/prop_table/definition_types.js +8 -0
- package/lib/components/prop_table/extended_types.d.ts +5 -0
- package/lib/components/prop_table/extended_types.js +27 -0
- package/lib/components/prop_table/extended_types_info.d.ts +26 -0
- package/lib/components/prop_table/extended_types_info.js +34 -0
- package/lib/components/prop_table/index.d.ts +1 -0
- package/lib/components/prop_table/index.js +8 -0
- package/lib/components/prop_table/prop_table.d.ts +8 -0
- package/lib/components/prop_table/prop_table.js +115 -0
- package/lib/components/theme_context/index.d.ts +16 -0
- package/lib/components/theme_context/index.js +103 -0
- package/lib/components/theme_context/theme_overrides.d.ts +2 -0
- package/lib/components/theme_context/theme_overrides.js +12 -0
- package/lib/components/version_switcher/index.d.ts +23 -0
- package/lib/components/version_switcher/index.js +51 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/lib/theme/Admonition/Types.d.ts +3 -0
- package/lib/theme/Admonition/Types.js +51 -0
- package/lib/theme/CodeBlock/index.d.ts +3 -0
- package/lib/theme/CodeBlock/index.js +35 -0
- package/lib/theme/ColorModeToggle/index.d.ts +10 -0
- package/lib/theme/ColorModeToggle/index.js +51 -0
- package/lib/theme/Demo/actions.d.ts +8 -0
- package/lib/theme/Demo/actions.js +8 -0
- package/lib/theme/Demo/default_scope.d.ts +3 -0
- package/lib/theme/Demo/default_scope.js +17 -0
- package/lib/theme/DocBreadcrumbs/Items/Home/index.d.ts +2 -0
- package/lib/theme/DocBreadcrumbs/Items/Home/index.js +15 -0
- package/lib/theme/DocBreadcrumbs/Items/item.styles.d.ts +5 -0
- package/lib/theme/DocBreadcrumbs/Items/item.styles.js +40 -0
- package/lib/theme/DocBreadcrumbs/index.d.ts +2 -0
- package/lib/theme/DocBreadcrumbs/index.js +63 -0
- package/lib/theme/DocItem/Content/index.d.ts +3 -0
- package/lib/theme/DocItem/Content/index.js +44 -0
- package/lib/theme/DocItem/Footer/index.d.ts +2 -0
- package/lib/theme/DocItem/Footer/index.js +17 -0
- package/lib/theme/DocItem/Layout/index.d.ts +3 -0
- package/lib/theme/DocItem/Layout/index.js +71 -0
- package/lib/theme/DocItem/Metadata/index.d.ts +2 -0
- package/lib/theme/DocItem/Metadata/index.js +7 -0
- package/lib/theme/DocItem/Paginator/index.d.ts +6 -0
- package/lib/theme/DocItem/Paginator/index.js +11 -0
- package/lib/theme/DocItem/TOC/Desktop/index.d.ts +2 -0
- package/lib/theme/DocItem/TOC/Desktop/index.js +8 -0
- package/lib/theme/DocItem/TOC/Mobile/index.d.ts +2 -0
- package/lib/theme/DocItem/TOC/Mobile/index.js +17 -0
- package/lib/theme/DocItem/index.d.ts +3 -0
- package/lib/theme/DocItem/index.js +10 -0
- package/lib/theme/DocPaginator/index.d.ts +3 -0
- package/lib/theme/DocPaginator/index.js +19 -0
- package/lib/theme/DocRoot/Layout/Main/index.d.ts +3 -0
- package/lib/theme/DocRoot/Layout/Main/index.js +35 -0
- package/lib/theme/DocRoot/Layout/Sidebar/index.d.ts +3 -0
- package/lib/theme/DocRoot/Layout/Sidebar/index.js +81 -0
- package/lib/theme/DocRoot/Layout/index.d.ts +3 -0
- package/lib/theme/DocRoot/Layout/index.js +47 -0
- package/lib/theme/DocSidebarItem/Category/index.d.ts +3 -0
- package/lib/theme/DocSidebarItem/Category/index.js +146 -0
- package/lib/theme/DocSidebarItem/Link/index.d.ts +3 -0
- package/lib/theme/DocSidebarItem/Link/index.js +39 -0
- package/lib/theme/DocSidebarItem/index.d.ts +3 -0
- package/lib/theme/DocSidebarItem/index.js +15 -0
- package/lib/theme/DocSidebarItems/index.d.ts +5 -0
- package/lib/theme/DocSidebarItems/index.js +17 -0
- package/lib/theme/EditThisPage/index.d.ts +3 -0
- package/lib/theme/EditThisPage/index.js +17 -0
- package/lib/theme/Footer/index.d.ts +2 -0
- package/lib/theme/Footer/index.js +43 -0
- package/lib/theme/Heading/index.d.ts +3 -0
- package/lib/theme/Heading/index.js +49 -0
- package/lib/theme/Logo/index.d.ts +3 -0
- package/lib/theme/Logo/index.js +80 -0
- package/lib/theme/MDXComponents/A.d.ts +6 -0
- package/lib/theme/MDXComponents/A.js +17 -0
- package/lib/theme/MDXComponents/Blockquote.d.ts +2 -0
- package/lib/theme/MDXComponents/Blockquote.js +18 -0
- package/lib/theme/MDXComponents/Code.d.ts +6 -0
- package/lib/theme/MDXComponents/Code.js +35 -0
- package/lib/theme/MDXComponents/Heading.d.ts +4 -0
- package/lib/theme/MDXComponents/Heading.js +4 -0
- package/lib/theme/MDXComponents/ListItem.d.ts +2 -0
- package/lib/theme/MDXComponents/ListItem.js +5 -0
- package/lib/theme/MDXComponents/OrderedList.d.ts +2 -0
- package/lib/theme/MDXComponents/OrderedList.js +11 -0
- package/lib/theme/MDXComponents/Paragraph.d.ts +2 -0
- package/lib/theme/MDXComponents/Paragraph.js +18 -0
- package/lib/theme/MDXComponents/Table.d.ts +2 -0
- package/lib/theme/MDXComponents/Table.js +3 -0
- package/lib/theme/MDXComponents/TableBody.d.ts +2 -0
- package/lib/theme/MDXComponents/TableBody.js +3 -0
- package/lib/theme/MDXComponents/TableDataCell.d.ts +2 -0
- package/lib/theme/MDXComponents/TableDataCell.js +3 -0
- package/lib/theme/MDXComponents/TableHeader.d.ts +2 -0
- package/lib/theme/MDXComponents/TableHeader.js +3 -0
- package/lib/theme/MDXComponents/TableHeaderCell.d.ts +2 -0
- package/lib/theme/MDXComponents/TableHeaderCell.js +3 -0
- package/lib/theme/MDXComponents/TableRow.d.ts +2 -0
- package/lib/theme/MDXComponents/TableRow.js +3 -0
- package/lib/theme/MDXComponents/UnorderedList.d.ts +2 -0
- package/lib/theme/MDXComponents/UnorderedList.js +11 -0
- package/lib/theme/MDXComponents/index.d.ts +2 -0
- package/lib/theme/MDXComponents/index.js +46 -0
- package/lib/theme/MDXContent/index.d.ts +6 -0
- package/lib/theme/MDXContent/index.js +4 -0
- package/lib/theme/Navbar/Content/index.d.ts +7 -0
- package/lib/theme/Navbar/Content/index.js +149 -0
- package/lib/theme/Navbar/Layout/index.d.ts +6 -0
- package/lib/theme/Navbar/Layout/index.js +59 -0
- package/lib/theme/Navbar/MobileSidebar/Header/index.d.ts +7 -0
- package/lib/theme/Navbar/MobileSidebar/Header/index.js +46 -0
- package/lib/theme/Navbar/MobileSidebar/Layout/index.d.ts +6 -0
- package/lib/theme/Navbar/MobileSidebar/Layout/index.js +26 -0
- package/lib/theme/Navbar/MobileSidebar/index.d.ts +7 -0
- package/lib/theme/Navbar/MobileSidebar/index.js +14 -0
- package/lib/theme/NavbarItem/DropdownNavbarItem/index.d.ts +3 -0
- package/lib/theme/NavbarItem/DropdownNavbarItem/index.js +94 -0
- package/lib/theme/NavbarItem/NavbarNavLink.d.ts +7 -0
- package/lib/theme/NavbarItem/NavbarNavLink.js +48 -0
- package/lib/theme/PaginatorNavLink/index.d.ts +3 -0
- package/lib/theme/PaginatorNavLink/index.js +43 -0
- package/lib/theme/Root.d.ts +3 -0
- package/lib/theme/Root.js +66 -0
- package/lib/theme/Root.styles.d.ts +2 -0
- package/lib/theme/Root.styles.js +111 -0
- package/lib/theme/TOCCollapsible/CollapseButton/index.d.ts +3 -0
- package/lib/theme/TOCCollapsible/CollapseButton/index.js +23 -0
- package/lib/theme/TOCItems/Tree.d.ts +5 -0
- package/lib/theme/TOCItems/Tree.js +80 -0
- package/lib/theme/infima.styles.d.ts +1 -0
- package/lib/theme/infima.styles.js +1456 -0
- package/lib/theme/reset.styles.d.ts +2 -0
- package/lib/theme/reset.styles.js +79 -0
- package/package.json +61 -0
- package/src/components/badge/index.ts +11 -0
- package/src/components/codesandbox_icon/codesandbox_icon.tsx +24 -0
- package/src/components/codesandbox_icon/index.ts +9 -0
- package/src/components/demo/actions_bar/actions_bar.tsx +95 -0
- package/src/components/demo/actions_bar/index.ts +9 -0
- package/src/components/demo/code_transformer.ts +44 -0
- package/src/components/demo/codesandbox/find_external_dependencies.ts +34 -0
- package/src/components/demo/codesandbox/index.ts +9 -0
- package/src/components/demo/codesandbox/open_action.tsx +132 -0
- package/src/components/demo/context.ts +30 -0
- package/src/components/demo/create_demo.tsx +17 -0
- package/src/components/demo/demo.tsx +143 -0
- package/src/components/demo/editor/editor.tsx +51 -0
- package/src/components/demo/editor/index.ts +9 -0
- package/src/components/demo/index.ts +11 -0
- package/src/components/demo/preview/index.ts +9 -0
- package/src/components/demo/preview/preview.tsx +77 -0
- package/src/components/demo/scope.ts +14 -0
- package/src/components/demo/source/get_source_from_children.ts +59 -0
- package/src/components/demo/source/index.ts +9 -0
- package/src/components/demo/source/source.tsx +36 -0
- package/src/components/figma_embed/index.tsx +57 -0
- package/src/components/guideline/guideline.tsx +121 -0
- package/src/components/guideline/guideline_text.tsx +51 -0
- package/src/components/guideline/index.ts +10 -0
- package/src/components/guideline/types.ts +9 -0
- package/src/components/high_contrast_mode_toggle/index.tsx +28 -0
- package/src/components/icon/index.ts +11 -0
- package/src/components/index.ts +15 -0
- package/src/components/navbar_item/index.tsx +164 -0
- package/src/components/prop_table/definition_types.ts +53 -0
- package/src/components/prop_table/extended_types.tsx +66 -0
- package/src/components/prop_table/extended_types_info.ts +35 -0
- package/src/components/prop_table/index.ts +9 -0
- package/src/components/prop_table/prop_table.tsx +235 -0
- package/src/components/theme_context/index.tsx +156 -0
- package/src/components/theme_context/theme_overrides.ts +15 -0
- package/src/components/version_switcher/index.tsx +144 -0
- package/src/index.ts +21 -0
- package/src/theme/Admonition/Types.tsx +85 -0
- package/src/theme/CodeBlock/index.tsx +57 -0
- package/src/theme/ColorModeToggle/index.tsx +93 -0
- package/src/theme/Demo/actions.tsx +20 -0
- package/src/theme/Demo/default_scope.ts +19 -0
- package/src/theme/DocBreadcrumbs/Items/Home/index.tsx +38 -0
- package/src/theme/DocBreadcrumbs/Items/item.styles.ts +43 -0
- package/src/theme/DocBreadcrumbs/index.tsx +144 -0
- package/src/theme/DocItem/Content/index.tsx +75 -0
- package/src/theme/DocItem/Footer/index.tsx +59 -0
- package/src/theme/DocItem/Layout/index.tsx +112 -0
- package/src/theme/DocItem/Metadata/index.tsx +23 -0
- package/src/theme/DocItem/Paginator/index.tsx +20 -0
- package/src/theme/DocItem/TOC/Desktop/index.tsx +24 -0
- package/src/theme/DocItem/TOC/Mobile/index.tsx +35 -0
- package/src/theme/DocItem/index.tsx +30 -0
- package/src/theme/DocPaginator/index.tsx +64 -0
- package/src/theme/DocRoot/Layout/Main/index.tsx +61 -0
- package/src/theme/DocRoot/Layout/Sidebar/index.tsx +124 -0
- package/src/theme/DocRoot/Layout/index.tsx +72 -0
- package/src/theme/DocSidebarItem/Category/index.tsx +266 -0
- package/src/theme/DocSidebarItem/Link/index.tsx +86 -0
- package/src/theme/DocSidebarItem/index.tsx +29 -0
- package/src/theme/DocSidebarItems/index.tsx +30 -0
- package/src/theme/EditThisPage/index.tsx +50 -0
- package/src/theme/Footer/index.tsx +67 -0
- package/src/theme/Heading/index.tsx +94 -0
- package/src/theme/Logo/index.tsx +146 -0
- package/src/theme/MDXComponents/A.tsx +33 -0
- package/src/theme/MDXComponents/Blockquote.tsx +35 -0
- package/src/theme/MDXComponents/Code.tsx +60 -0
- package/src/theme/MDXComponents/Heading.tsx +16 -0
- package/src/theme/MDXComponents/ListItem.tsx +20 -0
- package/src/theme/MDXComponents/OrderedList.tsx +26 -0
- package/src/theme/MDXComponents/Paragraph.tsx +33 -0
- package/src/theme/MDXComponents/Table.tsx +16 -0
- package/src/theme/MDXComponents/TableBody.tsx +16 -0
- package/src/theme/MDXComponents/TableDataCell.tsx +20 -0
- package/src/theme/MDXComponents/TableHeader.tsx +16 -0
- package/src/theme/MDXComponents/TableHeaderCell.tsx +20 -0
- package/src/theme/MDXComponents/TableRow.tsx +16 -0
- package/src/theme/MDXComponents/UnorderedList.tsx +26 -0
- package/src/theme/MDXComponents/index.ts +61 -0
- package/src/theme/MDXContent/index.tsx +22 -0
- package/src/theme/Navbar/Content/index.tsx +262 -0
- package/src/theme/Navbar/Layout/index.tsx +100 -0
- package/src/theme/Navbar/MobileSidebar/Header/index.tsx +89 -0
- package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +44 -0
- package/src/theme/Navbar/MobileSidebar/index.tsx +46 -0
- package/src/theme/NavbarItem/DropdownNavbarItem/index.tsx +200 -0
- package/src/theme/NavbarItem/NavbarNavLink.tsx +141 -0
- package/src/theme/PaginatorNavLink/index.tsx +72 -0
- package/src/theme/Root.styles.ts +122 -0
- package/src/theme/Root.tsx +106 -0
- package/src/theme/TOCCollapsible/CollapseButton/index.tsx +53 -0
- package/src/theme/TOCItems/Tree.tsx +114 -0
- package/src/theme/infima.styles.ts +1458 -0
- package/src/theme/reset.styles.ts +82 -0
- package/src/theme/theme.d.ts +598 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
import { useEffect, useMemo } from 'react';
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { css } from '@emotion/react';
|
|
12
|
+
import { ThemeClassNames, useThemeConfig, usePrevious, Collapsible, useCollapsible, } from '@docusaurus/theme-common';
|
|
13
|
+
import { isSamePath } from '@docusaurus/theme-common/internal';
|
|
14
|
+
import { isActiveSidebarItem, findFirstSidebarItemLink, useDocSidebarItemsExpandedState, } from '@docusaurus/plugin-content-docs/client';
|
|
15
|
+
import Link from '@docusaurus/Link';
|
|
16
|
+
import { translate } from '@docusaurus/Translate';
|
|
17
|
+
import useIsBrowser from '@docusaurus/useIsBrowser';
|
|
18
|
+
import { EuiIcon, useEuiMemoizedStyles } from '@elastic/eui';
|
|
19
|
+
import DocSidebarItems from '../../DocSidebarItems';
|
|
20
|
+
const getStyles = ({ euiTheme }) => ({
|
|
21
|
+
listItem: css `
|
|
22
|
+
--ifm-menu-color-background-hover: var(--eui-background-color-primary);
|
|
23
|
+
--ifm-menu-color-background-active: var(--eui-background-color-primary);
|
|
24
|
+
|
|
25
|
+
--ifm-menu-link-padding-horizontal: ${euiTheme.size.s};
|
|
26
|
+
--ifm-menu-link-padding-vertical: calc(${euiTheme.size.xs} + 2px);
|
|
27
|
+
|
|
28
|
+
.menu__link--sublist {
|
|
29
|
+
color: ${euiTheme.colors.text};
|
|
30
|
+
font-size: var(--eui-font-size-s);
|
|
31
|
+
line-height: var(--eui-line-height-s);
|
|
32
|
+
font-weight: ${euiTheme.font.weight.bold};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.menu__link--active {
|
|
36
|
+
border-radius: ${euiTheme.border.radius.small};
|
|
37
|
+
color: ${euiTheme.colors.primary};
|
|
38
|
+
}
|
|
39
|
+
`,
|
|
40
|
+
button: css `
|
|
41
|
+
padding: ${euiTheme.size.s};
|
|
42
|
+
`,
|
|
43
|
+
});
|
|
44
|
+
// If we navigate to a category and it becomes active, it should automatically
|
|
45
|
+
// expand itself
|
|
46
|
+
function useAutoExpandActiveCategory({ isActive, collapsed, updateCollapsed, }) {
|
|
47
|
+
const wasActive = usePrevious(isActive);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const justBecameActive = isActive && !wasActive;
|
|
50
|
+
if (justBecameActive && collapsed) {
|
|
51
|
+
updateCollapsed(false);
|
|
52
|
+
}
|
|
53
|
+
}, [isActive, wasActive, collapsed, updateCollapsed]);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* When a collapsible category has no link, we still link it to its first child
|
|
57
|
+
* during SSR as a temporary fallback. This allows to be able to navigate inside
|
|
58
|
+
* the category even when JS fails to load, is delayed or simply disabled
|
|
59
|
+
* React hydration becomes an optional progressive enhancement
|
|
60
|
+
* see https://github.com/facebookincubator/infima/issues/36#issuecomment-772543188
|
|
61
|
+
* see https://github.com/facebook/docusaurus/issues/3030
|
|
62
|
+
*/
|
|
63
|
+
function useCategoryHrefWithSSRFallback(item) {
|
|
64
|
+
const isBrowser = useIsBrowser();
|
|
65
|
+
return useMemo(() => {
|
|
66
|
+
if (item.href && !item.linkUnlisted) {
|
|
67
|
+
return item.href;
|
|
68
|
+
}
|
|
69
|
+
// In these cases, it's not necessary to render a fallback
|
|
70
|
+
// We skip the "findFirstCategoryLink" computation
|
|
71
|
+
if (isBrowser || !item.collapsible) {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
return findFirstSidebarItemLink(item);
|
|
75
|
+
}, [item, isBrowser]);
|
|
76
|
+
}
|
|
77
|
+
function CollapseButton({ collapsed, categoryLabel, onClick, ...rest }) {
|
|
78
|
+
return (_jsx("button", { "aria-label": collapsed
|
|
79
|
+
? translate({
|
|
80
|
+
id: 'theme.DocSidebarItem.expandCategoryAriaLabel',
|
|
81
|
+
message: "Expand sidebar category '{label}'",
|
|
82
|
+
description: 'The ARIA label to expand the sidebar category',
|
|
83
|
+
}, { label: categoryLabel })
|
|
84
|
+
: translate({
|
|
85
|
+
id: 'theme.DocSidebarItem.collapseCategoryAriaLabel',
|
|
86
|
+
message: "Collapse sidebar category '{label}'",
|
|
87
|
+
description: 'The ARIA label to collapse the sidebar category',
|
|
88
|
+
}, { label: categoryLabel }), "aria-expanded": !collapsed, type: "button", className: "clean-btn", onClick: onClick, ...rest, children: _jsx(EuiIcon, { size: "s", type: collapsed ? 'arrowRight' : 'arrowDown' }) }));
|
|
89
|
+
}
|
|
90
|
+
export default function DocSidebarItemCategory({ item, onItemClick, activePath, level, index, ...props }) {
|
|
91
|
+
const { items, label, collapsible, className, href } = item;
|
|
92
|
+
const { docs: { sidebar: { autoCollapseCategories }, }, } = useThemeConfig();
|
|
93
|
+
const hrefWithSSRFallback = useCategoryHrefWithSSRFallback(item);
|
|
94
|
+
const isActive = isActiveSidebarItem(item, activePath);
|
|
95
|
+
const isCurrentPage = isSamePath(href, activePath);
|
|
96
|
+
const styles = useEuiMemoizedStyles(getStyles);
|
|
97
|
+
const { collapsed, setCollapsed } = useCollapsible({
|
|
98
|
+
// Active categories are always initialized as expanded. The default
|
|
99
|
+
// (`item.collapsed`) is only used for non-active categories.
|
|
100
|
+
initialState: () => {
|
|
101
|
+
if (!collapsible) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
return isActive ? false : item.collapsed;
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
const { expandedItem, setExpandedItem } = useDocSidebarItemsExpandedState();
|
|
108
|
+
// Use this instead of `setCollapsed`, because it is also reactive
|
|
109
|
+
const updateCollapsed = (toCollapsed = !collapsed) => {
|
|
110
|
+
setExpandedItem(toCollapsed ? null : index);
|
|
111
|
+
setCollapsed(toCollapsed);
|
|
112
|
+
};
|
|
113
|
+
useAutoExpandActiveCategory({ isActive, collapsed, updateCollapsed });
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (collapsible &&
|
|
116
|
+
expandedItem != null &&
|
|
117
|
+
expandedItem !== index &&
|
|
118
|
+
autoCollapseCategories) {
|
|
119
|
+
setCollapsed(true);
|
|
120
|
+
}
|
|
121
|
+
}, [collapsible, expandedItem, index, setCollapsed, autoCollapseCategories]);
|
|
122
|
+
return (_jsxs("li", { className: clsx(ThemeClassNames.docs.docSidebarItemCategory, ThemeClassNames.docs.docSidebarItemCategoryLevel(level), 'menu__list-item', {
|
|
123
|
+
'menu__list-item--collapsed': collapsed,
|
|
124
|
+
}, className), css: styles.listItem, children: [_jsxs("div", { className: clsx('menu__list-item-collapsible', {
|
|
125
|
+
'menu__list-item-collapsible--active': isCurrentPage && !collapsed,
|
|
126
|
+
}), children: [_jsx(Link, { className: clsx('menu__link', {
|
|
127
|
+
'menu__link--sublist': collapsible,
|
|
128
|
+
'menu__link--active': isCurrentPage && !collapsed && isActive,
|
|
129
|
+
}), onClick: collapsible
|
|
130
|
+
? (e) => {
|
|
131
|
+
onItemClick?.(item);
|
|
132
|
+
if (href) {
|
|
133
|
+
updateCollapsed(false);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
updateCollapsed();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
: () => {
|
|
141
|
+
onItemClick?.(item);
|
|
142
|
+
}, "aria-current": isCurrentPage ? 'page' : undefined, role: collapsible && !href ? 'button' : undefined, "aria-expanded": collapsible && !href ? !collapsed : undefined, href: collapsible ? hrefWithSSRFallback ?? '#' : hrefWithSSRFallback, ...props, children: label }), collapsible && (_jsx(CollapseButton, { collapsed: collapsed, categoryLabel: label, onClick: (e) => {
|
|
143
|
+
e.preventDefault();
|
|
144
|
+
updateCollapsed();
|
|
145
|
+
}, css: styles.button }))] }), _jsx(Collapsible, { lazy: true, as: "ul", className: "menu__list", collapsed: collapsed, children: _jsx(DocSidebarItems, { items: items, tabIndex: collapsed ? -1 : 0, onItemClick: onItemClick, activePath: activePath, level: level + 1 }) })] }));
|
|
146
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { ThemeClassNames } from '@docusaurus/theme-common';
|
|
5
|
+
import { isActiveSidebarItem } from '@docusaurus/plugin-content-docs/client';
|
|
6
|
+
import Link from '@docusaurus/Link';
|
|
7
|
+
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
8
|
+
import IconExternalLink from '@theme-original/Icon/ExternalLink';
|
|
9
|
+
import { useEuiMemoizedStyles } from '@elastic/eui';
|
|
10
|
+
// converted from css modules to Emotion
|
|
11
|
+
const getStyles = ({ euiTheme }) => ({
|
|
12
|
+
menuListItem: css `
|
|
13
|
+
.menu__link {
|
|
14
|
+
color: ${euiTheme.colors.text};
|
|
15
|
+
font-size: var(--eui-font-size-s);
|
|
16
|
+
line-height: var(--eui-line-height-s);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.menu__link--active {
|
|
20
|
+
border-radius: ${euiTheme.border.radius.small};
|
|
21
|
+
color: ${euiTheme.colors.primary};
|
|
22
|
+
font-weight: ${euiTheme.font.weight.bold};
|
|
23
|
+
}
|
|
24
|
+
`,
|
|
25
|
+
menuExternalLink: css `
|
|
26
|
+
align-items: center;
|
|
27
|
+
`,
|
|
28
|
+
});
|
|
29
|
+
export default function DocSidebarItemLink({ item, onItemClick, activePath, level, index, ...props }) {
|
|
30
|
+
const { href, label, className, autoAddBaseUrl } = item;
|
|
31
|
+
const isActive = isActiveSidebarItem(item, activePath);
|
|
32
|
+
const isInternalLink = isInternalUrl(href);
|
|
33
|
+
const styles = useEuiMemoizedStyles(getStyles);
|
|
34
|
+
return (_jsx("li", { className: clsx(ThemeClassNames.docs.docSidebarItemLink, ThemeClassNames.docs.docSidebarItemLinkLevel(level), 'menu__list-item', className), css: styles.menuListItem, children: _jsxs(Link, { className: clsx('menu__link', !isInternalLink && styles.menuExternalLink, {
|
|
35
|
+
'menu__link--active': isActive,
|
|
36
|
+
}), autoAddBaseUrl: autoAddBaseUrl, "aria-current": isActive ? 'page' : undefined, to: href, ...(isInternalLink && {
|
|
37
|
+
onClick: onItemClick ? () => onItemClick(item) : undefined,
|
|
38
|
+
}), ...props, children: [label, !isInternalLink && _jsx(IconExternalLink, {})] }) }, label));
|
|
39
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import DocSidebarItemHtml from '@theme-original/DocSidebarItem/Html';
|
|
3
|
+
import DocSidebarItemCategory from './Category';
|
|
4
|
+
import DocSidebarItemLink from './Link';
|
|
5
|
+
export default function DocSidebarItem({ item, ...props }) {
|
|
6
|
+
switch (item.type) {
|
|
7
|
+
case 'category':
|
|
8
|
+
return _jsx(DocSidebarItemCategory, { item: item, ...props });
|
|
9
|
+
case 'html':
|
|
10
|
+
return _jsx(DocSidebarItemHtml, { item: item, ...props });
|
|
11
|
+
case 'link':
|
|
12
|
+
default:
|
|
13
|
+
return _jsx(DocSidebarItemLink, { item: item, ...props });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import type { Props } from '@theme-original/DocSidebarItems';
|
|
3
|
+
declare function DocSidebarItems({ items, ...props }: Props): JSX.Element;
|
|
4
|
+
declare const _default: import("react").MemoExoticComponent<typeof DocSidebarItems>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
import { memo } from 'react';
|
|
10
|
+
import { DocSidebarItemsExpandedStateProvider, useVisibleSidebarItems, } from '@docusaurus/plugin-content-docs/client';
|
|
11
|
+
import DocSidebarItem from '../DocSidebarItem';
|
|
12
|
+
function DocSidebarItems({ items, ...props }) {
|
|
13
|
+
const visibleItems = useVisibleSidebarItems(items, props.activePath);
|
|
14
|
+
return (_jsx(DocSidebarItemsExpandedStateProvider, { children: visibleItems.map((item, index) => (_jsx(DocSidebarItem, { item: item, index: index, ...props }, index))) }));
|
|
15
|
+
}
|
|
16
|
+
// Optimize sidebar at each "level"
|
|
17
|
+
export default memo(DocSidebarItems);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
import Translate from '@docusaurus/Translate';
|
|
4
|
+
import { EuiButton, euiButtonColor, useEuiMemoizedStyles, } from '@elastic/eui';
|
|
5
|
+
const getStyles = (theme) => {
|
|
6
|
+
const buttonColor = euiButtonColor(theme, 'primary');
|
|
7
|
+
return {
|
|
8
|
+
editPage: css `
|
|
9
|
+
// overriding Docusaurus link hover styles to preserve button styles
|
|
10
|
+
--ifm-link-hover-color: ${buttonColor.color};
|
|
11
|
+
`,
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default function EditThisPage({ editUrl, ...rest }) {
|
|
15
|
+
const styles = useEuiMemoizedStyles(getStyles);
|
|
16
|
+
return (_jsx(EuiButton, { ...rest, href: editUrl, iconType: "pencil", color: "primary", css: styles.editPage, children: _jsx(Translate, { id: "theme.common.editThisPage", description: "The link label to edit the current page", children: "Edit this page" }) }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
import { css } from '@emotion/react';
|
|
10
|
+
import { EuiText, EuiThemeProvider, useEuiMemoizedStyles, } from '@elastic/eui';
|
|
11
|
+
import { useThemeConfig } from '@docusaurus/theme-common';
|
|
12
|
+
import { euiLinkStyles } from '@elastic/eui/es/components/link/link.styles';
|
|
13
|
+
const getFooterStyles = (euiThemeContext) => {
|
|
14
|
+
const { euiTheme } = euiThemeContext;
|
|
15
|
+
return {
|
|
16
|
+
root: css `
|
|
17
|
+
background: ${euiTheme.colors
|
|
18
|
+
.backgroundBaseSubdued}; // Color not available in EUI
|
|
19
|
+
padding: ${euiTheme.size.l};
|
|
20
|
+
text-align: center;
|
|
21
|
+
`,
|
|
22
|
+
text: css `
|
|
23
|
+
line-height: var(--eui-line-height-s);
|
|
24
|
+
|
|
25
|
+
a {
|
|
26
|
+
${euiLinkStyles(euiThemeContext).euiLink}
|
|
27
|
+
${euiLinkStyles(euiThemeContext).primary}
|
|
28
|
+
}
|
|
29
|
+
`,
|
|
30
|
+
heart: css `
|
|
31
|
+
color: ${euiTheme.colors.accent};
|
|
32
|
+
`,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const _Footer = () => {
|
|
36
|
+
const styles = useEuiMemoizedStyles(getFooterStyles);
|
|
37
|
+
const { footer } = useThemeConfig();
|
|
38
|
+
return (_jsx("footer", { css: styles.root, children: _jsx(EuiText, { textAlign: "center", size: "s", css: styles.text, dangerouslySetInnerHTML: { __html: footer?.copyright ?? '' } }) }));
|
|
39
|
+
};
|
|
40
|
+
const Footer = () => {
|
|
41
|
+
return (_jsx(EuiThemeProvider, { colorMode: "dark", children: _jsx(_Footer, {}) }));
|
|
42
|
+
};
|
|
43
|
+
export default Footer;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
import useBrokenLinks from '@docusaurus/useBrokenLinks';
|
|
10
|
+
import { EuiTitle, EuiButtonIcon, useEuiMemoizedStyles, } from '@elastic/eui';
|
|
11
|
+
import { css } from '@emotion/react';
|
|
12
|
+
const TAG_TO_TITLE_SIZE_MAP = {
|
|
13
|
+
h6: 'xxxs',
|
|
14
|
+
h5: 'xxs',
|
|
15
|
+
h4: 'xs',
|
|
16
|
+
h3: 's',
|
|
17
|
+
h2: 'm',
|
|
18
|
+
h1: 'l',
|
|
19
|
+
};
|
|
20
|
+
const getHeadingStyles = ({ euiTheme }) => ({
|
|
21
|
+
heading: css `
|
|
22
|
+
margin-block-start: calc(var(--eui-theme-content-vertical-spacing) * 2.5);
|
|
23
|
+
margin-block-end: var(--eui-theme-content-vertical-spacing);
|
|
24
|
+
scroll-margin-block-start: calc(var(--ifm-navbar-height) + 1rem);
|
|
25
|
+
|
|
26
|
+
&:first-child {
|
|
27
|
+
margin-block-start: var(--eui-theme-content-vertical-spacing);
|
|
28
|
+
}
|
|
29
|
+
`,
|
|
30
|
+
anchor: css `
|
|
31
|
+
margin-inline-start: ${euiTheme.size.s};
|
|
32
|
+
opacity: 0;
|
|
33
|
+
|
|
34
|
+
&:focus,
|
|
35
|
+
.heading:hover & {
|
|
36
|
+
opacity: 1;
|
|
37
|
+
}
|
|
38
|
+
`,
|
|
39
|
+
});
|
|
40
|
+
const Heading = ({ as: Component, children, id, ...restProps }) => {
|
|
41
|
+
const brokenLinks = useBrokenLinks();
|
|
42
|
+
const styles = useEuiMemoizedStyles(getHeadingStyles);
|
|
43
|
+
brokenLinks.collectAnchor(id);
|
|
44
|
+
const anchorTitle = `Direct link to ${typeof children === 'string' ? children : id}`;
|
|
45
|
+
// We don't want to show section links on document title headings
|
|
46
|
+
const shouldShowSectionLink = Component !== 'h1';
|
|
47
|
+
return (_jsx(EuiTitle, { size: TAG_TO_TITLE_SIZE_MAP[Component], children: _jsxs(Component, { ...restProps, className: "heading anchor", css: styles.heading, id: id, children: [children, shouldShowSectionLink && (_jsx(EuiButtonIcon, { css: styles.anchor, href: `#${id}`, "aria-label": anchorTitle, title: anchorTitle, iconType: "link", color: "text", size: "xs" }))] }) }));
|
|
48
|
+
};
|
|
49
|
+
export default Heading;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
import { useContext } from 'react';
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import Link from '@docusaurus/Link';
|
|
12
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
13
|
+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
14
|
+
import { useThemeConfig, } from '@docusaurus/theme-common';
|
|
15
|
+
import { EuiImage, euiTextTruncate, useEuiMemoizedStyles, } from '@elastic/eui';
|
|
16
|
+
import { AppThemeContext } from '../../components/theme_context';
|
|
17
|
+
const getStyles = ({ euiTheme }) => ({
|
|
18
|
+
wrapper: css `
|
|
19
|
+
${euiTextTruncate()}
|
|
20
|
+
// create space to prevent focus outline from being cut off
|
|
21
|
+
padding: ${euiTheme.size.xs};
|
|
22
|
+
|
|
23
|
+
@media (min-width: 997px) {
|
|
24
|
+
border-right: ${euiTheme.border.thin};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.navbar__brand {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
|
|
31
|
+
margin-inline-end: ${euiTheme.size.m};
|
|
32
|
+
|
|
33
|
+
@media (min-width: 997px) {
|
|
34
|
+
margin-inline-end: ${euiTheme.size.l};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.navbar__logo {
|
|
39
|
+
height: 100%;
|
|
40
|
+
}
|
|
41
|
+
`,
|
|
42
|
+
imageWrapper: css `
|
|
43
|
+
margin-inline-end: ${euiTheme.size.m};
|
|
44
|
+
`,
|
|
45
|
+
image: css `
|
|
46
|
+
position: relative;
|
|
47
|
+
block-size: ${euiTheme.size.l};
|
|
48
|
+
inline-size: ${euiTheme.size.l};
|
|
49
|
+
margin: 0;
|
|
50
|
+
`,
|
|
51
|
+
});
|
|
52
|
+
function LogoThemedImage({ logo, alt, imageClassName, }) {
|
|
53
|
+
const { colorMode } = useContext(AppThemeContext);
|
|
54
|
+
const isDarkMode = colorMode === 'dark';
|
|
55
|
+
const styles = useEuiMemoizedStyles(getStyles);
|
|
56
|
+
const src = isDarkMode
|
|
57
|
+
? useBaseUrl(logo.srcDark || logo.src)
|
|
58
|
+
: useBaseUrl(logo.src);
|
|
59
|
+
const themedImage = (_jsx(EuiImage, { src: src, size: "fullWidth", alt: alt, className: logo.className, wrapperProps: {
|
|
60
|
+
style: logo.style,
|
|
61
|
+
css: styles.image,
|
|
62
|
+
} }));
|
|
63
|
+
// Is this extra div really necessary?
|
|
64
|
+
// introduced in https://github.com/facebook/docusaurus/pull/5666
|
|
65
|
+
return imageClassName ? (_jsx("div", { className: imageClassName, css: styles.imageWrapper, children: themedImage })) : (themedImage);
|
|
66
|
+
}
|
|
67
|
+
export default function Logo(props) {
|
|
68
|
+
const { siteConfig: { title }, } = useDocusaurusContext();
|
|
69
|
+
const { navbar: { title: navbarTitle, logo }, } = useThemeConfig();
|
|
70
|
+
const { imageClassName, titleClassName, ...propsRest } = props;
|
|
71
|
+
const logoLink = useBaseUrl(logo?.href || '/');
|
|
72
|
+
const styles = useEuiMemoizedStyles(getStyles);
|
|
73
|
+
// If visible title is shown, fallback alt text should be
|
|
74
|
+
// an empty string to mark the logo as decorative.
|
|
75
|
+
const fallbackAlt = navbarTitle ? '' : title;
|
|
76
|
+
// Use logo alt text if provided (including empty string),
|
|
77
|
+
// and provide a sensible fallback otherwise.
|
|
78
|
+
const alt = logo?.alt ?? fallbackAlt;
|
|
79
|
+
return (_jsx("div", { css: styles.wrapper, children: _jsxs(Link, { to: logoLink, ...propsRest, ...(logo?.target && { target: logo.target }), children: [logo && (_jsx(LogoThemedImage, { logo: logo, alt: alt, imageClassName: imageClassName })), navbarTitle != null && _jsx("b", { className: titleClassName, children: navbarTitle })] }) }));
|
|
80
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
import { EuiLink, useEuiMemoizedStyles } from '@elastic/eui';
|
|
4
|
+
const getStyles = ({ euiTheme }) => {
|
|
5
|
+
return {
|
|
6
|
+
link: css `
|
|
7
|
+
font-weight: ${euiTheme.font.weight.bold};
|
|
8
|
+
text-decoration: underline;
|
|
9
|
+
text-decoration-color: currentColor;
|
|
10
|
+
`,
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
const A = (props) => {
|
|
14
|
+
const styles = useEuiMemoizedStyles(getStyles);
|
|
15
|
+
return _jsx(EuiLink, { ...props, css: styles.link });
|
|
16
|
+
};
|
|
17
|
+
export default A;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { EuiText, useEuiMemoizedStyles } from '@elastic/eui';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
const getBlockquoteStyles = () => css `
|
|
5
|
+
margin-block: var(--eui-theme-content-vertical-spacing);
|
|
6
|
+
|
|
7
|
+
&:first-child {
|
|
8
|
+
margin-block-start: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&:last-child {
|
|
12
|
+
margin-block-end: 0;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
export const Blockquote = ({ children }) => {
|
|
16
|
+
const styles = useEuiMemoizedStyles(getBlockquoteStyles);
|
|
17
|
+
return (_jsx(EuiText, { size: "m", css: styles, children: _jsx("blockquote", { children: children }) }));
|
|
18
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import type CodeType from '@theme-init/MDXComponents/Code';
|
|
3
|
+
import type { WrapperProps } from '@docusaurus/types';
|
|
4
|
+
type Props = WrapperProps<typeof CodeType>;
|
|
5
|
+
declare const Code: ({ children, className, ...rest }: Props) => JSX.Element;
|
|
6
|
+
export default Code;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import CodeBlock from '@theme/CodeBlock';
|
|
11
|
+
import { css } from '@emotion/react';
|
|
12
|
+
import { EuiCode, useEuiMemoizedStyles } from '@elastic/eui';
|
|
13
|
+
const getStyles = ({ euiTheme }) => {
|
|
14
|
+
return {
|
|
15
|
+
code: css `
|
|
16
|
+
// reset docusaurus code styles
|
|
17
|
+
border: none;
|
|
18
|
+
vertical-align: initial;
|
|
19
|
+
`,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
const Code = ({ children, className, ...rest }) => {
|
|
23
|
+
const styles = useEuiMemoizedStyles(getStyles);
|
|
24
|
+
const language = className?.startsWith('language-')
|
|
25
|
+
? className.replace('language-', '')
|
|
26
|
+
: undefined;
|
|
27
|
+
const isInlineCode = children
|
|
28
|
+
? React.Children.toArray(children).every((el) => typeof el === 'string' && !el.includes('\n'))
|
|
29
|
+
: false;
|
|
30
|
+
if (isInlineCode) {
|
|
31
|
+
return (_jsx(EuiCode, { ...rest, className: className, language: language, css: styles.code, children: children }));
|
|
32
|
+
}
|
|
33
|
+
return (_jsx(CodeBlock, { className: className, ...rest, children: children }));
|
|
34
|
+
};
|
|
35
|
+
export default Code;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useEuiMemoizedStyles } from '@elastic/eui';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
const getOrderedListStyles = ({ euiTheme }) => css `
|
|
5
|
+
margin-inline-start: ${euiTheme.size.l};
|
|
6
|
+
list-style: decimal;
|
|
7
|
+
`;
|
|
8
|
+
export const OrderedList = ({ children, ...restProps }) => {
|
|
9
|
+
const styles = useEuiMemoizedStyles(getOrderedListStyles);
|
|
10
|
+
return (_jsx("ol", { ...restProps, css: styles, children: children }));
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { EuiText, useEuiMemoizedStyles } from '@elastic/eui';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
const getParagraphStyles = () => css `
|
|
5
|
+
margin-block: var(--eui-theme-content-vertical-spacing);
|
|
6
|
+
|
|
7
|
+
&:first-child {
|
|
8
|
+
margin-block-start: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&:last-child {
|
|
12
|
+
margin-block-end: 0;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
export const Paragraph = ({ children }) => {
|
|
16
|
+
const styles = useEuiMemoizedStyles(getParagraphStyles);
|
|
17
|
+
return (_jsx(EuiText, { size: "m", css: styles, component: "p", children: children }));
|
|
18
|
+
};
|