@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.
Files changed (297) hide show
  1. package/LICENSE.txt +6 -0
  2. package/README.md +292 -0
  3. package/lib/.tsbuildinfo-client +1 -0
  4. package/lib/components/badge/index.d.ts +1 -0
  5. package/lib/components/badge/index.js +9 -0
  6. package/lib/components/codesandbox_icon/codesandbox_icon.d.ts +4 -0
  7. package/lib/components/codesandbox_icon/codesandbox_icon.js +2 -0
  8. package/lib/components/codesandbox_icon/index.d.ts +1 -0
  9. package/lib/components/codesandbox_icon/index.js +8 -0
  10. package/lib/components/demo/actions_bar/actions_bar.d.ts +10 -0
  11. package/lib/components/demo/actions_bar/actions_bar.js +34 -0
  12. package/lib/components/demo/actions_bar/index.d.ts +1 -0
  13. package/lib/components/demo/actions_bar/index.js +8 -0
  14. package/lib/components/demo/code_transformer.d.ts +18 -0
  15. package/lib/components/demo/code_transformer.js +39 -0
  16. package/lib/components/demo/codesandbox/find_external_dependencies.d.ts +5 -0
  17. package/lib/components/demo/codesandbox/find_external_dependencies.js +30 -0
  18. package/lib/components/demo/codesandbox/index.d.ts +1 -0
  19. package/lib/components/demo/codesandbox/index.js +8 -0
  20. package/lib/components/demo/codesandbox/open_action.d.ts +16 -0
  21. package/lib/components/demo/codesandbox/open_action.js +91 -0
  22. package/lib/components/demo/context.d.ts +14 -0
  23. package/lib/components/demo/context.js +13 -0
  24. package/lib/components/demo/create_demo.d.ts +5 -0
  25. package/lib/components/demo/create_demo.js +13 -0
  26. package/lib/components/demo/demo.d.ts +23 -0
  27. package/lib/components/demo/demo.js +61 -0
  28. package/lib/components/demo/editor/editor.d.ts +1 -0
  29. package/lib/components/demo/editor/editor.js +39 -0
  30. package/lib/components/demo/editor/index.d.ts +1 -0
  31. package/lib/components/demo/editor/index.js +8 -0
  32. package/lib/components/demo/index.d.ts +3 -0
  33. package/lib/components/demo/index.js +10 -0
  34. package/lib/components/demo/preview/index.d.ts +1 -0
  35. package/lib/components/demo/preview/index.js +8 -0
  36. package/lib/components/demo/preview/preview.d.ts +7 -0
  37. package/lib/components/demo/preview/preview.js +36 -0
  38. package/lib/components/demo/scope.d.ts +1 -0
  39. package/lib/components/demo/scope.js +12 -0
  40. package/lib/components/demo/source/get_source_from_children.d.ts +11 -0
  41. package/lib/components/demo/source/get_source_from_children.js +42 -0
  42. package/lib/components/demo/source/index.d.ts +1 -0
  43. package/lib/components/demo/source/index.js +8 -0
  44. package/lib/components/demo/source/source.d.ts +6 -0
  45. package/lib/components/demo/source/source.js +25 -0
  46. package/lib/components/figma_embed/index.d.ts +5 -0
  47. package/lib/components/figma_embed/index.js +36 -0
  48. package/lib/components/guideline/guideline.d.ts +10 -0
  49. package/lib/components/guideline/guideline.js +68 -0
  50. package/lib/components/guideline/guideline_text.d.ts +6 -0
  51. package/lib/components/guideline/guideline_text.js +28 -0
  52. package/lib/components/guideline/index.d.ts +2 -0
  53. package/lib/components/guideline/index.js +9 -0
  54. package/lib/components/guideline/types.d.ts +1 -0
  55. package/lib/components/guideline/types.js +8 -0
  56. package/lib/components/high_contrast_mode_toggle/index.d.ts +1 -0
  57. package/lib/components/high_contrast_mode_toggle/index.js +15 -0
  58. package/lib/components/icon/index.d.ts +1 -0
  59. package/lib/components/icon/index.js +9 -0
  60. package/lib/components/index.d.ts +7 -0
  61. package/lib/components/index.js +14 -0
  62. package/lib/components/navbar_item/index.d.ts +19 -0
  63. package/lib/components/navbar_item/index.js +84 -0
  64. package/lib/components/prop_table/definition_types.d.ts +43 -0
  65. package/lib/components/prop_table/definition_types.js +8 -0
  66. package/lib/components/prop_table/extended_types.d.ts +5 -0
  67. package/lib/components/prop_table/extended_types.js +27 -0
  68. package/lib/components/prop_table/extended_types_info.d.ts +26 -0
  69. package/lib/components/prop_table/extended_types_info.js +34 -0
  70. package/lib/components/prop_table/index.d.ts +1 -0
  71. package/lib/components/prop_table/index.js +8 -0
  72. package/lib/components/prop_table/prop_table.d.ts +8 -0
  73. package/lib/components/prop_table/prop_table.js +115 -0
  74. package/lib/components/theme_context/index.d.ts +16 -0
  75. package/lib/components/theme_context/index.js +103 -0
  76. package/lib/components/theme_context/theme_overrides.d.ts +2 -0
  77. package/lib/components/theme_context/theme_overrides.js +12 -0
  78. package/lib/components/version_switcher/index.d.ts +23 -0
  79. package/lib/components/version_switcher/index.js +51 -0
  80. package/lib/index.d.ts +2 -0
  81. package/lib/index.js +19 -0
  82. package/lib/index.js.map +1 -0
  83. package/lib/theme/Admonition/Types.d.ts +3 -0
  84. package/lib/theme/Admonition/Types.js +51 -0
  85. package/lib/theme/CodeBlock/index.d.ts +3 -0
  86. package/lib/theme/CodeBlock/index.js +35 -0
  87. package/lib/theme/ColorModeToggle/index.d.ts +10 -0
  88. package/lib/theme/ColorModeToggle/index.js +51 -0
  89. package/lib/theme/Demo/actions.d.ts +8 -0
  90. package/lib/theme/Demo/actions.js +8 -0
  91. package/lib/theme/Demo/default_scope.d.ts +3 -0
  92. package/lib/theme/Demo/default_scope.js +17 -0
  93. package/lib/theme/DocBreadcrumbs/Items/Home/index.d.ts +2 -0
  94. package/lib/theme/DocBreadcrumbs/Items/Home/index.js +15 -0
  95. package/lib/theme/DocBreadcrumbs/Items/item.styles.d.ts +5 -0
  96. package/lib/theme/DocBreadcrumbs/Items/item.styles.js +40 -0
  97. package/lib/theme/DocBreadcrumbs/index.d.ts +2 -0
  98. package/lib/theme/DocBreadcrumbs/index.js +63 -0
  99. package/lib/theme/DocItem/Content/index.d.ts +3 -0
  100. package/lib/theme/DocItem/Content/index.js +44 -0
  101. package/lib/theme/DocItem/Footer/index.d.ts +2 -0
  102. package/lib/theme/DocItem/Footer/index.js +17 -0
  103. package/lib/theme/DocItem/Layout/index.d.ts +3 -0
  104. package/lib/theme/DocItem/Layout/index.js +71 -0
  105. package/lib/theme/DocItem/Metadata/index.d.ts +2 -0
  106. package/lib/theme/DocItem/Metadata/index.js +7 -0
  107. package/lib/theme/DocItem/Paginator/index.d.ts +6 -0
  108. package/lib/theme/DocItem/Paginator/index.js +11 -0
  109. package/lib/theme/DocItem/TOC/Desktop/index.d.ts +2 -0
  110. package/lib/theme/DocItem/TOC/Desktop/index.js +8 -0
  111. package/lib/theme/DocItem/TOC/Mobile/index.d.ts +2 -0
  112. package/lib/theme/DocItem/TOC/Mobile/index.js +17 -0
  113. package/lib/theme/DocItem/index.d.ts +3 -0
  114. package/lib/theme/DocItem/index.js +10 -0
  115. package/lib/theme/DocPaginator/index.d.ts +3 -0
  116. package/lib/theme/DocPaginator/index.js +19 -0
  117. package/lib/theme/DocRoot/Layout/Main/index.d.ts +3 -0
  118. package/lib/theme/DocRoot/Layout/Main/index.js +35 -0
  119. package/lib/theme/DocRoot/Layout/Sidebar/index.d.ts +3 -0
  120. package/lib/theme/DocRoot/Layout/Sidebar/index.js +81 -0
  121. package/lib/theme/DocRoot/Layout/index.d.ts +3 -0
  122. package/lib/theme/DocRoot/Layout/index.js +47 -0
  123. package/lib/theme/DocSidebarItem/Category/index.d.ts +3 -0
  124. package/lib/theme/DocSidebarItem/Category/index.js +146 -0
  125. package/lib/theme/DocSidebarItem/Link/index.d.ts +3 -0
  126. package/lib/theme/DocSidebarItem/Link/index.js +39 -0
  127. package/lib/theme/DocSidebarItem/index.d.ts +3 -0
  128. package/lib/theme/DocSidebarItem/index.js +15 -0
  129. package/lib/theme/DocSidebarItems/index.d.ts +5 -0
  130. package/lib/theme/DocSidebarItems/index.js +17 -0
  131. package/lib/theme/EditThisPage/index.d.ts +3 -0
  132. package/lib/theme/EditThisPage/index.js +17 -0
  133. package/lib/theme/Footer/index.d.ts +2 -0
  134. package/lib/theme/Footer/index.js +43 -0
  135. package/lib/theme/Heading/index.d.ts +3 -0
  136. package/lib/theme/Heading/index.js +49 -0
  137. package/lib/theme/Logo/index.d.ts +3 -0
  138. package/lib/theme/Logo/index.js +80 -0
  139. package/lib/theme/MDXComponents/A.d.ts +6 -0
  140. package/lib/theme/MDXComponents/A.js +17 -0
  141. package/lib/theme/MDXComponents/Blockquote.d.ts +2 -0
  142. package/lib/theme/MDXComponents/Blockquote.js +18 -0
  143. package/lib/theme/MDXComponents/Code.d.ts +6 -0
  144. package/lib/theme/MDXComponents/Code.js +35 -0
  145. package/lib/theme/MDXComponents/Heading.d.ts +4 -0
  146. package/lib/theme/MDXComponents/Heading.js +4 -0
  147. package/lib/theme/MDXComponents/ListItem.d.ts +2 -0
  148. package/lib/theme/MDXComponents/ListItem.js +5 -0
  149. package/lib/theme/MDXComponents/OrderedList.d.ts +2 -0
  150. package/lib/theme/MDXComponents/OrderedList.js +11 -0
  151. package/lib/theme/MDXComponents/Paragraph.d.ts +2 -0
  152. package/lib/theme/MDXComponents/Paragraph.js +18 -0
  153. package/lib/theme/MDXComponents/Table.d.ts +2 -0
  154. package/lib/theme/MDXComponents/Table.js +3 -0
  155. package/lib/theme/MDXComponents/TableBody.d.ts +2 -0
  156. package/lib/theme/MDXComponents/TableBody.js +3 -0
  157. package/lib/theme/MDXComponents/TableDataCell.d.ts +2 -0
  158. package/lib/theme/MDXComponents/TableDataCell.js +3 -0
  159. package/lib/theme/MDXComponents/TableHeader.d.ts +2 -0
  160. package/lib/theme/MDXComponents/TableHeader.js +3 -0
  161. package/lib/theme/MDXComponents/TableHeaderCell.d.ts +2 -0
  162. package/lib/theme/MDXComponents/TableHeaderCell.js +3 -0
  163. package/lib/theme/MDXComponents/TableRow.d.ts +2 -0
  164. package/lib/theme/MDXComponents/TableRow.js +3 -0
  165. package/lib/theme/MDXComponents/UnorderedList.d.ts +2 -0
  166. package/lib/theme/MDXComponents/UnorderedList.js +11 -0
  167. package/lib/theme/MDXComponents/index.d.ts +2 -0
  168. package/lib/theme/MDXComponents/index.js +46 -0
  169. package/lib/theme/MDXContent/index.d.ts +6 -0
  170. package/lib/theme/MDXContent/index.js +4 -0
  171. package/lib/theme/Navbar/Content/index.d.ts +7 -0
  172. package/lib/theme/Navbar/Content/index.js +149 -0
  173. package/lib/theme/Navbar/Layout/index.d.ts +6 -0
  174. package/lib/theme/Navbar/Layout/index.js +59 -0
  175. package/lib/theme/Navbar/MobileSidebar/Header/index.d.ts +7 -0
  176. package/lib/theme/Navbar/MobileSidebar/Header/index.js +46 -0
  177. package/lib/theme/Navbar/MobileSidebar/Layout/index.d.ts +6 -0
  178. package/lib/theme/Navbar/MobileSidebar/Layout/index.js +26 -0
  179. package/lib/theme/Navbar/MobileSidebar/index.d.ts +7 -0
  180. package/lib/theme/Navbar/MobileSidebar/index.js +14 -0
  181. package/lib/theme/NavbarItem/DropdownNavbarItem/index.d.ts +3 -0
  182. package/lib/theme/NavbarItem/DropdownNavbarItem/index.js +94 -0
  183. package/lib/theme/NavbarItem/NavbarNavLink.d.ts +7 -0
  184. package/lib/theme/NavbarItem/NavbarNavLink.js +48 -0
  185. package/lib/theme/PaginatorNavLink/index.d.ts +3 -0
  186. package/lib/theme/PaginatorNavLink/index.js +43 -0
  187. package/lib/theme/Root.d.ts +3 -0
  188. package/lib/theme/Root.js +66 -0
  189. package/lib/theme/Root.styles.d.ts +2 -0
  190. package/lib/theme/Root.styles.js +111 -0
  191. package/lib/theme/TOCCollapsible/CollapseButton/index.d.ts +3 -0
  192. package/lib/theme/TOCCollapsible/CollapseButton/index.js +23 -0
  193. package/lib/theme/TOCItems/Tree.d.ts +5 -0
  194. package/lib/theme/TOCItems/Tree.js +80 -0
  195. package/lib/theme/infima.styles.d.ts +1 -0
  196. package/lib/theme/infima.styles.js +1456 -0
  197. package/lib/theme/reset.styles.d.ts +2 -0
  198. package/lib/theme/reset.styles.js +79 -0
  199. package/package.json +61 -0
  200. package/src/components/badge/index.ts +11 -0
  201. package/src/components/codesandbox_icon/codesandbox_icon.tsx +24 -0
  202. package/src/components/codesandbox_icon/index.ts +9 -0
  203. package/src/components/demo/actions_bar/actions_bar.tsx +95 -0
  204. package/src/components/demo/actions_bar/index.ts +9 -0
  205. package/src/components/demo/code_transformer.ts +44 -0
  206. package/src/components/demo/codesandbox/find_external_dependencies.ts +34 -0
  207. package/src/components/demo/codesandbox/index.ts +9 -0
  208. package/src/components/demo/codesandbox/open_action.tsx +132 -0
  209. package/src/components/demo/context.ts +30 -0
  210. package/src/components/demo/create_demo.tsx +17 -0
  211. package/src/components/demo/demo.tsx +143 -0
  212. package/src/components/demo/editor/editor.tsx +51 -0
  213. package/src/components/demo/editor/index.ts +9 -0
  214. package/src/components/demo/index.ts +11 -0
  215. package/src/components/demo/preview/index.ts +9 -0
  216. package/src/components/demo/preview/preview.tsx +77 -0
  217. package/src/components/demo/scope.ts +14 -0
  218. package/src/components/demo/source/get_source_from_children.ts +59 -0
  219. package/src/components/demo/source/index.ts +9 -0
  220. package/src/components/demo/source/source.tsx +36 -0
  221. package/src/components/figma_embed/index.tsx +57 -0
  222. package/src/components/guideline/guideline.tsx +121 -0
  223. package/src/components/guideline/guideline_text.tsx +51 -0
  224. package/src/components/guideline/index.ts +10 -0
  225. package/src/components/guideline/types.ts +9 -0
  226. package/src/components/high_contrast_mode_toggle/index.tsx +28 -0
  227. package/src/components/icon/index.ts +11 -0
  228. package/src/components/index.ts +15 -0
  229. package/src/components/navbar_item/index.tsx +164 -0
  230. package/src/components/prop_table/definition_types.ts +53 -0
  231. package/src/components/prop_table/extended_types.tsx +66 -0
  232. package/src/components/prop_table/extended_types_info.ts +35 -0
  233. package/src/components/prop_table/index.ts +9 -0
  234. package/src/components/prop_table/prop_table.tsx +235 -0
  235. package/src/components/theme_context/index.tsx +156 -0
  236. package/src/components/theme_context/theme_overrides.ts +15 -0
  237. package/src/components/version_switcher/index.tsx +144 -0
  238. package/src/index.ts +21 -0
  239. package/src/theme/Admonition/Types.tsx +85 -0
  240. package/src/theme/CodeBlock/index.tsx +57 -0
  241. package/src/theme/ColorModeToggle/index.tsx +93 -0
  242. package/src/theme/Demo/actions.tsx +20 -0
  243. package/src/theme/Demo/default_scope.ts +19 -0
  244. package/src/theme/DocBreadcrumbs/Items/Home/index.tsx +38 -0
  245. package/src/theme/DocBreadcrumbs/Items/item.styles.ts +43 -0
  246. package/src/theme/DocBreadcrumbs/index.tsx +144 -0
  247. package/src/theme/DocItem/Content/index.tsx +75 -0
  248. package/src/theme/DocItem/Footer/index.tsx +59 -0
  249. package/src/theme/DocItem/Layout/index.tsx +112 -0
  250. package/src/theme/DocItem/Metadata/index.tsx +23 -0
  251. package/src/theme/DocItem/Paginator/index.tsx +20 -0
  252. package/src/theme/DocItem/TOC/Desktop/index.tsx +24 -0
  253. package/src/theme/DocItem/TOC/Mobile/index.tsx +35 -0
  254. package/src/theme/DocItem/index.tsx +30 -0
  255. package/src/theme/DocPaginator/index.tsx +64 -0
  256. package/src/theme/DocRoot/Layout/Main/index.tsx +61 -0
  257. package/src/theme/DocRoot/Layout/Sidebar/index.tsx +124 -0
  258. package/src/theme/DocRoot/Layout/index.tsx +72 -0
  259. package/src/theme/DocSidebarItem/Category/index.tsx +266 -0
  260. package/src/theme/DocSidebarItem/Link/index.tsx +86 -0
  261. package/src/theme/DocSidebarItem/index.tsx +29 -0
  262. package/src/theme/DocSidebarItems/index.tsx +30 -0
  263. package/src/theme/EditThisPage/index.tsx +50 -0
  264. package/src/theme/Footer/index.tsx +67 -0
  265. package/src/theme/Heading/index.tsx +94 -0
  266. package/src/theme/Logo/index.tsx +146 -0
  267. package/src/theme/MDXComponents/A.tsx +33 -0
  268. package/src/theme/MDXComponents/Blockquote.tsx +35 -0
  269. package/src/theme/MDXComponents/Code.tsx +60 -0
  270. package/src/theme/MDXComponents/Heading.tsx +16 -0
  271. package/src/theme/MDXComponents/ListItem.tsx +20 -0
  272. package/src/theme/MDXComponents/OrderedList.tsx +26 -0
  273. package/src/theme/MDXComponents/Paragraph.tsx +33 -0
  274. package/src/theme/MDXComponents/Table.tsx +16 -0
  275. package/src/theme/MDXComponents/TableBody.tsx +16 -0
  276. package/src/theme/MDXComponents/TableDataCell.tsx +20 -0
  277. package/src/theme/MDXComponents/TableHeader.tsx +16 -0
  278. package/src/theme/MDXComponents/TableHeaderCell.tsx +20 -0
  279. package/src/theme/MDXComponents/TableRow.tsx +16 -0
  280. package/src/theme/MDXComponents/UnorderedList.tsx +26 -0
  281. package/src/theme/MDXComponents/index.ts +61 -0
  282. package/src/theme/MDXContent/index.tsx +22 -0
  283. package/src/theme/Navbar/Content/index.tsx +262 -0
  284. package/src/theme/Navbar/Layout/index.tsx +100 -0
  285. package/src/theme/Navbar/MobileSidebar/Header/index.tsx +89 -0
  286. package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +44 -0
  287. package/src/theme/Navbar/MobileSidebar/index.tsx +46 -0
  288. package/src/theme/NavbarItem/DropdownNavbarItem/index.tsx +200 -0
  289. package/src/theme/NavbarItem/NavbarNavLink.tsx +141 -0
  290. package/src/theme/PaginatorNavLink/index.tsx +72 -0
  291. package/src/theme/Root.styles.ts +122 -0
  292. package/src/theme/Root.tsx +106 -0
  293. package/src/theme/TOCCollapsible/CollapseButton/index.tsx +53 -0
  294. package/src/theme/TOCItems/Tree.tsx +114 -0
  295. package/src/theme/infima.styles.ts +1458 -0
  296. package/src/theme/reset.styles.ts +82 -0
  297. package/src/theme/theme.d.ts +598 -0
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { EuiTableHeader } from '@elastic/eui';
3
+ export const TableHeader = ({ children, }) => (_jsx(EuiTableHeader, { wrapWithTableRow: false, children: children }));
@@ -0,0 +1,2 @@
1
+ import { JSX, ThHTMLAttributes } from 'react';
2
+ export declare const TableHeaderCell: ({ children, }: ThHTMLAttributes<HTMLTableCellElement>) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { EuiTableHeaderCell, EuiText } from '@elastic/eui';
3
+ export const TableHeaderCell = ({ children, }) => (_jsx(EuiTableHeaderCell, { children: _jsx(EuiText, { size: "m", component: "span", children: children }) }));
@@ -0,0 +1,2 @@
1
+ import { HTMLAttributes, JSX } from 'react';
2
+ export declare const TableRow: ({ children, }: HTMLAttributes<HTMLTableRowElement>) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { EuiTableRow } from '@elastic/eui';
3
+ export const TableRow = ({ children, }) => (_jsx(EuiTableRow, { children: children }));
@@ -0,0 +1,2 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare const UnorderedList: ({ children, ...restProps }: HTMLAttributes<HTMLUListElement>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -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 getUnorderedListStyles = ({ euiTheme }) => css `
5
+ margin-inline-start: ${euiTheme.size.l};
6
+ list-style: disc;
7
+ `;
8
+ export const UnorderedList = ({ children, ...restProps }) => {
9
+ const styles = useEuiMemoizedStyles(getUnorderedListStyles);
10
+ return (_jsx("ul", { ...restProps, css: styles, children: children }));
11
+ };
@@ -0,0 +1,2 @@
1
+ declare const MDXComponents: any;
2
+ export default MDXComponents;
@@ -0,0 +1,46 @@
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 OriginalMDXComponents from '@theme-init/MDXComponents';
9
+ import { Badge, Demo, DemoSource, FigmaEmbed, Guideline, GuidelineText, Icon, PropTable, } from '../../components';
10
+ import { ListItem } from './ListItem';
11
+ import { Blockquote } from './Blockquote';
12
+ import { Paragraph } from './Paragraph';
13
+ import { UnorderedList } from './UnorderedList';
14
+ import { OrderedList } from './OrderedList';
15
+ import { Table } from './Table';
16
+ import { TableBody } from './TableBody';
17
+ import { TableHeader } from './TableHeader';
18
+ import { TableHeaderCell } from './TableHeaderCell';
19
+ import { TableRow } from './TableRow';
20
+ import { TableDataCell } from './TableDataCell';
21
+ const MDXComponents = {
22
+ ...OriginalMDXComponents,
23
+ // Base content components
24
+ p: Paragraph,
25
+ li: ListItem,
26
+ ul: UnorderedList,
27
+ ol: OrderedList,
28
+ blockquote: Blockquote,
29
+ // Tables
30
+ table: Table,
31
+ tbody: TableBody,
32
+ thead: TableHeader,
33
+ tr: TableRow,
34
+ th: TableHeaderCell,
35
+ td: TableDataCell,
36
+ // Custom components
37
+ Badge,
38
+ Demo,
39
+ DemoSource,
40
+ FigmaEmbed,
41
+ Guideline,
42
+ GuidelineText,
43
+ Icon,
44
+ PropTable,
45
+ };
46
+ export default MDXComponents;
@@ -0,0 +1,6 @@
1
+ import { JSX } from 'react';
2
+ import type MDXContentType from '@theme-init/MDXContent';
3
+ import type { WrapperProps } from '@docusaurus/types';
4
+ type Props = WrapperProps<typeof MDXContentType>;
5
+ declare const MDXContent: (props: Props) => JSX.Element;
6
+ export default MDXContent;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import OriginalMDXContent from '@theme-init/MDXContent';
3
+ const MDXContent = (props) => (_jsx("div", { "data-search-children": true, children: _jsx(OriginalMDXContent, { ...props }) }));
4
+ export default MDXContent;
@@ -0,0 +1,7 @@
1
+ import { JSX } from 'react';
2
+ import { VersionSwitcherProps } from '../../../components/version_switcher';
3
+ type Props = {
4
+ versionSwitcherOptions?: VersionSwitcherProps;
5
+ };
6
+ export default function NavbarContent({ versionSwitcherOptions, }: Props): JSX.Element;
7
+ export {};
@@ -0,0 +1,149 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { css, Global } from '@emotion/react';
3
+ import { useThemeConfig, ErrorCauseBoundary } from '@docusaurus/theme-common';
4
+ import { splitNavbarItems, useNavbarMobileSidebar, } from '@docusaurus/theme-common/internal';
5
+ import useIsBrowser from '@docusaurus/useIsBrowser';
6
+ import { useLocation } from '@docusaurus/router';
7
+ import NavbarItem from '@theme-original/NavbarItem';
8
+ import NavbarColorModeToggle from '@theme-original/Navbar/ColorModeToggle';
9
+ import SearchBar from '@theme-original/SearchBar';
10
+ import NavbarMobileSidebarToggle from '@theme-original/Navbar/MobileSidebar/Toggle';
11
+ import NavbarLogo from '@theme-original/Navbar/Logo';
12
+ import NavbarSearch from '@theme-original/Navbar/Search';
13
+ import { euiFocusRing, euiTextTruncate, useEuiMemoizedStyles, } from '@elastic/eui';
14
+ import { euiFormControlText, euiFormVariables,
15
+ // @ts-ignore - reusing form styles as we don't have access to the plugin component yet
16
+ } from '@elastic/eui/lib/components/form/form.styles';
17
+ import { VersionSwitcher, } from '../../../components/version_switcher';
18
+ import { HighContrastModeToggle } from '../../../components/high_contrast_mode_toggle';
19
+ const DOCS_PATH = '/docs';
20
+ const placeHolderStyles = (content) => `
21
+ &::-webkit-input-placeholder { ${content} }
22
+ &::-moz-placeholder { ${content} }
23
+ &:-moz-placeholder { ${content} }
24
+ &::placeholder { ${content} }
25
+ `;
26
+ const getStyles = (euiThemeContext) => {
27
+ const { euiTheme } = euiThemeContext;
28
+ const form = euiFormVariables(euiThemeContext);
29
+ const iconColor = encodeURIComponent(euiTheme.colors.text);
30
+ return {
31
+ navbarItems: css `
32
+ --ifm-navbar-item-padding-horizontal: 0;
33
+ --ifm-navbar-item-padding-vertical: 0;
34
+
35
+ .navbar__item,
36
+ [class*='colorModeToggle'] {
37
+ @media (max-width: 996px) {
38
+ display: none;
39
+ }
40
+ }
41
+
42
+ .navbar__toggle {
43
+ border-radius: ${euiTheme.border.radius.small};
44
+
45
+ &:hover {
46
+ background-color: var(--ifm-color-emphasis-200);
47
+ color: currentColor;
48
+ }
49
+ }
50
+ `,
51
+ navbarItemsLeft: css `
52
+ gap: ${euiTheme.size.s};
53
+
54
+ @media (min-width: 997px) {
55
+ gap: ${euiTheme.size.l};
56
+ }
57
+
58
+ .navbar__link {
59
+ ${euiTextTruncate()}
60
+ }
61
+ `,
62
+ navbarItemsRight: css `
63
+ gap: ${euiTheme.size.s};
64
+ `,
65
+ actions: css `
66
+ @media (max-width: 996px) {
67
+ display: none;
68
+ }
69
+ `,
70
+ search: css `
71
+ .navbar__search-input {
72
+ // TODO: update search input styles or try to use EUI component
73
+ --ifm-navbar-search-input-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" height="16px" width="16px"><path fill="${iconColor}" d="M11.2709852,11.9779932 L15.14275,15.85075 C15.24075,15.94775 15.36875,15.99675 15.49675,15.99675 C15.62475,15.99675 15.75275,15.94775 15.85075,15.85075 C16.04575,15.65475 16.04575,15.33875 15.85075,15.14275 L12.2861494,11.5790625 C14.6668581,8.83239759 14.5527289,4.65636993 11.9437617,2.04675 C9.21444459,-0.68225 4.77355568,-0.68225 2.04623804,2.04675 C-0.682079347,4.77575 -0.682079347,9.21775 2.04623804,11.94675 C3.36890712,13.26875 5.12646738,13.99675 6.99499989,13.99675 C7.27093085,13.99675 7.49487482,13.77275 7.49487482,13.49675 C7.49487482,13.22075 7.27093085,12.99675 6.99499989,12.99675 C5.39240085,12.99675 3.88677755,12.37275 2.7530612,11.23975 C0.414646258,8.89975 0.414646258,5.09375 2.7530612,2.75375 C5.09047639,0.41375 8.89552438,0.41475 11.2369386,2.75375 C13.5753535,5.09375 13.5753535,8.89975 11.2369386,11.23975 C11.0419873,11.43475 11.0419873,11.75175 11.2369386,11.94675 C11.2479153,11.9577858 11.2592787,11.9682002 11.2709852,11.9779932 Z" /></svg>');
74
+ --ifm-navbar-search-input-background-color: ${form.backgroundColor};
75
+ --ifm-navbar-search-input-color: ${euiTheme.colors.text};
76
+
77
+ ${euiFormControlText(euiThemeContext)};
78
+ block-size: ${form.controlCompressedHeight};
79
+ padding-block: ${form.controlCompressedPadding};
80
+
81
+ border: ${euiTheme.border.width.thin} solid ${form.borderColor};
82
+ border-radius: ${form.controlBorderRadius};
83
+
84
+ ${placeHolderStyles(`
85
+ color: ${form.controlPlaceholderText};
86
+ opacity: 1;
87
+ `)}
88
+
89
+ ${euiFocusRing(euiThemeContext, 'outset', { color: 'primary' })}
90
+
91
+ &:disabled {
92
+ border-color: ${form.borderDisabledColor};
93
+ background-color: ${form.backgroundDisabledColor};
94
+ }
95
+
96
+ &[readOnly] {
97
+ background-color: ${form.backgroundReadOnlyColor};
98
+ }
99
+
100
+ @media (min-width: 400px) {
101
+ inline-size: 100%;
102
+ max-inline-size: 25rem;
103
+ }
104
+
105
+ @media (min-width: 997px) {
106
+ min-inline-size: 15rem;
107
+ }
108
+
109
+ @media (min-width: 1200px) {
110
+ min-inline-size: 25rem;
111
+ }
112
+ }
113
+ `,
114
+ versionSwitcher: css `
115
+ @media (max-width: 996px) {
116
+ display: none;
117
+ }
118
+ `,
119
+ themeSwitcher: css `
120
+ @media (max-width: 996px) {
121
+ display: none;
122
+ }
123
+ `,
124
+ };
125
+ };
126
+ function useNavbarItems() {
127
+ // TODO temporary casting until ThemeConfig type is improved
128
+ return useThemeConfig().navbar.items;
129
+ }
130
+ function NavbarItems({ items }) {
131
+ return (_jsx(_Fragment, { children: items.map((item, i) => (_jsx(ErrorCauseBoundary, { onError: (error) => new Error(`A theme navbar item failed to render.
132
+ Please double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:
133
+ ${JSON.stringify(item, null, 2)}`, { cause: error }), children: _jsx(NavbarItem, { ...item }) }, i))) }));
134
+ }
135
+ function NavbarContentLayout({ left, right, }) {
136
+ const styles = useEuiMemoizedStyles(getStyles);
137
+ return (_jsxs("div", { className: "navbar__inner", css: styles.navbarItems, children: [_jsx("div", { className: "navbar__items", css: styles.navbarItemsLeft, children: left }), _jsx("div", { className: "navbar__items navbar__items--right", css: styles.navbarItemsRight, children: right })] }));
138
+ }
139
+ export default function NavbarContent({ versionSwitcherOptions, }) {
140
+ const isBrowser = useIsBrowser();
141
+ const mobileSidebar = useNavbarMobileSidebar();
142
+ const location = useLocation();
143
+ const items = useNavbarItems();
144
+ const [leftItems, rightItems] = splitNavbarItems(items);
145
+ const styles = useEuiMemoizedStyles(getStyles);
146
+ const searchBarItem = items.find((item) => item.type === 'search');
147
+ const isRoot = !location?.pathname.includes(DOCS_PATH);
148
+ return (_jsxs(_Fragment, { children: [_jsx(Global, { styles: styles.search }), _jsx(NavbarContentLayout, { left: _jsxs(_Fragment, { children: [!mobileSidebar.disabled && _jsx(NavbarMobileSidebarToggle, {}), _jsx(NavbarLogo, {}), _jsx("div", { css: styles.versionSwitcher, children: isBrowser && versionSwitcherOptions && (_jsx(VersionSwitcher, { ...versionSwitcherOptions })) }), _jsx(NavbarItems, { items: leftItems })] }), right: _jsxs(_Fragment, { children: [!searchBarItem && !isRoot && (_jsx(NavbarSearch, { children: _jsx(SearchBar, {}) })), _jsx(NavbarColorModeToggle, { className: "colorModeToggle" }), isBrowser && (_jsx("div", { css: styles.themeSwitcher, children: _jsx(HighContrastModeToggle, {}) })), _jsx(NavbarItems, { items: rightItems })] }) })] }));
149
+ }
@@ -0,0 +1,6 @@
1
+ import { JSX } from 'react';
2
+ import type { Props } from '@theme-original/Navbar/Layout';
3
+ import { VersionSwitcherProps } from '../../../components/version_switcher';
4
+ export default function NavbarLayout({ children, versionSwitcherOptions, }: Props & {
5
+ versionSwitcherOptions?: VersionSwitcherProps;
6
+ }): JSX.Element;
@@ -0,0 +1,59 @@
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 { useThemeConfig } from '@docusaurus/theme-common';
5
+ import { useHideableNavbar, useNavbarMobileSidebar, } from '@docusaurus/theme-common/internal';
6
+ import { translate } from '@docusaurus/Translate';
7
+ import { useEuiMemoizedStyles } from '@elastic/eui';
8
+ import NavbarMobileSidebar from '../MobileSidebar';
9
+ const getStyles = ({ euiTheme }) => {
10
+ return {
11
+ navbar: css `
12
+ --ifm-navbar-padding-horizontal: ${euiTheme.size.m};
13
+ --ifm-navbar-padding-vertical: ${euiTheme.size.s};
14
+ --ifm-navbar-item-padding-horizontal: 0;
15
+ --ifm-navbar-item-padding-vertical: 0;
16
+
17
+ --ifm-navbar-background-color: ${euiTheme.colors.textInverse};
18
+
19
+ flex-grow: 0;
20
+ flex-shrink: 0;
21
+
22
+ &,
23
+ .navbar-sidebar__brand {
24
+ border-block-end: ${euiTheme.border.thin};
25
+ box-shadow: none;
26
+ }
27
+ `,
28
+ navbarHideable: css `
29
+ transition: transform var(--ifm-transition-fast) ease;
30
+ `,
31
+ navbarHidden: css `
32
+ transform: translate3d(0, calc(-100% - 2px), 0);
33
+ `,
34
+ };
35
+ };
36
+ function NavbarBackdrop(props) {
37
+ return (_jsx("div", { role: "presentation", ...props, className: clsx('navbar-sidebar__backdrop', props.className) }));
38
+ }
39
+ export default function NavbarLayout({ children, versionSwitcherOptions, }) {
40
+ const { navbar: { hideOnScroll, style }, } = useThemeConfig();
41
+ const mobileSidebar = useNavbarMobileSidebar();
42
+ const { navbarRef, isNavbarVisible } = useHideableNavbar(hideOnScroll);
43
+ const styles = useEuiMemoizedStyles(getStyles);
44
+ return (_jsxs("nav", { ref: navbarRef, "aria-label": translate({
45
+ id: 'theme.NavBar.navAriaLabel',
46
+ message: 'Main',
47
+ description: 'The ARIA label for the main navigation',
48
+ }), className: clsx('navbar', 'navbar--fixed-top', {
49
+ 'navbar--dark': style === 'dark',
50
+ 'navbar--primary': style === 'primary',
51
+ 'navbar-sidebar--show': mobileSidebar.shown,
52
+ }), css: [
53
+ styles.navbar,
54
+ hideOnScroll && [
55
+ styles.navbarHideable,
56
+ !isNavbarVisible && styles.navbarHidden,
57
+ ],
58
+ ], children: [children, _jsx(NavbarBackdrop, { onClick: mobileSidebar.toggle }), _jsx(NavbarMobileSidebar, { versionSwitcherOptions: versionSwitcherOptions })] }));
59
+ }
@@ -0,0 +1,7 @@
1
+ import { JSX } from 'react';
2
+ import { VersionSwitcherProps } from '../../../../components/version_switcher';
3
+ type Props = {
4
+ versionSwitcherOptions?: VersionSwitcherProps;
5
+ };
6
+ export default function NavbarMobileSidebarHeader({ versionSwitcherOptions, }: Props): JSX.Element;
7
+ export {};
@@ -0,0 +1,46 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { useNavbarMobileSidebar } from '@docusaurus/theme-common/internal';
3
+ import { translate } from '@docusaurus/Translate';
4
+ import NavbarColorModeToggle from '@theme-original/Navbar/ColorModeToggle';
5
+ import NavbarLogo from '@theme-original/Navbar/Logo';
6
+ import { EuiIcon, useEuiMemoizedStyles } from '@elastic/eui';
7
+ import { css } from '@emotion/react';
8
+ import useIsBrowser from '@docusaurus/useIsBrowser';
9
+ import { VersionSwitcher, } from '../../../../components/version_switcher';
10
+ import { HighContrastModeToggle } from '../../../../components/high_contrast_mode_toggle';
11
+ const getStyles = ({ euiTheme }) => ({
12
+ sidebar: css `
13
+ gap: ${euiTheme.size.s};
14
+
15
+ > :first-child {
16
+ border-right: ${euiTheme.border.thin};
17
+ }
18
+ `,
19
+ close: css `
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ width: ${euiTheme.size.xl};
24
+ height: ${euiTheme.size.xl};
25
+ border-radius: ${euiTheme.border.radius.small};
26
+
27
+ &:hover {
28
+ background-color: var(--ifm-color-emphasis-200);
29
+ color: currentColor;
30
+ }
31
+ `,
32
+ });
33
+ function CloseButton() {
34
+ const mobileSidebar = useNavbarMobileSidebar();
35
+ const styles = useEuiMemoizedStyles(getStyles);
36
+ return (_jsx("button", { type: "button", "aria-label": translate({
37
+ id: 'theme.docs.sidebar.closeSidebarButtonAriaLabel',
38
+ message: 'Close navigation bar',
39
+ description: 'The ARIA label for close button of mobile sidebar',
40
+ }), className: "clean-btn navbar-sidebar__close", css: styles.close, onClick: () => mobileSidebar.toggle(), children: _jsx(EuiIcon, { type: "cross", size: "l" }) }));
41
+ }
42
+ export default function NavbarMobileSidebarHeader({ versionSwitcherOptions, }) {
43
+ const isBrowser = useIsBrowser();
44
+ const styles = useEuiMemoizedStyles(getStyles);
45
+ return (_jsxs("div", { className: "navbar-sidebar__brand", css: styles.sidebar, children: [_jsx(NavbarLogo, {}), isBrowser && versionSwitcherOptions && (_jsx(VersionSwitcher, { ...versionSwitcherOptions })), _jsx(NavbarColorModeToggle, {}), isBrowser && _jsx(HighContrastModeToggle, {}), _jsx(CloseButton, {})] }));
46
+ }
@@ -0,0 +1,6 @@
1
+ import { JSX } from 'react';
2
+ import type LayoutType from '@theme-init/Navbar/MobileSidebar/Layout';
3
+ import type { WrapperProps } from '@docusaurus/types';
4
+ type Props = WrapperProps<typeof LayoutType>;
5
+ export default function LayoutWrapper(props: Props): JSX.Element;
6
+ export {};
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { css } from '@emotion/react';
3
+ import Layout from '@theme-init/Navbar/MobileSidebar/Layout';
4
+ const styles = {
5
+ mobileSidebar: css `
6
+ --ifm-navbar-sidebar-width: 100vw;
7
+
8
+ @media (min-width: 400px) {
9
+ --ifm-navbar-sidebar-width: 75vw;
10
+ }
11
+
12
+ @media (min-width: 600px) {
13
+ --ifm-navbar-sidebar-width: 50vw;
14
+ }
15
+
16
+ .navbar-sidebar__back {
17
+ font-size: var(--eui-font-size-s);
18
+ line-height: var(--eui-fline-height-xs);
19
+ padding-block: var(--eui-size-m);
20
+ padding-inline: var(--eui-size-s);
21
+ }
22
+ `,
23
+ };
24
+ export default function LayoutWrapper(props) {
25
+ return (_jsx("div", { css: styles.mobileSidebar, children: _jsx(Layout, { ...props }) }));
26
+ }
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from 'react';
2
+ import { VersionSwitcherProps } from '../../../components/version_switcher';
3
+ type Props = {
4
+ versionSwitcherOptions?: VersionSwitcherProps;
5
+ };
6
+ export default function NavbarMobileSidebar({ versionSwitcherOptions, }: Props): ReactNode;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { useLockBodyScroll, useNavbarMobileSidebar, } from '@docusaurus/theme-common/internal';
3
+ import NavbarMobileSidebarLayout from '@theme-original/Navbar/MobileSidebar/Layout';
4
+ import NavbarMobileSidebarHeader from './Header';
5
+ import NavbarMobileSidebarPrimaryMenu from '@theme-original/Navbar/MobileSidebar/PrimaryMenu';
6
+ import NavbarMobileSidebarSecondaryMenu from '@theme-original/Navbar/MobileSidebar/SecondaryMenu';
7
+ export default function NavbarMobileSidebar({ versionSwitcherOptions, }) {
8
+ const mobileSidebar = useNavbarMobileSidebar();
9
+ useLockBodyScroll(mobileSidebar.shown);
10
+ if (!mobileSidebar.shouldRender) {
11
+ return null;
12
+ }
13
+ return (_jsx(NavbarMobileSidebarLayout, { header: _jsx(NavbarMobileSidebarHeader, { versionSwitcherOptions: versionSwitcherOptions }), primaryMenu: _jsx(NavbarMobileSidebarPrimaryMenu, {}), secondaryMenu: _jsx(NavbarMobileSidebarSecondaryMenu, {}) }));
14
+ }
@@ -0,0 +1,3 @@
1
+ import { JSX } from 'react';
2
+ import type { Props } from '@theme-original/NavbarItem/DropdownNavbarItem';
3
+ export default function DropdownNavbarItem({ mobile, ...props }: Props): JSX.Element;
@@ -0,0 +1,94 @@
1
+ import { createElement as _createElement } from "@emotion/react";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { useState, useRef, useEffect } from 'react';
11
+ import clsx from 'clsx';
12
+ import { css } from '@emotion/react';
13
+ import { isRegexpStringMatch, useCollapsible, Collapsible, } from '@docusaurus/theme-common';
14
+ import { isSamePath, useLocalPathname, } from '@docusaurus/theme-common/internal';
15
+ import NavbarNavLink from '@theme-original/NavbarItem/NavbarNavLink';
16
+ import NavbarItem from '@theme-original/NavbarItem';
17
+ const styles = {
18
+ dropdownNavbarItemMobile: css `
19
+ cursor: pointer;
20
+ `,
21
+ };
22
+ function isItemActive(item, localPathname) {
23
+ if (isSamePath(item.to, localPathname)) {
24
+ return true;
25
+ }
26
+ if (isRegexpStringMatch(item.activeBaseRegex, localPathname)) {
27
+ return true;
28
+ }
29
+ if (item.activeBasePath && localPathname.startsWith(item.activeBasePath)) {
30
+ return true;
31
+ }
32
+ return false;
33
+ }
34
+ function containsActiveItems(items, localPathname) {
35
+ return items.some((item) => isItemActive(item, localPathname));
36
+ }
37
+ function DropdownNavbarItemDesktop({ items, position, className, onClick, ...props }) {
38
+ const dropdownRef = useRef(null);
39
+ const [showDropdown, setShowDropdown] = useState(false);
40
+ useEffect(() => {
41
+ const handleClickOutside = (event) => {
42
+ if (!dropdownRef.current ||
43
+ dropdownRef.current.contains(event.target)) {
44
+ return;
45
+ }
46
+ setShowDropdown(false);
47
+ };
48
+ document.addEventListener('mousedown', handleClickOutside);
49
+ document.addEventListener('touchstart', handleClickOutside);
50
+ document.addEventListener('focusin', handleClickOutside);
51
+ return () => {
52
+ document.removeEventListener('mousedown', handleClickOutside);
53
+ document.removeEventListener('touchstart', handleClickOutside);
54
+ document.removeEventListener('focusin', handleClickOutside);
55
+ };
56
+ }, [dropdownRef]);
57
+ return (_jsxs("div", { ref: dropdownRef, className: clsx('navbar__item', 'dropdown', 'dropdown--hoverable', {
58
+ 'dropdown--right': position === 'right',
59
+ 'dropdown--show': showDropdown,
60
+ }), children: [_jsx(NavbarNavLink, { "aria-haspopup": "true", "aria-expanded": showDropdown, role: "button",
61
+ // # hash permits to make the <a> tag focusable in case no link target
62
+ // See https://github.com/facebook/docusaurus/pull/6003
63
+ // There's probably a better solution though...
64
+ href: props.to ? undefined : '#', className: clsx('navbar__link', className), ...props, onClick: props.to ? undefined : (e) => e.preventDefault(), onKeyDown: (e) => {
65
+ if (e.key === 'Enter') {
66
+ e.preventDefault();
67
+ setShowDropdown(!showDropdown);
68
+ }
69
+ }, children: props.children ?? props.label }), _jsx("ul", { className: "dropdown__menu", children: items.map((childItemProps, i) => (_createElement(NavbarItem, { isDropdownItem: true, activeClassName: "dropdown__link--active", ...childItemProps, key: i }))) })] }));
70
+ }
71
+ function DropdownNavbarItemMobile({ items, className, position, // Need to destructure position from props so that it doesn't get passed on.
72
+ onClick, ...props }) {
73
+ const localPathname = useLocalPathname();
74
+ const containsActive = containsActiveItems(items, localPathname);
75
+ const { collapsed, toggleCollapsed, setCollapsed } = useCollapsible({
76
+ initialState: () => !containsActive,
77
+ });
78
+ // Expand/collapse if any item active after a navigation
79
+ useEffect(() => {
80
+ if (containsActive) {
81
+ setCollapsed(!containsActive);
82
+ }
83
+ }, [localPathname, containsActive, setCollapsed]);
84
+ return (_jsxs("li", { className: clsx('menu__list-item', {
85
+ 'menu__list-item--collapsed': collapsed,
86
+ }), children: [_jsx(NavbarNavLink, { role: "button", className: clsx(styles.dropdownNavbarItemMobile, 'menu__link menu__link--sublist', className), ...props, onClick: (e) => {
87
+ e.preventDefault();
88
+ toggleCollapsed();
89
+ }, children: props.children ?? props.label }), _jsx(Collapsible, { lazy: true, as: "ul", className: "menu__list", collapsed: collapsed, children: items.map((childItemProps, i) => (_createElement(NavbarItem, { mobile: true, isDropdownItem: true, onClick: onClick, activeClassName: "menu__link--active", ...childItemProps, key: i }))) })] }));
90
+ }
91
+ export default function DropdownNavbarItem({ mobile = false, ...props }) {
92
+ const Comp = mobile ? DropdownNavbarItemMobile : DropdownNavbarItemDesktop;
93
+ return _jsx(Comp, { ...props });
94
+ }
@@ -0,0 +1,7 @@
1
+ import { JSX } from 'react';
2
+ import type { Props as NavbarNavLinkProps } from '@theme-original/NavbarItem/NavbarNavLink';
3
+ type Props = NavbarNavLinkProps & {
4
+ component: string;
5
+ };
6
+ export default function NavbarNavLink({ activeBasePath, activeBaseRegex, to, href, label, html, isDropdownLink, prependBaseUrlToHref, component, ...props }: Props): JSX.Element;
7
+ export {};
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import Link from '@docusaurus/Link';
3
+ import useBaseUrl from '@docusaurus/useBaseUrl';
4
+ import isInternalUrl from '@docusaurus/isInternalUrl';
5
+ import { isRegexpStringMatch } from '@docusaurus/theme-common';
6
+ import IconExternalLink from '@theme-original/Icon/ExternalLink';
7
+ import { NavbarItem } from '../../components/navbar_item';
8
+ const CUSTOM_LINK_COMPONENT_MAP = {
9
+ github: {
10
+ component: NavbarItem,
11
+ icon: () => (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fill: "currentColor", d: "M8 0C3.58203 0 0 3.67167 0 8.2002C0 11.8238 2.292 14.8969 5.47119 15.981C5.87109 16.0561 6.01709 15.8028 6.01709 15.5866C6.01709 15.3914 6.00977 14.7447 6.00586 14.0601C3.78125 14.5555 3.31103 13.0931 3.31103 13.0931C2.94678 12.1461 2.42284 11.8939 2.42284 11.8939C1.6958 11.3854 2.478 11.3954 2.478 11.3954C3.28122 11.4524 3.70409 12.2402 3.70409 12.2402C4.41797 13.4935 5.57714 13.1311 6.03222 12.9209C6.10494 12.3924 6.31197 12.03 6.54003 11.8258C4.76416 11.6186 2.896 10.9149 2.896 7.77276C2.896 6.87686 3.20802 6.14615 3.71875 5.57207C3.6372 5.36386 3.36181 4.52952 3.79784 3.4009C3.79784 3.4009 4.46875 3.18069 5.99803 4.24175C6.63572 4.05907 7.31981 3.96898 7.99998 3.96597C8.67967 3.96898 9.36423 4.06006 10.0029 4.24274C11.5293 3.18068 12.2012 3.4019 12.2012 3.4019C12.6387 4.53152 12.3633 5.36485 12.2812 5.57207C12.7939 6.14615 13.1035 6.87688 13.1035 7.77276C13.1035 10.9229 11.2324 11.6166 9.4502 11.8198C9.7383 12.0741 9.99317 12.5726 9.99317 13.3373C9.99317 14.4334 9.98242 15.3173 9.98242 15.5876C9.98242 15.8058 10.1279 16.0611 10.5332 15.981C13.71 14.8949 16 11.8218 16 8.2002C16 3.67167 12.418 0 8 0Z" }) })),
12
+ },
13
+ changelog: {
14
+ component: NavbarItem,
15
+ icon: 'cheer',
16
+ },
17
+ figma: {
18
+ component: NavbarItem,
19
+ icon: () => (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fill: "currentColor", d: "M12.5 6.5A2.5 2.5 0 0 0 11 2H6.5A2.5 2.5 0 0 0 5 6.5a2.5 2.5 0 0 0 .085 4.063A2.75 2.75 0 1 0 9.5 12.75V10.5a2.5 2.5 0 0 0 3-4Zm0-2A1.5 1.5 0 0 1 11 6H9.5V3H11a1.5 1.5 0 0 1 1.5 1.5ZM5 4.5A1.5 1.5 0 0 1 6.5 3h2v3h-2A1.5 1.5 0 0 1 5 4.5ZM6.5 10a1.5 1.5 0 0 1 0-3h2v3h-2Zm2 2.75A1.75 1.75 0 1 1 6.75 11H8.5v1.75ZM11 10a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z" }) })),
20
+ },
21
+ };
22
+ export default function NavbarNavLink({ activeBasePath, activeBaseRegex, to, href, label, html, isDropdownLink, prependBaseUrlToHref, component, ...props }) {
23
+ // TODO all this seems hacky
24
+ // {to: 'version'} should probably be forbidden, in favor of {to: '/version'}
25
+ const toUrl = useBaseUrl(to);
26
+ const activeBaseUrl = useBaseUrl(activeBasePath);
27
+ const normalizedHref = useBaseUrl(href, { forcePrependBaseUrl: true });
28
+ const isExternalLink = label && href && !isInternalUrl(href);
29
+ if (component != null && CUSTOM_LINK_COMPONENT_MAP[component] !== undefined) {
30
+ const componentData = CUSTOM_LINK_COMPONENT_MAP[component];
31
+ const Element = componentData.component;
32
+ return (_jsx(Element, { href: href, title: label, icon: componentData.icon, className: props.className, showLabel: true }));
33
+ }
34
+ // Link content is set through html XOR label
35
+ const linkContentProps = html
36
+ ? { dangerouslySetInnerHTML: { __html: html } }
37
+ : {
38
+ children: (_jsxs(_Fragment, { children: [label, isExternalLink && (_jsx(IconExternalLink, { ...(isDropdownLink && { width: 12, height: 12 }) }))] })),
39
+ };
40
+ if (href) {
41
+ return (_jsx(Link, { href: prependBaseUrlToHref ? normalizedHref : href, ...props, ...linkContentProps }));
42
+ }
43
+ return (_jsx(Link, { to: toUrl, isNavLink: true, ...((activeBasePath || activeBaseRegex) && {
44
+ isActive: (_match, location) => activeBaseRegex
45
+ ? isRegexpStringMatch(activeBaseRegex, location.pathname)
46
+ : location.pathname.startsWith(activeBaseUrl),
47
+ }), ...props, ...linkContentProps }));
48
+ }
@@ -0,0 +1,3 @@
1
+ import { JSX } from 'react';
2
+ import type { Props } from '@theme-original/PaginatorNavLink';
3
+ export default function PaginatorNavLink(props: Props): JSX.Element;