@vx-oss/docs-react 1.0.3

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 (262) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +5 -0
  3. package/css/aspen.css +39 -0
  4. package/css/black.css +39 -0
  5. package/css/catppuccin.css +49 -0
  6. package/css/dusk.css +47 -0
  7. package/css/emerald.css +39 -0
  8. package/css/generated/docs.css +1 -0
  9. package/css/generated/flux.css +1 -0
  10. package/css/generated/glass.css +1 -0
  11. package/css/generated/home.css +1 -0
  12. package/css/generated/notebook.css +1 -0
  13. package/css/generated/shared.css +1 -0
  14. package/css/lib/base.css +296 -0
  15. package/css/lib/default-colors.css +51 -0
  16. package/css/lib/shiki.css +108 -0
  17. package/css/neutral.css +7 -0
  18. package/css/ocean.css +44 -0
  19. package/css/preset-legacy.css +43 -0
  20. package/css/preset.css +11 -0
  21. package/css/purple.css +39 -0
  22. package/css/ruby.css +39 -0
  23. package/css/shadcn.css +36 -0
  24. package/css/solar.css +65 -0
  25. package/css/style.css +9 -0
  26. package/css/vitepress.css +72 -0
  27. package/dist/.translations/index.d.ts +55 -0
  28. package/dist/.translations/keys.js +55 -0
  29. package/dist/_virtual/_rolldown/runtime.js +13 -0
  30. package/dist/components/accordion.d.ts +10 -0
  31. package/dist/components/accordion.js +68 -0
  32. package/dist/components/banner.d.ts +25 -0
  33. package/dist/components/banner.js +85 -0
  34. package/dist/components/callout.d.ts +21 -0
  35. package/dist/components/callout.js +60 -0
  36. package/dist/components/card.d.ts +13 -0
  37. package/dist/components/card.js +39 -0
  38. package/dist/components/codeblock.d.ts +45 -0
  39. package/dist/components/codeblock.js +126 -0
  40. package/dist/components/codeblock.rsc.d.ts +15 -0
  41. package/dist/components/codeblock.rsc.js +22 -0
  42. package/dist/components/dialog/search-algolia.d.ts +27 -0
  43. package/dist/components/dialog/search-algolia.js +64 -0
  44. package/dist/components/dialog/search-default.d.ts +29 -0
  45. package/dist/components/dialog/search-default.js +66 -0
  46. package/dist/components/dialog/search-orama.d.ts +32 -0
  47. package/dist/components/dialog/search-orama.js +69 -0
  48. package/dist/components/dialog/search.d.ts +76 -0
  49. package/dist/components/dialog/search.js +351 -0
  50. package/dist/components/dynamic-codeblock.core.d.ts +26 -0
  51. package/dist/components/dynamic-codeblock.core.js +51 -0
  52. package/dist/components/dynamic-codeblock.d.ts +8 -0
  53. package/dist/components/dynamic-codeblock.js +17 -0
  54. package/dist/components/files.d.ts +21 -0
  55. package/dist/components/files.js +40 -0
  56. package/dist/components/github-info.d.ts +20 -0
  57. package/dist/components/github-info.js +75 -0
  58. package/dist/components/heading.d.ts +9 -0
  59. package/dist/components/heading.js +38 -0
  60. package/dist/components/image-zoom.d.ts +18 -0
  61. package/dist/components/image-zoom.js +32 -0
  62. package/dist/components/image-zoom2.css +71 -0
  63. package/dist/components/inline-toc.d.ts +10 -0
  64. package/dist/components/inline-toc.js +28 -0
  65. package/dist/components/sidebar/base.d.ts +85 -0
  66. package/dist/components/sidebar/base.js +277 -0
  67. package/dist/components/sidebar/link-item.d.ts +12 -0
  68. package/dist/components/sidebar/link-item.js +37 -0
  69. package/dist/components/sidebar/page-tree.d.ts +20 -0
  70. package/dist/components/sidebar/page-tree.js +69 -0
  71. package/dist/components/sidebar/tabs/dropdown.d.ts +15 -0
  72. package/dist/components/sidebar/tabs/dropdown.js +83 -0
  73. package/dist/components/sidebar/tabs/index.d.ts +8 -0
  74. package/dist/components/sidebar/tabs/index.js +46 -0
  75. package/dist/components/steps.d.ts +10 -0
  76. package/dist/components/steps.js +16 -0
  77. package/dist/components/tabs.d.ts +33 -0
  78. package/dist/components/tabs.js +95 -0
  79. package/dist/components/toc/clerk.d.ts +11 -0
  80. package/dist/components/toc/clerk.js +227 -0
  81. package/dist/components/toc/default.d.ts +13 -0
  82. package/dist/components/toc/default.js +260 -0
  83. package/dist/components/toc/index.d.ts +10 -0
  84. package/dist/components/toc/index.js +45 -0
  85. package/dist/components/type-table.d.ts +37 -0
  86. package/dist/components/type-table.js +117 -0
  87. package/dist/components/ui/accordion.d.ts +10 -0
  88. package/dist/components/ui/accordion.js +42 -0
  89. package/dist/components/ui/button.d.ts +10 -0
  90. package/dist/components/ui/button.js +20 -0
  91. package/dist/components/ui/collapsible.d.ts +11 -0
  92. package/dist/components/ui/collapsible.js +21 -0
  93. package/dist/components/ui/navigation-menu.d.ts +14 -0
  94. package/dist/components/ui/navigation-menu.js +41 -0
  95. package/dist/components/ui/popover.d.ts +9 -0
  96. package/dist/components/ui/popover.js +20 -0
  97. package/dist/components/ui/scroll-area.d.ts +9 -0
  98. package/dist/components/ui/scroll-area.js +34 -0
  99. package/dist/components/ui/tabs.d.ts +23 -0
  100. package/dist/components/ui/tabs.js +102 -0
  101. package/dist/contexts/i18n.d.ts +34 -0
  102. package/dist/contexts/i18n.js +37 -0
  103. package/dist/contexts/search.d.ts +64 -0
  104. package/dist/contexts/search.js +68 -0
  105. package/dist/contexts/tree.d.ts +29 -0
  106. package/dist/contexts/tree.js +91 -0
  107. package/dist/i18n.d.ts +15 -0
  108. package/dist/i18n.js +38 -0
  109. package/dist/layouts/docs/client.d.ts +33 -0
  110. package/dist/layouts/docs/client.js +94 -0
  111. package/dist/layouts/docs/index.d.ts +32 -0
  112. package/dist/layouts/docs/index.js +23 -0
  113. package/dist/layouts/docs/page/index.d.ts +76 -0
  114. package/dist/layouts/docs/page/index.js +124 -0
  115. package/dist/layouts/docs/page/slots/breadcrumb.d.ts +7 -0
  116. package/dist/layouts/docs/page/slots/breadcrumb.js +44 -0
  117. package/dist/layouts/docs/page/slots/container.d.ts +5 -0
  118. package/dist/layouts/docs/page/slots/container.js +22 -0
  119. package/dist/layouts/docs/page/slots/footer.d.ts +16 -0
  120. package/dist/layouts/docs/page/slots/footer.js +56 -0
  121. package/dist/layouts/docs/page/slots/toc.d.ts +47 -0
  122. package/dist/layouts/docs/page/slots/toc.js +182 -0
  123. package/dist/layouts/docs/slots/container.d.ts +5 -0
  124. package/dist/layouts/docs/slots/container.js +36 -0
  125. package/dist/layouts/docs/slots/header.d.ts +5 -0
  126. package/dist/layouts/docs/slots/header.js +38 -0
  127. package/dist/layouts/docs/slots/sidebar.d.ts +22 -0
  128. package/dist/layouts/docs/slots/sidebar.js +268 -0
  129. package/dist/layouts/flux/index.d.ts +61 -0
  130. package/dist/layouts/flux/index.js +146 -0
  131. package/dist/layouts/flux/page/index.d.ts +67 -0
  132. package/dist/layouts/flux/page/index.js +104 -0
  133. package/dist/layouts/flux/page/slots/breadcrumb.d.ts +7 -0
  134. package/dist/layouts/flux/page/slots/breadcrumb.js +44 -0
  135. package/dist/layouts/flux/page/slots/container.d.ts +5 -0
  136. package/dist/layouts/flux/page/slots/container.js +22 -0
  137. package/dist/layouts/flux/page/slots/footer.d.ts +16 -0
  138. package/dist/layouts/flux/page/slots/footer.js +56 -0
  139. package/dist/layouts/flux/page/slots/toc.d.ts +29 -0
  140. package/dist/layouts/flux/page/slots/toc.js +181 -0
  141. package/dist/layouts/flux/slots/container.d.ts +5 -0
  142. package/dist/layouts/flux/slots/container.js +13 -0
  143. package/dist/layouts/flux/slots/sidebar.d.ts +16 -0
  144. package/dist/layouts/flux/slots/sidebar.js +243 -0
  145. package/dist/layouts/flux/slots/tab-dropdown.d.ts +10 -0
  146. package/dist/layouts/flux/slots/tab-dropdown.js +88 -0
  147. package/dist/layouts/glass/index.d.ts +39 -0
  148. package/dist/layouts/glass/index.js +70 -0
  149. package/dist/layouts/glass/layout-tabs.js +54 -0
  150. package/dist/layouts/glass/page/index.d.ts +31 -0
  151. package/dist/layouts/glass/page/index.js +92 -0
  152. package/dist/layouts/glass/page/slots/breadcrumb.d.ts +7 -0
  153. package/dist/layouts/glass/page/slots/breadcrumb.js +44 -0
  154. package/dist/layouts/glass/page/slots/footer.d.ts +16 -0
  155. package/dist/layouts/glass/page/slots/footer.js +56 -0
  156. package/dist/layouts/glass/page/slots/toc.d.ts +19 -0
  157. package/dist/layouts/glass/page/slots/toc.js +108 -0
  158. package/dist/layouts/glass/slots/header.d.ts +6 -0
  159. package/dist/layouts/glass/slots/header.js +68 -0
  160. package/dist/layouts/glass/slots/sidebar.d.ts +21 -0
  161. package/dist/layouts/glass/slots/sidebar.js +267 -0
  162. package/dist/layouts/home/index.d.ts +27 -0
  163. package/dist/layouts/home/index.js +40 -0
  164. package/dist/layouts/home/navbar.d.ts +9 -0
  165. package/dist/layouts/home/navbar.js +34 -0
  166. package/dist/layouts/home/not-found.d.ts +7 -0
  167. package/dist/layouts/home/not-found.js +41 -0
  168. package/dist/layouts/home/slots/container.d.ts +5 -0
  169. package/dist/layouts/home/slots/container.js +13 -0
  170. package/dist/layouts/home/slots/header.d.ts +8 -0
  171. package/dist/layouts/home/slots/header.js +239 -0
  172. package/dist/layouts/notebook/client.d.ts +35 -0
  173. package/dist/layouts/notebook/client.js +69 -0
  174. package/dist/layouts/notebook/index.d.ts +26 -0
  175. package/dist/layouts/notebook/index.js +23 -0
  176. package/dist/layouts/notebook/page/index.d.ts +76 -0
  177. package/dist/layouts/notebook/page/index.js +124 -0
  178. package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +7 -0
  179. package/dist/layouts/notebook/page/slots/breadcrumb.js +44 -0
  180. package/dist/layouts/notebook/page/slots/container.d.ts +5 -0
  181. package/dist/layouts/notebook/page/slots/container.js +22 -0
  182. package/dist/layouts/notebook/page/slots/footer.d.ts +16 -0
  183. package/dist/layouts/notebook/page/slots/footer.js +56 -0
  184. package/dist/layouts/notebook/page/slots/toc.d.ts +47 -0
  185. package/dist/layouts/notebook/page/slots/toc.js +181 -0
  186. package/dist/layouts/notebook/slots/container.d.ts +5 -0
  187. package/dist/layouts/notebook/slots/container.js +38 -0
  188. package/dist/layouts/notebook/slots/header.d.ts +5 -0
  189. package/dist/layouts/notebook/slots/header.js +204 -0
  190. package/dist/layouts/notebook/slots/sidebar.d.ts +23 -0
  191. package/dist/layouts/notebook/slots/sidebar.js +240 -0
  192. package/dist/layouts/shared/client.d.ts +37 -0
  193. package/dist/layouts/shared/client.js +85 -0
  194. package/dist/layouts/shared/index.d.ts +169 -0
  195. package/dist/layouts/shared/index.js +98 -0
  196. package/dist/layouts/shared/page-actions.d.ts +27 -0
  197. package/dist/layouts/shared/page-actions.js +199 -0
  198. package/dist/layouts/shared/slots/language-select.d.ts +12 -0
  199. package/dist/layouts/shared/slots/language-select.js +43 -0
  200. package/dist/layouts/shared/slots/search-trigger.d.ts +13 -0
  201. package/dist/layouts/shared/slots/search-trigger.js +53 -0
  202. package/dist/layouts/shared/slots/theme-switch.d.ts +8 -0
  203. package/dist/layouts/shared/slots/theme-switch.js +70 -0
  204. package/dist/legacy/layout.d.ts +29 -0
  205. package/dist/legacy/layout.js +44 -0
  206. package/dist/legacy/sidebar.d.ts +14 -0
  207. package/dist/legacy/sidebar.js +34 -0
  208. package/dist/mdx.d.ts +44 -0
  209. package/dist/mdx.js +70 -0
  210. package/dist/mdx.server.d.ts +14 -0
  211. package/dist/mdx.server.js +20 -0
  212. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/controlled.d.ts +30 -0
  213. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/controlled.js +461 -0
  214. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/index.d.ts +3 -0
  215. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/uncontrolled.d.ts +6 -0
  216. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/uncontrolled.js +17 -0
  217. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/adjust-svg-ids.js +53 -0
  218. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/compute-positioned-style.js +25 -0
  219. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/element-tests.js +12 -0
  220. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-div-img-style.js +45 -0
  221. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-alt.js +10 -0
  222. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-object-fit-style.js +57 -0
  223. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-regular-style.js +21 -0
  224. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-src.js +14 -0
  225. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-modal-img-transform.js +22 -0
  226. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-scale.js +27 -0
  227. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-style-ghost.js +31 -0
  228. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-style-modal-img.js +75 -0
  229. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-target-dimension.js +4 -0
  230. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/parse-position.js +7 -0
  231. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/test-has-scalable-src.js +5 -0
  232. package/dist/og/takumi.d.ts +15 -0
  233. package/dist/og/takumi.js +91 -0
  234. package/dist/og.d.ts +16 -0
  235. package/dist/og.js +91 -0
  236. package/dist/page.d.ts +29 -0
  237. package/dist/page.js +33 -0
  238. package/dist/provider/astro.d.ts +29 -0
  239. package/dist/provider/astro.js +20 -0
  240. package/dist/provider/base.d.ts +48 -0
  241. package/dist/provider/base.js +73 -0
  242. package/dist/provider/next.d.ts +16 -0
  243. package/dist/provider/next.js +17 -0
  244. package/dist/provider/react-router.d.ts +16 -0
  245. package/dist/provider/react-router.js +17 -0
  246. package/dist/provider/tanstack.d.ts +16 -0
  247. package/dist/provider/tanstack.js +17 -0
  248. package/dist/provider/waku.d.ts +16 -0
  249. package/dist/provider/waku.js +17 -0
  250. package/dist/style.css +3640 -0
  251. package/dist/tailwind/typography.d.ts +2 -0
  252. package/dist/tailwind/typography.js +2 -0
  253. package/dist/utils/cn.js +2 -0
  254. package/dist/utils/merge-refs.js +11 -0
  255. package/dist/utils/urls.js +15 -0
  256. package/dist/utils/use-copy-button.d.ts +5 -0
  257. package/dist/utils/use-copy-button.js +26 -0
  258. package/dist/utils/use-footer-items.d.ts +8 -0
  259. package/dist/utils/use-footer-items.js +24 -0
  260. package/dist/utils/use-is-scroll-top.d.ts +6 -0
  261. package/dist/utils/use-is-scroll-top.js +20 -0
  262. package/package.json +212 -0
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { cn } from "../utils/cn.js";
3
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { FileIcon, FolderIcon, FolderOpen } from "lucide-react";
6
+ import { cva } from "class-variance-authority";
7
+ import { useState } from "react";
8
+ //#region src/components/files.tsx
9
+ const itemVariants = cva("flex flex-row items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-fd-accent hover:text-fd-accent-foreground [&_svg]:size-4");
10
+ function Files({ className, ...props }) {
11
+ return /* @__PURE__ */ jsx("div", {
12
+ className: cn("not-prose rounded-md border bg-fd-card p-2", className),
13
+ ...props,
14
+ children: props.children
15
+ });
16
+ }
17
+ function File({ name, icon = /* @__PURE__ */ jsx(FileIcon, {}), className, ...rest }) {
18
+ return /* @__PURE__ */ jsxs("div", {
19
+ className: cn(itemVariants({ className })),
20
+ ...rest,
21
+ children: [icon, name]
22
+ });
23
+ }
24
+ function Folder({ name, defaultOpen = false, ...props }) {
25
+ const [open, setOpen] = useState(defaultOpen);
26
+ return /* @__PURE__ */ jsxs(Collapsible, {
27
+ open,
28
+ onOpenChange: setOpen,
29
+ ...props,
30
+ children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
31
+ className: cn(itemVariants({ className: "w-full" })),
32
+ children: [open ? /* @__PURE__ */ jsx(FolderOpen, {}) : /* @__PURE__ */ jsx(FolderIcon, {}), name]
33
+ }), /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", {
34
+ className: "ms-2 flex flex-col border-l ps-2",
35
+ children: props.children
36
+ }) })]
37
+ });
38
+ }
39
+ //#endregion
40
+ export { File, Files, Folder };
@@ -0,0 +1,20 @@
1
+ import { ComponentProps } from "react";
2
+ //#region src/components/github-info.d.ts
3
+ interface FetchRepositoryInfoOptions {
4
+ owner: string;
5
+ repo: string;
6
+ baseUrl?: string;
7
+ token?: string;
8
+ fetchOptions?: RequestInit;
9
+ }
10
+ interface RepositoryInfo {
11
+ stars: number;
12
+ forks: number;
13
+ }
14
+ interface GithubInfoProps extends ComponentProps<'a'>, FetchRepositoryInfoOptions {
15
+ locale?: Intl.LocalesArgument;
16
+ }
17
+ declare function fetchRepositoryInfo({ owner, repo, token, baseUrl, fetchOptions }: FetchRepositoryInfoOptions): Promise<RepositoryInfo>;
18
+ declare function GithubInfo({ repo, owner, token, baseUrl, fetchOptions, locale, ...props }: GithubInfoProps): import("react").JSX.Element;
19
+ //#endregion
20
+ export { FetchRepositoryInfoOptions, GithubInfo, GithubInfoProps, RepositoryInfo, fetchRepositoryInfo };
@@ -0,0 +1,75 @@
1
+ import { cn } from "../utils/cn.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { GitFork, Star } from "lucide-react";
4
+ import { use } from "react";
5
+ //#region src/components/github-info.tsx
6
+ async function fetchRepositoryInfo({ owner, repo, token, baseUrl = "https://api.github.com", fetchOptions = { next: { revalidate: 60 } } }) {
7
+ const endpoint = `${baseUrl}/repos/${owner}/${repo}`;
8
+ const headers = new Headers(fetchOptions.headers);
9
+ headers.set("Content-Type", "application/json");
10
+ if (token) headers.set("Authorization", `Bearer ${token}`);
11
+ const response = await fetch(endpoint, {
12
+ ...fetchOptions,
13
+ headers
14
+ });
15
+ if (!response.ok) {
16
+ const message = await response.text();
17
+ throw new Error(`Failed to fetch repository data: ${message}`);
18
+ }
19
+ const data = await response.json();
20
+ return {
21
+ stars: data.stargazers_count,
22
+ forks: data.forks_count
23
+ };
24
+ }
25
+ /**
26
+ * Uses compact notation (e.g., 1.5K, 2.3M).
27
+ */
28
+ const formatterOptions = {
29
+ notation: "compact",
30
+ maximumFractionDigits: 1
31
+ };
32
+ const defaultFormatter = new Intl.NumberFormat(void 0, formatterOptions);
33
+ const promises = {};
34
+ function GithubInfo({ repo, owner, token, baseUrl, fetchOptions, locale, ...props }) {
35
+ const options = {
36
+ repo,
37
+ owner,
38
+ token,
39
+ baseUrl,
40
+ fetchOptions
41
+ };
42
+ const { stars, forks } = use(promises[JSON.stringify(options)] ??= fetchRepositoryInfo(options));
43
+ const formatter = locale ? new Intl.NumberFormat(locale, formatterOptions) : defaultFormatter;
44
+ return /* @__PURE__ */ jsxs("a", {
45
+ href: `https://github.com/${owner}/${repo}`,
46
+ rel: "noreferrer noopener",
47
+ target: "_blank",
48
+ ...props,
49
+ className: cn("flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors hover:text-fd-accent-foreground hover:bg-fd-accent", props.className),
50
+ children: [/* @__PURE__ */ jsxs("p", {
51
+ className: "flex items-center gap-2 truncate",
52
+ children: [
53
+ /* @__PURE__ */ jsxs("svg", {
54
+ fill: "currentColor",
55
+ viewBox: "0 0 24 24",
56
+ className: "size-3.5",
57
+ children: [/* @__PURE__ */ jsx("title", { children: "GitHub" }), /* @__PURE__ */ jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })]
58
+ }),
59
+ owner,
60
+ "/",
61
+ repo
62
+ ]
63
+ }), /* @__PURE__ */ jsxs("div", {
64
+ className: "flex text-xs items-center gap-1 text-fd-muted-foreground",
65
+ children: [
66
+ /* @__PURE__ */ jsx(Star, { className: "size-3" }),
67
+ /* @__PURE__ */ jsx("span", { children: formatter.format(stars) }),
68
+ /* @__PURE__ */ jsx(GitFork, { className: "size-3 ms-2" }),
69
+ /* @__PURE__ */ jsx("span", { children: formatter.format(forks) })
70
+ ]
71
+ })]
72
+ });
73
+ }
74
+ //#endregion
75
+ export { GithubInfo, fetchRepositoryInfo };
@@ -0,0 +1,9 @@
1
+ import { ComponentPropsWithoutRef } from "react";
2
+ //#region src/components/heading.d.ts
3
+ type Types = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
4
+ type HeadingProps<T extends Types> = Omit<ComponentPropsWithoutRef<T>, 'as'> & {
5
+ as?: T;
6
+ };
7
+ declare function Heading<T extends Types = 'h1'>({ as, ...props }: HeadingProps<T>): import("react").JSX.Element;
8
+ //#endregion
9
+ export { Heading };
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { cn } from "../utils/cn.js";
3
+ import { buttonVariants } from "./ui/button.js";
4
+ import { useCopyButton } from "../utils/use-copy-button.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { CopyCheckIcon, LinkIcon } from "lucide-react";
7
+ import { useTranslations } from "@fuma-translate/react";
8
+ //#region src/components/heading.tsx
9
+ function Heading({ as, ...props }) {
10
+ const As = as ?? "h1";
11
+ const t = useTranslations({ note: "heading anchor" });
12
+ const [isChecked, onCopy] = useCopyButton(() => {
13
+ if (!props.id) return;
14
+ const url = new URL(window.location.href);
15
+ url.hash = props.id;
16
+ return navigator.clipboard.writeText(url.href);
17
+ });
18
+ if (!props.id) return /* @__PURE__ */ jsx(As, { ...props });
19
+ return /* @__PURE__ */ jsxs(As, {
20
+ ...props,
21
+ className: cn("group/heading flex scroll-m-28 flex-row items-center gap-1", props.className),
22
+ children: [/* @__PURE__ */ jsx("a", {
23
+ "data-card": "",
24
+ href: `#${props.id}`,
25
+ children: props.children
26
+ }), /* @__PURE__ */ jsx("button", {
27
+ "aria-label": t("Copy Anchor Link", { note: "aria-label" }),
28
+ className: cn(buttonVariants({
29
+ variant: "ghost",
30
+ size: "icon-xs"
31
+ }), "not-prose shrink-0 text-fd-muted-foreground opacity-0 transition-opacity group-hover/heading:opacity-100"),
32
+ onClick: onCopy,
33
+ children: isChecked ? /* @__PURE__ */ jsx(CopyCheckIcon, {}) : /* @__PURE__ */ jsx(LinkIcon, {})
34
+ })]
35
+ });
36
+ }
37
+ //#endregion
38
+ export { Heading };
@@ -0,0 +1,18 @@
1
+ import { UncontrolledProps } from "../node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/uncontrolled.js";
2
+ import "../node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/index.js";
3
+ import { ImageProps } from "@vx-oss/docs-core/framework";
4
+ import { ComponentProps } from "react";
5
+ //#region src/components/image-zoom.d.ts
6
+ type ImageZoomProps = ImageProps & {
7
+ /**
8
+ * Image props when zoom in
9
+ */
10
+ zoomInProps?: ComponentProps<'img'>;
11
+ /**
12
+ * Props for `react-medium-image-zoom`
13
+ */
14
+ rmiz?: UncontrolledProps;
15
+ };
16
+ declare function ImageZoom({ zoomInProps, children, rmiz, ...props }: ImageZoomProps): import("react").JSX.Element;
17
+ //#endregion
18
+ export { ImageZoom, ImageZoomProps };
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { Uncontrolled } from "../node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/uncontrolled.js";
3
+ import "./image-zoom2.css";
4
+ import { Image } from "@vx-oss/docs-core/framework";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/components/image-zoom.tsx
7
+ function getImageSrc(src) {
8
+ if (typeof src === "string") return src;
9
+ if (typeof src === "object") {
10
+ if ("default" in src) return src.default.src;
11
+ return src.src;
12
+ }
13
+ return "";
14
+ }
15
+ function ImageZoom({ zoomInProps, children, rmiz, ...props }) {
16
+ return /* @__PURE__ */ jsx(Uncontrolled, {
17
+ zoomMargin: 20,
18
+ wrapElement: "span",
19
+ ...rmiz,
20
+ zoomImg: {
21
+ src: getImageSrc(props.src),
22
+ sizes: void 0,
23
+ ...zoomInProps
24
+ },
25
+ children: children ?? /* @__PURE__ */ jsx(Image, {
26
+ sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px",
27
+ ...props
28
+ })
29
+ });
30
+ }
31
+ //#endregion
32
+ export { ImageZoom };
@@ -0,0 +1,71 @@
1
+ [data-rmiz] {
2
+ display: block;
3
+ position: relative;
4
+ }
5
+
6
+ [data-rmiz-ghost] {
7
+ pointer-events: none;
8
+ position: absolute;
9
+ }
10
+
11
+ [data-rmiz-btn-zoom], [data-rmiz-btn-unzoom] {
12
+ display: none;
13
+ }
14
+
15
+ [data-rmiz-content="found"] img {
16
+ cursor: zoom-in;
17
+ }
18
+
19
+ [data-rmiz-modal][open] {
20
+ background-color: #0000;
21
+ width: 100dvw;
22
+ max-width: none;
23
+ height: 100dvh;
24
+ max-height: none;
25
+ margin: 0;
26
+ padding: 0;
27
+ position: fixed;
28
+ overflow: hidden;
29
+ }
30
+
31
+ [data-rmiz-modal]:focus-visible {
32
+ outline: none;
33
+ }
34
+
35
+ [data-rmiz-modal-overlay] {
36
+ transition: background-color .3s;
37
+ position: absolute;
38
+ inset: 0;
39
+ }
40
+
41
+ [data-rmiz-modal-overlay="visible"] {
42
+ background-color: var(--color-fd-background);
43
+ }
44
+
45
+ [data-rmiz-modal-overlay="hidden"] {
46
+ background-color: #0000;
47
+ }
48
+
49
+ [data-rmiz-modal-content] {
50
+ width: 100%;
51
+ height: 100%;
52
+ position: relative;
53
+ }
54
+
55
+ [data-rmiz-modal]::backdrop {
56
+ display: none;
57
+ }
58
+
59
+ [data-rmiz-modal-img] {
60
+ cursor: zoom-out;
61
+ image-rendering: high-quality;
62
+ transform-origin: 0 0;
63
+ transition: transform .3s;
64
+ position: absolute;
65
+ }
66
+
67
+ @media (prefers-reduced-motion: reduce) {
68
+ [data-rmiz-modal-overlay], [data-rmiz-modal-img] {
69
+ transition-duration: .01ms !important;
70
+ }
71
+ }
@@ -0,0 +1,10 @@
1
+ import { Collapsible } from "./ui/collapsible.js";
2
+ import { ComponentProps } from "react";
3
+ import { TOCItemType } from "@vx-oss/docs-core/toc";
4
+ //#region src/components/inline-toc.d.ts
5
+ interface InlineTocProps extends ComponentProps<typeof Collapsible> {
6
+ items: TOCItemType[];
7
+ }
8
+ declare function InlineTOC({ items, ...props }: InlineTocProps): import("react").JSX.Element;
9
+ //#endregion
10
+ export { InlineTOC, InlineTocProps };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { cn } from "../utils/cn.js";
3
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { ChevronDown } from "lucide-react";
6
+ import { useTranslations } from "@fuma-translate/react";
7
+ //#region src/components/inline-toc.tsx
8
+ function InlineTOC({ items, ...props }) {
9
+ const t = useTranslations({ note: "inline table of contents" });
10
+ return /* @__PURE__ */ jsxs(Collapsible, {
11
+ ...props,
12
+ className: cn("not-prose rounded-lg border bg-fd-card text-fd-card-foreground", props.className),
13
+ children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
14
+ className: "group inline-flex w-full items-center justify-between px-4 py-2.5 font-medium",
15
+ children: [props.children ?? t("Table of Contents"), /* @__PURE__ */ jsx(ChevronDown, { className: "size-4 transition-transform duration-200 group-data-[state=open]:rotate-180" })]
16
+ }), /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", {
17
+ className: "flex flex-col p-4 pt-0 text-sm text-fd-muted-foreground",
18
+ children: items.map((item) => /* @__PURE__ */ jsx("a", {
19
+ href: item.url,
20
+ className: "border-s py-1.5 hover:text-fd-accent-foreground",
21
+ style: { paddingInlineStart: 12 * Math.max(item.depth - 1, 0) },
22
+ children: item.title
23
+ }, item.url))
24
+ }) })]
25
+ });
26
+ }
27
+ //#endregion
28
+ export { InlineTOC };
@@ -0,0 +1,85 @@
1
+ import { CollapsibleContentProps, CollapsibleTriggerProps } from "../ui/collapsible.js";
2
+ import { ScrollArea, ScrollViewport } from "../ui/scroll-area.js";
3
+ import { LinkProps } from "@vx-oss/docs-core/link";
4
+ import { ComponentProps, PointerEvent, ReactNode, RefObject } from "react";
5
+ declare namespace base_d_exports {
6
+ export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarProviderProps, SidebarSeparator, SidebarTrigger, SidebarViewport, useAutoScroll, useFolder, useFolderDepth, useSidebar };
7
+ }
8
+ interface SidebarContext {
9
+ open: boolean;
10
+ setOpen: React.Dispatch<React.SetStateAction<boolean>>;
11
+ collapsed: boolean;
12
+ setCollapsed: React.Dispatch<React.SetStateAction<boolean>>;
13
+ /**
14
+ * When set to false, don't close the sidebar when navigate to another page
15
+ */
16
+ closeOnRedirect: RefObject<boolean>;
17
+ defaultOpenLevel: number;
18
+ prefetch?: boolean;
19
+ mode: Mode;
20
+ }
21
+ interface SidebarProviderProps {
22
+ /**
23
+ * Open folders by default if their level is lower or equal to a specific level
24
+ * (Starting from 1)
25
+ *
26
+ * @defaultValue 0
27
+ */
28
+ defaultOpenLevel?: number;
29
+ /**
30
+ * Prefetch links, default behaviour depends on your React.js framework.
31
+ */
32
+ prefetch?: boolean;
33
+ children?: ReactNode;
34
+ }
35
+ type Mode = 'drawer' | 'full';
36
+ declare const SidebarContext: import("react").Context<SidebarContext | null>;
37
+ declare function SidebarProvider({ defaultOpenLevel, prefetch, children }: SidebarProviderProps): import("react").JSX.Element;
38
+ declare function useSidebar(): SidebarContext;
39
+ declare function useFolder(): {
40
+ open: boolean;
41
+ setOpen: React.Dispatch<React.SetStateAction<boolean>>;
42
+ depth: number;
43
+ collapsible: boolean;
44
+ } | null;
45
+ declare function useFolderDepth(): number;
46
+ declare function SidebarContent({ mode: allowedMode, children }: {
47
+ mode?: Mode | true;
48
+ children: (state: {
49
+ ref: RefObject<HTMLElement | null>;
50
+ collapsed: boolean;
51
+ hovered: boolean;
52
+ onPointerEnter: (event: PointerEvent) => void;
53
+ onPointerLeave: (event: PointerEvent) => void;
54
+ }) => ReactNode;
55
+ }): ReactNode;
56
+ declare function SidebarViewport({ area, viewport, children }: {
57
+ area?: ComponentProps<typeof ScrollArea>;
58
+ viewport?: ComponentProps<typeof ScrollViewport>;
59
+ children: ReactNode;
60
+ }): import("react").JSX.Element;
61
+ declare function SidebarDrawerOverlay(props: ComponentProps<'div'>): import("react").JSX.Element | undefined;
62
+ declare function SidebarDrawerContent({ className, children, ...props }: ComponentProps<'aside'>): import("react").JSX.Element | undefined;
63
+ declare function SidebarSeparator(props: ComponentProps<'p'>): import("react").JSX.Element;
64
+ declare function SidebarItem({ icon, active, children, ...props }: LinkProps & {
65
+ active?: boolean;
66
+ icon?: ReactNode;
67
+ }): import("react").JSX.Element;
68
+ declare function SidebarFolder({ defaultOpen: defaultOpenProp, collapsible, active, children, ...props }: ComponentProps<'div'> & {
69
+ active?: boolean;
70
+ defaultOpen?: boolean;
71
+ collapsible?: boolean;
72
+ }): import("react").JSX.Element;
73
+ declare function SidebarFolderTrigger({ children, ...props }: CollapsibleTriggerProps): import("react").JSX.Element;
74
+ declare function SidebarFolderLink({ children, active, ...props }: LinkProps & {
75
+ active?: boolean;
76
+ }): import("react").JSX.Element;
77
+ declare function SidebarFolderContent(props: CollapsibleContentProps): import("react").JSX.Element;
78
+ declare function SidebarTrigger({ children, ...props }: ComponentProps<'button'>): import("react").JSX.Element;
79
+ declare function SidebarCollapseTrigger(props: ComponentProps<'button'>): import("react").JSX.Element;
80
+ /**
81
+ * scroll to the element if `active` is true
82
+ */
83
+ declare function useAutoScroll(active: boolean, ref: RefObject<HTMLElement | null>): void;
84
+ //#endregion
85
+ export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarProviderProps, SidebarSeparator, SidebarTrigger, SidebarViewport, base_d_exports, useAutoScroll, useFolder, useFolderDepth, useSidebar };