@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,74 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
3
+ import cn from "clsx";
4
+ import { useId } from "react";
5
+ const Steps = (t0) => {
6
+ const $ = _c(17);
7
+ let children;
8
+ let className;
9
+ let props;
10
+ let style;
11
+ if ($[0] !== t0) {
12
+ ({
13
+ children,
14
+ className,
15
+ style,
16
+ ...props
17
+ } = t0);
18
+ $[0] = t0;
19
+ $[1] = children;
20
+ $[2] = className;
21
+ $[3] = props;
22
+ $[4] = style;
23
+ } else {
24
+ children = $[1];
25
+ className = $[2];
26
+ props = $[3];
27
+ style = $[4];
28
+ }
29
+ const t1 = useId();
30
+ let t2;
31
+ if ($[5] !== t1) {
32
+ t2 = t1.replaceAll(":", "");
33
+ $[5] = t1;
34
+ $[6] = t2;
35
+ } else {
36
+ t2 = $[6];
37
+ }
38
+ const id = t2;
39
+ let t3;
40
+ if ($[7] !== className) {
41
+ t3 = cn("nextra-steps x:ms-4 x:mb-12 x:border-s x:border-gray-200 x:ps-6", "x:dark:border-neutral-800", className);
42
+ $[7] = className;
43
+ $[8] = t3;
44
+ } else {
45
+ t3 = $[8];
46
+ }
47
+ let t4;
48
+ if ($[9] !== id || $[10] !== style) {
49
+ t4 = {
50
+ ...style,
51
+ "--counter-id": id
52
+ };
53
+ $[9] = id;
54
+ $[10] = style;
55
+ $[11] = t4;
56
+ } else {
57
+ t4 = $[11];
58
+ }
59
+ let t5;
60
+ if ($[12] !== children || $[13] !== props || $[14] !== t3 || $[15] !== t4) {
61
+ t5 = /* @__PURE__ */ jsx("div", { className: t3, style: t4, ...props, children });
62
+ $[12] = children;
63
+ $[13] = props;
64
+ $[14] = t3;
65
+ $[15] = t4;
66
+ $[16] = t5;
67
+ } else {
68
+ t5 = $[16];
69
+ }
70
+ return t5;
71
+ };
72
+ export {
73
+ Steps
74
+ };
@@ -0,0 +1,21 @@
1
+ import { TabListProps, TabProps, TabGroupProps, TabPanelProps } from '@headlessui/react';
2
+ import { FC, ReactElement, ReactNode } from 'react';
3
+
4
+ type TabItem = string | ReactElement;
5
+ type TabObjectItem = {
6
+ label: TabItem;
7
+ disabled: boolean;
8
+ };
9
+ declare const Tabs: FC<{
10
+ items: (TabItem | TabObjectItem)[];
11
+ children: ReactNode;
12
+ /** LocalStorage key for persisting the selected tab. */
13
+ storageKey?: string;
14
+ /** Tabs CSS class name. */
15
+ className?: TabListProps['className'];
16
+ /** Tab CSS class name. */
17
+ tabClassName?: TabProps['className'];
18
+ } & Pick<TabGroupProps, 'defaultIndex' | 'selectedIndex' | 'onChange'>>;
19
+ declare const Tab: FC<TabPanelProps>;
20
+
21
+ export { Tab, Tabs };
@@ -0,0 +1,243 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { c as _c } from "react-compiler-runtime";
4
+ import { Tab as HeadlessTab, TabGroup, TabList, TabPanel, TabPanels } from "@headlessui/react";
5
+ import cn from "clsx";
6
+ import { Fragment, useEffect, useRef, useState } from "react";
7
+ import { useHash } from "../../hooks/use-hash.js";
8
+ function isTabObjectItem(item) {
9
+ return !!item && typeof item === "object" && "label" in item;
10
+ }
11
+ const Tabs = (t0) => {
12
+ const $ = _c(30);
13
+ const {
14
+ items,
15
+ children,
16
+ storageKey,
17
+ defaultIndex: t1,
18
+ selectedIndex: _selectedIndex,
19
+ onChange,
20
+ className,
21
+ tabClassName
22
+ } = t0;
23
+ const defaultIndex = t1 === void 0 ? 0 : t1;
24
+ const [selectedIndex, setSelectedIndex] = useState(defaultIndex);
25
+ const hash = useHash();
26
+ const tabPanelsRef = useRef(null);
27
+ let t2;
28
+ let t3;
29
+ if ($[0] !== _selectedIndex) {
30
+ t2 = () => {
31
+ if (_selectedIndex !== void 0) {
32
+ setSelectedIndex(_selectedIndex);
33
+ }
34
+ };
35
+ t3 = [_selectedIndex];
36
+ $[0] = _selectedIndex;
37
+ $[1] = t2;
38
+ $[2] = t3;
39
+ } else {
40
+ t2 = $[1];
41
+ t3 = $[2];
42
+ }
43
+ useEffect(t2, t3);
44
+ let t4;
45
+ let t5;
46
+ if ($[3] !== hash) {
47
+ t4 = () => {
48
+ if (!hash) {
49
+ return;
50
+ }
51
+ const tabPanel = tabPanelsRef.current.querySelector(`[role=tabpanel]:has([id="${hash}"])`);
52
+ if (!tabPanel) {
53
+ return;
54
+ }
55
+ for (const [index, el] of Object.entries(tabPanelsRef.current.children)) {
56
+ if (el === tabPanel) {
57
+ setSelectedIndex(Number(index));
58
+ location.hash = "";
59
+ requestAnimationFrame(() => {
60
+ location.hash = `#${hash}`;
61
+ });
62
+ }
63
+ }
64
+ };
65
+ t5 = [hash];
66
+ $[3] = hash;
67
+ $[4] = t4;
68
+ $[5] = t5;
69
+ } else {
70
+ t4 = $[4];
71
+ t5 = $[5];
72
+ }
73
+ useEffect(t4, t5);
74
+ let t6;
75
+ if ($[6] !== storageKey) {
76
+ t6 = () => {
77
+ if (!storageKey) {
78
+ return;
79
+ }
80
+ const fn = function fn2(event) {
81
+ if (event.key === storageKey) {
82
+ setSelectedIndex(Number(event.newValue));
83
+ }
84
+ };
85
+ const index_0 = Number(localStorage.getItem(storageKey));
86
+ setSelectedIndex(Number.isNaN(index_0) ? 0 : index_0);
87
+ window.addEventListener("storage", fn);
88
+ return () => {
89
+ window.removeEventListener("storage", fn);
90
+ };
91
+ };
92
+ $[6] = storageKey;
93
+ $[7] = t6;
94
+ } else {
95
+ t6 = $[7];
96
+ }
97
+ let t7;
98
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
99
+ t7 = [];
100
+ $[8] = t7;
101
+ } else {
102
+ t7 = $[8];
103
+ }
104
+ useEffect(t6, t7);
105
+ let t8;
106
+ if ($[9] !== onChange || $[10] !== storageKey) {
107
+ t8 = (index_1) => {
108
+ if (storageKey) {
109
+ const newValue = String(index_1);
110
+ localStorage.setItem(storageKey, newValue);
111
+ window.dispatchEvent(new StorageEvent("storage", {
112
+ key: storageKey,
113
+ newValue
114
+ }));
115
+ return;
116
+ }
117
+ setSelectedIndex(index_1);
118
+ onChange?.(index_1);
119
+ };
120
+ $[9] = onChange;
121
+ $[10] = storageKey;
122
+ $[11] = t8;
123
+ } else {
124
+ t8 = $[11];
125
+ }
126
+ const handleChange = t8;
127
+ let t9;
128
+ if ($[12] !== className) {
129
+ t9 = (args) => cn("nextra-scrollbar x:overflow-x-auto x:overscroll-x-contain x:overflow-y-hidden", "x:mt-4 x:flex x:w-full x:gap-2 x:border-b x:border-gray-200 x:pb-px x:dark:border-neutral-800", "x:focus-visible:nextra-focus", typeof className === "function" ? className(args) : className);
130
+ $[12] = className;
131
+ $[13] = t9;
132
+ } else {
133
+ t9 = $[13];
134
+ }
135
+ let t10;
136
+ if ($[14] !== items || $[15] !== tabClassName) {
137
+ let t112;
138
+ if ($[17] !== tabClassName) {
139
+ t112 = (item, index_2) => /* @__PURE__ */ jsx(HeadlessTab, { disabled: isTabObjectItem(item) && item.disabled, className: (args_0) => {
140
+ const {
141
+ selected,
142
+ disabled,
143
+ hover,
144
+ focus
145
+ } = args_0;
146
+ return cn(focus && "x:nextra-focus x:ring-inset", "x:whitespace-nowrap x:cursor-pointer", "x:rounded-t x:p-2 x:font-medium x:leading-5 x:transition-colors", "x:-mb-0.5 x:select-none x:border-b-2", selected ? "x:border-current x:outline-none" : hover ? "x:border-gray-200 x:dark:border-neutral-800" : "x:border-transparent", selected ? "x:text-primary-600" : disabled ? "x:text-gray-400 x:dark:text-neutral-600 x:pointer-events-none" : hover ? "x:text-black x:dark:text-white" : "x:text-gray-600 x:dark:text-gray-200", typeof tabClassName === "function" ? tabClassName(args_0) : tabClassName);
147
+ }, children: isTabObjectItem(item) ? item.label : item }, index_2);
148
+ $[17] = tabClassName;
149
+ $[18] = t112;
150
+ } else {
151
+ t112 = $[18];
152
+ }
153
+ t10 = items.map(t112);
154
+ $[14] = items;
155
+ $[15] = tabClassName;
156
+ $[16] = t10;
157
+ } else {
158
+ t10 = $[16];
159
+ }
160
+ let t11;
161
+ if ($[19] !== t10 || $[20] !== t9) {
162
+ t11 = /* @__PURE__ */ jsx(TabList, { className: t9, children: t10 });
163
+ $[19] = t10;
164
+ $[20] = t9;
165
+ $[21] = t11;
166
+ } else {
167
+ t11 = $[21];
168
+ }
169
+ let t12;
170
+ if ($[22] !== children) {
171
+ t12 = /* @__PURE__ */ jsx(TabPanels, { ref: tabPanelsRef, children });
172
+ $[22] = children;
173
+ $[23] = t12;
174
+ } else {
175
+ t12 = $[23];
176
+ }
177
+ let t13;
178
+ if ($[24] !== defaultIndex || $[25] !== handleChange || $[26] !== selectedIndex || $[27] !== t11 || $[28] !== t12) {
179
+ t13 = /* @__PURE__ */ jsxs(TabGroup, { selectedIndex, defaultIndex, onChange: handleChange, as: Fragment, children: [
180
+ t11,
181
+ t12
182
+ ] });
183
+ $[24] = defaultIndex;
184
+ $[25] = handleChange;
185
+ $[26] = selectedIndex;
186
+ $[27] = t11;
187
+ $[28] = t12;
188
+ $[29] = t13;
189
+ } else {
190
+ t13 = $[29];
191
+ }
192
+ return t13;
193
+ };
194
+ const Tab = (t0) => {
195
+ const $ = _c(12);
196
+ let children;
197
+ let className;
198
+ let props;
199
+ let t1;
200
+ if ($[0] !== t0) {
201
+ ({
202
+ children,
203
+ unmount: t1,
204
+ className,
205
+ ...props
206
+ } = t0);
207
+ $[0] = t0;
208
+ $[1] = children;
209
+ $[2] = className;
210
+ $[3] = props;
211
+ $[4] = t1;
212
+ } else {
213
+ children = $[1];
214
+ className = $[2];
215
+ props = $[3];
216
+ t1 = $[4];
217
+ }
218
+ const unmount = t1 === void 0 ? false : t1;
219
+ let t2;
220
+ if ($[5] !== className) {
221
+ t2 = (args) => cn("x:rounded x:mt-[1.25em]", args.focus && "x:nextra-focus", typeof className === "function" ? className(args) : className);
222
+ $[5] = className;
223
+ $[6] = t2;
224
+ } else {
225
+ t2 = $[6];
226
+ }
227
+ let t3;
228
+ if ($[7] !== children || $[8] !== props || $[9] !== t2 || $[10] !== unmount) {
229
+ t3 = /* @__PURE__ */ jsx(TabPanel, { ...props, unmount, className: t2, children });
230
+ $[7] = children;
231
+ $[8] = props;
232
+ $[9] = t2;
233
+ $[10] = unmount;
234
+ $[11] = t3;
235
+ } else {
236
+ t3 = $[11];
237
+ }
238
+ return t3;
239
+ };
240
+ export {
241
+ Tab,
242
+ Tabs
243
+ };
@@ -0,0 +1,53 @@
1
+ import * as react from 'react';
2
+ import { ComponentProps } from 'react';
3
+ import * as _headlessui_react from '@headlessui/react';
4
+ import * as react_jsx_runtime_js from 'react/jsx-runtime.js';
5
+ import { Tabs as Tabs$1 } from './index.client.js';
6
+
7
+ /**
8
+ * A built-in component for creating tabbed content, helping organize related information in a
9
+ * compact, interactive layout.
10
+ *
11
+ * @example
12
+ * <Tabs items={['pnpm', 'npm', 'yarn']}>
13
+ * <Tabs.Tab>**pnpm**: Fast, disk space efficient package manager.</Tabs.Tab>
14
+ * <Tabs.Tab>**npm** is a package manager for the JavaScript programming language.</Tabs.Tab>
15
+ * <Tabs.Tab>**Yarn** is a software packaging system.</Tabs.Tab>
16
+ * </Tabs>
17
+ *
18
+ * @usage
19
+ * ```mdx
20
+ * import { Tabs } from 'nextra/components'
21
+ *
22
+ * <Tabs items={['pnpm', 'npm', 'yarn']}>
23
+ * <Tabs.Tab>**pnpm**: Fast, disk space efficient package manager.</Tabs.Tab>
24
+ * <Tabs.Tab>**npm** is a package manager for the JavaScript programming language.</Tabs.Tab>
25
+ * <Tabs.Tab>**Yarn** is a software packaging system.</Tabs.Tab>
26
+ * </Tabs>
27
+ * ```
28
+ *
29
+ * ### Default Selected Index
30
+ *
31
+ * You can use the `defaultIndex` prop to set the default tab index:
32
+ *
33
+ * ```mdx /defaultIndex="1"/
34
+ * import { Tabs } from 'nextra/components'
35
+ *
36
+ * <Tabs items={['pnpm', 'npm', 'yarn']} defaultIndex="1">
37
+ * ...
38
+ * </Tabs>
39
+ * ```
40
+ *
41
+ * And you will have `npm` as the default tab:
42
+ *
43
+ * <Tabs items={['pnpm', 'npm', 'yarn']} defaultIndex="1">
44
+ * <Tabs.Tab>**pnpm**: Fast, disk space efficient package manager.</Tabs.Tab>
45
+ * <Tabs.Tab>**npm** is a package manager for the JavaScript programming language.</Tabs.Tab>
46
+ * <Tabs.Tab>**Yarn** is a software packaging system.</Tabs.Tab>
47
+ * </Tabs>
48
+ */
49
+ declare const Tabs: ((props: ComponentProps<typeof Tabs$1>) => react_jsx_runtime_js.JSX.Element) & {
50
+ Tab: react.FC<_headlessui_react.TabPanelProps>;
51
+ };
52
+
53
+ export { Tabs };
@@ -0,0 +1,9 @@
1
+ "use no memo";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Tabs as _Tabs, Tab } from "./index.client.js";
4
+ const Tabs = Object.assign((props) => /* @__PURE__ */ jsx(_Tabs, { ...props }), {
5
+ Tab
6
+ });
7
+ export {
8
+ Tabs
9
+ };
@@ -0,0 +1,30 @@
1
+ import { EvaluateResult } from '../types.js';
2
+ import { MDXComponents } from './mdx-components.js';
3
+ import 'mdast';
4
+ import 'next';
5
+ import 'react';
6
+ import 'zod';
7
+ import '../server/schemas.js';
8
+ import './lib/index.js';
9
+ import 'rehype-katex/lib/index.js';
10
+ import 'better-react-mathjax';
11
+ import 'rehype-pretty-code';
12
+ import '../types.generated.js';
13
+ import '@mdx-js/mdx';
14
+ import 'rehype-katex';
15
+ import 'url';
16
+ import 'next/link.js';
17
+ import 'next/image.js';
18
+ import './components/image-zoom.js';
19
+ import 'next/image';
20
+ import './mdx-components/anchor.js';
21
+ import 'next/link';
22
+
23
+ type Scope = Record<string, unknown>;
24
+ declare function evaluate(rawJs: string,
25
+ /** @default {} */
26
+ components?: MDXComponents,
27
+ /** @default {} */
28
+ scope?: Scope): EvaluateResult;
29
+
30
+ export { type Scope, evaluate };
@@ -0,0 +1,17 @@
1
+ "use no memo";
2
+ import jsxDevRuntime from "react/jsx-dev-runtime";
3
+ import jsxRuntime from "react/jsx-runtime";
4
+ const runtime = process.env.NODE_ENV === "production" ? jsxRuntime : jsxDevRuntime;
5
+ function evaluate(rawJs, components = {}, scope = {}) {
6
+ const keys = Object.keys(scope);
7
+ const values = Object.values(scope);
8
+ const hydrateFn = Reflect.construct(Function, ["$", ...keys, rawJs]);
9
+ return hydrateFn({
10
+ ...runtime,
11
+ // Inject components in `<MDXContent>` and TOC
12
+ useMDXComponents: () => components
13
+ }, ...values);
14
+ }
15
+ export {
16
+ evaluate
17
+ };
@@ -0,0 +1,4 @@
1
+ export { withIcons } from './with-icons.js';
2
+ export { withGitHubAlert } from './with-github-alert.js';
3
+ import 'react';
4
+ import '../mdx-components/pre/index.js';
@@ -0,0 +1,6 @@
1
+ import { withIcons } from "./with-icons.js";
2
+ import { withGitHubAlert } from "./with-github-alert.js";
3
+ export {
4
+ withGitHubAlert,
5
+ withIcons
6
+ };
@@ -0,0 +1,11 @@
1
+ import { FC, ReactNode, ComponentProps } from 'react';
2
+
3
+ type BlockquoteType = FC<ComponentProps<'blockquote'>>;
4
+ type T = (typeof GITHUB_ALERTS)[number];
5
+ declare const GITHUB_ALERTS: readonly ["note", "tip", "important", "warning", "caution"];
6
+ declare function withGitHubAlert(fn: FC<{
7
+ type: T;
8
+ children: ReactNode;
9
+ }>, Component?: BlockquoteType | 'blockquote'): BlockquoteType;
10
+
11
+ export { withGitHubAlert };
@@ -0,0 +1,30 @@
1
+ "use no memo";
2
+ import { jsx } from "react/jsx-runtime";
3
+ const GITHUB_ALERT_RE = /^\s*\[!(?<name>.*?)]\s*$/;
4
+ const GITHUB_ALERTS = ["note", "tip", "important", "warning", "caution"];
5
+ const GITHUB_ALERT_TYPES = new Set(GITHUB_ALERTS);
6
+ function withGitHubAlert(fn, Component = "blockquote") {
7
+ return function Blockquote(props) {
8
+ if (Array.isArray(props.children)) {
9
+ const str = props.children[1].props.children;
10
+ if (typeof str === "string") {
11
+ const alertName = str.match(GITHUB_ALERT_RE)?.groups?.name.toLowerCase();
12
+ if (alertName) {
13
+ if (!GITHUB_ALERT_TYPES.has(alertName)) {
14
+ throw new Error(`Invalid GitHub alert type: "${alertName}". Should be one of: ${GITHUB_ALERTS.join(", ")}.`);
15
+ }
16
+ const capitalizedName = alertName[0].toUpperCase() + alertName.slice(1);
17
+ return fn({
18
+ ...props,
19
+ type: alertName,
20
+ children: [/* @__PURE__ */ jsx("b", { children: capitalizedName }, 0), ...props.children.slice(2)]
21
+ });
22
+ }
23
+ }
24
+ }
25
+ return /* @__PURE__ */ jsx(Component, { ...props });
26
+ };
27
+ }
28
+ export {
29
+ withGitHubAlert
30
+ };
@@ -0,0 +1,6 @@
1
+ import { FC, SVGProps } from 'react';
2
+ import { PreProps } from '../mdx-components/pre/index.js';
3
+
4
+ declare function withIcons(Component: FC, obj?: Record<string, FC<SVGProps<SVGElement>>>): FC<PreProps>;
5
+
6
+ export { withIcons };
@@ -0,0 +1,76 @@
1
+ "use no memo";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import path from "path";
4
+ import { CPPIcon, CsharpIcon, CssIcon, GoIcon, GraphQLIcon, JavaScriptIcon, JSONIcon, MarkdownIcon, MdxIcon, MoveIcon, PythonIcon, ReactIcon, RustIcon, SvelteIcon, TerminalIcon, TerraformIcon, TypeScriptIcon } from "../icons/index.js";
5
+ function getIcon(language) {
6
+ switch (language) {
7
+ case "javascript":
8
+ case "js":
9
+ case "mjs":
10
+ case "cjs":
11
+ return JavaScriptIcon;
12
+ case "typescript":
13
+ case "ts":
14
+ case "mts":
15
+ case "cts":
16
+ return TypeScriptIcon;
17
+ case "jsx":
18
+ case "tsx":
19
+ return ReactIcon;
20
+ case "md":
21
+ return MarkdownIcon;
22
+ case "mdx":
23
+ return MdxIcon;
24
+ case "sh":
25
+ case "bash":
26
+ return TerminalIcon;
27
+ case "css":
28
+ return CssIcon;
29
+ case "c++":
30
+ case "cpp":
31
+ return CPPIcon;
32
+ case "csharp":
33
+ case "cs":
34
+ case "c#":
35
+ return CsharpIcon;
36
+ case "graphql":
37
+ case "gql":
38
+ return GraphQLIcon;
39
+ case "python":
40
+ case "py":
41
+ return PythonIcon;
42
+ case "rust":
43
+ case "rs":
44
+ return RustIcon;
45
+ case "terraform":
46
+ case "tf":
47
+ return TerraformIcon;
48
+ case "move":
49
+ return MoveIcon;
50
+ case "go":
51
+ case "golang":
52
+ return GoIcon;
53
+ case "json":
54
+ case "jsonc":
55
+ return JSONIcon;
56
+ case "svelte":
57
+ return SvelteIcon;
58
+ }
59
+ }
60
+ function withIcons(Component, obj) {
61
+ return function Pre(props) {
62
+ let language = props["data-language"];
63
+ const filename = props["data-filename"];
64
+ if (language === "diff" && filename) {
65
+ const ext = path.parse(filename).ext.slice(1);
66
+ if (ext) {
67
+ language = ext;
68
+ }
69
+ }
70
+ const Icon = language && (obj?.[language] || getIcon(language));
71
+ return /* @__PURE__ */ jsx(Component, { icon: Icon && /* @__PURE__ */ jsx(Icon, { height: "1em", className: "x:max-w-6 x:shrink-0" }), ...props });
72
+ };
73
+ }
74
+ export {
75
+ withIcons
76
+ };
@@ -0,0 +1,4 @@
1
+ export { useMounted } from './use-mounted.js';
2
+ export { useCopy } from './use-copy.js';
3
+ export { useFSRoute } from './use-fs-route.js';
4
+ export { useHash } from './use-hash.js';
@@ -0,0 +1,10 @@
1
+ import { useMounted } from "./use-mounted.js";
2
+ import { useCopy } from "./use-copy.js";
3
+ import { useFSRoute } from "./use-fs-route.js";
4
+ import { useHash } from "./use-hash.js";
5
+ export {
6
+ useCopy,
7
+ useFSRoute,
8
+ useHash,
9
+ useMounted
10
+ };
@@ -0,0 +1,9 @@
1
+ declare function useCopy({ timeout }?: {
2
+ /** @default 2000 */
3
+ timeout?: number;
4
+ }): {
5
+ copy: (content: string) => Promise<void>;
6
+ isCopied: boolean;
7
+ };
8
+
9
+ export { useCopy };