@depup/nextra 4.6.1-depup.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 (293) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/changes.json +110 -0
  4. package/dist/client/components/banner/close-banner-button.d.ts +8 -0
  5. package/dist/client/components/banner/close-banner-button.js +45 -0
  6. package/dist/client/components/banner/index.client.d.ts +5 -0
  7. package/dist/client/components/banner/index.client.js +46 -0
  8. package/dist/client/components/banner/index.d.ts +51 -0
  9. package/dist/client/components/banner/index.js +93 -0
  10. package/dist/client/components/bleed.d.ts +63 -0
  11. package/dist/client/components/bleed.js +54 -0
  12. package/dist/client/components/button.d.ts +9 -0
  13. package/dist/client/components/button.js +55 -0
  14. package/dist/client/components/callout.d.ts +136 -0
  15. package/dist/client/components/callout.js +99 -0
  16. package/dist/client/components/cards.d.ts +104 -0
  17. package/dist/client/components/cards.js +132 -0
  18. package/dist/client/components/collapse.d.ts +12 -0
  19. package/dist/client/components/collapse.js +143 -0
  20. package/dist/client/components/file-tree/file.d.ts +9 -0
  21. package/dist/client/components/file-tree/file.js +43 -0
  22. package/dist/client/components/file-tree/folder.d.ts +12 -0
  23. package/dist/client/components/file-tree/folder.js +94 -0
  24. package/dist/client/components/file-tree/index.d.ts +57 -0
  25. package/dist/client/components/file-tree/index.js +12 -0
  26. package/dist/client/components/file-tree/tree.d.ts +5 -0
  27. package/dist/client/components/file-tree/tree.js +41 -0
  28. package/dist/client/components/head.d.ts +139 -0
  29. package/dist/client/components/head.js +202 -0
  30. package/dist/client/components/image-zoom.d.ts +6 -0
  31. package/dist/client/components/image-zoom.js +79 -0
  32. package/dist/client/components/index.d.ts +56 -0
  33. package/dist/client/components/index.js +42 -0
  34. package/dist/client/components/playground.d.ts +90 -0
  35. package/dist/client/components/playground.js +103 -0
  36. package/dist/client/components/popup/index.client.d.ts +7 -0
  37. package/dist/client/components/popup/index.client.js +83 -0
  38. package/dist/client/components/popup/index.d.ts +12 -0
  39. package/dist/client/components/popup/index.js +11 -0
  40. package/dist/client/components/search.d.ts +88 -0
  41. package/dist/client/components/search.js +426 -0
  42. package/dist/client/components/select.d.ts +19 -0
  43. package/dist/client/components/select.js +109 -0
  44. package/dist/client/components/skip-nav/index.client.d.ts +5 -0
  45. package/dist/client/components/skip-nav/index.client.js +45 -0
  46. package/dist/client/components/skip-nav/index.d.ts +6 -0
  47. package/dist/client/components/skip-nav/index.js +24 -0
  48. package/dist/client/components/steps.d.ts +64 -0
  49. package/dist/client/components/steps.js +74 -0
  50. package/dist/client/components/tabs/index.client.d.ts +21 -0
  51. package/dist/client/components/tabs/index.client.js +243 -0
  52. package/dist/client/components/tabs/index.d.ts +53 -0
  53. package/dist/client/components/tabs/index.js +9 -0
  54. package/dist/client/evaluate.d.ts +30 -0
  55. package/dist/client/evaluate.js +17 -0
  56. package/dist/client/hocs/index.d.ts +4 -0
  57. package/dist/client/hocs/index.js +6 -0
  58. package/dist/client/hocs/with-github-alert.d.ts +11 -0
  59. package/dist/client/hocs/with-github-alert.js +30 -0
  60. package/dist/client/hocs/with-icons.d.ts +6 -0
  61. package/dist/client/hocs/with-icons.js +76 -0
  62. package/dist/client/hooks/index.d.ts +4 -0
  63. package/dist/client/hooks/index.js +10 -0
  64. package/dist/client/hooks/use-copy.d.ts +9 -0
  65. package/dist/client/hooks/use-copy.js +77 -0
  66. package/dist/client/hooks/use-fs-route.d.ts +3 -0
  67. package/dist/client/hooks/use-fs-route.js +20 -0
  68. package/dist/client/hooks/use-hash.d.ts +3 -0
  69. package/dist/client/hooks/use-hash.js +20 -0
  70. package/dist/client/hooks/use-mounted.d.ts +3 -0
  71. package/dist/client/hooks/use-mounted.js +13 -0
  72. package/dist/client/icons/arrow-right.d.ts +5 -0
  73. package/dist/client/icons/arrow-right.js +24 -0
  74. package/dist/client/icons/chatgpt.d.ts +2 -0
  75. package/dist/client/icons/chatgpt.js +24 -0
  76. package/dist/client/icons/check.d.ts +2 -0
  77. package/dist/client/icons/check.js +24 -0
  78. package/dist/client/icons/claude.d.ts +2 -0
  79. package/dist/client/icons/claude.js +81 -0
  80. package/dist/client/icons/copy.d.ts +2 -0
  81. package/dist/client/icons/copy.js +31 -0
  82. package/dist/client/icons/cpp.d.ts +2 -0
  83. package/dist/client/icons/cpp.js +24 -0
  84. package/dist/client/icons/cross-circled.d.ts +2 -0
  85. package/dist/client/icons/cross-circled.js +24 -0
  86. package/dist/client/icons/csharp.d.ts +2 -0
  87. package/dist/client/icons/csharp.js +24 -0
  88. package/dist/client/icons/css.d.ts +2 -0
  89. package/dist/client/icons/css.js +24 -0
  90. package/dist/client/icons/discord.d.ts +2 -0
  91. package/dist/client/icons/discord.js +24 -0
  92. package/dist/client/icons/expand.d.ts +2 -0
  93. package/dist/client/icons/expand.js +31 -0
  94. package/dist/client/icons/file.d.ts +2 -0
  95. package/dist/client/icons/file.js +24 -0
  96. package/dist/client/icons/folder-open.d.ts +2 -0
  97. package/dist/client/icons/folder-open.js +24 -0
  98. package/dist/client/icons/folder.d.ts +2 -0
  99. package/dist/client/icons/folder.js +24 -0
  100. package/dist/client/icons/github-caution.d.ts +2 -0
  101. package/dist/client/icons/github-caution.js +24 -0
  102. package/dist/client/icons/github-important.d.ts +2 -0
  103. package/dist/client/icons/github-important.js +24 -0
  104. package/dist/client/icons/github-note.d.ts +2 -0
  105. package/dist/client/icons/github-note.js +24 -0
  106. package/dist/client/icons/github-tip.d.ts +2 -0
  107. package/dist/client/icons/github-tip.js +24 -0
  108. package/dist/client/icons/github-warning.d.ts +2 -0
  109. package/dist/client/icons/github-warning.js +24 -0
  110. package/dist/client/icons/github.d.ts +2 -0
  111. package/dist/client/icons/github.js +24 -0
  112. package/dist/client/icons/globe.d.ts +2 -0
  113. package/dist/client/icons/globe.js +24 -0
  114. package/dist/client/icons/go.d.ts +2 -0
  115. package/dist/client/icons/go.js +46 -0
  116. package/dist/client/icons/graphql.d.ts +2 -0
  117. package/dist/client/icons/graphql.js +56 -0
  118. package/dist/client/icons/index.d.ts +2 -0
  119. package/dist/client/icons/index.js +92 -0
  120. package/dist/client/icons/javascript.d.ts +2 -0
  121. package/dist/client/icons/javascript.js +24 -0
  122. package/dist/client/icons/json.d.ts +2 -0
  123. package/dist/client/icons/json.js +41 -0
  124. package/dist/client/icons/link-arrow.d.ts +2 -0
  125. package/dist/client/icons/link-arrow.js +31 -0
  126. package/dist/client/icons/link.d.ts +2 -0
  127. package/dist/client/icons/link.js +24 -0
  128. package/dist/client/icons/markdown.d.ts +2 -0
  129. package/dist/client/icons/markdown.js +24 -0
  130. package/dist/client/icons/mdx.d.ts +2 -0
  131. package/dist/client/icons/mdx.js +24 -0
  132. package/dist/client/icons/menu.d.ts +2 -0
  133. package/dist/client/icons/menu.js +36 -0
  134. package/dist/client/icons/moon.d.ts +2 -0
  135. package/dist/client/icons/moon.js +24 -0
  136. package/dist/client/icons/move.d.ts +2 -0
  137. package/dist/client/icons/move.js +24 -0
  138. package/dist/client/icons/python.d.ts +2 -0
  139. package/dist/client/icons/python.js +31 -0
  140. package/dist/client/icons/react.d.ts +2 -0
  141. package/dist/client/icons/react.js +38 -0
  142. package/dist/client/icons/rust.d.ts +2 -0
  143. package/dist/client/icons/rust.js +31 -0
  144. package/dist/client/icons/spinner.d.ts +2 -0
  145. package/dist/client/icons/spinner.js +31 -0
  146. package/dist/client/icons/sun.d.ts +2 -0
  147. package/dist/client/icons/sun.js +24 -0
  148. package/dist/client/icons/svelte.d.ts +2 -0
  149. package/dist/client/icons/svelte.js +31 -0
  150. package/dist/client/icons/terminal.d.ts +2 -0
  151. package/dist/client/icons/terminal.js +24 -0
  152. package/dist/client/icons/terraform.d.ts +2 -0
  153. package/dist/client/icons/terraform.js +24 -0
  154. package/dist/client/icons/typescript.d.ts +2 -0
  155. package/dist/client/icons/typescript.js +24 -0
  156. package/dist/client/icons/word-wrap.d.ts +2 -0
  157. package/dist/client/icons/word-wrap.js +24 -0
  158. package/dist/client/icons/x.d.ts +2 -0
  159. package/dist/client/icons/x.js +24 -0
  160. package/dist/client/mdx-components/anchor.d.ts +10 -0
  161. package/dist/client/mdx-components/anchor.js +109 -0
  162. package/dist/client/mdx-components/code.d.ts +7 -0
  163. package/dist/client/mdx-components/code.js +52 -0
  164. package/dist/client/mdx-components/details.d.ts +5 -0
  165. package/dist/client/mdx-components/details.js +166 -0
  166. package/dist/client/mdx-components/image.d.ts +28 -0
  167. package/dist/client/mdx-components/image.js +39 -0
  168. package/dist/client/mdx-components/index.d.ts +11 -0
  169. package/dist/client/mdx-components/index.js +16 -0
  170. package/dist/client/mdx-components/pre/copy-to-clipboard.d.ts +5 -0
  171. package/dist/client/mdx-components/pre/copy-to-clipboard.js +49 -0
  172. package/dist/client/mdx-components/pre/index.d.ts +16 -0
  173. package/dist/client/mdx-components/pre/index.js +156 -0
  174. package/dist/client/mdx-components/pre/toggle-word-wrap-button.d.ts +7 -0
  175. package/dist/client/mdx-components/pre/toggle-word-wrap-button.js +31 -0
  176. package/dist/client/mdx-components/summary.d.ts +5 -0
  177. package/dist/client/mdx-components/summary.js +80 -0
  178. package/dist/client/mdx-components/table.d.ts +57 -0
  179. package/dist/client/mdx-components/table.js +95 -0
  180. package/dist/client/mdx-components.d.ts +89 -0
  181. package/dist/client/mdx-components.js +15 -0
  182. package/dist/client/mdx-remote.d.ts +62 -0
  183. package/dist/client/mdx-remote.js +36 -0
  184. package/dist/client/normalize-pages.d.ts +84 -0
  185. package/dist/client/normalize-pages.js +232 -0
  186. package/dist/client/package.json +1 -0
  187. package/dist/client/pages.d.ts +131 -0
  188. package/dist/client/pages.js +39 -0
  189. package/dist/client/remove-links.d.ts +6 -0
  190. package/dist/client/remove-links.js +35 -0
  191. package/dist/client/setup-page.d.ts +18 -0
  192. package/dist/client/setup-page.js +14 -0
  193. package/dist/server/compile-metadata.d.ts +12 -0
  194. package/dist/server/compile-metadata.js +39 -0
  195. package/dist/server/compile.d.ts +39 -0
  196. package/dist/server/compile.js +158 -0
  197. package/dist/server/constants.d.ts +15 -0
  198. package/dist/server/constants.js +22 -0
  199. package/dist/server/fetch-filepaths-from-github.d.ts +10 -0
  200. package/dist/server/fetch-filepaths-from-github.js +36 -0
  201. package/dist/server/index.d.ts +39 -0
  202. package/dist/server/index.js +203 -0
  203. package/dist/server/loader.d.ts +18 -0
  204. package/dist/server/loader.js +155 -0
  205. package/dist/server/locales.d.ts +22 -0
  206. package/dist/server/locales.js +38 -0
  207. package/dist/server/page-map/find-meta-and-page-file-paths.d.ts +8 -0
  208. package/dist/server/page-map/find-meta-and-page-file-paths.js +32 -0
  209. package/dist/server/page-map/get.d.ts +50 -0
  210. package/dist/server/page-map/get.js +28 -0
  211. package/dist/server/page-map/index-page.d.ts +21 -0
  212. package/dist/server/page-map/index-page.js +57 -0
  213. package/dist/server/page-map/index.d.ts +26 -0
  214. package/dist/server/page-map/index.js +24 -0
  215. package/dist/server/page-map/merge-meta-with-page-map.d.ts +17 -0
  216. package/dist/server/page-map/merge-meta-with-page-map.js +74 -0
  217. package/dist/server/page-map/normalize.d.ts +17 -0
  218. package/dist/server/page-map/normalize.js +122 -0
  219. package/dist/server/page-map/placeholder.d.ts +2 -0
  220. package/dist/server/page-map/placeholder.js +0 -0
  221. package/dist/server/page-map/to-ast.d.ts +18 -0
  222. package/dist/server/page-map/to-ast.js +47 -0
  223. package/dist/server/page-map/to-js.d.ts +21 -0
  224. package/dist/server/page-map/to-js.js +72 -0
  225. package/dist/server/page-map/to-page-map.d.ts +26 -0
  226. package/dist/server/page-map/to-page-map.js +101 -0
  227. package/dist/server/recma-plugins/index.d.ts +3 -0
  228. package/dist/server/recma-plugins/index.js +4 -0
  229. package/dist/server/recma-plugins/recma-rewrite.d.ts +11 -0
  230. package/dist/server/recma-plugins/recma-rewrite.js +98 -0
  231. package/dist/server/rehype-plugins/index.d.ts +18 -0
  232. package/dist/server/rehype-plugins/index.js +16 -0
  233. package/dist/server/rehype-plugins/rehype-better-react-mathjax.d.ts +24 -0
  234. package/dist/server/rehype-plugins/rehype-better-react-mathjax.js +96 -0
  235. package/dist/server/rehype-plugins/rehype-extract-toc-content.d.ts +6 -0
  236. package/dist/server/rehype-plugins/rehype-extract-toc-content.js +119 -0
  237. package/dist/server/rehype-plugins/rehype-twoslash-popup.d.ts +6 -0
  238. package/dist/server/rehype-plugins/rehype-twoslash-popup.js +50 -0
  239. package/dist/server/rehype-plugins/rehype.d.ts +21 -0
  240. package/dist/server/rehype-plugins/rehype.js +84 -0
  241. package/dist/server/remark-plugins/index.d.ts +15 -0
  242. package/dist/server/remark-plugins/index.js +26 -0
  243. package/dist/server/remark-plugins/remark-assign-frontmatter.d.ts +10 -0
  244. package/dist/server/remark-plugins/remark-assign-frontmatter.js +24 -0
  245. package/dist/server/remark-plugins/remark-custom-heading-id.d.ts +9 -0
  246. package/dist/server/remark-plugins/remark-custom-heading-id.js +18 -0
  247. package/dist/server/remark-plugins/remark-export-only-metadata.d.ts +6 -0
  248. package/dist/server/remark-plugins/remark-export-only-metadata.js +18 -0
  249. package/dist/server/remark-plugins/remark-export-source-code.d.ts +6 -0
  250. package/dist/server/remark-plugins/remark-export-source-code.js +35 -0
  251. package/dist/server/remark-plugins/remark-headings.d.ts +12 -0
  252. package/dist/server/remark-plugins/remark-headings.js +133 -0
  253. package/dist/server/remark-plugins/remark-link-rewrite.d.ts +11 -0
  254. package/dist/server/remark-plugins/remark-link-rewrite.js +12 -0
  255. package/dist/server/remark-plugins/remark-mdx-disable-explicit-jsx.d.ts +10 -0
  256. package/dist/server/remark-plugins/remark-mdx-disable-explicit-jsx.js +10 -0
  257. package/dist/server/remark-plugins/remark-mdx-frontmatter.d.ts +6 -0
  258. package/dist/server/remark-plugins/remark-mdx-frontmatter.js +37 -0
  259. package/dist/server/remark-plugins/remark-mdx-title.d.ts +10 -0
  260. package/dist/server/remark-plugins/remark-mdx-title.js +53 -0
  261. package/dist/server/remark-plugins/remark-remove-imports.d.ts +6 -0
  262. package/dist/server/remark-plugins/remark-remove-imports.js +12 -0
  263. package/dist/server/remark-plugins/remark-static-image.d.ts +6 -0
  264. package/dist/server/remark-plugins/remark-static-image.js +107 -0
  265. package/dist/server/schemas.d.ts +352 -0
  266. package/dist/server/schemas.js +240 -0
  267. package/dist/server/tsdoc/base.d.ts +38 -0
  268. package/dist/server/tsdoc/base.js +284 -0
  269. package/dist/server/tsdoc/index.d.ts +6 -0
  270. package/dist/server/tsdoc/index.js +10 -0
  271. package/dist/server/tsdoc/tsdoc.d.ts +102 -0
  272. package/dist/server/tsdoc/tsdoc.js +262 -0
  273. package/dist/server/tsdoc/types.d.ts +64 -0
  274. package/dist/server/tsdoc/types.js +0 -0
  275. package/dist/server/tsdoc/zod-to-ts.d.ts +5 -0
  276. package/dist/server/tsdoc/zod-to-ts.js +107 -0
  277. package/dist/server/twoslash.d.ts +6 -0
  278. package/dist/server/twoslash.js +60 -0
  279. package/dist/server/utils.d.ts +12 -0
  280. package/dist/server/utils.js +45 -0
  281. package/dist/types.d.ts +128 -0
  282. package/dist/types.generated.d.ts +203 -0
  283. package/dist/types.generated.js +0 -0
  284. package/dist/types.js +0 -0
  285. package/loader.cjs +24 -0
  286. package/package.json +265 -0
  287. package/styles/cards.css +24 -0
  288. package/styles/code-block.css +266 -0
  289. package/styles/default.css +55 -0
  290. package/styles/react-medium-image-zoom.css +101 -0
  291. package/styles/scrollbar.css +14 -0
  292. package/styles/steps.css +22 -0
  293. package/styles/subheading-anchor.css +25 -0
@@ -0,0 +1,426 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { c as _c } from "react-compiler-runtime";
4
+ import { Combobox, ComboboxInput, ComboboxOption, ComboboxOptions } from "@headlessui/react";
5
+ import cn from "clsx";
6
+ import { addBasePath } from "next/dist/client/add-base-path";
7
+ import NextLink from "next/link";
8
+ import { useRouter } from "next/navigation";
9
+ import { useDeferredValue, useEffect, useRef, useState } from "react";
10
+ import { useMounted } from "../hooks/use-mounted.js";
11
+ import { InformationCircleIcon, SpinnerIcon } from "../icons/index.js";
12
+ async function importPagefind() {
13
+ window.pagefind = await import(
14
+ /* webpackIgnore: true */
15
+ addBasePath("/_pagefind/pagefind.js")
16
+ );
17
+ await window.pagefind.options({
18
+ baseUrl: "/"
19
+ // ... more search options
20
+ });
21
+ }
22
+ const INPUTS = /* @__PURE__ */ new Set(["INPUT", "SELECT", "BUTTON", "TEXTAREA"]);
23
+ const DEV_SEARCH_NOTICE = /* @__PURE__ */ jsxs(Fragment, { children: [
24
+ /* @__PURE__ */ jsx("p", { children: "Search isn't available in development because Nextra\xA04 uses Pagefind package, which indexes built `.html` files instead of `.md`/`.mdx`." }),
25
+ /* @__PURE__ */ jsx("p", { className: "x:mt-2", children: "To test search during development, run `next build` and then restart your app with `next dev`." })
26
+ ] });
27
+ const Search = (t0) => {
28
+ const $ = _c(60);
29
+ let className;
30
+ let onSearch;
31
+ let props;
32
+ let searchOptions;
33
+ let t1;
34
+ let t2;
35
+ let t3;
36
+ let t4;
37
+ if ($[0] !== t0) {
38
+ ({
39
+ className,
40
+ emptyResult: t1,
41
+ errorText: t2,
42
+ loading: t3,
43
+ placeholder: t4,
44
+ searchOptions,
45
+ onSearch,
46
+ ...props
47
+ } = t0);
48
+ $[0] = t0;
49
+ $[1] = className;
50
+ $[2] = onSearch;
51
+ $[3] = props;
52
+ $[4] = searchOptions;
53
+ $[5] = t1;
54
+ $[6] = t2;
55
+ $[7] = t3;
56
+ $[8] = t4;
57
+ } else {
58
+ className = $[1];
59
+ onSearch = $[2];
60
+ props = $[3];
61
+ searchOptions = $[4];
62
+ t1 = $[5];
63
+ t2 = $[6];
64
+ t3 = $[7];
65
+ t4 = $[8];
66
+ }
67
+ const emptyResult = t1 === void 0 ? "No results found." : t1;
68
+ const errorText = t2 === void 0 ? "Failed to load search index." : t2;
69
+ const loading = t3 === void 0 ? "Loading\u2026" : t3;
70
+ const placeholder = t4 === void 0 ? "Search documentation\u2026" : t4;
71
+ const [isLoading, setIsLoading] = useState(true);
72
+ const [error, setError] = useState("");
73
+ let t5;
74
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
75
+ t5 = [];
76
+ $[9] = t5;
77
+ } else {
78
+ t5 = $[9];
79
+ }
80
+ const [results, setResults] = useState(t5);
81
+ const [search, setSearch] = useState("");
82
+ const deferredSearch = useDeferredValue(search);
83
+ let t6;
84
+ if ($[10] !== deferredSearch || $[11] !== searchOptions) {
85
+ t6 = () => {
86
+ const handleSearch = async (value) => {
87
+ if (!value) {
88
+ setResults([]);
89
+ setError("");
90
+ return;
91
+ }
92
+ setIsLoading(true);
93
+ if (!window.pagefind) {
94
+ ;
95
+ try {
96
+ await importPagefind();
97
+ } catch (t72) {
98
+ const error_0 = t72;
99
+ const message = error_0 instanceof Error ? process.env.NODE_ENV !== "production" && error_0.message.includes("Failed to fetch") ? DEV_SEARCH_NOTICE : `${error_0.constructor.name}: ${error_0.message}` : String(error_0);
100
+ setError(message);
101
+ setIsLoading(false);
102
+ return;
103
+ }
104
+ }
105
+ const response = await window.pagefind.debouncedSearch(value, searchOptions);
106
+ if (!response) {
107
+ return;
108
+ }
109
+ const data = await Promise.all(response.results.map(_temp));
110
+ setIsLoading(false);
111
+ setError("");
112
+ setResults(data.map(_temp3));
113
+ };
114
+ handleSearch(deferredSearch);
115
+ };
116
+ $[10] = deferredSearch;
117
+ $[11] = searchOptions;
118
+ $[12] = t6;
119
+ } else {
120
+ t6 = $[12];
121
+ }
122
+ let t7;
123
+ if ($[13] !== deferredSearch) {
124
+ t7 = [deferredSearch];
125
+ $[13] = deferredSearch;
126
+ $[14] = t7;
127
+ } else {
128
+ t7 = $[14];
129
+ }
130
+ useEffect(t6, t7);
131
+ const router = useRouter();
132
+ const [focused, setFocused] = useState(false);
133
+ const mounted = useMounted();
134
+ const inputRef = useRef(null);
135
+ let t8;
136
+ let t9;
137
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
138
+ t8 = () => {
139
+ const handleKeyDown = function handleKeyDown2(event) {
140
+ const el = document.activeElement;
141
+ if (!el || INPUTS.has(el.tagName) || el.isContentEditable) {
142
+ return;
143
+ }
144
+ if (event.key === "/" || event.key === "k" && !event.shiftKey && (navigator.userAgent.includes("Mac") ? event.metaKey : event.ctrlKey)) {
145
+ event.preventDefault();
146
+ inputRef.current.focus({
147
+ preventScroll: true
148
+ });
149
+ }
150
+ };
151
+ window.addEventListener("keydown", handleKeyDown);
152
+ return () => {
153
+ window.removeEventListener("keydown", handleKeyDown);
154
+ };
155
+ };
156
+ t9 = [];
157
+ $[15] = t8;
158
+ $[16] = t9;
159
+ } else {
160
+ t8 = $[15];
161
+ t9 = $[16];
162
+ }
163
+ useEffect(t8, t9);
164
+ const t10 = (!mounted || focused) && "x:invisible x:opacity-0";
165
+ let t11;
166
+ if ($[17] !== t10) {
167
+ t11 = cn("x:absolute x:my-1.5 x:select-none x:pointer-events-none x:end-1.5 x:transition-all", "x:h-5 x:rounded x:bg-nextra-bg x:px-1.5 x:font-mono x:text-[11px] x:font-medium x:text-gray-600 x:dark:text-gray-400", "x:border nextra-border", "x:contrast-more:text-current", "x:items-center x:gap-1 x:flex", "x:max-sm:hidden not-prose", t10);
168
+ $[17] = t10;
169
+ $[18] = t11;
170
+ } else {
171
+ t11 = $[18];
172
+ }
173
+ let t12;
174
+ if ($[19] !== mounted) {
175
+ t12 = mounted && navigator.userAgent.includes("Mac") ? /* @__PURE__ */ jsxs(Fragment, { children: [
176
+ /* @__PURE__ */ jsx("span", { className: "x:text-xs", children: "\u2318" }),
177
+ "K"
178
+ ] }) : "CTRL K";
179
+ $[19] = mounted;
180
+ $[20] = t12;
181
+ } else {
182
+ t12 = $[20];
183
+ }
184
+ let t13;
185
+ if ($[21] !== t11 || $[22] !== t12) {
186
+ t13 = /* @__PURE__ */ jsx("kbd", { className: t11, children: t12 });
187
+ $[21] = t11;
188
+ $[22] = t12;
189
+ $[23] = t13;
190
+ } else {
191
+ t13 = $[23];
192
+ }
193
+ const shortcut = t13;
194
+ let t14;
195
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
196
+ t14 = (event_0) => {
197
+ const isFocus = event_0.type === "focus";
198
+ setFocused(isFocus);
199
+ };
200
+ $[24] = t14;
201
+ } else {
202
+ t14 = $[24];
203
+ }
204
+ const handleFocus = t14;
205
+ let t15;
206
+ if ($[25] !== onSearch) {
207
+ t15 = (event_1) => {
208
+ const {
209
+ value: value_0
210
+ } = event_1.currentTarget;
211
+ setSearch(value_0);
212
+ onSearch?.(value_0);
213
+ };
214
+ $[25] = onSearch;
215
+ $[26] = t15;
216
+ } else {
217
+ t15 = $[26];
218
+ }
219
+ const handleChange = t15;
220
+ let t16;
221
+ if ($[27] !== router) {
222
+ t16 = (searchResult) => {
223
+ if (!searchResult) {
224
+ return;
225
+ }
226
+ inputRef.current.blur();
227
+ const [url_0, hash] = searchResult.url.split("#");
228
+ const isSamePathname = location.pathname === url_0;
229
+ if (isSamePathname) {
230
+ location.href = `#${hash}`;
231
+ } else {
232
+ router.push(searchResult.url);
233
+ }
234
+ setSearch("");
235
+ };
236
+ $[27] = router;
237
+ $[28] = t16;
238
+ } else {
239
+ t16 = $[28];
240
+ }
241
+ const handleSelect = t16;
242
+ let t17;
243
+ if ($[29] !== className) {
244
+ t17 = cn("nextra-search", "x:relative x:flex x:items-center", "x:text-gray-900 x:dark:text-gray-300", "x:contrast-more:text-gray-800 x:contrast-more:dark:text-gray-300", className);
245
+ $[29] = className;
246
+ $[30] = t17;
247
+ } else {
248
+ t17 = $[30];
249
+ }
250
+ let t18;
251
+ if ($[31] !== handleChange || $[32] !== placeholder || $[33] !== props || $[34] !== search) {
252
+ t18 = /* @__PURE__ */ jsx(ComboboxInput, { spellCheck: false, autoComplete: "off", type: "search", ...props, ref: inputRef, className: _temp4, onChange: handleChange, onFocus: handleFocus, onBlur: handleFocus, value: search, placeholder });
253
+ $[31] = handleChange;
254
+ $[32] = placeholder;
255
+ $[33] = props;
256
+ $[34] = search;
257
+ $[35] = t18;
258
+ } else {
259
+ t18 = $[35];
260
+ }
261
+ let t19;
262
+ if ($[36] !== shortcut || $[37] !== t17 || $[38] !== t18) {
263
+ t19 = /* @__PURE__ */ jsxs("div", { className: t17, children: [
264
+ t18,
265
+ shortcut
266
+ ] });
267
+ $[36] = shortcut;
268
+ $[37] = t17;
269
+ $[38] = t18;
270
+ $[39] = t19;
271
+ } else {
272
+ t19 = $[39];
273
+ }
274
+ let t20;
275
+ if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
276
+ t20 = {
277
+ to: "top end",
278
+ gap: 10,
279
+ padding: 16
280
+ };
281
+ $[40] = t20;
282
+ } else {
283
+ t20 = $[40];
284
+ }
285
+ let t21;
286
+ if ($[41] !== error || $[42] !== isLoading || $[43] !== results) {
287
+ t21 = cn("nextra-search-results", "nextra-scrollbar x:max-md:h-full", "x:border x:border-gray-200 x:text-gray-100 x:dark:border-neutral-800", "x:z-30 x:rounded-xl x:py-2.5 x:shadow-xl", "x:contrast-more:border x:contrast-more:border-gray-900 x:contrast-more:dark:border-gray-50", "x:backdrop-blur-md x:bg-nextra-bg/70", "x:motion-reduce:transition-none", "x:origin-top x:transition x:duration-200 x:ease-out x:data-closed:scale-95 x:data-closed:opacity-0 x:empty:invisible", error || isLoading || !results.length ? ["x:md:min-h-28 x:grow x:flex x:justify-center x:text-sm x:gap-2 x:px-8", error ? "x:text-red-500 x:items-start" : "x:text-gray-400 x:items-center"] : "x:md:max-h-[min(calc(100vh-5rem),400px)]!", "x:w-full x:md:w-[576px]");
288
+ $[41] = error;
289
+ $[42] = isLoading;
290
+ $[43] = results;
291
+ $[44] = t21;
292
+ } else {
293
+ t21 = $[44];
294
+ }
295
+ let t22;
296
+ if ($[45] !== deferredSearch || $[46] !== emptyResult || $[47] !== error || $[48] !== errorText || $[49] !== isLoading || $[50] !== loading || $[51] !== results) {
297
+ t22 = error ? /* @__PURE__ */ jsxs(Fragment, { children: [
298
+ /* @__PURE__ */ jsx(InformationCircleIcon, { height: "1.25em", className: "x:shrink-0" }),
299
+ /* @__PURE__ */ jsxs("div", { className: "x:grid", children: [
300
+ /* @__PURE__ */ jsx("b", { className: "x:mb-2", children: errorText }),
301
+ error
302
+ ] })
303
+ ] }) : isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
304
+ /* @__PURE__ */ jsx(SpinnerIcon, { height: "20", className: "x:shrink-0 x:animate-spin" }),
305
+ loading
306
+ ] }) : results.length ? results.map(_temp5) : deferredSearch && emptyResult;
307
+ $[45] = deferredSearch;
308
+ $[46] = emptyResult;
309
+ $[47] = error;
310
+ $[48] = errorText;
311
+ $[49] = isLoading;
312
+ $[50] = loading;
313
+ $[51] = results;
314
+ $[52] = t22;
315
+ } else {
316
+ t22 = $[52];
317
+ }
318
+ let t23;
319
+ if ($[53] !== t21 || $[54] !== t22) {
320
+ t23 = /* @__PURE__ */ jsx(ComboboxOptions, { transition: true, anchor: t20, className: t21, children: t22 });
321
+ $[53] = t21;
322
+ $[54] = t22;
323
+ $[55] = t23;
324
+ } else {
325
+ t23 = $[55];
326
+ }
327
+ let t24;
328
+ if ($[56] !== handleSelect || $[57] !== t19 || $[58] !== t23) {
329
+ t24 = /* @__PURE__ */ jsxs(Combobox, { onChange: handleSelect, children: [
330
+ t19,
331
+ t23
332
+ ] });
333
+ $[56] = handleSelect;
334
+ $[57] = t19;
335
+ $[58] = t23;
336
+ $[59] = t24;
337
+ } else {
338
+ t24 = $[59];
339
+ }
340
+ return t24;
341
+ };
342
+ const Result = (t0) => {
343
+ const $ = _c(8);
344
+ const {
345
+ data
346
+ } = t0;
347
+ let t1;
348
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
349
+ t1 = cn("x:mx-2.5 x:mb-2 x:not-first:mt-6 x:select-none x:border-b x:border-black/10 x:px-2.5 x:pb-1.5 x:text-xs x:font-semibold x:uppercase x:text-gray-600 x:dark:border-white/20 x:dark:text-gray-300", "x:contrast-more:border-gray-600 x:contrast-more:text-gray-900 x:contrast-more:dark:border-gray-50 x:contrast-more:dark:text-gray-50");
350
+ $[0] = t1;
351
+ } else {
352
+ t1 = $[0];
353
+ }
354
+ let t2;
355
+ if ($[1] !== data.meta.title) {
356
+ t2 = /* @__PURE__ */ jsx("div", { className: t1, children: data.meta.title });
357
+ $[1] = data.meta.title;
358
+ $[2] = t2;
359
+ } else {
360
+ t2 = $[2];
361
+ }
362
+ let t3;
363
+ if ($[3] !== data.sub_results) {
364
+ t3 = data.sub_results.map(_temp7);
365
+ $[3] = data.sub_results;
366
+ $[4] = t3;
367
+ } else {
368
+ t3 = $[4];
369
+ }
370
+ let t4;
371
+ if ($[5] !== t2 || $[6] !== t3) {
372
+ t4 = /* @__PURE__ */ jsxs(Fragment, { children: [
373
+ t2,
374
+ t3
375
+ ] });
376
+ $[5] = t2;
377
+ $[6] = t3;
378
+ $[7] = t4;
379
+ } else {
380
+ t4 = $[7];
381
+ }
382
+ return t4;
383
+ };
384
+ function _temp(o) {
385
+ return o.data();
386
+ }
387
+ function _temp2(r) {
388
+ const url = r.url.replace(/\.html$/, "").replace(/\.html#/, "#");
389
+ return {
390
+ ...r,
391
+ url
392
+ };
393
+ }
394
+ function _temp3(newData) {
395
+ return {
396
+ ...newData,
397
+ sub_results: newData.sub_results.map(_temp2)
398
+ };
399
+ }
400
+ function _temp4(t0) {
401
+ const {
402
+ focus
403
+ } = t0;
404
+ return cn("x:rounded-lg x:px-3 x:py-2 x:transition-all", "x:w-full x:md:w-64", "x:text-base x:leading-tight x:md:text-sm", focus ? "x:bg-transparent x:nextra-focus" : "x:bg-black/[.05] x:dark:bg-gray-50/10", "x:placeholder:text-gray-600 x:dark:placeholder:text-gray-400", "x:contrast-more:border x:contrast-more:border-current", "x:[&::-webkit-search-cancel-button]:appearance-none");
405
+ }
406
+ function _temp5(searchResult_0) {
407
+ return /* @__PURE__ */ jsx(Result, { data: searchResult_0 }, searchResult_0.url);
408
+ }
409
+ function _temp6(t0) {
410
+ const {
411
+ focus
412
+ } = t0;
413
+ return cn("x:mx-2.5 x:break-words x:rounded-md", "x:contrast-more:border", focus ? "x:text-primary-600 x:contrast-more:border-current x:bg-primary-500/10" : "x:text-gray-800 x:dark:text-gray-300 x:contrast-more:border-transparent", "x:block x:scroll-m-12 x:px-2.5 x:py-2");
414
+ }
415
+ function _temp7(subResult) {
416
+ return /* @__PURE__ */ jsxs(ComboboxOption, { as: NextLink, value: subResult, href: subResult.url, className: _temp6, children: [
417
+ /* @__PURE__ */ jsx("div", { className: "x:text-base x:font-semibold x:leading-5", children: subResult.title }),
418
+ /* @__PURE__ */ jsx("div", { className: cn("x:mt-1 x:text-sm x:leading-[1.35rem] x:text-gray-600 x:dark:text-gray-400 x:contrast-more:dark:text-gray-50", "x:[&_mark]:bg-primary-600/80 x:[&_mark]:text-white"), dangerouslySetInnerHTML: {
419
+ __html: subResult.excerpt
420
+ } })
421
+ ] }, subResult.url);
422
+ }
423
+ export {
424
+ Search,
425
+ importPagefind
426
+ };
@@ -0,0 +1,19 @@
1
+ import { AnchorPropsWithSelection } from '@headlessui/react/dist/internal/floating';
2
+ import { FC, ReactNode, Dispatch } from 'react';
3
+
4
+ interface MenuOption {
5
+ id: string;
6
+ name: ReactNode;
7
+ }
8
+ interface MenuProps {
9
+ selectedOption: ReactNode;
10
+ value: string;
11
+ onChange: Dispatch<string>;
12
+ options: MenuOption[];
13
+ title?: string;
14
+ className?: string;
15
+ anchor?: AnchorPropsWithSelection;
16
+ }
17
+ declare const Select: FC<MenuProps>;
18
+
19
+ export { Select };
@@ -0,0 +1,109 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { c as _c } from "react-compiler-runtime";
4
+ import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from "@headlessui/react";
5
+ import cn from "clsx";
6
+ import { Fragment } from "react";
7
+ import { CheckIcon } from "../icons/index.js";
8
+ const Select = (t0) => {
9
+ const $ = _c(18);
10
+ const {
11
+ options,
12
+ onChange,
13
+ selectedOption,
14
+ value,
15
+ title,
16
+ className,
17
+ anchor: t1
18
+ } = t0;
19
+ let t2;
20
+ if ($[0] !== t1) {
21
+ t2 = t1 === void 0 ? {
22
+ to: "top start",
23
+ gap: 10
24
+ } : t1;
25
+ $[0] = t1;
26
+ $[1] = t2;
27
+ } else {
28
+ t2 = $[1];
29
+ }
30
+ const anchor = t2;
31
+ let t3;
32
+ if ($[2] !== className) {
33
+ t3 = (t42) => {
34
+ const {
35
+ hover,
36
+ open,
37
+ focus
38
+ } = t42;
39
+ return cn("x:cursor-pointer", "x:h-7 x:rounded-md x:px-2 x:text-xs x:font-medium x:transition-colors", open ? "x:bg-gray-200 x:text-gray-900 x:dark:bg-primary-100/10 x:dark:text-gray-50" : hover ? "x:bg-gray-200 x:text-gray-900 x:dark:bg-primary-100/5 x:dark:text-gray-50" : "x:text-gray-600 x:dark:text-gray-400", focus && "x:nextra-focus", className);
40
+ };
41
+ $[2] = className;
42
+ $[3] = t3;
43
+ } else {
44
+ t3 = $[3];
45
+ }
46
+ let t4;
47
+ if ($[4] !== selectedOption || $[5] !== t3 || $[6] !== title) {
48
+ t4 = /* @__PURE__ */ jsx(ListboxButton, { title, className: t3, children: selectedOption });
49
+ $[4] = selectedOption;
50
+ $[5] = t3;
51
+ $[6] = title;
52
+ $[7] = t4;
53
+ } else {
54
+ t4 = $[7];
55
+ }
56
+ let t5;
57
+ if ($[8] !== options) {
58
+ t5 = options.map(_temp2);
59
+ $[8] = options;
60
+ $[9] = t5;
61
+ } else {
62
+ t5 = $[9];
63
+ }
64
+ let t6;
65
+ if ($[10] !== anchor || $[11] !== t5) {
66
+ t6 = /* @__PURE__ */ jsx(ListboxOptions, { as: "ul", transition: true, anchor, className: _temp, children: t5 });
67
+ $[10] = anchor;
68
+ $[11] = t5;
69
+ $[12] = t6;
70
+ } else {
71
+ t6 = $[12];
72
+ }
73
+ let t7;
74
+ if ($[13] !== onChange || $[14] !== t4 || $[15] !== t6 || $[16] !== value) {
75
+ t7 = /* @__PURE__ */ jsxs(Listbox, { value, onChange, children: [
76
+ t4,
77
+ t6
78
+ ] });
79
+ $[13] = onChange;
80
+ $[14] = t4;
81
+ $[15] = t6;
82
+ $[16] = value;
83
+ $[17] = t7;
84
+ } else {
85
+ t7 = $[17];
86
+ }
87
+ return t7;
88
+ };
89
+ function _temp(t0) {
90
+ const {
91
+ open: open_0
92
+ } = t0;
93
+ return cn("x:focus-visible:nextra-focus", open_0 ? "x:opacity-100" : "x:opacity-0", "x:motion-reduce:transition-none x:transition-opacity x:min-w-(--button-width) x:z-30 x:max-h-64 x:rounded-md x:border x:border-black/5 x:backdrop-blur-md x:bg-nextra-bg/70 x:py-1 x:text-sm x:shadow-lg x:dark:border-white/20");
94
+ }
95
+ function _temp2(option) {
96
+ return /* @__PURE__ */ jsx(ListboxOption, { value: option.id, as: Fragment, children: (t0) => {
97
+ const {
98
+ selected,
99
+ focus: focus_0
100
+ } = t0;
101
+ return /* @__PURE__ */ jsxs("li", { className: cn(focus_0 ? "x:bg-primary-100 x:text-primary-800 x:dark:text-primary-500 x:dark:bg-primary-500/10" : "x:text-gray-800 x:dark:text-gray-100", "x:cursor-pointer x:whitespace-nowrap x:py-1.5 x:px-3", "x:transition-colors", selected && "x:flex x:items-center x:justify-between x:gap-3"), children: [
102
+ option.name,
103
+ selected && /* @__PURE__ */ jsx(CheckIcon, { height: "1em" })
104
+ ] });
105
+ } }, option.id);
106
+ }
107
+ export {
108
+ Select
109
+ };
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+
3
+ declare const SkipNavLink: FC;
4
+
5
+ export { SkipNavLink };
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { c as _c } from "react-compiler-runtime";
4
+ import { Button } from "@headlessui/react";
5
+ import cn from "clsx";
6
+ const DEFAULT_ID = "nextra-skip-nav";
7
+ const DEFAULT_LABEL = "Skip to Content";
8
+ const SkipNavLink = (t0) => {
9
+ const $ = _c(6);
10
+ const {
11
+ className,
12
+ id: t1,
13
+ children: t2
14
+ } = t0;
15
+ const id = t1 === void 0 ? DEFAULT_ID : t1;
16
+ const children = t2 === void 0 ? DEFAULT_LABEL : t2;
17
+ const t3 = `#${id}`;
18
+ let t4;
19
+ if ($[0] !== className) {
20
+ t4 = (t52) => {
21
+ const {
22
+ focus
23
+ } = t52;
24
+ return cn("nextra-skip-nav", focus ? "x:nextra-focus x:fixed x:z-50 x:my-3 x:mx-4 x:rounded-lg x:px-3 x:py-2 x:text-sm x:font-bold x:bg-nextra-bg x:border x:border-current" : "x:sr-only", className);
25
+ };
26
+ $[0] = className;
27
+ $[1] = t4;
28
+ } else {
29
+ t4 = $[1];
30
+ }
31
+ let t5;
32
+ if ($[2] !== children || $[3] !== t3 || $[4] !== t4) {
33
+ t5 = /* @__PURE__ */ jsx(Button, { as: "a", href: t3, className: t4, children });
34
+ $[2] = children;
35
+ $[3] = t3;
36
+ $[4] = t4;
37
+ $[5] = t5;
38
+ } else {
39
+ t5 = $[5];
40
+ }
41
+ return t5;
42
+ };
43
+ export {
44
+ SkipNavLink
45
+ };
@@ -0,0 +1,6 @@
1
+ import { FC, HTMLAttributes } from 'react';
2
+ export { SkipNavLink } from './index.client.js';
3
+
4
+ declare const SkipNavContent: FC<Pick<HTMLAttributes<HTMLDivElement>, 'id'>>;
5
+
6
+ export { SkipNavContent };
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
3
+ const DEFAULT_ID = "nextra-skip-nav";
4
+ import { SkipNavLink } from "./index.client.js";
5
+ const SkipNavContent = (t0) => {
6
+ const $ = _c(2);
7
+ const {
8
+ id: t1
9
+ } = t0;
10
+ const id = t1 === void 0 ? DEFAULT_ID : t1;
11
+ let t2;
12
+ if ($[0] !== id) {
13
+ t2 = /* @__PURE__ */ jsx("div", { id });
14
+ $[0] = id;
15
+ $[1] = t2;
16
+ } else {
17
+ t2 = $[1];
18
+ }
19
+ return t2;
20
+ };
21
+ export {
22
+ SkipNavContent,
23
+ SkipNavLink
24
+ };
@@ -0,0 +1,64 @@
1
+ import { FC, HTMLAttributes } from 'react';
2
+
3
+ /**
4
+ * A built-in component to turn a numbered list into a visual representation of
5
+ * steps.
6
+ *
7
+ * @example
8
+ * <Steps>
9
+ *
10
+ * ### This is the first step
11
+ *
12
+ * This is the first step description.
13
+ *
14
+ * ### This is the second step
15
+ *
16
+ * This is the second step description.
17
+ *
18
+ * ### This is the third step
19
+ *
20
+ * This is the third step description.
21
+ *
22
+ * </Steps>
23
+ *
24
+ * @usage
25
+ * Wrap a set of Markdown headings (from `<h2>` to `<h6>`) with the `<Steps>`
26
+ * component to display them as visual steps. You can choose the appropriate
27
+ * heading level based on the content hierarchy on the page.
28
+ *
29
+ * ```mdx filename="MDX" {7-15}
30
+ * import { Steps } from 'nextra/components'
31
+ *
32
+ * ## Getting Started
33
+ *
34
+ * Here is some description.
35
+ *
36
+ * <Steps>
37
+ * ### Step 1
38
+ *
39
+ * Contents for step 1.
40
+ *
41
+ * ### Step 2
42
+ *
43
+ * Contents for step 2.
44
+ * </Steps>
45
+ * ```
46
+ *
47
+ * ### Excluding Headings from Table of Contents
48
+ *
49
+ * To exclude the headings from the `<Steps>` component (or any other headings)
50
+ * to appear in the Table of Contents, replace the Markdown headings `### ...`
51
+ * with `<h3>` HTML element wrapped in curly braces.
52
+ *
53
+ * ```diff filename="MDX"
54
+ * <Steps>
55
+ * - ### Step 1
56
+ * + {<h3>Step 1</h3>}
57
+ *
58
+ * Contents for step 1.
59
+ * </Steps>
60
+ * ```
61
+ */
62
+ declare const Steps: FC<HTMLAttributes<HTMLDivElement>>;
63
+
64
+ export { Steps };