@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,136 @@
1
+ import * as react_jsx_runtime_js from 'react/jsx-runtime.js';
2
+ import { FC, HTMLAttributes, ReactNode } from 'react';
3
+
4
+ declare const TypeToEmoji: {
5
+ default: react_jsx_runtime_js.JSX.Element;
6
+ error: react_jsx_runtime_js.JSX.Element;
7
+ info: react_jsx_runtime_js.JSX.Element;
8
+ warning: react_jsx_runtime_js.JSX.Element;
9
+ important: react_jsx_runtime_js.JSX.Element;
10
+ };
11
+ type CalloutType = keyof typeof TypeToEmoji;
12
+ type CalloutProps = HTMLAttributes<HTMLDivElement> & {
13
+ /**
14
+ * Defines the style of the callout and determines the default icon if `emoji` is not provided.
15
+ *
16
+ * If set to `null`, no border, background, or text styling will be applied.
17
+ * @default 'default'
18
+ */
19
+ type?: CalloutType | null;
20
+ /**
21
+ * Icon displayed in the callout. Can be a string emoji or a custom React element.
22
+ *
23
+ * Default values based on `type`:
24
+ * - `<GitHubTipIcon />` for `type: 'default'`
25
+ * - `<GitHubCautionIcon />` for `type: 'error'`
26
+ * - `<GitHubNoteIcon />` for `type: 'info'`
27
+ * - `<GitHubWarningIcon />` for `type: 'warning'`
28
+ * - `<GitHubImportantIcon />` for `type: 'important'`
29
+ * @default Determined by `type`
30
+ */
31
+ emoji?: ReactNode;
32
+ };
33
+ /**
34
+ * A built-in component to show important information to the reader.
35
+ *
36
+ * @example
37
+ * <Callout>
38
+ * A **callout** is a short piece of text intended to attract attention.
39
+ * </Callout>
40
+ *
41
+ * <Callout type="info">
42
+ * A **callout** is a short piece of text intended to attract attention.
43
+ * </Callout>
44
+ *
45
+ * <Callout type="warning">
46
+ * A **callout** is a short piece of text intended to attract attention.
47
+ * </Callout>
48
+ *
49
+ * <Callout type="error">
50
+ * A **callout** is a short piece of text intended to attract attention.
51
+ * </Callout>
52
+ *
53
+ * <Callout type="important">
54
+ * A **callout** is a short piece of text intended to attract attention.
55
+ * </Callout>
56
+ *
57
+ * @usage
58
+ * ### Default
59
+ *
60
+ * <Callout>Helpful advice for doing things better or more easily.</Callout>
61
+ *
62
+ * ```mdx
63
+ * import { Callout } from 'nextra/components'
64
+ *
65
+ * <Callout>Helpful advice for doing things better or more easily.</Callout>
66
+ * ```
67
+ *
68
+ * ### Info
69
+ *
70
+ * <Callout type="info">
71
+ * Useful information that users should know, even when skimming content.
72
+ * </Callout>
73
+ *
74
+ * ```mdx
75
+ * import { Callout } from 'nextra/components'
76
+ *
77
+ * <Callout type="info">
78
+ * Useful information that users should know, even when skimming content.
79
+ * </Callout>
80
+ * ```
81
+ *
82
+ * ### Warning
83
+ *
84
+ * <Callout type="warning">
85
+ * Urgent info that needs immediate user attention to avoid problems.
86
+ * </Callout>
87
+ *
88
+ * ```mdx
89
+ * import { Callout } from 'nextra/components'
90
+ *
91
+ * <Callout type="warning">
92
+ * Urgent info that needs immediate user attention to avoid problems.
93
+ * </Callout>
94
+ * ```
95
+ *
96
+ * ### Error
97
+ *
98
+ * <Callout type="error">
99
+ * Advises about risks or negative outcomes of certain actions.
100
+ * </Callout>
101
+ *
102
+ * ```mdx
103
+ * import { Callout } from 'nextra/components'
104
+ *
105
+ * <Callout type="error">
106
+ * Advises about risks or negative outcomes of certain actions.
107
+ * </Callout>
108
+ * ```
109
+ *
110
+ * ### Important
111
+ *
112
+ * <Callout type="important">
113
+ * Key information users need to know to achieve their goal.
114
+ * </Callout>
115
+ *
116
+ * ```mdx
117
+ * import { Callout } from 'nextra/components'
118
+ *
119
+ * <Callout type="important">
120
+ * Key information users need to know to achieve their goal.
121
+ * </Callout>
122
+ * ```
123
+ *
124
+ * ### Custom icon
125
+ *
126
+ * <Callout type="info" emoji="⭐">Nextra has 13k stars on GitHub!</Callout>
127
+ *
128
+ * ```mdx
129
+ * import { Callout } from 'nextra/components'
130
+ *
131
+ * <Callout type="info" emoji="⭐">Nextra has 13k stars on GitHub!</Callout>
132
+ * ```
133
+ */
134
+ declare const Callout: FC<CalloutProps>;
135
+
136
+ export { Callout };
@@ -0,0 +1,99 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
3
+ import cn from "clsx";
4
+ import { GitHubCautionIcon, GitHubImportantIcon, GitHubNoteIcon, GitHubTipIcon, GitHubWarningIcon } from "../icons/index.js";
5
+ const TypeToEmoji = {
6
+ default: /* @__PURE__ */ jsx(GitHubTipIcon, { height: ".8em", className: "x:mt-[.3em]" }),
7
+ error: /* @__PURE__ */ jsx(GitHubCautionIcon, { height: ".8em", className: "x:mt-[.3em]" }),
8
+ info: /* @__PURE__ */ jsx(GitHubNoteIcon, { height: ".8em", className: "x:mt-[.3em]" }),
9
+ warning: /* @__PURE__ */ jsx(GitHubWarningIcon, { height: ".8em", className: "x:mt-[.3em]" }),
10
+ important: /* @__PURE__ */ jsx(GitHubImportantIcon, { height: ".8em", className: "x:mt-[.3em]" })
11
+ };
12
+ const classes = {
13
+ default: cn("x:bg-green-100 x:dark:bg-green-900/30", "x:text-green-700 x:dark:text-green-500", "x:border-green-700 x:dark:border-green-800"),
14
+ error: cn("x:bg-red-100 x:dark:bg-red-900/30", "x:text-red-700 x:dark:text-red-500", "x:border-red-700 x:dark:border-red-600"),
15
+ info: cn("x:bg-blue-100 x:dark:bg-blue-900/30", "x:text-blue-700 x:dark:text-blue-400", "x:border-blue-700 x:dark:border-blue-600"),
16
+ warning: cn("x:bg-yellow-50 x:dark:bg-yellow-700/30", "x:text-yellow-700 x:dark:text-yellow-500", "x:border-yellow-700"),
17
+ important: cn("x:bg-purple-100 x:dark:bg-purple-900/30", "x:text-purple-600 x:dark:text-purple-400", "x:border-purple-600")
18
+ };
19
+ const Callout = (t0) => {
20
+ const $ = _c(18);
21
+ let className;
22
+ let props;
23
+ let t1;
24
+ let t2;
25
+ if ($[0] !== t0) {
26
+ ({
27
+ className,
28
+ type: t1,
29
+ emoji: t2,
30
+ ...props
31
+ } = t0);
32
+ $[0] = t0;
33
+ $[1] = className;
34
+ $[2] = props;
35
+ $[3] = t1;
36
+ $[4] = t2;
37
+ } else {
38
+ className = $[1];
39
+ props = $[2];
40
+ t1 = $[3];
41
+ t2 = $[4];
42
+ }
43
+ const type = t1 === void 0 ? "default" : t1;
44
+ const emoji = t2 === void 0 ? type && TypeToEmoji[type] : t2;
45
+ const t3 = type && classes[type];
46
+ let t4;
47
+ if ($[5] !== t3) {
48
+ t4 = cn("nextra-callout x:overflow-x-auto x:not-first:mt-[1.25em] x:flex x:rounded-lg x:border x:py-[.5em] x:pe-[1em]", "x:contrast-more:border-current!", t3);
49
+ $[5] = t3;
50
+ $[6] = t4;
51
+ } else {
52
+ t4 = $[6];
53
+ }
54
+ let t5;
55
+ if ($[7] !== emoji) {
56
+ t5 = /* @__PURE__ */ jsx("div", { className: "x:select-none x:text-[1.25em] x:ps-[.6em] x:pe-[.4em]", style, "data-pagefind-ignore": "all", children: emoji });
57
+ $[7] = emoji;
58
+ $[8] = t5;
59
+ } else {
60
+ t5 = $[8];
61
+ }
62
+ let t6;
63
+ if ($[9] !== className) {
64
+ t6 = cn("x:w-full x:min-w-0", className);
65
+ $[9] = className;
66
+ $[10] = t6;
67
+ } else {
68
+ t6 = $[10];
69
+ }
70
+ let t7;
71
+ if ($[11] !== props || $[12] !== t6) {
72
+ t7 = /* @__PURE__ */ jsx("div", { className: t6, ...props });
73
+ $[11] = props;
74
+ $[12] = t6;
75
+ $[13] = t7;
76
+ } else {
77
+ t7 = $[13];
78
+ }
79
+ let t8;
80
+ if ($[14] !== t4 || $[15] !== t5 || $[16] !== t7) {
81
+ t8 = /* @__PURE__ */ jsxs("div", { className: t4, children: [
82
+ t5,
83
+ t7
84
+ ] });
85
+ $[14] = t4;
86
+ $[15] = t5;
87
+ $[16] = t7;
88
+ $[17] = t8;
89
+ } else {
90
+ t8 = $[17];
91
+ }
92
+ return t8;
93
+ };
94
+ const style = {
95
+ fontFamily: '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
96
+ };
97
+ export {
98
+ Callout
99
+ };
@@ -0,0 +1,104 @@
1
+ import { FC, HTMLAttributes, ReactElement, ReactNode } from 'react';
2
+
3
+ /**
4
+ * A built-in component that allows you to display content in a visually appealing card format. It
5
+ * includes options for adding an icon, title, link and an image to related content.
6
+ *
7
+ * @example
8
+ * ### Grouped cards
9
+ *
10
+ * <Cards>
11
+ * <Cards.Card
12
+ * icon={<WarningIcon />}
13
+ * title="Callout"
14
+ * href="/docs/built-ins/callout"
15
+ * />
16
+ * <Cards.Card
17
+ * icon={<CardsIcon />}
18
+ * title="Tabs"
19
+ * href="/docs/built-ins/tabs"
20
+ * />
21
+ * <Cards.Card
22
+ * icon={<OneIcon />}
23
+ * title="Steps"
24
+ * href="/docs/built-ins/steps"
25
+ * />
26
+ * </Cards>
27
+ *
28
+ * ### Single card
29
+ *
30
+ * <br />
31
+ * <Cards.Card
32
+ * icon={<BoxIcon />}
33
+ * title="About Nextra"
34
+ * href="/about"
35
+ * arrow
36
+ * />
37
+ *
38
+ * @usage
39
+ * ### Grouped cards
40
+ *
41
+ * Import the `<Cards>` component to your page, which includes the `<Card>` component.
42
+ *
43
+ * Then, optionally import the icons that you want to use. To create a set of cards, follow the
44
+ * example below where the `<Cards.Card>` component is used to create a card and the `<Cards>`
45
+ * component is used to group multiple cards together.
46
+ *
47
+ * ```mdx filename="MDX"
48
+ * import { Cards } from 'nextra/components'
49
+ * import { CardsIcon, OneIcon, WarningIcon } from '../path/with/your/icons'
50
+ *
51
+ * <Cards>
52
+ * <Cards.Card
53
+ * icon={<WarningIcon />}
54
+ * title="Callout"
55
+ * href="/docs/built-ins/callout"
56
+ * />
57
+ * <Cards.Card
58
+ * icon={<CardsIcon />}
59
+ * title="Tabs"
60
+ * href="/docs/built-ins/tabs"
61
+ * />
62
+ * <Cards.Card
63
+ * icon={<OneIcon />}
64
+ * title="Steps"
65
+ * href="/docs/built-ins/steps"
66
+ * />
67
+ * </Cards>
68
+ * ```
69
+ *
70
+ * ### Single card
71
+ *
72
+ * A `<Card>` not wrapped in a `<Cards>` component will not be grouped with other cards. This can
73
+ * be useful if you want to display a single card in a different format than the other cards on the
74
+ * page.
75
+ *
76
+ * ```mdx filename="MDX"
77
+ * <Cards.Card
78
+ * icon={<BoxIcon />}
79
+ * title="About Nextra"
80
+ * href="/about"
81
+ * arrow
82
+ * />
83
+ * ```
84
+ */
85
+ declare const Cards: FC<{
86
+ /**
87
+ * Number of columns.
88
+ * @default 3
89
+ */
90
+ num?: number;
91
+ } & HTMLAttributes<HTMLDivElement>> & {
92
+ displayName: string;
93
+ Card: FC<{
94
+ title: string;
95
+ icon?: ReactElement;
96
+ arrow?: boolean;
97
+ href: string;
98
+ children?: ReactNode;
99
+ /** CSS class name. */
100
+ className?: string;
101
+ }>;
102
+ };
103
+
104
+ export { Cards };
@@ -0,0 +1,132 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
3
+ import cn from "clsx";
4
+ import NextLink from "next/link";
5
+ const Card = (t0) => {
6
+ const $ = _c(29);
7
+ let arrow;
8
+ let children;
9
+ let className;
10
+ let href;
11
+ let icon;
12
+ let props;
13
+ let title;
14
+ if ($[0] !== t0) {
15
+ ({
16
+ children,
17
+ title,
18
+ icon,
19
+ arrow,
20
+ href,
21
+ className,
22
+ ...props
23
+ } = t0);
24
+ $[0] = t0;
25
+ $[1] = arrow;
26
+ $[2] = children;
27
+ $[3] = className;
28
+ $[4] = href;
29
+ $[5] = icon;
30
+ $[6] = props;
31
+ $[7] = title;
32
+ } else {
33
+ arrow = $[1];
34
+ children = $[2];
35
+ className = $[3];
36
+ href = $[4];
37
+ icon = $[5];
38
+ props = $[6];
39
+ title = $[7];
40
+ }
41
+ const t1 = children ? "x:bg-gray-100 x:shadow x:dark:border-neutral-700 x:dark:bg-neutral-800 x:dark:text-gray-50 x:hover:shadow-lg x:dark:hover:border-neutral-500 x:dark:hover:bg-neutral-700" : "x:bg-transparent x:shadow-sm x:dark:border-neutral-800 x:hover:bg-slate-50 x:hover:shadow-md x:dark:hover:border-neutral-700 x:dark:hover:bg-neutral-900";
42
+ let t2;
43
+ if ($[8] !== className || $[9] !== t1) {
44
+ t2 = cn("x:group", "x:focus-visible:nextra-focus nextra-card x:flex x:flex-col x:justify-start x:overflow-hidden x:rounded-lg x:border x:border-gray-200", "x:text-current x:no-underline x:dark:shadow-none", "x:hover:shadow-gray-100 x:dark:hover:shadow-none x:shadow-gray-100", "x:active:shadow-sm x:active:shadow-gray-200", "x:transition-all x:duration-200 x:hover:border-gray-300", t1, className);
45
+ $[8] = className;
46
+ $[9] = t1;
47
+ $[10] = t2;
48
+ } else {
49
+ t2 = $[10];
50
+ }
51
+ let t3;
52
+ if ($[11] !== arrow) {
53
+ t3 = arrow && ['x:after:content-["\u2192"] x:after:transition-transform x:after:duration-75', "x:group-hover:after:translate-x-0.5", "x:group-focus:after:translate-x-0.5"];
54
+ $[11] = arrow;
55
+ $[12] = t3;
56
+ } else {
57
+ t3 = $[12];
58
+ }
59
+ const t4 = children ? "x:dark:text-gray-300 x:dark:hover:text-gray-100" : "x:dark:text-neutral-200 x:dark:hover:text-neutral-50";
60
+ let t5;
61
+ if ($[13] !== t3 || $[14] !== t4) {
62
+ t5 = cn("x:flex x:font-semibold x:items-center x:gap-2 x:p-4 x:text-gray-700 x:hover:text-gray-900", t3, t4);
63
+ $[13] = t3;
64
+ $[14] = t4;
65
+ $[15] = t5;
66
+ } else {
67
+ t5 = $[15];
68
+ }
69
+ const t6 = typeof title === "string" ? title : void 0;
70
+ let t7;
71
+ if ($[16] !== title) {
72
+ t7 = /* @__PURE__ */ jsx("span", { className: "_truncate", children: title });
73
+ $[16] = title;
74
+ $[17] = t7;
75
+ } else {
76
+ t7 = $[17];
77
+ }
78
+ let t8;
79
+ if ($[18] !== icon || $[19] !== t5 || $[20] !== t6 || $[21] !== t7) {
80
+ t8 = /* @__PURE__ */ jsxs("span", { className: t5, title: t6, children: [
81
+ icon,
82
+ t7
83
+ ] });
84
+ $[18] = icon;
85
+ $[19] = t5;
86
+ $[20] = t6;
87
+ $[21] = t7;
88
+ $[22] = t8;
89
+ } else {
90
+ t8 = $[22];
91
+ }
92
+ let t9;
93
+ if ($[23] !== children || $[24] !== href || $[25] !== props || $[26] !== t2 || $[27] !== t8) {
94
+ t9 = /* @__PURE__ */ jsxs(NextLink, { href, className: t2, ...props, children: [
95
+ children,
96
+ t8
97
+ ] });
98
+ $[23] = children;
99
+ $[24] = href;
100
+ $[25] = props;
101
+ $[26] = t2;
102
+ $[27] = t8;
103
+ $[28] = t9;
104
+ } else {
105
+ t9 = $[28];
106
+ }
107
+ return t9;
108
+ };
109
+ const _Cards = ({
110
+ children,
111
+ num = 3,
112
+ className,
113
+ style,
114
+ ...props
115
+ }) => {
116
+ return /* @__PURE__ */ jsx("div", { className: cn(
117
+ "nextra-cards x:mt-4 x:gap-4 x:grid",
118
+ "not-prose",
119
+ // for nextra-theme-blog
120
+ className
121
+ ), ...props, style: {
122
+ ...style,
123
+ ["--rows"]: num
124
+ }, children });
125
+ };
126
+ const Cards = Object.assign(_Cards, {
127
+ displayName: "Cards",
128
+ Card
129
+ });
130
+ export {
131
+ Cards
132
+ };
@@ -0,0 +1,12 @@
1
+ import { FC, ReactNode } from 'react';
2
+
3
+ declare const Collapse: FC<{
4
+ className?: string;
5
+ children: ReactNode;
6
+ isOpen: boolean;
7
+ horizontal?: boolean;
8
+ openDuration?: number;
9
+ closeDuration?: number;
10
+ }>;
11
+
12
+ export { Collapse };
@@ -0,0 +1,143 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { c as _c } from "react-compiler-runtime";
4
+ import cn from "clsx";
5
+ import { Children, useEffect, useRef, useState } from "react";
6
+ const Collapse = (t0) => {
7
+ const $ = _c(24);
8
+ const {
9
+ className,
10
+ children,
11
+ isOpen,
12
+ horizontal: t1,
13
+ openDuration: t2,
14
+ closeDuration: t3
15
+ } = t0;
16
+ const horizontal = t1 === void 0 ? false : t1;
17
+ const openDuration = t2 === void 0 ? 500 : t2;
18
+ const closeDuration = t3 === void 0 ? 300 : t3;
19
+ const containerRef = useRef(null);
20
+ const [initialOpen] = useState(isOpen);
21
+ const animationRef = useRef(0);
22
+ const initialRender = useRef(true);
23
+ let t4;
24
+ let t5;
25
+ if ($[0] !== horizontal || $[1] !== isOpen || $[2] !== openDuration) {
26
+ t4 = () => {
27
+ const animation = animationRef.current;
28
+ const container = containerRef.current;
29
+ if (animation) {
30
+ clearTimeout(animation);
31
+ animationRef.current = 0;
32
+ }
33
+ if (initialRender.current) {
34
+ return;
35
+ }
36
+ const child = container.children[0];
37
+ if (horizontal) {
38
+ child.style.width = `${child.clientWidth}px`;
39
+ container.style.width = `${child.clientWidth}px`;
40
+ } else {
41
+ container.style.height = `${child.clientHeight}px`;
42
+ }
43
+ if (isOpen) {
44
+ animationRef.current = window.setTimeout(() => {
45
+ container.style.removeProperty("height");
46
+ }, openDuration);
47
+ } else {
48
+ requestAnimationFrame(() => {
49
+ if (horizontal) {
50
+ container.style.width = "0";
51
+ } else {
52
+ container.style.height = "0";
53
+ }
54
+ });
55
+ }
56
+ };
57
+ t5 = [horizontal, isOpen, openDuration];
58
+ $[0] = horizontal;
59
+ $[1] = isOpen;
60
+ $[2] = openDuration;
61
+ $[3] = t4;
62
+ $[4] = t5;
63
+ } else {
64
+ t4 = $[3];
65
+ t5 = $[4];
66
+ }
67
+ useEffect(t4, t5);
68
+ let t6;
69
+ let t7;
70
+ if ($[5] !== horizontal || $[6] !== isOpen) {
71
+ t6 = () => {
72
+ if (isOpen || !horizontal) {
73
+ initialRender.current = false;
74
+ }
75
+ };
76
+ t7 = [horizontal, isOpen];
77
+ $[5] = horizontal;
78
+ $[6] = isOpen;
79
+ $[7] = t6;
80
+ $[8] = t7;
81
+ } else {
82
+ t6 = $[7];
83
+ t7 = $[8];
84
+ }
85
+ useEffect(t6, t7);
86
+ let t8;
87
+ if ($[9] !== children) {
88
+ t8 = Children.count(children) === 1 && children && typeof children === "object" && "type" in children ? children : /* @__PURE__ */ jsx("div", { children });
89
+ $[9] = children;
90
+ $[10] = t8;
91
+ } else {
92
+ t8 = $[10];
93
+ }
94
+ const newChildren = t8;
95
+ const t9 = isOpen ? "x:opacity-100" : "x:opacity-0 x:overflow-hidden";
96
+ let t10;
97
+ if ($[11] !== className || $[12] !== t9) {
98
+ t10 = cn("x:transform-gpu x:transition-all x:ease-in-out x:motion-reduce:transition-none", t9, className);
99
+ $[11] = className;
100
+ $[12] = t9;
101
+ $[13] = t10;
102
+ } else {
103
+ t10 = $[13];
104
+ }
105
+ let t11;
106
+ if ($[14] !== horizontal || $[15] !== initialOpen) {
107
+ t11 = initialOpen || horizontal ? void 0 : {
108
+ height: 0
109
+ };
110
+ $[14] = horizontal;
111
+ $[15] = initialOpen;
112
+ $[16] = t11;
113
+ } else {
114
+ t11 = $[16];
115
+ }
116
+ const t12 = (isOpen ? openDuration : closeDuration) + "ms";
117
+ let t13;
118
+ if ($[17] !== t11 || $[18] !== t12) {
119
+ t13 = {
120
+ ...t11,
121
+ transitionDuration: t12
122
+ };
123
+ $[17] = t11;
124
+ $[18] = t12;
125
+ $[19] = t13;
126
+ } else {
127
+ t13 = $[19];
128
+ }
129
+ let t14;
130
+ if ($[20] !== newChildren || $[21] !== t10 || $[22] !== t13) {
131
+ t14 = /* @__PURE__ */ jsx("div", { ref: containerRef, className: t10, style: t13, children: newChildren });
132
+ $[20] = newChildren;
133
+ $[21] = t10;
134
+ $[22] = t13;
135
+ $[23] = t14;
136
+ } else {
137
+ t14 = $[23];
138
+ }
139
+ return t14;
140
+ };
141
+ export {
142
+ Collapse
143
+ };
@@ -0,0 +1,9 @@
1
+ import { ReactNode, FC } from 'react';
2
+
3
+ type FileProps = {
4
+ name: ReactNode;
5
+ active?: boolean;
6
+ };
7
+ declare const File: FC<FileProps>;
8
+
9
+ export { File, type FileProps };
@@ -0,0 +1,43 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
3
+ import cn from "clsx";
4
+ import { FileIcon } from "../../icons/index.js";
5
+ const File = (t0) => {
6
+ const $ = _c(6);
7
+ const {
8
+ name,
9
+ active
10
+ } = t0;
11
+ const t1 = active && "x:text-primary-600";
12
+ let t2;
13
+ if ($[0] !== t1) {
14
+ t2 = cn("x:flex x:items-center x:gap-1 x:break-all", t1);
15
+ $[0] = t1;
16
+ $[1] = t2;
17
+ } else {
18
+ t2 = $[1];
19
+ }
20
+ let t3;
21
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
22
+ t3 = /* @__PURE__ */ jsx(FileIcon, { height: "14", className: "x:shrink-0" });
23
+ $[2] = t3;
24
+ } else {
25
+ t3 = $[2];
26
+ }
27
+ let t4;
28
+ if ($[3] !== name || $[4] !== t2) {
29
+ t4 = /* @__PURE__ */ jsxs("li", { className: t2, children: [
30
+ t3,
31
+ name
32
+ ] });
33
+ $[3] = name;
34
+ $[4] = t2;
35
+ $[5] = t4;
36
+ } else {
37
+ t4 = $[5];
38
+ }
39
+ return t4;
40
+ };
41
+ export {
42
+ File
43
+ };
@@ -0,0 +1,12 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { FileProps } from './file.js';
3
+
4
+ type FolderProps = FileProps & {
5
+ open?: boolean;
6
+ /** @default false */
7
+ defaultOpen?: boolean;
8
+ children: ReactNode;
9
+ };
10
+ declare const Folder: FC<FolderProps>;
11
+
12
+ export { Folder };