@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,94 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { c as _c } from "react-compiler-runtime";
4
+ import cn from "clsx";
5
+ import { useState } from "react";
6
+ import { FolderIcon, FolderOpenIcon } from "../../icons/index.js";
7
+ import { Button } from "../button.js";
8
+ const Folder = (t0) => {
9
+ const $ = _c(16);
10
+ const {
11
+ name,
12
+ open,
13
+ children,
14
+ defaultOpen: t1,
15
+ active
16
+ } = t0;
17
+ const defaultOpen = t1 === void 0 ? false : t1;
18
+ const [isOpen, setIsOpen] = useState(defaultOpen);
19
+ let t2;
20
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
21
+ t2 = () => {
22
+ setIsOpen(_temp);
23
+ };
24
+ $[0] = t2;
25
+ } else {
26
+ t2 = $[0];
27
+ }
28
+ const toggle = t2;
29
+ const isFolderOpen = open === void 0 ? isOpen : open;
30
+ const ComponentToUse = isFolderOpen ? FolderOpenIcon : FolderIcon;
31
+ let t3;
32
+ if ($[1] !== active) {
33
+ t3 = (t42) => {
34
+ const {
35
+ hover
36
+ } = t42;
37
+ return cn("x:flex x:items-center x:gap-1 x:break-all", "x:text-start", hover && "x:opacity-60", active && "x:text-primary-600");
38
+ };
39
+ $[1] = active;
40
+ $[2] = t3;
41
+ } else {
42
+ t3 = $[2];
43
+ }
44
+ let t4;
45
+ if ($[3] !== ComponentToUse) {
46
+ t4 = /* @__PURE__ */ jsx(ComponentToUse, { height: "14", className: "x:shrink-0" });
47
+ $[3] = ComponentToUse;
48
+ $[4] = t4;
49
+ } else {
50
+ t4 = $[4];
51
+ }
52
+ let t5;
53
+ if ($[5] !== name || $[6] !== open || $[7] !== t3 || $[8] !== t4) {
54
+ t5 = /* @__PURE__ */ jsxs(Button, { onClick: toggle, disabled: open, className: t3, children: [
55
+ t4,
56
+ name
57
+ ] });
58
+ $[5] = name;
59
+ $[6] = open;
60
+ $[7] = t3;
61
+ $[8] = t4;
62
+ $[9] = t5;
63
+ } else {
64
+ t5 = $[9];
65
+ }
66
+ let t6;
67
+ if ($[10] !== children || $[11] !== isFolderOpen) {
68
+ t6 = isFolderOpen && /* @__PURE__ */ jsx("ul", { className: "x:flex x:flex-col x:gap-2 x:ps-4", children });
69
+ $[10] = children;
70
+ $[11] = isFolderOpen;
71
+ $[12] = t6;
72
+ } else {
73
+ t6 = $[12];
74
+ }
75
+ let t7;
76
+ if ($[13] !== t5 || $[14] !== t6) {
77
+ t7 = /* @__PURE__ */ jsxs("li", { className: "x:flex x:flex-col x:gap-1", children: [
78
+ t5,
79
+ t6
80
+ ] });
81
+ $[13] = t5;
82
+ $[14] = t6;
83
+ $[15] = t7;
84
+ } else {
85
+ t7 = $[15];
86
+ }
87
+ return t7;
88
+ };
89
+ function _temp(v) {
90
+ return !v;
91
+ }
92
+ export {
93
+ Folder
94
+ };
@@ -0,0 +1,57 @@
1
+ import * as react from 'react';
2
+ import { ComponentProps } from 'react';
3
+ import { FileProps } from './file.js';
4
+ import * as react_jsx_runtime_js from 'react/jsx-runtime.js';
5
+ import { Tree } from './tree.js';
6
+
7
+ /**
8
+ * A built-in component to visually represent a file tree.
9
+ *
10
+ * @example
11
+ * Click the folder to test the dynamic functionality of the file tree.
12
+ *
13
+ * <FileTree>
14
+ * <FileTree.Folder name="content" defaultOpen>
15
+ * <FileTree.File name="_meta.js" />
16
+ * <FileTree.File name="contact.md" />
17
+ * <FileTree.File name="index.mdx" />
18
+ * <FileTree.Folder name="about">
19
+ * <FileTree.File name="_meta.js" />
20
+ * <FileTree.File name="legal.md" />
21
+ * <FileTree.File name="index.mdx" />
22
+ * </FileTree.Folder>
23
+ * </FileTree.Folder>
24
+ * </FileTree>
25
+ *
26
+ * @usage
27
+ * Create the file tree structure by nesting `<FileTree.Folder>` and
28
+ * `<FileTree.File>` components within a `<FileTree>`. Name each file or folder
29
+ * with the `name` attribute. Use `defaultOpen` to set the folder to open on load.
30
+ *
31
+ * ```mdx filename="MDX"
32
+ * import { FileTree } from 'nextra/components'
33
+ *
34
+ * <FileTree>
35
+ * <FileTree.Folder name="content" defaultOpen>
36
+ * <FileTree.File name="_meta.js" />
37
+ * <FileTree.File name="contact.md" />
38
+ * <FileTree.File name="index.mdx" />
39
+ * <FileTree.Folder name="about">
40
+ * <FileTree.File name="_meta.js" />
41
+ * <FileTree.File name="legal.md" />
42
+ * <FileTree.File name="index.mdx" />
43
+ * </FileTree.Folder>
44
+ * </FileTree.Folder>
45
+ * </FileTree>
46
+ * ```
47
+ */
48
+ declare const FileTree: ((props: ComponentProps<typeof Tree>) => react_jsx_runtime_js.JSX.Element) & {
49
+ Folder: react.FC<FileProps & {
50
+ open?: boolean;
51
+ defaultOpen?: boolean;
52
+ children: react.ReactNode;
53
+ }>;
54
+ File: react.FC<FileProps>;
55
+ };
56
+
57
+ export { FileTree };
@@ -0,0 +1,12 @@
1
+ "use no memo";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { File } from "./file.js";
4
+ import { Folder } from "./folder.js";
5
+ import { Tree } from "./tree.js";
6
+ const FileTree = Object.assign((props) => /* @__PURE__ */ jsx(Tree, { ...props }), {
7
+ Folder,
8
+ File
9
+ });
10
+ export {
11
+ FileTree
12
+ };
@@ -0,0 +1,5 @@
1
+ import { FC, HTMLAttributes } from 'react';
2
+
3
+ declare const Tree: FC<HTMLAttributes<HTMLUListElement>>;
4
+
5
+ export { Tree };
@@ -0,0 +1,41 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
3
+ import cn from "clsx";
4
+ const Tree = (t0) => {
5
+ const $ = _c(8);
6
+ let className;
7
+ let props;
8
+ if ($[0] !== t0) {
9
+ ({
10
+ className,
11
+ ...props
12
+ } = t0);
13
+ $[0] = t0;
14
+ $[1] = className;
15
+ $[2] = props;
16
+ } else {
17
+ className = $[1];
18
+ props = $[2];
19
+ }
20
+ let t1;
21
+ if ($[3] !== className) {
22
+ t1 = cn("nextra-filetree x:mt-[1.25em] x:select-none x:text-sm x:text-gray-800 x:dark:text-gray-300", "not-prose", "x:rounded-lg x:border x:px-4 x:py-3 x:inline-flex x:flex-col x:gap-2", "nextra-border", className);
23
+ $[3] = className;
24
+ $[4] = t1;
25
+ } else {
26
+ t1 = $[4];
27
+ }
28
+ let t2;
29
+ if ($[5] !== props || $[6] !== t1) {
30
+ t2 = /* @__PURE__ */ jsx("ul", { className: t1, ...props });
31
+ $[5] = props;
32
+ $[6] = t1;
33
+ $[7] = t2;
34
+ } else {
35
+ t2 = $[7];
36
+ }
37
+ return t2;
38
+ };
39
+ export {
40
+ Tree
41
+ };
@@ -0,0 +1,139 @@
1
+ import * as react from 'react';
2
+ import { FC } from 'react';
3
+ import { z } from 'zod';
4
+ import { HeadProps } from '../../types.generated.js';
5
+ import 'rehype-pretty-code';
6
+ import '@mdx-js/mdx';
7
+ import 'rehype-katex';
8
+ import 'better-react-mathjax';
9
+
10
+ declare const HeadPropsSchema: z.ZodObject<{
11
+ color: z.ZodDefault<z.ZodObject<{
12
+ hue: z.ZodDefault<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
13
+ dark: z.ZodNumber;
14
+ light: z.ZodNumber;
15
+ }, z.core.$strict>]>>;
16
+ saturation: z.ZodDefault<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
17
+ dark: z.ZodNumber;
18
+ light: z.ZodNumber;
19
+ }, z.core.$strict>]>>;
20
+ lightness: z.ZodDefault<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
21
+ dark: z.ZodNumber;
22
+ light: z.ZodNumber;
23
+ }, z.core.$strict>]>>;
24
+ }, z.core.$strict>>;
25
+ faviconGlyph: z.ZodOptional<z.ZodString>;
26
+ backgroundColor: z.ZodDefault<z.ZodObject<{
27
+ dark: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<string, string>>;
28
+ light: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<string, string>>;
29
+ }, z.core.$strict>>;
30
+ children: z.ZodOptional<z.ZodCustom<react.ReactNode, react.ReactNode>>;
31
+ }, z.core.$strict>;
32
+ /**
33
+ * Configure the `<head>` tags, primary color, background color and favicon glyph
34
+ * of the website.
35
+ *
36
+ * @usage
37
+ * ### Static head tags
38
+ *
39
+ * If you have static head tags, they should be put as `children` in `Head`. For
40
+ * example:
41
+ *
42
+ * ```jsx filename="app/layout.jsx" {8}
43
+ * import { Layout } from 'my-nextra-theme'
44
+ * import { Head } from 'nextra/components'
45
+ *
46
+ * export default function MyLayout({ children, ...props }) {
47
+ * return (
48
+ * <html lang="en">
49
+ * <Head>
50
+ * <meta name="viewport" content="width=device-width, initial-scale=1.0" />
51
+ * </Head>
52
+ * <body>
53
+ * <Layout>{children}</Layout>
54
+ * </body>
55
+ * </html>
56
+ * )
57
+ * }
58
+ * ```
59
+ *
60
+ * ### Dynamic tags based on page
61
+ *
62
+ * You can dynamically generate the head tags based on the current page's front
63
+ * matter. For example:
64
+ *
65
+ * #### via Markdown front matter
66
+ *
67
+ * ```mdx filename="my-page/page.mdx"
68
+ * ---
69
+ * title: My title
70
+ * description: My description
71
+ * ---
72
+ * ```
73
+ *
74
+ * #### via exporting `metadata` object
75
+ *
76
+ * ```mdx filename="my-page/page.mdx"
77
+ * export const metadata = {
78
+ * title: 'My title',
79
+ * description: 'My description'
80
+ * }
81
+ * ```
82
+ *
83
+ * #### in [dynamic routes with catch-all segment](https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes#catch-all-segments)
84
+ *
85
+ * ```jsx filename="app/[[...mdxPath]]/page.jsx"
86
+ * import { importPage } from 'nextra/pages'
87
+ *
88
+ * export async function generateMetadata(props) {
89
+ * const { mdxPath } = await props.params
90
+ * const { metadata } = await importPage(mdxPath)
91
+ * return {
92
+ * title: metadata.title || 'Nextra',
93
+ * description: metadata.description || 'The next site builder'
94
+ * }
95
+ * }
96
+ * ```
97
+ *
98
+ * ### Theme color
99
+ *
100
+ * You can adjust the theme color of the website by setting primary Hue, Saturation
101
+ * and Lightness (HSL) values for light and dark themes. Try it out for this
102
+ * website:
103
+ *
104
+ * | Hue (H) | Saturation (S) | Lightness (L) | Background Color |
105
+ * | -------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | ------------------ |
106
+ * | <Slider max={360} cssVar="--nextra-primary-hue" /> | <Slider max={100} cssVar="--nextra-primary-saturation" /> | <Slider max={100} cssVar="--nextra-primary-lightness" /> | <BackgroundColor/> |
107
+ *
108
+ * > [!TIP]
109
+ * >
110
+ * > You can adjust the lightness independently for dark or light mode to increase
111
+ * > legibility. E.g. to have a neutral primary color you can set the primary color
112
+ * > to be white `HSL(0, 0%, 100%)` on dark theme and gray `HSL(0, 0%, 50%)` for
113
+ * > light theme.
114
+ * >
115
+ * > ```jsx filename="app/layout.jsx"
116
+ * > <Head
117
+ * > color={{
118
+ * > hue: 0,
119
+ * > saturation: 0,
120
+ * > lightness: {
121
+ * > light: 50,
122
+ * > dark: 100
123
+ * > }
124
+ * > }}
125
+ * > />
126
+ * > ```
127
+ *
128
+ * ### Favicon glyph
129
+ *
130
+ * This isn't supported by all browsers, but it's a nice way to customize the
131
+ * favicon of the website simply by using an emoji or character.
132
+ *
133
+ * ```jsx filename="app/layout.jsx"
134
+ * <Head faviconGlyph="✦" />
135
+ * ```
136
+ */
137
+ declare const Head: FC<HeadProps>;
138
+
139
+ export { Head, HeadPropsSchema };
@@ -0,0 +1,202 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
3
+ import { z } from "zod";
4
+ import { reactNode } from "../../server/schemas.js";
5
+ const darkLightSchema = z.union([z.number(), z.strictObject({
6
+ dark: z.number(),
7
+ light: z.number()
8
+ })]);
9
+ function convertColor(v) {
10
+ return typeof v === "number" ? {
11
+ dark: v,
12
+ light: v
13
+ } : v;
14
+ }
15
+ function hexToRgb(hex) {
16
+ hex = hex.slice(1);
17
+ if (hex.length === 3) {
18
+ hex = hex.split("").map((char) => char + char).join("");
19
+ }
20
+ const bigint = Number.parseInt(hex, 16);
21
+ const r = bigint >> 16 & 255;
22
+ const g = bigint >> 8 & 255;
23
+ const b = bigint & 255;
24
+ return `${r},${g},${b}`;
25
+ }
26
+ const RGB_RE = /^rgb\((?<rgb>.*?)\)$/;
27
+ const HEX_RE = /^#(?<hex>[0-9a-f]{3,6})$/i;
28
+ function normalizeColor(value) {
29
+ if (value.startsWith("#")) {
30
+ return hexToRgb(value);
31
+ }
32
+ const rgb = value.match(RGB_RE)?.groups.rgb;
33
+ if (rgb) {
34
+ return rgb.replaceAll(" ", "");
35
+ }
36
+ return value;
37
+ }
38
+ const stringColorSchema = z.string().refine((str) => {
39
+ if (HEX_RE.test(str) || RGB_RE.test(str)) {
40
+ return true;
41
+ }
42
+ throw new Error("Color format should be in HEX or RGB format. E.g. #000, #112233 or rgb(255,255,255)");
43
+ });
44
+ const colorSchema = z.strictObject({
45
+ hue: darkLightSchema.default({
46
+ dark: 204,
47
+ light: 212
48
+ }).overwrite(convertColor).meta({
49
+ description: "The hue of the primary theme color.<br/>Range: `0 - 360`"
50
+ }),
51
+ saturation: darkLightSchema.default(100).overwrite(convertColor).meta({
52
+ description: "The saturation of the primary theme color.<br/>Range: `0 - 100`"
53
+ }),
54
+ lightness: darkLightSchema.default({
55
+ dark: 55,
56
+ light: 45
57
+ }).overwrite(convertColor).meta({
58
+ description: "The lightness of the primary theme color.<br/>Range: `0 - 100`"
59
+ })
60
+ });
61
+ const bgColorSchema = z.strictObject({
62
+ dark: stringColorSchema.default("rgb(17,17,17)").transform(normalizeColor).meta({
63
+ description: 'Background color for dark theme.<br/>Format: `"rgb(RRR,GGG,BBB)" | "#RRGGBB"`'
64
+ }),
65
+ light: stringColorSchema.default("rgb(250,250,250)").transform(normalizeColor).meta({
66
+ description: 'Background color for light theme.<br/>Format: `"rgb(RRR,GGG,BBB)" | "#RRGGBB"`'
67
+ })
68
+ });
69
+ const HeadPropsSchema = z.strictObject({
70
+ color: colorSchema.default(colorSchema.parse({})),
71
+ faviconGlyph: z.string().optional().meta({
72
+ description: "The glyph to use as the favicon."
73
+ }),
74
+ backgroundColor: bgColorSchema.default(bgColorSchema.parse({})),
75
+ children: reactNode.optional().meta({
76
+ description: "Content of `<head>`."
77
+ })
78
+ });
79
+ const Head = (t0) => {
80
+ const $ = _c(21);
81
+ let children;
82
+ let props;
83
+ if ($[0] !== t0) {
84
+ ({
85
+ children,
86
+ ...props
87
+ } = t0);
88
+ $[0] = t0;
89
+ $[1] = children;
90
+ $[2] = props;
91
+ } else {
92
+ children = $[1];
93
+ props = $[2];
94
+ }
95
+ let data;
96
+ if ($[3] !== props) {
97
+ const {
98
+ data: t12,
99
+ error
100
+ } = HeadPropsSchema.safeParse(props);
101
+ data = t12;
102
+ if (error) {
103
+ throw z.prettifyError(error);
104
+ }
105
+ $[3] = props;
106
+ $[4] = data;
107
+ } else {
108
+ data = $[4];
109
+ }
110
+ const {
111
+ color,
112
+ backgroundColor,
113
+ faviconGlyph
114
+ } = data;
115
+ const t1 = `
116
+ :root {
117
+ --nextra-primary-hue: ${color.hue.light}deg;
118
+ --nextra-primary-saturation: ${color.saturation.light}%;
119
+ --nextra-primary-lightness: ${color.lightness.light}%;
120
+ --nextra-bg: ${backgroundColor.light};
121
+ --nextra-content-width: 90rem;
122
+ }
123
+ .dark {
124
+ --nextra-primary-hue: ${color.hue.dark}deg;
125
+ --nextra-primary-saturation: ${color.saturation.dark}%;
126
+ --nextra-primary-lightness: ${color.lightness.dark}%;
127
+ --nextra-bg: ${backgroundColor.dark};
128
+ }
129
+ ::selection {
130
+ background: hsla(var(--nextra-primary-hue),var(--nextra-primary-saturation),var(--nextra-primary-lightness),.3);
131
+ }
132
+ html {
133
+ background: rgb(var(--nextra-bg));
134
+ }
135
+ `;
136
+ let t2;
137
+ if ($[5] !== t1) {
138
+ t2 = t1.trim();
139
+ $[5] = t1;
140
+ $[6] = t2;
141
+ } else {
142
+ t2 = $[6];
143
+ }
144
+ const style = t2;
145
+ let t3;
146
+ if ($[7] !== style) {
147
+ t3 = /* @__PURE__ */ jsx("style", { children: style });
148
+ $[7] = style;
149
+ $[8] = t3;
150
+ } else {
151
+ t3 = $[8];
152
+ }
153
+ const t4 = `rgb(${backgroundColor.light})`;
154
+ let t5;
155
+ if ($[9] !== t4) {
156
+ t5 = /* @__PURE__ */ jsx("meta", { name: "theme-color", media: "(prefers-color-scheme: light)", content: t4 });
157
+ $[9] = t4;
158
+ $[10] = t5;
159
+ } else {
160
+ t5 = $[10];
161
+ }
162
+ const t6 = `rgb(${backgroundColor.dark})`;
163
+ let t7;
164
+ if ($[11] !== t6) {
165
+ t7 = /* @__PURE__ */ jsx("meta", { name: "theme-color", media: "(prefers-color-scheme: dark)", content: t6 });
166
+ $[11] = t6;
167
+ $[12] = t7;
168
+ } else {
169
+ t7 = $[12];
170
+ }
171
+ let t8;
172
+ if ($[13] !== faviconGlyph) {
173
+ t8 = faviconGlyph && /* @__PURE__ */ jsx("link", { rel: "icon", href: `data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='.9em' font-size='90' text-anchor='middle'>${faviconGlyph}</text><style>svg{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}@media(prefers-color-scheme:dark){svg{fill:#fff}}</style></svg>` });
174
+ $[13] = faviconGlyph;
175
+ $[14] = t8;
176
+ } else {
177
+ t8 = $[14];
178
+ }
179
+ let t9;
180
+ if ($[15] !== children || $[16] !== t3 || $[17] !== t5 || $[18] !== t7 || $[19] !== t8) {
181
+ t9 = /* @__PURE__ */ jsxs("head", { children: [
182
+ children,
183
+ t3,
184
+ t5,
185
+ t7,
186
+ t8
187
+ ] });
188
+ $[15] = children;
189
+ $[16] = t3;
190
+ $[17] = t5;
191
+ $[18] = t7;
192
+ $[19] = t8;
193
+ $[20] = t9;
194
+ } else {
195
+ t9 = $[20];
196
+ }
197
+ return t9;
198
+ };
199
+ export {
200
+ Head,
201
+ HeadPropsSchema
202
+ };
@@ -0,0 +1,6 @@
1
+ import { ImageProps } from 'next/image';
2
+ import { FC } from 'react';
3
+
4
+ declare const ImageZoom: FC<ImageProps>;
5
+
6
+ export { ImageZoom };
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { c as _c } from "react-compiler-runtime";
4
+ import { useEffect, useRef, useState } from "react";
5
+ import Zoom from "react-medium-image-zoom";
6
+ import { Image } from "../mdx-components/image.js";
7
+ function getImageSrc(src) {
8
+ if (typeof src === "string") {
9
+ return src;
10
+ }
11
+ if ("default" in src) {
12
+ return src.default.src;
13
+ }
14
+ return src.src;
15
+ }
16
+ const ImageZoom = (props) => {
17
+ const $ = _c(12);
18
+ const imgRef = useRef(null);
19
+ const [isInsideAnchor, setIsInsideAnchor] = useState(false);
20
+ let t0;
21
+ let t1;
22
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
23
+ t0 = () => {
24
+ setIsInsideAnchor(imgRef.current.closest("a") !== null);
25
+ };
26
+ t1 = [];
27
+ $[0] = t0;
28
+ $[1] = t1;
29
+ } else {
30
+ t0 = $[0];
31
+ t1 = $[1];
32
+ }
33
+ useEffect(t0, t1);
34
+ let t2;
35
+ if ($[2] !== props) {
36
+ t2 = /* @__PURE__ */ jsx(Image, { ...props, ref: imgRef });
37
+ $[2] = props;
38
+ $[3] = t2;
39
+ } else {
40
+ t2 = $[3];
41
+ }
42
+ const img = t2;
43
+ if (isInsideAnchor) {
44
+ return img;
45
+ }
46
+ let t3;
47
+ if ($[4] !== props.src) {
48
+ t3 = getImageSrc(props.src);
49
+ $[4] = props.src;
50
+ $[5] = t3;
51
+ } else {
52
+ t3 = $[5];
53
+ }
54
+ let t4;
55
+ if ($[6] !== props.alt || $[7] !== t3) {
56
+ t4 = {
57
+ src: t3,
58
+ alt: props.alt
59
+ };
60
+ $[6] = props.alt;
61
+ $[7] = t3;
62
+ $[8] = t4;
63
+ } else {
64
+ t4 = $[8];
65
+ }
66
+ let t5;
67
+ if ($[9] !== img || $[10] !== t4) {
68
+ t5 = /* @__PURE__ */ jsx(Zoom, { zoomMargin: 40, zoomImg: t4, wrapElement: "span", children: img });
69
+ $[9] = img;
70
+ $[10] = t4;
71
+ $[11] = t5;
72
+ } else {
73
+ t5 = $[11];
74
+ }
75
+ return t5;
76
+ };
77
+ export {
78
+ ImageZoom
79
+ };
@@ -0,0 +1,56 @@
1
+ export { Mermaid } from '@theguild/remark-mermaid/mermaid';
2
+ export { MathJax, MathJaxContext } from 'better-react-mathjax';
3
+ export { Banner } from './banner/index.js';
4
+ export { FileTree } from './file-tree/index.js';
5
+ export { SkipNavContent } from './skip-nav/index.js';
6
+ export { Popup } from './popup/index.js';
7
+ export { Tabs } from './tabs/index.js';
8
+ export { Bleed } from './bleed.js';
9
+ export { Button } from './button.js';
10
+ export { Callout } from './callout.js';
11
+ export { Cards } from './cards.js';
12
+ export { Collapse } from './collapse.js';
13
+ export { Head } from './head.js';
14
+ export { ImageZoom } from './image-zoom.js';
15
+ export { Playground } from './playground.js';
16
+ export { Search } from './search.js';
17
+ export { Select } from './select.js';
18
+ export { Steps } from './steps.js';
19
+ export { withIcons } from '../hocs/with-icons.js';
20
+ export { withGitHubAlert } from '../hocs/with-github-alert.js';
21
+ export { Pre } from '../mdx-components/pre/index.js';
22
+ export { Anchor } from '../mdx-components/anchor.js';
23
+ export { Code } from '../mdx-components/code.js';
24
+ export { Details } from '../mdx-components/details.js';
25
+ export { Image } from '../mdx-components/image.js';
26
+ export { Summary } from '../mdx-components/summary.js';
27
+ export { Table } from '../mdx-components/table.js';
28
+ export { SkipNavLink } from './skip-nav/index.client.js';
29
+ import 'react';
30
+ import './file-tree/file.js';
31
+ import 'react/jsx-runtime.js';
32
+ import './file-tree/tree.js';
33
+ import '@headlessui/react';
34
+ import './popup/index.client.js';
35
+ import './tabs/index.client.js';
36
+ import 'zod';
37
+ import '../../types.generated.js';
38
+ import 'rehype-pretty-code';
39
+ import '@mdx-js/mdx';
40
+ import 'rehype-katex';
41
+ import 'next/image';
42
+ import '../mdx-remote.js';
43
+ import '../evaluate.js';
44
+ import '../../types.js';
45
+ import 'mdast';
46
+ import 'next';
47
+ import '../../server/schemas.js';
48
+ import './lib/index.js';
49
+ import 'rehype-katex/lib/index.js';
50
+ import '../mdx-components.js';
51
+ import 'url';
52
+ import 'next/link.js';
53
+ import 'next/image.js';
54
+ import '@headlessui/react/dist/internal/floating';
55
+ import 'next/link';
56
+ import 'next/dist/shared/lib/get-img-props';