@vx-oss/docs-react 1.0.4 → 1.0.5

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 (255) hide show
  1. package/README.md +3 -3
  2. package/css/generated/docs.css +1 -1
  3. package/css/generated/flux.css +1 -1
  4. package/css/generated/glass.css +1 -1
  5. package/css/generated/home.css +1 -1
  6. package/css/generated/notebook.css +1 -1
  7. package/css/generated/shared.css +1 -1
  8. package/css/lib/base.css +0 -127
  9. package/css/preset.css +1 -2
  10. package/css/style.css +1 -0
  11. package/dist/components/accordion.js +1 -68
  12. package/dist/components/banner.js +1 -85
  13. package/dist/components/callout.js +1 -60
  14. package/dist/components/card.js +1 -39
  15. package/dist/components/codeblock.js +1 -126
  16. package/dist/components/codeblock.rsc.js +1 -22
  17. package/dist/components/dialog/search-algolia.js +2 -64
  18. package/dist/components/dialog/search-default.js +2 -66
  19. package/dist/components/dialog/search-orama.js +2 -69
  20. package/dist/components/dialog/search.js +1 -351
  21. package/dist/components/dynamic-codeblock.core.js +1 -51
  22. package/dist/components/dynamic-codeblock.js +1 -17
  23. package/dist/components/files.js +1 -40
  24. package/dist/components/github-info.js +1 -75
  25. package/dist/components/heading.js +1 -38
  26. package/dist/components/image-zoom.js +1 -32
  27. package/dist/components/inline-toc.js +1 -28
  28. package/dist/components/sidebar/base.js +1 -277
  29. package/dist/components/sidebar/link-item.js +1 -37
  30. package/dist/components/sidebar/page-tree.js +1 -69
  31. package/dist/components/sidebar/tabs/dropdown.js +1 -83
  32. package/dist/components/sidebar/tabs/index.js +1 -46
  33. package/dist/components/steps.js +1 -16
  34. package/dist/components/tabs.js +1 -95
  35. package/dist/components/toc/clerk.js +1 -227
  36. package/dist/components/toc/default.js +1 -260
  37. package/dist/components/toc/index.js +1 -45
  38. package/dist/components/type-table.js +1 -117
  39. package/dist/components/ui/accordion.js +1 -42
  40. package/dist/components/ui/button.js +1 -20
  41. package/dist/components/ui/collapsible.js +1 -21
  42. package/dist/components/ui/popover.js +1 -20
  43. package/dist/components/ui/scroll-area.js +1 -34
  44. package/dist/components/ui/tabs.js +1 -102
  45. package/dist/contexts/i18n.js +1 -37
  46. package/dist/contexts/search.js +1 -68
  47. package/dist/contexts/tree.js +1 -91
  48. package/dist/i18n.js +1 -38
  49. package/dist/index.js +1 -0
  50. package/dist/layouts/docs/index.js +1 -23
  51. package/dist/layouts/docs/page/index.js +1 -124
  52. package/dist/layouts/docs/page/slots/breadcrumb.js +1 -44
  53. package/dist/layouts/docs/page/slots/container.js +1 -22
  54. package/dist/layouts/docs/page/slots/footer.js +1 -56
  55. package/dist/layouts/docs/page/slots/toc.js +1 -182
  56. package/dist/layouts/docs/slots/container.js +1 -36
  57. package/dist/layouts/docs/slots/header.js +1 -38
  58. package/dist/layouts/docs/slots/sidebar.js +1 -268
  59. package/dist/layouts/flux/index.js +1 -146
  60. package/dist/layouts/flux/page/index.js +1 -104
  61. package/dist/layouts/flux/page/slots/breadcrumb.js +1 -44
  62. package/dist/layouts/flux/page/slots/container.js +1 -22
  63. package/dist/layouts/flux/page/slots/footer.js +1 -56
  64. package/dist/layouts/flux/page/slots/toc.js +1 -181
  65. package/dist/layouts/flux/slots/container.js +1 -13
  66. package/dist/layouts/flux/slots/sidebar.js +1 -243
  67. package/dist/layouts/flux/slots/tab-dropdown.js +1 -88
  68. package/dist/layouts/glass/index.js +1 -70
  69. package/dist/layouts/glass/page/index.js +1 -92
  70. package/dist/layouts/glass/page/slots/breadcrumb.js +1 -44
  71. package/dist/layouts/glass/page/slots/footer.js +1 -56
  72. package/dist/layouts/glass/page/slots/toc.js +1 -108
  73. package/dist/layouts/glass/slots/header.js +1 -68
  74. package/dist/layouts/glass/slots/sidebar.js +1 -267
  75. package/dist/layouts/home/index.js +1 -40
  76. package/dist/layouts/home/navbar.js +1 -34
  77. package/dist/layouts/home/not-found.js +1 -41
  78. package/dist/layouts/home/slots/container.js +1 -13
  79. package/dist/layouts/home/slots/header.js +1 -239
  80. package/dist/layouts/notebook/index.js +1 -23
  81. package/dist/layouts/notebook/page/index.js +1 -124
  82. package/dist/layouts/notebook/page/slots/breadcrumb.js +1 -44
  83. package/dist/layouts/notebook/page/slots/container.js +1 -22
  84. package/dist/layouts/notebook/page/slots/footer.js +1 -56
  85. package/dist/layouts/notebook/page/slots/toc.js +1 -181
  86. package/dist/layouts/notebook/slots/container.js +1 -38
  87. package/dist/layouts/notebook/slots/header.js +1 -204
  88. package/dist/layouts/notebook/slots/sidebar.js +1 -240
  89. package/dist/layouts/shared/index.js +1 -98
  90. package/dist/layouts/shared/slots/language-select.js +1 -43
  91. package/dist/layouts/shared/slots/search-trigger.js +1 -53
  92. package/dist/layouts/shared/slots/theme-switch.js +1 -70
  93. package/dist/mdx.d.ts +2 -44
  94. package/dist/mdx.js +2 -70
  95. package/dist/mdx.server.js +2 -20
  96. package/dist/og/takumi.js +1 -91
  97. package/dist/og.js +1 -91
  98. package/dist/page.js +1 -33
  99. package/dist/primitives/accordion.js +1 -0
  100. package/dist/primitives/collapsible.js +1 -0
  101. package/dist/primitives/dialog.js +1 -0
  102. package/dist/primitives/direction-provider.js +1 -0
  103. package/dist/primitives/drawer.js +1 -0
  104. package/dist/primitives/navigation-menu.js +1 -0
  105. package/dist/primitives/popover.js +1 -0
  106. package/dist/primitives/scroll-area.js +1 -0
  107. package/dist/primitives/shared.js +1 -0
  108. package/dist/primitives/tabs.js +1 -0
  109. package/dist/provider/astro.js +1 -20
  110. package/dist/provider/base.js +1 -73
  111. package/dist/provider/next.js +1 -17
  112. package/dist/provider/react-router.js +1 -17
  113. package/dist/provider/tanstack.js +1 -17
  114. package/dist/provider/waku.js +1 -17
  115. package/dist/style.css +11577 -310
  116. package/dist/utils/use-copy-button.js +1 -26
  117. package/dist/utils/use-footer-items.js +1 -24
  118. package/dist/utils/use-is-scroll-top.js +1 -20
  119. package/package.json +28 -66
  120. package/css/preset-legacy.css +0 -43
  121. package/dist/.translations/index.d.ts +0 -55
  122. package/dist/.translations/keys.js +0 -55
  123. package/dist/_virtual/_rolldown/runtime.js +0 -13
  124. package/dist/components/accordion.d.ts +0 -10
  125. package/dist/components/banner.d.ts +0 -25
  126. package/dist/components/callout.d.ts +0 -21
  127. package/dist/components/card.d.ts +0 -13
  128. package/dist/components/codeblock.d.ts +0 -45
  129. package/dist/components/codeblock.rsc.d.ts +0 -15
  130. package/dist/components/dialog/search-algolia.d.ts +0 -27
  131. package/dist/components/dialog/search-default.d.ts +0 -29
  132. package/dist/components/dialog/search-orama.d.ts +0 -32
  133. package/dist/components/dialog/search.d.ts +0 -76
  134. package/dist/components/dynamic-codeblock.core.d.ts +0 -26
  135. package/dist/components/dynamic-codeblock.d.ts +0 -8
  136. package/dist/components/files.d.ts +0 -21
  137. package/dist/components/github-info.d.ts +0 -20
  138. package/dist/components/heading.d.ts +0 -9
  139. package/dist/components/image-zoom.d.ts +0 -18
  140. package/dist/components/inline-toc.d.ts +0 -10
  141. package/dist/components/sidebar/base.d.ts +0 -85
  142. package/dist/components/sidebar/link-item.d.ts +0 -12
  143. package/dist/components/sidebar/page-tree.d.ts +0 -20
  144. package/dist/components/sidebar/tabs/dropdown.d.ts +0 -15
  145. package/dist/components/sidebar/tabs/index.d.ts +0 -8
  146. package/dist/components/steps.d.ts +0 -10
  147. package/dist/components/tabs.d.ts +0 -33
  148. package/dist/components/toc/clerk.d.ts +0 -11
  149. package/dist/components/toc/default.d.ts +0 -13
  150. package/dist/components/toc/index.d.ts +0 -10
  151. package/dist/components/type-table.d.ts +0 -37
  152. package/dist/components/ui/accordion.d.ts +0 -10
  153. package/dist/components/ui/button.d.ts +0 -10
  154. package/dist/components/ui/collapsible.d.ts +0 -11
  155. package/dist/components/ui/navigation-menu.d.ts +0 -14
  156. package/dist/components/ui/navigation-menu.js +0 -41
  157. package/dist/components/ui/popover.d.ts +0 -9
  158. package/dist/components/ui/scroll-area.d.ts +0 -9
  159. package/dist/components/ui/tabs.d.ts +0 -23
  160. package/dist/contexts/i18n.d.ts +0 -34
  161. package/dist/contexts/search.d.ts +0 -64
  162. package/dist/contexts/tree.d.ts +0 -29
  163. package/dist/i18n.d.ts +0 -15
  164. package/dist/layouts/docs/client.d.ts +0 -33
  165. package/dist/layouts/docs/client.js +0 -94
  166. package/dist/layouts/docs/index.d.ts +0 -32
  167. package/dist/layouts/docs/page/index.d.ts +0 -76
  168. package/dist/layouts/docs/page/slots/breadcrumb.d.ts +0 -7
  169. package/dist/layouts/docs/page/slots/container.d.ts +0 -5
  170. package/dist/layouts/docs/page/slots/footer.d.ts +0 -16
  171. package/dist/layouts/docs/page/slots/toc.d.ts +0 -47
  172. package/dist/layouts/docs/slots/container.d.ts +0 -5
  173. package/dist/layouts/docs/slots/header.d.ts +0 -5
  174. package/dist/layouts/docs/slots/sidebar.d.ts +0 -22
  175. package/dist/layouts/flux/index.d.ts +0 -61
  176. package/dist/layouts/flux/page/index.d.ts +0 -67
  177. package/dist/layouts/flux/page/slots/breadcrumb.d.ts +0 -7
  178. package/dist/layouts/flux/page/slots/container.d.ts +0 -5
  179. package/dist/layouts/flux/page/slots/footer.d.ts +0 -16
  180. package/dist/layouts/flux/page/slots/toc.d.ts +0 -29
  181. package/dist/layouts/flux/slots/container.d.ts +0 -5
  182. package/dist/layouts/flux/slots/sidebar.d.ts +0 -16
  183. package/dist/layouts/flux/slots/tab-dropdown.d.ts +0 -10
  184. package/dist/layouts/glass/index.d.ts +0 -39
  185. package/dist/layouts/glass/layout-tabs.js +0 -54
  186. package/dist/layouts/glass/page/index.d.ts +0 -31
  187. package/dist/layouts/glass/page/slots/breadcrumb.d.ts +0 -7
  188. package/dist/layouts/glass/page/slots/footer.d.ts +0 -16
  189. package/dist/layouts/glass/page/slots/toc.d.ts +0 -19
  190. package/dist/layouts/glass/slots/header.d.ts +0 -6
  191. package/dist/layouts/glass/slots/sidebar.d.ts +0 -21
  192. package/dist/layouts/home/index.d.ts +0 -27
  193. package/dist/layouts/home/navbar.d.ts +0 -9
  194. package/dist/layouts/home/not-found.d.ts +0 -7
  195. package/dist/layouts/home/slots/container.d.ts +0 -5
  196. package/dist/layouts/home/slots/header.d.ts +0 -8
  197. package/dist/layouts/notebook/client.d.ts +0 -35
  198. package/dist/layouts/notebook/client.js +0 -69
  199. package/dist/layouts/notebook/index.d.ts +0 -26
  200. package/dist/layouts/notebook/page/index.d.ts +0 -76
  201. package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +0 -7
  202. package/dist/layouts/notebook/page/slots/container.d.ts +0 -5
  203. package/dist/layouts/notebook/page/slots/footer.d.ts +0 -16
  204. package/dist/layouts/notebook/page/slots/toc.d.ts +0 -47
  205. package/dist/layouts/notebook/slots/container.d.ts +0 -5
  206. package/dist/layouts/notebook/slots/header.d.ts +0 -5
  207. package/dist/layouts/notebook/slots/sidebar.d.ts +0 -23
  208. package/dist/layouts/shared/client.d.ts +0 -37
  209. package/dist/layouts/shared/client.js +0 -85
  210. package/dist/layouts/shared/index.d.ts +0 -169
  211. package/dist/layouts/shared/page-actions.d.ts +0 -27
  212. package/dist/layouts/shared/page-actions.js +0 -199
  213. package/dist/layouts/shared/slots/language-select.d.ts +0 -12
  214. package/dist/layouts/shared/slots/search-trigger.d.ts +0 -13
  215. package/dist/layouts/shared/slots/theme-switch.d.ts +0 -8
  216. package/dist/legacy/layout.d.ts +0 -29
  217. package/dist/legacy/layout.js +0 -44
  218. package/dist/legacy/sidebar.d.ts +0 -14
  219. package/dist/legacy/sidebar.js +0 -34
  220. package/dist/mdx.server.d.ts +0 -14
  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/controlled.d.ts +0 -30
  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/controlled.js +0 -461
  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/index.d.ts +0 -3
  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/uncontrolled.d.ts +0 -6
  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/uncontrolled.js +0 -17
  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/adjust-svg-ids.js +0 -53
  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/compute-positioned-style.js +0 -25
  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/element-tests.js +0 -12
  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-div-img-style.js +0 -45
  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/get-img-alt.js +0 -10
  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/get-img-object-fit-style.js +0 -57
  232. 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 +0 -21
  233. 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 +0 -14
  234. 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 +0 -22
  235. 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 +0 -27
  236. 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 +0 -31
  237. 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 +0 -75
  238. 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 +0 -4
  239. 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 +0 -7
  240. 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 +0 -5
  241. package/dist/og/takumi.d.ts +0 -15
  242. package/dist/og.d.ts +0 -16
  243. package/dist/page.d.ts +0 -29
  244. package/dist/provider/astro.d.ts +0 -29
  245. package/dist/provider/base.d.ts +0 -48
  246. package/dist/provider/next.d.ts +0 -16
  247. package/dist/provider/react-router.d.ts +0 -16
  248. package/dist/provider/tanstack.d.ts +0 -16
  249. package/dist/provider/waku.d.ts +0 -16
  250. package/dist/utils/cn.js +0 -2
  251. package/dist/utils/merge-refs.js +0 -11
  252. package/dist/utils/urls.js +0 -15
  253. package/dist/utils/use-copy-button.d.ts +0 -5
  254. package/dist/utils/use-footer-items.d.ts +0 -8
  255. package/dist/utils/use-is-scroll-top.d.ts +0 -6
@@ -1,243 +1 @@
1
- "use client";
2
- import { cn } from "../../../utils/cn.js";
3
- import { mergeRefs } from "../../../utils/merge-refs.js";
4
- import { SidebarFolder as SidebarFolder$1, SidebarFolderContent as SidebarFolderContent$1, SidebarFolderLink as SidebarFolderLink$1, SidebarFolderTrigger as SidebarFolderTrigger$1, SidebarItem as SidebarItem$1, SidebarProvider as SidebarProvider$1, SidebarSeparator as SidebarSeparator$1, SidebarViewport, base_exports, useFolder, useFolderDepth } from "../../../components/sidebar/base.js";
5
- import { createPageTreeRenderer } from "../../../components/sidebar/page-tree.js";
6
- import { createLinkItemRenderer } from "../../../components/sidebar/link-item.js";
7
- import { useFluxLayout } from "../index.js";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
- import { SidebarIcon, XIcon } from "lucide-react";
10
- import { cva } from "class-variance-authority";
11
- import { useEffect, useEffectEvent, useRef, useState } from "react";
12
- import { useTranslations } from "@fuma-translate/react";
13
- import { AnimatePresence, motion } from "motion/react";
14
- import { RemoveScroll } from "react-remove-scroll";
15
- //#region src/layouts/flux/slots/sidebar.tsx
16
- const MotionSidebarItem = motion.create(SidebarItem$1);
17
- const MotionSidebarFolderTrigger = motion.create(SidebarFolderTrigger$1);
18
- const MotionSidebarFolderLink = motion.create(SidebarFolderLink$1);
19
- const MotionSidebarFolderContent = motion.create(SidebarFolderContent$1);
20
- const itemVariants = cva("relative flex flex-row items-center gap-2 rounded-lg p-2 text-start text-fd-muted-foreground wrap-anywhere [&_svg]:size-4 [&_svg]:shrink-0", { variants: {
21
- variant: {
22
- link: "transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none data-[active=true]:bg-fd-primary/10 data-[active=true]:text-fd-primary data-[active=true]:hover:transition-colors",
23
- button: "transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none"
24
- },
25
- highlight: { true: "data-[active=true]:before:content-[''] data-[active=true]:before:bg-fd-primary data-[active=true]:before:absolute data-[active=true]:before:w-px data-[active=true]:before:inset-y-2.5 data-[active=true]:before:start-2.5" }
26
- } });
27
- function getItemOffset(depth) {
28
- return `calc(${2 + 3 * depth} * var(--spacing))`;
29
- }
30
- const { useSidebar } = base_exports;
31
- function SidebarProvider(props) {
32
- return /* @__PURE__ */ jsx(SidebarProvider$1, { ...props });
33
- }
34
- function Sidebar({ footer, banner, components, ...rest }) {
35
- const { menuItems } = useFluxLayout();
36
- return /* @__PURE__ */ jsxs(SidebarContent, {
37
- ...rest,
38
- children: [
39
- /* @__PURE__ */ jsx("div", {
40
- className: "flex flex-col gap-3 p-4 pb-2 empty:hidden",
41
- children: banner
42
- }),
43
- /* @__PURE__ */ jsxs(SidebarViewport, {
44
- viewport: { className: "*:gap-0!" },
45
- children: [menuItems.filter((v) => v.type !== "icon").map((item, i, list) => /* @__PURE__ */ jsx(SidebarLinkItem, {
46
- item,
47
- className: cn(i === list.length - 1 && "mb-4")
48
- }, i)), /* @__PURE__ */ jsx(SidebarPageTree, { ...components })]
49
- }),
50
- footer
51
- ]
52
- });
53
- }
54
- function SidebarTrigger(props) {
55
- const { open, setOpen } = useSidebar();
56
- const t = useTranslations({ note: "sidebar" });
57
- return /* @__PURE__ */ jsx("button", {
58
- type: "button",
59
- "aria-label": open ? t("Close Sidebar", { note: "aria-label" }) : t("Open Sidebar", { note: "aria-label" }),
60
- "aria-expanded": open,
61
- "aria-controls": "nd-sidebar",
62
- onClick: () => setOpen((prev) => !prev),
63
- ...props,
64
- children: /* @__PURE__ */ jsx(AnimatePresence, {
65
- mode: "wait",
66
- children: /* @__PURE__ */ jsx(motion.span, {
67
- transition: { duration: .2 },
68
- initial: {
69
- y: "100%",
70
- opacity: 0
71
- },
72
- animate: {
73
- y: 0,
74
- opacity: 1
75
- },
76
- exit: {
77
- y: "100%",
78
- opacity: 0
79
- },
80
- children: open ? /* @__PURE__ */ jsx(XIcon, {}) : /* @__PURE__ */ jsx(SidebarIcon, {})
81
- }, open ? "open" : "closed")
82
- })
83
- });
84
- }
85
- function SidebarContent({ ref: refProp, className, children, ...props }) {
86
- const ref = useRef(null);
87
- const [blockScroll, setBlockScroll] = useState(false);
88
- const { open, setOpen } = useSidebar();
89
- const listener = useEffectEvent((e) => {
90
- if (open && e.key === "Escape") {
91
- setOpen(false);
92
- e.preventDefault();
93
- }
94
- });
95
- useEffect(() => {
96
- window.addEventListener("keydown", listener);
97
- return () => {
98
- window.removeEventListener("keydown", listener);
99
- };
100
- }, []);
101
- if (open && !blockScroll) setBlockScroll(true);
102
- return /* @__PURE__ */ jsx(RemoveScroll, {
103
- enabled: blockScroll,
104
- children: /* @__PURE__ */ jsx(motion.div, {
105
- className: cn("fixed inset-0 py-10 z-30 backdrop-blur-md bg-fd-background/60", !open && "pointer-events-none"),
106
- initial: "hide",
107
- variants: {
108
- show: { opacity: 1 },
109
- hide: { opacity: 0 }
110
- },
111
- animate: open ? "show" : "hide",
112
- exit: "hide",
113
- onClick: () => {
114
- setOpen(false);
115
- },
116
- onAnimationComplete: (definition) => {
117
- if (definition === "hide") setBlockScroll(false);
118
- },
119
- children: /* @__PURE__ */ jsx(motion.div, {
120
- className: "absolute top-0 min-h-0 inset-x-0 bottom-26 overflow-y-auto fd-scroll-container pr-(--removed-body-scroll-bar-size,0) py-16 mask-[linear-gradient(to_bottom,transparent,white_--spacing(14),white_calc(100%---spacing(14)),transparent)] lg:text-sm",
121
- variants: {
122
- show: {
123
- y: 0,
124
- opacity: 1
125
- },
126
- hide: {
127
- y: "80%",
128
- opacity: 0
129
- }
130
- },
131
- transition: {
132
- duration: .4,
133
- ease: [
134
- .16,
135
- 1,
136
- .3,
137
- 1
138
- ]
139
- },
140
- children: /* @__PURE__ */ jsx(motion.aside, {
141
- id: "nd-sidebar",
142
- ref: mergeRefs(ref, refProp),
143
- className: cn("mx-auto sm:max-w-[400px]", className),
144
- onClick: (e) => e.stopPropagation(),
145
- ...props,
146
- children
147
- })
148
- })
149
- })
150
- });
151
- }
152
- function SidebarFolder(props) {
153
- return /* @__PURE__ */ jsx(SidebarFolder$1, { ...props });
154
- }
155
- function SidebarSeparator({ className, style, children, ...props }) {
156
- const depth = useFolderDepth();
157
- return /* @__PURE__ */ jsx(SidebarSeparator$1, {
158
- className: cn("inline-flex items-center gap-2 mb-1.5 px-2 mt-6 empty:mb-0 [&_svg]:size-4 [&_svg]:shrink-0", depth === 0 && "first:mt-0", className),
159
- style: {
160
- paddingInlineStart: getItemOffset(depth),
161
- ...style
162
- },
163
- ...props,
164
- children
165
- });
166
- }
167
- function SidebarItem({ className, style, children, ...props }) {
168
- const depth = useFolderDepth();
169
- return /* @__PURE__ */ jsx(MotionSidebarItem, {
170
- className: cn(itemVariants({
171
- variant: "link",
172
- highlight: depth >= 1
173
- }), className),
174
- style: {
175
- paddingInlineStart: getItemOffset(depth),
176
- ...style
177
- },
178
- ...props,
179
- children
180
- });
181
- }
182
- function SidebarFolderTrigger({ className, style, ...props }) {
183
- const { depth, collapsible } = useFolder();
184
- return /* @__PURE__ */ jsx(MotionSidebarFolderTrigger, {
185
- className: cn(itemVariants({ variant: collapsible ? "button" : null }), "w-full", className),
186
- style: {
187
- paddingInlineStart: getItemOffset(depth - 1),
188
- ...style
189
- },
190
- ...props,
191
- children: props.children
192
- });
193
- }
194
- function SidebarFolderLink({ className, style, ...props }) {
195
- const depth = useFolderDepth();
196
- return /* @__PURE__ */ jsx(MotionSidebarFolderLink, {
197
- className: cn(itemVariants({
198
- variant: "link",
199
- highlight: depth > 1
200
- }), "w-full", className),
201
- style: {
202
- paddingInlineStart: getItemOffset(depth - 1),
203
- ...style
204
- },
205
- ...props,
206
- children: props.children
207
- });
208
- }
209
- function SidebarFolderContent({ className, children, ...props }) {
210
- const depth = useFolderDepth();
211
- const { open } = useFolder();
212
- return /* @__PURE__ */ jsx(MotionSidebarFolderContent, {
213
- className: cn("relative", depth === 1 && "before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:start-2.5", className),
214
- ...props,
215
- children: /* @__PURE__ */ jsx(motion.div, {
216
- initial: "hide",
217
- animate: open ? "show" : "hide",
218
- exit: "hide",
219
- variants: {
220
- show: { opacity: 1 },
221
- hide: { opacity: 0 }
222
- },
223
- children
224
- })
225
- });
226
- }
227
- const SidebarPageTree = createPageTreeRenderer({
228
- SidebarFolder,
229
- SidebarFolderContent,
230
- SidebarSeparator,
231
- SidebarFolderLink,
232
- SidebarFolderTrigger,
233
- SidebarItem
234
- });
235
- const SidebarLinkItem = createLinkItemRenderer({
236
- SidebarFolder,
237
- SidebarFolderContent,
238
- SidebarFolderLink,
239
- SidebarFolderTrigger,
240
- SidebarItem
241
- });
242
- //#endregion
243
- export { Sidebar, SidebarProvider, SidebarTrigger, useSidebar };
1
+ export * from '@vx-oss/docs-vezham-ui/layouts/flux/slots/sidebar';
@@ -1,88 +1 @@
1
- "use client";
2
- import { cn } from "../../../utils/cn.js";
3
- import { useTabsGroups } from "../../../contexts/tree.js";
4
- import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.js";
5
- import { isLayoutTabActive } from "../../shared/index.js";
6
- import Link from "@vx-oss/docs-core/link";
7
- import { usePathname } from "@vx-oss/docs-core/framework";
8
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
- import { Check, ChevronsUpDown } from "lucide-react";
10
- import { useMemo, useState } from "react";
11
- import { AnimatePresence, motion } from "motion/react";
12
- //#region src/layouts/flux/slots/tab-dropdown.tsx
13
- function TabDropdown({ tabs: allTabs, placeholder, className, ...props }) {
14
- const [open, setOpen] = useState(false);
15
- const pathname = usePathname();
16
- const tabs = useTabsGroups(allTabs).findLast((group) => typeof group.active?.root !== "string")?.options;
17
- const selectedIdx = useMemo(() => {
18
- return tabs?.findLastIndex((item) => isLayoutTabActive(item, pathname)) ?? -1;
19
- }, [tabs, pathname]);
20
- if (!tabs) return;
21
- const selected = selectedIdx !== -1 ? tabs[selectedIdx] : void 0;
22
- const onClick = () => {
23
- setOpen(false);
24
- };
25
- const item = selected ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
26
- className: "size-4.5 shrink-0 empty:hidden",
27
- children: selected.icon
28
- }), /* @__PURE__ */ jsx("p", {
29
- className: "font-medium",
30
- children: selected.title
31
- })] }) : placeholder;
32
- return /* @__PURE__ */ jsxs(Popover, {
33
- open,
34
- onOpenChange: setOpen,
35
- children: [item && /* @__PURE__ */ jsxs(PopoverTrigger, {
36
- className: cn("flex items-center gap-2 rounded-xl overflow-hidden p-1.5 border shadow-sm text-sm text-start transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground data-[state=open]:bg-fd-accent data-[state=open]:text-fd-accent-foreground", className),
37
- ...props,
38
- children: [/* @__PURE__ */ jsx(AnimatePresence, {
39
- mode: "popLayout",
40
- children: /* @__PURE__ */ jsx(motion.span, {
41
- className: "flex w-full min-w-0 overflow-hidden items-center text-nowrap gap-1.5",
42
- initial: {
43
- opacity: 0,
44
- y: "100%"
45
- },
46
- animate: {
47
- opacity: 1,
48
- y: 0
49
- },
50
- exit: {
51
- opacity: 0,
52
- y: "-100%"
53
- },
54
- children: item
55
- }, selectedIdx)
56
- }), /* @__PURE__ */ jsx(ChevronsUpDown, { className: "shrink-0 ms-auto size-4 text-fd-muted-foreground" })]
57
- }), /* @__PURE__ */ jsx(PopoverContent, {
58
- align: "start",
59
- className: "flex flex-col gap-1 max-w-svw p-1 fd-scroll-container",
60
- children: tabs.map((item, i) => {
61
- const isActive = i === selectedIdx;
62
- if (!isActive && item.unlisted) return;
63
- return /* @__PURE__ */ jsxs(Link, {
64
- href: item.url,
65
- onClick,
66
- ...item.props,
67
- className: cn("flex items-center gap-1.5 rounded-lg p-1.5 hover:bg-fd-accent hover:text-fd-accent-foreground", item.props?.className),
68
- children: [
69
- /* @__PURE__ */ jsx("div", {
70
- className: "shrink-0 mb-auto size-4.5 empty:hidden",
71
- children: item.icon
72
- }),
73
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
74
- className: "text-sm font-medium leading-none",
75
- children: item.title
76
- }), /* @__PURE__ */ jsx("p", {
77
- className: "text-[0.8125rem] text-fd-muted-foreground mt-1 empty:hidden",
78
- children: item.description
79
- })] }),
80
- /* @__PURE__ */ jsx(Check, { className: cn("shrink-0 ms-auto size-3.5 text-fd-primary", !isActive && "invisible") })
81
- ]
82
- }, item.url);
83
- })
84
- })]
85
- });
86
- }
87
- //#endregion
88
- export { TabDropdown };
1
+ export * from '@vx-oss/docs-vezham-ui/layouts/flux/slots/tab-dropdown';
@@ -1,70 +1 @@
1
- "use client";
2
- import { TreeContextProvider } from "../../contexts/tree.js";
3
- import { baseSlots } from "../shared/client.js";
4
- import { getLayoutTabs, useLinkItems } from "../shared/index.js";
5
- import { Sidebar, SidebarDrawer, SidebarProvider, useSidebar } from "./slots/sidebar.js";
6
- import { Header } from "./slots/header.js";
7
- import { jsx, jsxs } from "react/jsx-runtime";
8
- import { createContext, use, useMemo } from "react";
9
- //#region src/layouts/glass/index.tsx
10
- const LayoutContext = createContext(null);
11
- function useGlassLayout() {
12
- const context = use(LayoutContext);
13
- if (!context) throw new Error("Please use Glass layout components under <GlassLayout /> (`@vx-oss/docs-react/layouts/glass`).");
14
- return context;
15
- }
16
- const { useBaseSlots } = baseSlots({ useProps() {
17
- return useGlassLayout().props;
18
- } });
19
- function GlassLayout(props) {
20
- const { tree, tabs: defaultTabs, aiChat, children, slots: defaultSlots = {} } = props;
21
- const linkItems = useLinkItems(props);
22
- const { baseSlots, baseProps } = useBaseSlots(props);
23
- const tabs = useMemo(() => {
24
- if (Array.isArray(defaultTabs)) return defaultTabs;
25
- if (typeof defaultTabs === "object") return getLayoutTabs(tree, defaultTabs);
26
- if (defaultTabs !== false) return getLayoutTabs(tree);
27
- return [];
28
- }, [tree, defaultTabs]);
29
- const slots = {
30
- ...baseSlots,
31
- header: defaultSlots.header ?? Header,
32
- sidebar: defaultSlots.sidebar ?? {
33
- drawer: SidebarDrawer,
34
- main: Sidebar,
35
- provider: SidebarProvider,
36
- use: useSidebar
37
- }
38
- };
39
- const leftSpace = "calc(50% - var(--fd-main-width)/2 - var(--fd-left-width))";
40
- return /* @__PURE__ */ jsx(LayoutContext, {
41
- value: {
42
- props: {
43
- tabs,
44
- aiChat,
45
- ...baseProps
46
- },
47
- slots,
48
- ...linkItems
49
- },
50
- children: /* @__PURE__ */ jsx(slots.sidebar.provider, {
51
- ...props.sidebar,
52
- children: /* @__PURE__ */ jsx(TreeContextProvider, {
53
- tree,
54
- children: /* @__PURE__ */ jsxs("div", {
55
- id: "fd-glass-layout",
56
- className: "grid overflow-x-clip min-h-dvh [--fd-main-width:900px] [--fd-left-width:0px] [--fd-right-width:0px]",
57
- style: { gridTemplate: `"left left-margin main right-margin right" 1fr / var(--fd-left-width) ${leftSpace} 1fr calc(50% - var(--fd-main-width)/2 - var(--fd-right-width) + min(${leftSpace}, 0px)) var(--fd-right-width)` },
58
- children: [
59
- /* @__PURE__ */ jsx(slots.sidebar.drawer, {}),
60
- /* @__PURE__ */ jsx(slots.sidebar.main, {}),
61
- /* @__PURE__ */ jsx(slots.header, {}),
62
- children
63
- ]
64
- })
65
- })
66
- })
67
- });
68
- }
69
- //#endregion
70
- export { GlassLayout, useGlassLayout };
1
+ export * from '@vx-oss/docs-vezham-ui/layouts/glass';
@@ -1,92 +1 @@
1
- "use client";
2
- import { cn } from "../../../utils/cn.js";
3
- import { buttonVariants } from "../../../components/ui/button.js";
4
- import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.js";
5
- import { Footer } from "./slots/footer.js";
6
- import { Breadcrumb } from "./slots/breadcrumb.js";
7
- import { TOC, TOCProvider } from "./slots/toc.js";
8
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
- import { Edit } from "lucide-react";
10
- import { createContext, use, useEffect, useState } from "react";
11
- import { useTranslations } from "@fuma-translate/react";
12
- //#region src/layouts/glass/page/index.tsx
13
- const PageContext = createContext(null);
14
- function useDocsPage() {
15
- const context = use(PageContext);
16
- if (!context) throw new Error("Please use page components under <DocsPage /> (`@vx-oss/docs-react/layouts/glass/page`).");
17
- return context;
18
- }
19
- const Empty = [];
20
- function DocsPage({ full = false, toc = Empty, tableOfContent, children }) {
21
- return /* @__PURE__ */ jsx(PageContext, {
22
- value: { full },
23
- children: /* @__PURE__ */ jsxs(TOCProvider, {
24
- toc,
25
- children: [/* @__PURE__ */ jsxs("div", {
26
- "data-fd-full": full,
27
- className: cn("flex flex-col gap-2 p-6 pb-16 min-w-0 [grid-area:main] md:pt-16 md:pb-8", full && "layout:[--fd-main-width:1200px]"),
28
- children: [
29
- /* @__PURE__ */ jsx(Breadcrumb, {}),
30
- children,
31
- /* @__PURE__ */ jsx(Footer, {})
32
- ]
33
- }), /* @__PURE__ */ jsx(TOC, { ...tableOfContent })]
34
- })
35
- });
36
- }
37
- function EditOnGitHub(props) {
38
- const t = useTranslations({ note: "edit page" });
39
- return /* @__PURE__ */ jsx("a", {
40
- target: "_blank",
41
- rel: "noreferrer noopener",
42
- ...props,
43
- className: cn(buttonVariants({
44
- color: "secondary",
45
- size: "sm"
46
- }), "gap-1.5 not-prose", props.className),
47
- children: props.children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Edit, { className: "size-3.5" }), t("Edit on GitHub")] })
48
- });
49
- }
50
- /**
51
- * Add typography styles
52
- */
53
- function DocsBody({ children, className, ...props }) {
54
- return /* @__PURE__ */ jsx("div", {
55
- ...props,
56
- className: cn("prose flex-1", className),
57
- children
58
- });
59
- }
60
- function DocsDescription({ children, className, ...props }) {
61
- if (children === void 0) return null;
62
- return /* @__PURE__ */ jsx("p", {
63
- ...props,
64
- className: cn("mb-8 text-lg text-fd-muted-foreground", className),
65
- children
66
- });
67
- }
68
- function DocsTitle({ children, className, ...props }) {
69
- return /* @__PURE__ */ jsx("h1", {
70
- ...props,
71
- className: cn("text-[1.75em] font-semibold", className),
72
- children
73
- });
74
- }
75
- function PageLastUpdate({ date: value, ...props }) {
76
- const t = useTranslations({ note: "page footer" });
77
- const [date, setDate] = useState("");
78
- useEffect(() => {
79
- setDate(value.toLocaleDateString());
80
- }, [value]);
81
- return /* @__PURE__ */ jsxs("p", {
82
- ...props,
83
- className: cn("text-sm text-fd-muted-foreground", props.className),
84
- children: [
85
- t("Last updated on"),
86
- " ",
87
- date
88
- ]
89
- });
90
- }
91
- //#endregion
92
- export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, MarkdownCopyButton, PageLastUpdate, ViewOptionsPopover, useDocsPage };
1
+ export * from '@vx-oss/docs-vezham-ui/layouts/glass/page';
@@ -1,44 +1 @@
1
- "use client";
2
- import { cn } from "../../../../utils/cn.js";
3
- import { useTreeContext, useTreePath } from "../../../../contexts/tree.js";
4
- import Link from "@vx-oss/docs-core/link";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- import { ChevronRight } from "lucide-react";
7
- import { Fragment as Fragment$1, useMemo } from "react";
8
- import { getBreadcrumbItemsFromPath } from "@vx-oss/docs-core/breadcrumb";
9
- //#region src/layouts/glass/page/slots/breadcrumb.tsx
10
- function Breadcrumb({ includeRoot, includeSeparator, includePage, ...props }) {
11
- const path = useTreePath();
12
- const { root } = useTreeContext();
13
- const items = useMemo(() => {
14
- return getBreadcrumbItemsFromPath(root, path, {
15
- includePage,
16
- includeSeparator,
17
- includeRoot
18
- });
19
- }, [
20
- includePage,
21
- includeRoot,
22
- includeSeparator,
23
- path,
24
- root
25
- ]);
26
- if (items.length === 0) return null;
27
- return /* @__PURE__ */ jsx("div", {
28
- ...props,
29
- className: cn("flex items-center gap-1.5 text-sm text-fd-muted-foreground", props.className),
30
- children: items.map((item, i) => {
31
- const className = cn("truncate", i === items.length - 1 && "text-fd-primary font-medium");
32
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [i !== 0 && /* @__PURE__ */ jsx(ChevronRight, { className: "size-3.5 shrink-0" }), item.url ? /* @__PURE__ */ jsx(Link, {
33
- href: item.url,
34
- className: cn(className, "transition-opacity hover:opacity-80"),
35
- children: item.name
36
- }) : /* @__PURE__ */ jsx("span", {
37
- className,
38
- children: item.name
39
- })] }, i);
40
- })
41
- });
42
- }
43
- //#endregion
44
- export { Breadcrumb };
1
+ export * from '@vx-oss/docs-vezham-ui/layouts/glass/page/slots/breadcrumb';
@@ -1,56 +1 @@
1
- "use client";
2
- import { cn } from "../../../../utils/cn.js";
3
- import { isActive } from "../../../../utils/urls.js";
4
- import { useFooterItems } from "../../../../utils/use-footer-items.js";
5
- import Link from "@vx-oss/docs-core/link";
6
- import { usePathname } from "@vx-oss/docs-core/framework";
7
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- import { ChevronLeft, ChevronRight } from "lucide-react";
9
- import { useMemo } from "react";
10
- import { useTranslations } from "@fuma-translate/react";
11
- //#region src/layouts/glass/page/slots/footer.tsx
12
- function Footer({ items, children, className, ...props }) {
13
- const footerList = useFooterItems();
14
- const pathname = usePathname();
15
- const { previous, next } = useMemo(() => {
16
- if (items) return items;
17
- const idx = footerList.findIndex((item) => isActive(item.url, pathname));
18
- if (idx === -1) return {};
19
- return {
20
- previous: footerList[idx - 1],
21
- next: footerList[idx + 1]
22
- };
23
- }, [
24
- footerList,
25
- items,
26
- pathname
27
- ]);
28
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
29
- className: cn("@container grid gap-4", previous && next ? "grid-cols-2" : "grid-cols-1", className),
30
- ...props,
31
- children: [previous && /* @__PURE__ */ jsx(FooterItem, {
32
- item: previous,
33
- index: 0
34
- }), next && /* @__PURE__ */ jsx(FooterItem, {
35
- item: next,
36
- index: 1
37
- })]
38
- }), children] });
39
- }
40
- function FooterItem({ item, index }) {
41
- const t = useTranslations({ note: "pagination" });
42
- const Icon = index === 0 ? ChevronLeft : ChevronRight;
43
- return /* @__PURE__ */ jsxs(Link, {
44
- href: item.url,
45
- className: cn("flex flex-col gap-2 rounded-lg border p-4 text-sm transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground @max-lg:col-span-full", index === 1 && "text-end"),
46
- children: [/* @__PURE__ */ jsxs("div", {
47
- className: cn("inline-flex items-center gap-1.5 font-medium", index === 1 && "flex-row-reverse"),
48
- children: [/* @__PURE__ */ jsx(Icon, { className: "-mx-1 size-4 shrink-0 rtl:rotate-180" }), /* @__PURE__ */ jsx("p", { children: item.name })]
49
- }), /* @__PURE__ */ jsx("p", {
50
- className: "text-fd-muted-foreground truncate",
51
- children: item.description ?? (index === 0 ? t("Previous Page") : t("Next Page"))
52
- })]
53
- });
54
- }
55
- //#endregion
56
- export { Footer };
1
+ export * from '@vx-oss/docs-vezham-ui/layouts/glass/page/slots/footer';