@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,43 @@
|
|
|
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 Link from '@docusaurus/Link';
|
|
5
|
+
import { useEuiMemoizedStyles, EuiIcon } from '@elastic/eui';
|
|
6
|
+
const getStyles = ({ euiTheme }) => {
|
|
7
|
+
return {
|
|
8
|
+
link: css `
|
|
9
|
+
--ifm-pagination-nav-color-hover: ${euiTheme.colors.primary};
|
|
10
|
+
|
|
11
|
+
border: ${euiTheme.border.thin};
|
|
12
|
+
|
|
13
|
+
.pagination-nav__label {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
|
|
17
|
+
font-size: var(--eui-font-size-m);
|
|
18
|
+
line-height: var(--eui-line-height-l);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.pagination-nav__link--next .pagination-nav__label {
|
|
22
|
+
justify-content: flex-end;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.pagination-nav__label::before,
|
|
26
|
+
.pagination-nav__label::after {
|
|
27
|
+
content: '';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.pagination-nav__sublabel {
|
|
31
|
+
margin-block-end: ${euiTheme.size.xs};
|
|
32
|
+
font-size: var(--eui-font-size-s);
|
|
33
|
+
line-height: var(--eui-line-height-l);
|
|
34
|
+
}
|
|
35
|
+
`,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export default function PaginatorNavLink(props) {
|
|
39
|
+
const { permalink, title, subLabel, isNext } = props;
|
|
40
|
+
const isPrev = !isNext;
|
|
41
|
+
const styles = useEuiMemoizedStyles(getStyles);
|
|
42
|
+
return (_jsxs(Link, { className: clsx('pagination-nav__link', isNext ? 'pagination-nav__link--next' : 'pagination-nav__link--prev'), css: styles.link, to: permalink, children: [subLabel && _jsx("div", { className: "pagination-nav__sublabel", children: subLabel }), _jsxs("div", { className: "pagination-nav__label", children: [isPrev && _jsx(EuiIcon, { type: "arrowLeft" }), title, isNext && _jsx(EuiIcon, { type: "arrowRight" })] })] }));
|
|
43
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, 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, useState, } from 'react';
|
|
10
|
+
import Head from '@docusaurus/Head';
|
|
11
|
+
import chartsDarkThemeUrl from '!file-loader!@elastic/charts/dist/theme_only_dark.css';
|
|
12
|
+
import chartsLightThemeUrl from '!file-loader!@elastic/charts/dist/theme_only_light.css';
|
|
13
|
+
import { CacheProvider, css, Global } from '@emotion/react';
|
|
14
|
+
import { useEuiTheme } from '@elastic/eui';
|
|
15
|
+
import { AppThemeProvider, cssGlobalCache, useAppTheme, } from '../components/theme_context';
|
|
16
|
+
import { getGlobalStyles } from './Root.styles';
|
|
17
|
+
import { getResetStyles } from './reset.styles';
|
|
18
|
+
import { getInfimaStyles } from './infima.styles';
|
|
19
|
+
const styles = {
|
|
20
|
+
root: css `
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
min-height: 100vh;
|
|
24
|
+
`,
|
|
25
|
+
};
|
|
26
|
+
const _Root = ({ children }) => {
|
|
27
|
+
const { colorMode } = useAppTheme();
|
|
28
|
+
const [mounted, setMounted] = useState(false);
|
|
29
|
+
const euiTheme = useEuiTheme();
|
|
30
|
+
const globalStyles = getGlobalStyles(euiTheme);
|
|
31
|
+
const resetStyles = getResetStyles(euiTheme);
|
|
32
|
+
const infimaStyles = getInfimaStyles();
|
|
33
|
+
// NOTE: This is a temp. solution
|
|
34
|
+
// Emotion styles are loaded dynamically on client in contrast
|
|
35
|
+
// to Docusaurus' SSR content. By rendering the content only
|
|
36
|
+
// after mount we can prevent some quite noticeable style updates
|
|
37
|
+
// and layout shifts. The drawback is that the page initially loads blank.
|
|
38
|
+
// TODO: remove this once we have an approach to inject HTML server-side
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!mounted) {
|
|
41
|
+
setMounted(true);
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
44
|
+
// Load chart theme CSS based on color mode
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (colorMode !== 'light' && colorMode !== 'dark') {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const element = document.createElement('link');
|
|
50
|
+
element.rel = 'stylesheet';
|
|
51
|
+
element.href =
|
|
52
|
+
colorMode === 'light' ? chartsLightThemeUrl : chartsDarkThemeUrl;
|
|
53
|
+
element.dataset.elasticChartsTheme = 'true';
|
|
54
|
+
document.head.appendChild(element);
|
|
55
|
+
return () => {
|
|
56
|
+
document.head.removeChild(element);
|
|
57
|
+
};
|
|
58
|
+
}, [colorMode]);
|
|
59
|
+
return (_jsxs(_Fragment, { children: [_jsx(Head, { children: _jsx("link", { href: "https://fonts.googleapis.com/css2?family=Inter:wght@300..700&family=Roboto+Mono:ital,wght@0,400..700;1,400..700&display=swap", rel: "stylesheet" }) }), _jsx(CacheProvider, { value: cssGlobalCache, children: _jsx(Global, { styles: [resetStyles, infimaStyles, globalStyles] }) }), _jsx("div", { style: !mounted ? { display: 'none' } : undefined, css: styles.root, children: children })] }));
|
|
60
|
+
};
|
|
61
|
+
// Wrap docusaurus root component with <EuiProvider>
|
|
62
|
+
// See https://docusaurus.io/docs/swizzling#wrapper-your-site-with-root
|
|
63
|
+
const Root = ({ children }) => {
|
|
64
|
+
return (_jsx(AppThemeProvider, { children: _jsx(_Root, { children: children }) }));
|
|
65
|
+
};
|
|
66
|
+
export default Root;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { euiFontSizeFromScale, euiLineHeightFromBaseline, } from '@elastic/eui';
|
|
9
|
+
import { css } from '@emotion/react';
|
|
10
|
+
// override docusaurus variables as needed
|
|
11
|
+
// NOTE: we use define variables with style calculations here
|
|
12
|
+
// on the global level to reduce how often they are called
|
|
13
|
+
export const getGlobalStyles = (theme) => {
|
|
14
|
+
const { euiTheme } = theme;
|
|
15
|
+
const { font, base, colors, size, components } = euiTheme;
|
|
16
|
+
const fontBodyScale = font.scale[font.body.scale];
|
|
17
|
+
const fontBase = {
|
|
18
|
+
fontFamily: font.family,
|
|
19
|
+
fontSize: `${font.defaultUnits === 'px' ? fontBodyScale * base : fontBodyScale}${font.defaultUnits}`,
|
|
20
|
+
fontWeight: font.weight[font.body.weight],
|
|
21
|
+
};
|
|
22
|
+
const fontSizeXXL = euiFontSizeFromScale('xxl', euiTheme);
|
|
23
|
+
const fontSizeXL = euiFontSizeFromScale('xl', euiTheme);
|
|
24
|
+
const fontSizeL = euiFontSizeFromScale('l', euiTheme);
|
|
25
|
+
const fontSizeM = euiFontSizeFromScale('m', euiTheme);
|
|
26
|
+
const fontSizeS = euiFontSizeFromScale('s', euiTheme);
|
|
27
|
+
const fontSizeXS = euiFontSizeFromScale('xs', euiTheme);
|
|
28
|
+
const fontSizeXXS = euiFontSizeFromScale('xxs', euiTheme);
|
|
29
|
+
const lineHeightXXL = '2rem';
|
|
30
|
+
const lineHeightXL = '1.75rem';
|
|
31
|
+
const lineHeightL = euiLineHeightFromBaseline('s', euiTheme);
|
|
32
|
+
const lineHeightM = '1.5rem';
|
|
33
|
+
const lineHeightS = euiLineHeightFromBaseline('xs', euiTheme);
|
|
34
|
+
const lineHeightXS = '1.33rem';
|
|
35
|
+
const lineHeightXXS = euiLineHeightFromBaseline('xxs', euiTheme);
|
|
36
|
+
return css `
|
|
37
|
+
// color theme related variables
|
|
38
|
+
:root,
|
|
39
|
+
[data-theme='dark']:root {
|
|
40
|
+
/* EUI theme variables */
|
|
41
|
+
--eui-background-color-primary: ${colors.backgroundBasePrimary};
|
|
42
|
+
--eui-background-color-success: ${colors.backgroundBaseSuccess};
|
|
43
|
+
--eui-background-color-danger: ${colors.backgroundBaseDanger};
|
|
44
|
+
--eui-background-color-warning: ${colors.backgroundBaseWarning};
|
|
45
|
+
--eui-background-color-accent: ${colors.backgroundBaseAccent};
|
|
46
|
+
|
|
47
|
+
--eui-color-danger-text: ${colors.textDanger};
|
|
48
|
+
|
|
49
|
+
/* Docusaurus theme variables */
|
|
50
|
+
--ifm-background-color: ${colors.backgroundBasePlain};
|
|
51
|
+
--ifm-font-color-base: ${colors.textParagraph};
|
|
52
|
+
--ifm-link-color: ${colors.link};
|
|
53
|
+
--ifm-link-hover-color: ${colors.link};
|
|
54
|
+
|
|
55
|
+
--ifm-menu-color: ${colors.textParagraph};
|
|
56
|
+
--ifm-menu-color-background-active: ${colors.backgroundBaseSubdued};
|
|
57
|
+
--ifm-menu-color-background-hover: var(--eui-background-color-primary);
|
|
58
|
+
|
|
59
|
+
--ifm-pre-background: ${components.codeBackground};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:root {
|
|
63
|
+
/* EUI theme variables */
|
|
64
|
+
--eui-font-size-base: ${fontBase.fontSize};
|
|
65
|
+
--eui-font-size-xxl: ${fontSizeXXL};
|
|
66
|
+
--eui-font-size-xl: ${fontSizeXL};
|
|
67
|
+
--eui-font-size-l: ${fontSizeL};
|
|
68
|
+
--eui-font-size-m: ${fontSizeM};
|
|
69
|
+
--eui-font-size-s: ${fontSizeS};
|
|
70
|
+
--eui-font-size-xs: ${fontSizeXS};
|
|
71
|
+
--eui-font-size-xxs: ${fontSizeXXS};
|
|
72
|
+
|
|
73
|
+
--eui-line-height-base: ${lineHeightXL};
|
|
74
|
+
--eui-line-height-xxl: ${lineHeightXXL};
|
|
75
|
+
--eui-line-height-xl: ${lineHeightXL};
|
|
76
|
+
--eui-line-height-l: ${lineHeightL};
|
|
77
|
+
--eui-line-height-m: ${lineHeightM};
|
|
78
|
+
--eui-line-height-s: ${lineHeightS};
|
|
79
|
+
--eui-line-height-xs: ${lineHeightXS};
|
|
80
|
+
--eui-line-height-xxs: ${lineHeightXXS};
|
|
81
|
+
|
|
82
|
+
--eui-size-xs: ${size.xs};
|
|
83
|
+
--eui-size-s: ${size.s};
|
|
84
|
+
--eui-size-m: ${size.m};
|
|
85
|
+
|
|
86
|
+
--eui-border-color-primary: ${colors.borderStrongPrimary};
|
|
87
|
+
|
|
88
|
+
--eui-theme-content-vertical-spacing: ${size.base};
|
|
89
|
+
|
|
90
|
+
/* Docusaurus theme variables */
|
|
91
|
+
--ifm-font-family-base: ${fontBase.fontFamily};
|
|
92
|
+
--ifm-font-size-base: var(--eui-font-size-base);
|
|
93
|
+
--ifm-font-weight-base: ${fontBase.fontWeight};
|
|
94
|
+
--ifm-line-height-base: var(--eui-line-height-base);
|
|
95
|
+
|
|
96
|
+
--ifm-h1-font-size: var(--eui-font-size-xl);
|
|
97
|
+
--ifm-h2-font-size: var(--eui-font-size-l);
|
|
98
|
+
--ifm-h3-font-size: var(--eui-font-size-m);
|
|
99
|
+
--ifm-h4-font-size: var(--eui-font-size-s);
|
|
100
|
+
--ifm-h5-font-size: var(--eui-font-size-xs);
|
|
101
|
+
--ifm-h6-font-size: var(--eui-font-size-xxs);
|
|
102
|
+
|
|
103
|
+
--ifm-global-radius: ${euiTheme.border.radius.small};
|
|
104
|
+
|
|
105
|
+
--ifm-toc-border-color: ${euiTheme.border.color};
|
|
106
|
+
|
|
107
|
+
--doc-sidebar-width: 258px;
|
|
108
|
+
--doc-sidebar-hidden-width: 30px;
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
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 Translate from '@docusaurus/Translate';
|
|
5
|
+
import { EuiIcon, useEuiMemoizedStyles } from '@elastic/eui';
|
|
6
|
+
// coverted from css modules to Emotion
|
|
7
|
+
const getStyles = ({ euiTheme }) => {
|
|
8
|
+
return {
|
|
9
|
+
tocCollapsibleButton: css `
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
align-items: center;
|
|
13
|
+
width: 100%;
|
|
14
|
+
padding: ${euiTheme.size.s} ${euiTheme.size.m};
|
|
15
|
+
border-radius: ${euiTheme.border.radius.small};
|
|
16
|
+
font-size: inherit;
|
|
17
|
+
`,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default function TOCCollapsibleCollapseButton({ collapsed, ...props }) {
|
|
21
|
+
const styles = useEuiMemoizedStyles(getStyles);
|
|
22
|
+
return (_jsxs("button", { type: "button", ...props, className: clsx('clean-btn', props.className), css: styles.tocCollapsibleButton, children: [_jsx(Translate, { id: "theme.TOCCollapsible.toggleButtonLabel", description: "The label used by the button on the collapsible TOC component", children: "On this page" }), _jsx(EuiIcon, { type: collapsed ? 'arrowDown' : 'arrowUp' })] }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React, { JSX } from 'react';
|
|
2
|
+
import type { Props } from '@theme-original/TOCItems/Tree';
|
|
3
|
+
declare function TOCItemTree({ toc, className, linkClassName, isChild, }: Props): JSX.Element | null;
|
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof TOCItemTree>;
|
|
5
|
+
export default _default;
|
|
@@ -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 React from 'react';
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import Link from '@docusaurus/Link';
|
|
12
|
+
import { useEuiMemoizedStyles } from '@elastic/eui';
|
|
13
|
+
const getStyles = ({ euiTheme }) => {
|
|
14
|
+
return {
|
|
15
|
+
list: css `
|
|
16
|
+
// ensure specificity to apply override
|
|
17
|
+
:is(ul) li {
|
|
18
|
+
margin: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:is(ul.table-of-contents) {
|
|
22
|
+
padding: ${euiTheme.size.m};
|
|
23
|
+
border-top: ${euiTheme.border.width.thin} solid ${euiTheme.border.color};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.tree-item__inner {
|
|
27
|
+
font-size: var(--eui-font-size-s);
|
|
28
|
+
line-height: var(--eui-line-height-l);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media (min-width: 997px) {
|
|
32
|
+
&:is(ul.table-of-contents) {
|
|
33
|
+
padding: 0;
|
|
34
|
+
border: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.tree-item__inner {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
padding: ${euiTheme.size.s} ${euiTheme.size.m} ${euiTheme.size.s} 0;
|
|
41
|
+
font-size: var(--eui-font-size-xs);
|
|
42
|
+
line-height: var(--eui-line-height-xxs);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// apply the decor border only to top level tree items
|
|
46
|
+
&.table-of-contents > li > .tree-item__inner {
|
|
47
|
+
padding: ${euiTheme.size.s} ${euiTheme.size.m};
|
|
48
|
+
border-left: ${euiTheme.border.width.thick} solid
|
|
49
|
+
${euiTheme.border.color};
|
|
50
|
+
|
|
51
|
+
&:has(.table-of-contents__link--active) {
|
|
52
|
+
border-left-color: ${euiTheme.colors.link};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.table-of-contents__link--active {
|
|
58
|
+
color: ${euiTheme.colors.link};
|
|
59
|
+
}
|
|
60
|
+
`,
|
|
61
|
+
listChild: css `
|
|
62
|
+
padding-inline-start: ${euiTheme.size.m};
|
|
63
|
+
`,
|
|
64
|
+
link: css `
|
|
65
|
+
color: ${euiTheme.colors.textParagraph};
|
|
66
|
+
`,
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
// Recursive component rendering the toc tree
|
|
70
|
+
function TOCItemTree({ toc, className, linkClassName, isChild, }) {
|
|
71
|
+
const styles = useEuiMemoizedStyles(getStyles);
|
|
72
|
+
if (!toc.length) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
return (_jsx("ul", { className: isChild ? undefined : className, css: [styles.list, isChild && styles.listChild], children: toc.map((heading) => (_jsx("li", { children: _jsxs("span", { className: "tree-item__inner", children: [_jsx(Link, { to: `#${heading.id}`, css: styles.link, className: linkClassName ?? undefined,
|
|
76
|
+
// Developer provided the HTML, so assume it's safe.
|
|
77
|
+
dangerouslySetInnerHTML: { __html: heading.value } }), _jsx(TOCItemTree, { isChild: true, toc: heading.children, className: className, linkClassName: linkClassName })] }) }, heading.id))) }));
|
|
78
|
+
}
|
|
79
|
+
// Memo only the tree root is enough
|
|
80
|
+
export default React.memo(TOCItemTree);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getInfimaStyles: () => import("@emotion/react").SerializedStyles;
|