@vx-oss/docs-react 1.0.3 → 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,239 +1 @@
1
- "use client";
2
- import { cn } from "../../../utils/cn.js";
3
- import { buttonVariants } from "../../../components/ui/button.js";
4
- import { LinkItem } from "../../shared/client.js";
5
- import "../../shared/index.js";
6
- import { useIsScrollTop } from "../../../utils/use-is-scroll-top.js";
7
- import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport } from "../../../components/ui/navigation-menu.js";
8
- import { useHomeLayout } from "../index.js";
9
- import Link from "@vx-oss/docs-core/link";
10
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- import { ChevronDown, Languages } from "lucide-react";
12
- import { cva } from "class-variance-authority";
13
- import { Fragment as Fragment$1, useState } from "react";
14
- import { useTranslations } from "@fuma-translate/react";
15
- //#region src/layouts/home/slots/header.tsx
16
- const navItemVariants = cva("[&_svg]:size-4", {
17
- variants: { variant: {
18
- main: "inline-flex items-center gap-1 p-2 text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground data-[active=true]:text-fd-primary",
19
- button: buttonVariants({
20
- color: "secondary",
21
- className: "gap-1.5"
22
- }),
23
- icon: buttonVariants({
24
- color: "ghost",
25
- size: "icon"
26
- })
27
- } },
28
- defaultVariants: { variant: "main" }
29
- });
30
- function Header(props) {
31
- const { navItems, menuItems, slots, props: { nav } } = useHomeLayout();
32
- const t = useTranslations({ note: "mobile menu" });
33
- if (nav?.component) return nav.component;
34
- return /* @__PURE__ */ jsxs(HeaderNavigationMenu, {
35
- transparentMode: nav?.transparentMode,
36
- ...props,
37
- children: [
38
- slots.navTitle && /* @__PURE__ */ jsx(slots.navTitle, { className: "inline-flex items-center gap-2.5 font-semibold" }),
39
- nav?.children,
40
- /* @__PURE__ */ jsx("ul", {
41
- className: "flex flex-row items-center gap-2 px-6 max-sm:hidden",
42
- children: navItems.filter((item) => !isSecondary(item)).map((item, i) => /* @__PURE__ */ jsx(NavigationMenuLinkItem, {
43
- item,
44
- className: "text-sm"
45
- }, i))
46
- }),
47
- /* @__PURE__ */ jsxs("div", {
48
- className: "flex flex-row items-center justify-end gap-1.5 flex-1 max-lg:hidden",
49
- children: [
50
- slots.searchTrigger && /* @__PURE__ */ jsx(slots.searchTrigger.full, {
51
- hideIfDisabled: true,
52
- className: "w-full rounded-full ps-2.5 max-w-[240px]"
53
- }),
54
- slots.themeSwitch && /* @__PURE__ */ jsx(slots.themeSwitch, {}),
55
- slots.languageSelect && /* @__PURE__ */ jsx(slots.languageSelect.root, { children: /* @__PURE__ */ jsx(Languages, { className: "size-5" }) }),
56
- /* @__PURE__ */ jsx("ul", {
57
- className: "flex flex-row gap-2 items-center empty:hidden",
58
- children: navItems.filter(isSecondary).map((item, i) => /* @__PURE__ */ jsx(NavigationMenuLinkItem, {
59
- className: cn(item.type === "icon" && "-mx-1 first:ms-0 last:me-0"),
60
- item
61
- }, i))
62
- })
63
- ]
64
- }),
65
- /* @__PURE__ */ jsxs("div", {
66
- className: "flex flex-row items-center ms-auto -me-1.5 lg:hidden",
67
- children: [slots.searchTrigger && /* @__PURE__ */ jsx(slots.searchTrigger.sm, {
68
- hideIfDisabled: true,
69
- className: "p-2"
70
- }), /* @__PURE__ */ jsx(NavigationMenuItem, {
71
- asChild: true,
72
- children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(NavigationMenuTrigger, {
73
- "aria-label": t("Toggle Menu", { note: "aria-label" }),
74
- className: cn(buttonVariants({
75
- size: "icon",
76
- color: "ghost",
77
- className: "group [&_svg]:size-5.5"
78
- })),
79
- onPointerMove: nav?.enableHoverToOpen ? void 0 : (e) => e.preventDefault(),
80
- children: /* @__PURE__ */ jsx(ChevronDown, { className: "transition-transform duration-300 group-data-[state=open]:rotate-180" })
81
- }), /* @__PURE__ */ jsxs(NavigationMenuContent, {
82
- className: "flex flex-col p-4 sm:flex-row sm:items-center sm:justify-end",
83
- children: [menuItems.filter((item) => !isSecondary(item)).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
84
- item,
85
- className: "sm:hidden"
86
- }, i)), /* @__PURE__ */ jsxs("div", {
87
- className: "-ms-1.5 flex flex-row items-center gap-2 max-sm:mt-2",
88
- children: [
89
- menuItems.filter(isSecondary).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
90
- item,
91
- className: cn(item.type === "icon" && "-mx-1 first:ms-0")
92
- }, i)),
93
- /* @__PURE__ */ jsx("div", {
94
- role: "separator",
95
- className: "flex-1"
96
- }),
97
- slots.languageSelect && /* @__PURE__ */ jsxs(slots.languageSelect.root, { children: [
98
- /* @__PURE__ */ jsx(Languages, { className: "size-5" }),
99
- slots.languageSelect.text && /* @__PURE__ */ jsx(slots.languageSelect.text, {}),
100
- /* @__PURE__ */ jsx(ChevronDown, { className: "size-3 text-fd-muted-foreground" })
101
- ] }),
102
- slots.themeSwitch && /* @__PURE__ */ jsx(slots.themeSwitch, {})
103
- ]
104
- })]
105
- })] })
106
- })]
107
- })
108
- ]
109
- });
110
- }
111
- function isSecondary(item) {
112
- if ("secondary" in item && item.secondary != null) return item.secondary;
113
- return item.type === "icon";
114
- }
115
- function HeaderNavigationMenu({ transparentMode = "none", ...props }) {
116
- const [value, setValue] = useState("");
117
- const isTop = useIsScrollTop({ enabled: transparentMode === "top" }) ?? true;
118
- const isTransparent = transparentMode === "top" ? isTop : transparentMode === "always";
119
- return /* @__PURE__ */ jsx(NavigationMenu, {
120
- value,
121
- onValueChange: setValue,
122
- asChild: true,
123
- children: /* @__PURE__ */ jsx("header", {
124
- id: "nd-nav",
125
- ...props,
126
- className: cn("sticky h-14 top-0 z-40", props.className),
127
- children: /* @__PURE__ */ jsxs("div", {
128
- className: cn("backdrop-blur-lg border-b transition-colors *:mx-auto *:max-w-(--fd-layout-width)", value.length > 0 && "max-lg:shadow-lg max-lg:rounded-b-2xl", (!isTransparent || value.length > 0) && "bg-fd-background/80"),
129
- children: [/* @__PURE__ */ jsx(NavigationMenuList, {
130
- className: "flex h-14 w-full items-center px-4",
131
- asChild: true,
132
- children: /* @__PURE__ */ jsx("nav", { children: props.children })
133
- }), /* @__PURE__ */ jsx(NavigationMenuViewport, {})]
134
- })
135
- })
136
- });
137
- }
138
- function NavigationMenuLinkItem({ item, ...props }) {
139
- if (item.type === "custom") return item.children;
140
- if (item.type === "menu") {
141
- const children = item.items.map((child, j) => {
142
- if (child.type === "custom") return /* @__PURE__ */ jsx(Fragment$1, { children: child.children }, j);
143
- const { banner = child.icon ? /* @__PURE__ */ jsx("div", {
144
- className: "w-fit rounded-md border bg-fd-muted p-1 [&_svg]:size-4",
145
- children: child.icon
146
- }) : null, ...rest } = child.menu ?? {};
147
- return /* @__PURE__ */ jsx(NavigationMenuLink, {
148
- asChild: true,
149
- children: /* @__PURE__ */ jsx(Link, {
150
- href: child.url,
151
- external: child.external,
152
- ...rest,
153
- className: cn("flex flex-col gap-2 rounded-lg border bg-fd-card p-3 transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground", rest.className),
154
- children: rest.children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
155
- banner,
156
- /* @__PURE__ */ jsx("p", {
157
- className: "text-base font-medium",
158
- children: child.text
159
- }),
160
- /* @__PURE__ */ jsx("p", {
161
- className: "text-sm text-fd-muted-foreground empty:hidden",
162
- children: child.description
163
- })
164
- ] })
165
- })
166
- }, `${j}-${child.url}`);
167
- });
168
- return /* @__PURE__ */ jsxs(NavigationMenuItem, {
169
- ...props,
170
- children: [/* @__PURE__ */ jsx(NavigationMenuTrigger, {
171
- className: cn(navItemVariants(), "rounded-md"),
172
- children: item.url ? /* @__PURE__ */ jsx(Link, {
173
- href: item.url,
174
- external: item.external,
175
- children: item.text
176
- }) : item.text
177
- }), /* @__PURE__ */ jsx(NavigationMenuContent, {
178
- className: "grid grid-cols-1 gap-2 p-4 md:grid-cols-2 lg:grid-cols-3",
179
- children
180
- })]
181
- });
182
- }
183
- return /* @__PURE__ */ jsx(NavigationMenuItem, {
184
- ...props,
185
- children: /* @__PURE__ */ jsx(NavigationMenuLink, {
186
- asChild: true,
187
- children: /* @__PURE__ */ jsx(LinkItem, {
188
- item,
189
- "aria-label": item.type === "icon" ? item.label : void 0,
190
- className: cn(navItemVariants({ variant: item.type })),
191
- children: item.type === "icon" ? item.icon : item.text
192
- })
193
- })
194
- });
195
- }
196
- function MobileNavigationMenuLinkItem({ item, ...props }) {
197
- if (item.type === "custom") return /* @__PURE__ */ jsx("div", {
198
- className: cn("grid", props.className),
199
- children: item.children
200
- });
201
- if (item.type === "menu") {
202
- const header = /* @__PURE__ */ jsxs(Fragment, { children: [item.icon, item.text] });
203
- return /* @__PURE__ */ jsxs("div", {
204
- className: cn("mb-4 flex flex-col", props.className),
205
- children: [/* @__PURE__ */ jsx("p", {
206
- className: "mb-1 text-sm text-fd-muted-foreground",
207
- children: item.url ? /* @__PURE__ */ jsx(NavigationMenuLink, {
208
- asChild: true,
209
- children: /* @__PURE__ */ jsx(Link, {
210
- href: item.url,
211
- external: item.external,
212
- children: header
213
- })
214
- }) : header
215
- }), item.items.map((child, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, { item: child }, i))]
216
- });
217
- }
218
- return /* @__PURE__ */ jsx(NavigationMenuLink, {
219
- asChild: true,
220
- children: /* @__PURE__ */ jsxs(LinkItem, {
221
- item,
222
- className: cn({
223
- main: "inline-flex items-center gap-2 py-1.5 transition-colors hover:text-fd-popover-foreground/50 data-[active=true]:font-medium data-[active=true]:text-fd-primary [&_svg]:size-4",
224
- icon: buttonVariants({
225
- size: "icon",
226
- color: "ghost"
227
- }),
228
- button: buttonVariants({
229
- color: "secondary",
230
- className: "gap-1.5 [&_svg]:size-4"
231
- })
232
- }[item.type ?? "main"], props.className),
233
- "aria-label": item.type === "icon" ? item.label : void 0,
234
- children: [item.icon, item.type === "icon" ? void 0 : item.text]
235
- })
236
- });
237
- }
238
- //#endregion
239
- export { Header, navItemVariants };
1
+ export * from '@vx-oss/docs-vezham-ui/layouts/home/slots/header';
@@ -1,23 +1 @@
1
- import { getLayoutTabs } from "../shared/index.js";
2
- import { LayoutBody, useNotebookLayout } from "./client.js";
3
- import { jsx } from "react/jsx-runtime";
4
- import { useMemo } from "react";
5
- //#region src/layouts/notebook/index.tsx
6
- function DocsLayout({ tree, tabMode = "sidebar", sidebar: { tabs: defaultTabs, ...sidebarProps } = {}, children, tabs = defaultTabs, ...props }) {
7
- const resolvedTabs = useMemo(() => {
8
- if (Array.isArray(tabs)) return tabs;
9
- if (typeof tabs === "object") return getLayoutTabs(tree, tabs);
10
- if (tabs !== false) return getLayoutTabs(tree);
11
- return [];
12
- }, [tabs, tree]);
13
- return /* @__PURE__ */ jsx(LayoutBody, {
14
- tree,
15
- tabs: resolvedTabs,
16
- tabMode,
17
- sidebar: sidebarProps,
18
- ...props,
19
- children
20
- });
21
- }
22
- //#endregion
23
- export { DocsLayout, useNotebookLayout };
1
+ export * from '@vx-oss/docs-vezham-ui/layouts/notebook';
@@ -1,124 +1 @@
1
- "use client";
2
- import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
3
- import { cn } from "../../../utils/cn.js";
4
- import { buttonVariants } from "../../../components/ui/button.js";
5
- import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.js";
6
- import { TOC, TOCPopover, TOCProvider } from "./slots/toc.js";
7
- import { Footer } from "./slots/footer.js";
8
- import { Breadcrumb } from "./slots/breadcrumb.js";
9
- import { Container } from "./slots/container.js";
10
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- import { Edit } from "lucide-react";
12
- import { createContext, use, useEffect, useState } from "react";
13
- import { useTranslations } from "@fuma-translate/react";
14
- //#region src/layouts/notebook/page/index.tsx
15
- var page_exports = /* @__PURE__ */ __exportAll({
16
- DocsBody: () => DocsBody,
17
- DocsDescription: () => DocsDescription,
18
- DocsPage: () => DocsPage,
19
- DocsTitle: () => DocsTitle,
20
- EditOnGitHub: () => EditOnGitHub,
21
- MarkdownCopyButton: () => MarkdownCopyButton,
22
- PageBreadcrumb: () => Breadcrumb,
23
- PageFooter: () => Footer,
24
- PageLastUpdate: () => PageLastUpdate,
25
- ViewOptionsPopover: () => ViewOptionsPopover,
26
- useDocsPage: () => useDocsPage
27
- });
28
- const PageContext = createContext(null);
29
- function useDocsPage() {
30
- const context = use(PageContext);
31
- if (!context) throw new Error("Please use page components under <DocsPage /> (`@vx-oss/docs-react/layouts/notebook/page`).");
32
- return context;
33
- }
34
- function DocsPage({ full = false, tableOfContent: { enabled: tocEnabled = !full, single, ...tocProps } = {}, tableOfContentPopover: { enabled: tocPopoverEnabled, ...tocPopoverProps } = {}, breadcrumb: { enabled: breadcrumbEnabled = true, ...breadcrumb } = {}, footer: { enabled: footerEnabled = true, ...footer } = {}, toc = [], slots: defaultSlots = {}, children, ...containerProps }) {
35
- tocPopoverEnabled ??= Boolean(toc.length > 0 || tocPopoverProps.header || tocPopoverProps.footer);
36
- const slots = {
37
- breadcrumb: defaultSlots.breadcrumb ?? Breadcrumb,
38
- footer: defaultSlots.footer ?? Footer,
39
- toc: defaultSlots.toc ?? {
40
- provider: TOCProvider,
41
- main: TOC,
42
- popover: TOCPopover
43
- },
44
- container: defaultSlots.container ?? Container
45
- };
46
- return /* @__PURE__ */ jsx(PageContext, {
47
- value: {
48
- full,
49
- slots
50
- },
51
- children: /* @__PURE__ */ jsxs(slots.toc.provider, {
52
- single,
53
- toc: tocEnabled || tocPopoverEnabled ? toc : [],
54
- children: [
55
- tocPopoverEnabled && (tocPopoverProps.component ?? /* @__PURE__ */ jsx(slots.toc.popover, { ...tocPopoverProps })),
56
- /* @__PURE__ */ jsxs(slots.container, {
57
- ...containerProps,
58
- children: [
59
- breadcrumbEnabled && (breadcrumb.component ?? /* @__PURE__ */ jsx(slots.breadcrumb, { ...breadcrumb })),
60
- children,
61
- footerEnabled && (footer.component ?? /* @__PURE__ */ jsx(slots.footer, { ...footer }))
62
- ]
63
- }),
64
- tocEnabled && (tocProps.component ?? /* @__PURE__ */ jsx(slots.toc.main, { ...tocProps }))
65
- ]
66
- })
67
- });
68
- }
69
- function EditOnGitHub(props) {
70
- const t = useTranslations({ note: "edit page" });
71
- return /* @__PURE__ */ jsx("a", {
72
- target: "_blank",
73
- rel: "noreferrer noopener",
74
- ...props,
75
- className: cn(buttonVariants({
76
- color: "secondary",
77
- size: "sm"
78
- }), "gap-1.5 not-prose", props.className),
79
- children: props.children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Edit, { className: "size-3.5" }), t("Edit on GitHub")] })
80
- });
81
- }
82
- /**
83
- * Add typography styles
84
- */
85
- function DocsBody({ children, className, ...props }) {
86
- return /* @__PURE__ */ jsx("div", {
87
- ...props,
88
- className: cn("prose flex-1", className),
89
- children
90
- });
91
- }
92
- function DocsDescription({ children, className, ...props }) {
93
- if (children === void 0) return null;
94
- return /* @__PURE__ */ jsx("p", {
95
- ...props,
96
- className: cn("mb-8 text-lg text-fd-muted-foreground", className),
97
- children
98
- });
99
- }
100
- function DocsTitle({ children, className, ...props }) {
101
- return /* @__PURE__ */ jsx("h1", {
102
- ...props,
103
- className: cn("text-[1.75em] font-semibold", className),
104
- children
105
- });
106
- }
107
- function PageLastUpdate({ date: value, ...props }) {
108
- const t = useTranslations({ note: "page footer" });
109
- const [date, setDate] = useState("");
110
- useEffect(() => {
111
- setDate(value.toLocaleDateString());
112
- }, [value]);
113
- return /* @__PURE__ */ jsxs("p", {
114
- ...props,
115
- className: cn("text-sm text-fd-muted-foreground", props.className),
116
- children: [
117
- t("Last updated on"),
118
- " ",
119
- date
120
- ]
121
- });
122
- }
123
- //#endregion
124
- export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, MarkdownCopyButton, Breadcrumb as PageBreadcrumb, Footer as PageFooter, PageLastUpdate, ViewOptionsPopover, page_exports, useDocsPage };
1
+ export * from '@vx-oss/docs-vezham-ui/layouts/notebook/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/notebook/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/notebook/page/slots/breadcrumb';
@@ -1,22 +1 @@
1
- "use client";
2
- import { cn } from "../../../../utils/cn.js";
3
- import { useDocsPage } from "../index.js";
4
- import { jsx } from "react/jsx-runtime";
5
- //#region src/layouts/notebook/page/slots/container.tsx
6
- function Container(props) {
7
- const { full } = useDocsPage();
8
- return /* @__PURE__ */ jsx("main", {
9
- className: "grid [grid-area:main]",
10
- "data-layout-main": "",
11
- children: /* @__PURE__ */ jsx("article", {
12
- id: "nd-page",
13
- "data-layout-content": "",
14
- "data-full": full,
15
- ...props,
16
- className: cn("flex flex-col min-w-0 px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14 *:max-w-[900px]", full && "*:max-w-[1285px]", props.className),
17
- children: props.children
18
- })
19
- });
20
- }
21
- //#endregion
22
- export { Container };
1
+ export * from '@vx-oss/docs-vezham-ui/layouts/notebook/page/slots/container';
@@ -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/notebook/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/notebook/page/slots/footer';