@hanzo/docs-base-ui 16.5.0 → 16.7.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.
- package/README.md +3 -3
- package/css/aspen.css +39 -0
- package/css/black.css +39 -1
- package/css/catppuccin.css +49 -1
- package/css/dusk.css +47 -1
- package/css/emerald.css +39 -0
- package/css/generated/docs.css +490 -0
- package/css/generated/flux.css +429 -0
- package/css/generated/home.css +285 -0
- package/css/generated/notebook.css +526 -0
- package/css/generated/shared.css +1173 -0
- package/css/lib/base.css +214 -0
- package/css/lib/default-colors.css +51 -0
- package/css/lib/shiki.css +98 -0
- package/css/neutral.css +7 -1
- package/css/ocean.css +44 -1
- package/css/preset.css +9 -7
- package/css/purple.css +39 -1
- package/css/ruby.css +39 -0
- package/css/shadcn.css +36 -1
- package/css/solar.css +75 -1
- package/css/vitepress.css +65 -1
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/accordion.d.ts +2 -3
- package/dist/components/accordion.js +9 -13
- package/dist/components/banner.d.ts +3 -4
- package/dist/components/banner.js +5 -9
- package/dist/components/callout.d.ts +6 -7
- package/dist/components/callout.js +1 -4
- package/dist/components/card.d.ts +4 -5
- package/dist/components/card.js +2 -5
- package/dist/components/codeblock.d.ts +8 -9
- package/dist/components/codeblock.js +9 -13
- package/dist/components/codeblock.rsc.d.ts +21 -0
- package/dist/components/codeblock.rsc.js +22 -0
- package/dist/components/dialog/search-algolia.d.ts +7 -9
- package/dist/components/dialog/search-algolia.js +8 -12
- package/dist/components/dialog/search-default.d.ts +7 -9
- package/dist/components/dialog/search-default.js +8 -12
- package/dist/components/dialog/search-orama.d.ts +7 -9
- package/dist/components/dialog/search-orama.js +8 -12
- package/dist/components/dialog/search.d.ts +21 -21
- package/dist/components/dialog/search.js +137 -60
- package/dist/components/dynamic-codeblock.core.d.ts +35 -0
- package/dist/components/dynamic-codeblock.core.js +51 -0
- package/dist/components/dynamic-codeblock.d.ts +7 -29
- package/dist/components/dynamic-codeblock.js +11 -60
- package/dist/components/files.d.ts +1 -2
- package/dist/components/files.js +6 -10
- package/dist/components/github-info.d.ts +23 -10
- package/dist/components/github-info.js +34 -29
- package/dist/components/heading.d.ts +1 -2
- package/dist/components/heading.js +3 -6
- package/dist/components/image-zoom.d.ts +4 -5
- package/dist/components/image-zoom.js +2 -5
- package/dist/components/inline-toc.d.ts +3 -4
- package/dist/components/inline-toc.js +2 -6
- package/dist/components/sidebar/base.d.ts +29 -23
- package/dist/components/sidebar/base.js +16 -22
- package/dist/components/sidebar/link-item.d.ts +3 -4
- package/dist/components/sidebar/link-item.js +6 -3
- package/dist/components/sidebar/page-tree.d.ts +3 -4
- package/dist/components/sidebar/page-tree.js +56 -45
- package/dist/components/sidebar/tabs/dropdown.d.ts +6 -9
- package/dist/components/sidebar/tabs/dropdown.js +22 -29
- package/dist/components/sidebar/tabs/index.d.ts +3 -17
- package/dist/components/sidebar/tabs/index.js +0 -3
- package/dist/components/steps.d.ts +4 -5
- package/dist/components/steps.js +0 -3
- package/dist/components/tabs.d.ts +15 -11
- package/dist/components/tabs.js +15 -20
- package/dist/components/toc/clerk.d.ts +19 -1
- package/dist/components/toc/clerk.js +165 -10
- package/dist/components/toc/default.d.ts +19 -1
- package/dist/components/toc/default.js +45 -10
- package/dist/components/toc/index.d.ts +29 -1
- package/dist/components/toc/index.js +105 -10
- package/dist/components/type-table.d.ts +11 -6
- package/dist/components/type-table.js +28 -23
- package/dist/components/ui/accordion.d.ts +7 -8
- package/dist/components/ui/accordion.js +2 -6
- package/dist/components/ui/button.d.ts +1 -2
- package/dist/components/ui/button.js +0 -3
- package/dist/components/ui/collapsible.d.ts +6 -7
- package/dist/components/ui/collapsible.js +3 -7
- package/dist/components/ui/navigation-menu.d.ts +27 -13
- package/dist/components/ui/navigation-menu.js +53 -31
- package/dist/components/ui/popover.d.ts +11 -6
- package/dist/components/ui/popover.js +15 -19
- package/dist/components/ui/scroll-area.d.ts +17 -7
- package/dist/components/ui/scroll-area.js +27 -31
- package/dist/components/ui/tabs.d.ts +8 -9
- package/dist/components/ui/tabs.js +5 -9
- package/dist/contexts/i18n.d.ts +62 -1
- package/dist/contexts/i18n.js +53 -10
- package/dist/contexts/search.d.ts +71 -5
- package/dist/contexts/search.js +64 -10
- package/dist/contexts/tree.d.ts +21 -1
- package/dist/contexts/tree.js +36 -10
- package/dist/i18n.d.ts +21 -1
- package/dist/i18n.js +20 -3
- package/dist/layouts/docs/client.d.ts +30 -29
- package/dist/layouts/docs/client.js +76 -52
- package/dist/layouts/docs/index.d.ts +21 -35
- package/dist/layouts/docs/index.js +16 -172
- package/dist/layouts/docs/page/index.d.ts +75 -52
- package/dist/layouts/docs/page/index.js +76 -56
- package/dist/layouts/docs/page/slots/breadcrumb.d.ts +14 -0
- package/dist/layouts/docs/page/slots/breadcrumb.js +44 -0
- package/dist/layouts/docs/page/slots/container.d.ts +7 -0
- package/dist/layouts/docs/page/slots/container.js +17 -0
- package/dist/layouts/docs/page/slots/footer.d.ts +23 -0
- package/dist/layouts/docs/page/slots/footer.js +56 -0
- package/dist/layouts/docs/page/slots/toc.d.ts +55 -0
- package/dist/layouts/docs/page/slots/toc.js +166 -0
- package/dist/layouts/docs/slots/container.d.ts +7 -0
- package/dist/layouts/docs/slots/container.js +29 -0
- package/dist/layouts/docs/slots/header.d.ts +8 -0
- package/dist/layouts/docs/slots/header.js +38 -0
- package/dist/layouts/docs/slots/sidebar.d.ts +30 -0
- package/dist/layouts/docs/slots/sidebar.js +319 -0
- package/dist/layouts/flux/index.d.ts +74 -0
- package/dist/layouts/flux/index.js +146 -0
- package/dist/layouts/flux/page/index.d.ts +105 -0
- package/dist/layouts/flux/page/index.js +104 -0
- package/dist/layouts/flux/page/slots/breadcrumb.d.ts +14 -0
- package/dist/layouts/flux/page/slots/breadcrumb.js +44 -0
- package/dist/layouts/flux/page/slots/container.d.ts +7 -0
- package/dist/layouts/flux/page/slots/container.js +17 -0
- package/dist/layouts/flux/page/slots/footer.d.ts +23 -0
- package/dist/layouts/flux/page/slots/footer.js +56 -0
- package/dist/layouts/flux/page/slots/toc.d.ts +34 -0
- package/dist/layouts/flux/page/slots/toc.js +172 -0
- package/dist/layouts/flux/slots/container.d.ts +7 -0
- package/dist/layouts/flux/slots/container.js +13 -0
- package/dist/layouts/flux/slots/sidebar.d.ts +23 -0
- package/dist/layouts/flux/slots/sidebar.js +237 -0
- package/dist/layouts/flux/slots/tab-dropdown.d.ts +17 -0
- package/dist/layouts/flux/slots/tab-dropdown.js +85 -0
- package/dist/layouts/home/index.d.ts +25 -8
- package/dist/layouts/home/index.js +39 -19
- package/dist/layouts/home/navbar.d.ts +7 -16
- package/dist/layouts/home/navbar.js +12 -14
- package/dist/layouts/home/not-found.d.ts +9 -0
- package/dist/layouts/home/not-found.js +38 -0
- package/dist/layouts/home/slots/container.d.ts +7 -0
- package/dist/layouts/home/slots/container.js +13 -0
- package/dist/layouts/home/slots/header.d.ts +11 -0
- package/dist/layouts/home/slots/header.js +242 -0
- package/dist/layouts/notebook/client.d.ts +32 -44
- package/dist/layouts/notebook/client.js +58 -148
- package/dist/layouts/notebook/index.d.ts +26 -25
- package/dist/layouts/notebook/index.js +16 -213
- package/dist/layouts/notebook/page/index.d.ts +75 -52
- package/dist/layouts/notebook/page/index.js +76 -56
- package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +14 -0
- package/dist/layouts/notebook/page/slots/breadcrumb.js +44 -0
- package/dist/layouts/notebook/page/slots/container.d.ts +7 -0
- package/dist/layouts/notebook/page/slots/container.js +17 -0
- package/dist/layouts/notebook/page/slots/footer.d.ts +23 -0
- package/dist/layouts/notebook/page/slots/footer.js +56 -0
- package/dist/layouts/notebook/page/slots/toc.d.ts +55 -0
- package/dist/layouts/notebook/page/slots/toc.js +165 -0
- package/dist/layouts/notebook/slots/container.d.ts +7 -0
- package/dist/layouts/notebook/slots/container.js +31 -0
- package/dist/layouts/notebook/slots/header.d.ts +8 -0
- package/dist/layouts/notebook/slots/header.js +194 -0
- package/dist/layouts/notebook/slots/sidebar.d.ts +40 -0
- package/dist/layouts/notebook/slots/sidebar.js +297 -0
- package/dist/layouts/shared/client.d.ts +45 -0
- package/dist/layouts/shared/client.js +84 -0
- package/dist/layouts/shared/index.d.ts +144 -35
- package/dist/layouts/shared/index.js +74 -15
- package/dist/layouts/shared/page-actions.d.ts +36 -0
- package/dist/layouts/shared/page-actions.js +190 -0
- package/dist/layouts/shared/slots/language-select.d.ts +10 -0
- package/dist/layouts/shared/{language-toggle.js → slots/language-select.js} +12 -16
- package/dist/layouts/shared/slots/search-trigger.d.ts +23 -0
- package/dist/layouts/shared/{search-toggle.js → slots/search-trigger.js} +12 -16
- package/dist/layouts/shared/slots/theme-switch.d.ts +14 -0
- package/dist/layouts/shared/{theme-toggle.js → slots/theme-switch.js} +11 -15
- package/dist/mdx.d.ts +23 -13
- package/dist/mdx.js +2 -6
- package/dist/mdx.server.d.ts +1 -3
- package/dist/mdx.server.js +0 -3
- package/dist/og/takumi.d.ts +21 -0
- package/dist/og/takumi.js +70 -0
- package/dist/og.d.ts +22 -1
- package/dist/og.js +70 -3
- package/dist/page.d.ts +6 -7
- package/dist/page.js +9 -14
- package/dist/provider/base.d.ts +5 -6
- package/dist/provider/base.js +5 -9
- package/dist/provider/next.d.ts +4 -5
- package/dist/provider/next.js +1 -5
- package/dist/provider/react-router.d.ts +4 -5
- package/dist/provider/react-router.js +1 -5
- package/dist/provider/tanstack.d.ts +4 -5
- package/dist/provider/tanstack.js +1 -5
- package/dist/provider/waku.d.ts +4 -5
- package/dist/provider/waku.js +1 -5
- package/dist/style.css +594 -192
- package/dist/tailwind/typography.d.ts +2 -0
- package/dist/tailwind/typography.js +2 -0
- package/dist/utils/cn.js +2 -0
- package/dist/utils/merge-refs.js +11 -0
- package/dist/utils/urls.js +15 -0
- package/dist/utils/use-copy-button.d.ts +6 -1
- package/dist/utils/use-copy-button.js +26 -3
- package/dist/utils/use-footer-items.d.ts +9 -1
- package/dist/utils/use-footer-items.js +24 -3
- package/dist/utils/use-is-scroll-top.d.ts +8 -1
- package/dist/utils/use-is-scroll-top.js +20 -3
- package/package.json +133 -81
- package/css/layouts/docs.css +0 -1
- package/css/layouts/home.css +0 -1
- package/css/layouts/notebook.css +0 -1
- package/dist/_virtual/rolldown_runtime.js +0 -36
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/accordion.js.map +0 -1
- package/dist/components/banner.d.ts.map +0 -1
- package/dist/components/banner.js.map +0 -1
- package/dist/components/callout.d.ts.map +0 -1
- package/dist/components/callout.js.map +0 -1
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/card.js.map +0 -1
- package/dist/components/codeblock.d.ts.map +0 -1
- package/dist/components/codeblock.js.map +0 -1
- package/dist/components/dialog/search-algolia.d.ts.map +0 -1
- package/dist/components/dialog/search-algolia.js.map +0 -1
- package/dist/components/dialog/search-default.d.ts.map +0 -1
- package/dist/components/dialog/search-default.js.map +0 -1
- package/dist/components/dialog/search-orama.d.ts.map +0 -1
- package/dist/components/dialog/search-orama.js.map +0 -1
- package/dist/components/dialog/search.d.ts.map +0 -1
- package/dist/components/dialog/search.js.map +0 -1
- package/dist/components/dynamic-codeblock.d.ts.map +0 -1
- package/dist/components/dynamic-codeblock.js.map +0 -1
- package/dist/components/files.d.ts.map +0 -1
- package/dist/components/files.js.map +0 -1
- package/dist/components/github-info.d.ts.map +0 -1
- package/dist/components/github-info.js.map +0 -1
- package/dist/components/heading.d.ts.map +0 -1
- package/dist/components/heading.js.map +0 -1
- package/dist/components/image-zoom-CtfZieBH.css +0 -80
- package/dist/components/image-zoom-CtfZieBH.css.map +0 -1
- package/dist/components/image-zoom.d.ts.map +0 -1
- package/dist/components/image-zoom.js.map +0 -1
- package/dist/components/image-zoom2.js +0 -1
- package/dist/components/inline-toc.d.ts.map +0 -1
- package/dist/components/inline-toc.js.map +0 -1
- package/dist/components/sidebar/base.d.ts.map +0 -1
- package/dist/components/sidebar/base.js.map +0 -1
- package/dist/components/sidebar/link-item.d.ts.map +0 -1
- package/dist/components/sidebar/link-item.js.map +0 -1
- package/dist/components/sidebar/page-tree.d.ts.map +0 -1
- package/dist/components/sidebar/page-tree.js.map +0 -1
- package/dist/components/sidebar/tabs/dropdown.d.ts.map +0 -1
- package/dist/components/sidebar/tabs/dropdown.js.map +0 -1
- package/dist/components/sidebar/tabs/index.d.ts.map +0 -1
- package/dist/components/sidebar/tabs/index.js.map +0 -1
- package/dist/components/steps.d.ts.map +0 -1
- package/dist/components/steps.js.map +0 -1
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tabs.js.map +0 -1
- package/dist/components/toc/clerk.js.map +0 -1
- package/dist/components/toc/default.js.map +0 -1
- package/dist/components/toc/index.js.map +0 -1
- package/dist/components/type-table.d.ts.map +0 -1
- package/dist/components/type-table.js.map +0 -1
- package/dist/components/ui/accordion.d.ts.map +0 -1
- package/dist/components/ui/accordion.js.map +0 -1
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/button.js.map +0 -1
- package/dist/components/ui/collapsible.d.ts.map +0 -1
- package/dist/components/ui/collapsible.js.map +0 -1
- package/dist/components/ui/navigation-menu.d.ts.map +0 -1
- package/dist/components/ui/navigation-menu.js.map +0 -1
- package/dist/components/ui/popover.d.ts.map +0 -1
- package/dist/components/ui/popover.js.map +0 -1
- package/dist/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/components/ui/scroll-area.js.map +0 -1
- package/dist/components/ui/tabs.d.ts.map +0 -1
- package/dist/components/ui/tabs.js.map +0 -1
- package/dist/contexts/i18n.js.map +0 -1
- package/dist/contexts/search.d.ts.map +0 -1
- package/dist/contexts/search.js.map +0 -1
- package/dist/contexts/tree.js.map +0 -1
- package/dist/layouts/docs/client.d.ts.map +0 -1
- package/dist/layouts/docs/client.js.map +0 -1
- package/dist/layouts/docs/index.d.ts.map +0 -1
- package/dist/layouts/docs/index.js.map +0 -1
- package/dist/layouts/docs/page/client.d.ts +0 -46
- package/dist/layouts/docs/page/client.d.ts.map +0 -1
- package/dist/layouts/docs/page/client.js +0 -227
- package/dist/layouts/docs/page/client.js.map +0 -1
- package/dist/layouts/docs/page/index.d.ts.map +0 -1
- package/dist/layouts/docs/page/index.js.map +0 -1
- package/dist/layouts/docs/sidebar.d.ts +0 -63
- package/dist/layouts/docs/sidebar.d.ts.map +0 -1
- package/dist/layouts/docs/sidebar.js +0 -162
- package/dist/layouts/docs/sidebar.js.map +0 -1
- package/dist/layouts/home/client.d.ts +0 -19
- package/dist/layouts/home/client.d.ts.map +0 -1
- package/dist/layouts/home/client.js +0 -285
- package/dist/layouts/home/client.js.map +0 -1
- package/dist/layouts/home/index.d.ts.map +0 -1
- package/dist/layouts/home/index.js.map +0 -1
- package/dist/layouts/home/navbar.d.ts.map +0 -1
- package/dist/layouts/home/navbar.js.map +0 -1
- package/dist/layouts/notebook/client.d.ts.map +0 -1
- package/dist/layouts/notebook/client.js.map +0 -1
- package/dist/layouts/notebook/index.d.ts.map +0 -1
- package/dist/layouts/notebook/index.js.map +0 -1
- package/dist/layouts/notebook/page/client.d.ts +0 -46
- package/dist/layouts/notebook/page/client.d.ts.map +0 -1
- package/dist/layouts/notebook/page/client.js +0 -227
- package/dist/layouts/notebook/page/client.js.map +0 -1
- package/dist/layouts/notebook/page/index.d.ts.map +0 -1
- package/dist/layouts/notebook/page/index.js.map +0 -1
- package/dist/layouts/notebook/sidebar.d.ts +0 -59
- package/dist/layouts/notebook/sidebar.d.ts.map +0 -1
- package/dist/layouts/notebook/sidebar.js +0 -133
- package/dist/layouts/notebook/sidebar.js.map +0 -1
- package/dist/layouts/shared/index.d.ts.map +0 -1
- package/dist/layouts/shared/index.js.map +0 -1
- package/dist/layouts/shared/language-toggle.d.ts +0 -10
- package/dist/layouts/shared/language-toggle.d.ts.map +0 -1
- package/dist/layouts/shared/language-toggle.js.map +0 -1
- package/dist/layouts/shared/search-toggle.d.ts +0 -23
- package/dist/layouts/shared/search-toggle.d.ts.map +0 -1
- package/dist/layouts/shared/search-toggle.js.map +0 -1
- package/dist/layouts/shared/theme-toggle.d.ts +0 -14
- package/dist/layouts/shared/theme-toggle.d.ts.map +0 -1
- package/dist/layouts/shared/theme-toggle.js.map +0 -1
- package/dist/mdx.d.ts.map +0 -1
- package/dist/mdx.js.map +0 -1
- package/dist/mdx.server.d.ts.map +0 -1
- package/dist/mdx.server.js.map +0 -1
- package/dist/page.d.ts.map +0 -1
- package/dist/page.js.map +0 -1
- package/dist/provider/base.d.ts.map +0 -1
- package/dist/provider/base.js.map +0 -1
- package/dist/provider/next.d.ts.map +0 -1
- package/dist/provider/next.js.map +0 -1
- package/dist/provider/react-router.d.ts.map +0 -1
- package/dist/provider/react-router.js.map +0 -1
- package/dist/provider/tanstack.d.ts.map +0 -1
- package/dist/provider/tanstack.js.map +0 -1
- package/dist/provider/waku.d.ts.map +0 -1
- package/dist/provider/waku.js.map +0 -1
|
@@ -0,0 +1,237 @@
|
|
|
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 { useEffect, useEffectEvent, useRef, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { SidebarIcon, XIcon } from "lucide-react";
|
|
11
|
+
import { cva } from "class-variance-authority";
|
|
12
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
13
|
+
import { RemoveScroll } from "react-remove-scroll";
|
|
14
|
+
//#region src/layouts/flux/slots/sidebar.tsx
|
|
15
|
+
const MotionSidebarItem = motion.create(SidebarItem$1);
|
|
16
|
+
const MotionSidebarFolderTrigger = motion.create(SidebarFolderTrigger$1);
|
|
17
|
+
const MotionSidebarFolderLink = motion.create(SidebarFolderLink$1);
|
|
18
|
+
const MotionSidebarFolderContent = motion.create(SidebarFolderContent$1);
|
|
19
|
+
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: {
|
|
20
|
+
variant: {
|
|
21
|
+
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",
|
|
22
|
+
button: "transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none"
|
|
23
|
+
},
|
|
24
|
+
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" }
|
|
25
|
+
} });
|
|
26
|
+
function getItemOffset(depth) {
|
|
27
|
+
return `calc(${2 + 3 * depth} * var(--spacing))`;
|
|
28
|
+
}
|
|
29
|
+
const { useSidebar } = base_exports;
|
|
30
|
+
function SidebarProvider(props) {
|
|
31
|
+
return /* @__PURE__ */ jsx(SidebarProvider$1, { ...props });
|
|
32
|
+
}
|
|
33
|
+
function Sidebar({ footer, banner, components, ...rest }) {
|
|
34
|
+
const { menuItems } = useFluxLayout();
|
|
35
|
+
return /* @__PURE__ */ jsxs(SidebarContent, {
|
|
36
|
+
...rest,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ jsx("div", {
|
|
39
|
+
className: "flex flex-col gap-3 p-4 pb-2 empty:hidden",
|
|
40
|
+
children: banner
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx(SidebarViewport, { children: /* @__PURE__ */ jsxs("div", {
|
|
43
|
+
className: "flex flex-col",
|
|
44
|
+
children: [menuItems.filter((v) => v.type !== "icon").map((item, i, list) => /* @__PURE__ */ jsx(SidebarLinkItem, {
|
|
45
|
+
item,
|
|
46
|
+
className: cn(i === list.length - 1 && "mb-4")
|
|
47
|
+
}, i)), /* @__PURE__ */ jsx(SidebarPageTree, { ...components })]
|
|
48
|
+
}) }),
|
|
49
|
+
footer
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function SidebarTrigger(props) {
|
|
54
|
+
const { open, setOpen } = useSidebar();
|
|
55
|
+
return /* @__PURE__ */ jsx("button", {
|
|
56
|
+
onClick: () => setOpen((prev) => !prev),
|
|
57
|
+
...props,
|
|
58
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
59
|
+
mode: "wait",
|
|
60
|
+
children: /* @__PURE__ */ jsx(motion.span, {
|
|
61
|
+
transition: { duration: .2 },
|
|
62
|
+
initial: {
|
|
63
|
+
y: "100%",
|
|
64
|
+
opacity: 0
|
|
65
|
+
},
|
|
66
|
+
animate: {
|
|
67
|
+
y: 0,
|
|
68
|
+
opacity: 1
|
|
69
|
+
},
|
|
70
|
+
exit: {
|
|
71
|
+
y: "100%",
|
|
72
|
+
opacity: 0
|
|
73
|
+
},
|
|
74
|
+
children: open ? /* @__PURE__ */ jsx(XIcon, {}) : /* @__PURE__ */ jsx(SidebarIcon, {})
|
|
75
|
+
}, open ? "open" : "closed")
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function SidebarContent({ ref: refProp, className, children, ...props }) {
|
|
80
|
+
const ref = useRef(null);
|
|
81
|
+
const [blockScroll, setBlockScroll] = useState(false);
|
|
82
|
+
const { open, setOpen } = useSidebar();
|
|
83
|
+
const listener = useEffectEvent((e) => {
|
|
84
|
+
if (open && e.key === "Escape") {
|
|
85
|
+
setOpen(false);
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
window.addEventListener("keydown", listener);
|
|
91
|
+
return () => {
|
|
92
|
+
window.removeEventListener("keydown", listener);
|
|
93
|
+
};
|
|
94
|
+
}, []);
|
|
95
|
+
if (open && !blockScroll) setBlockScroll(true);
|
|
96
|
+
return /* @__PURE__ */ jsx(RemoveScroll, {
|
|
97
|
+
enabled: blockScroll,
|
|
98
|
+
children: /* @__PURE__ */ jsx(motion.div, {
|
|
99
|
+
className: cn("fixed inset-0 py-10 z-30 backdrop-blur-md bg-fd-background/60", !open && "pointer-events-none"),
|
|
100
|
+
initial: "hide",
|
|
101
|
+
variants: {
|
|
102
|
+
show: { opacity: 1 },
|
|
103
|
+
hide: { opacity: 0 }
|
|
104
|
+
},
|
|
105
|
+
animate: open ? "show" : "hide",
|
|
106
|
+
exit: "hide",
|
|
107
|
+
onClick: () => {
|
|
108
|
+
setOpen(false);
|
|
109
|
+
},
|
|
110
|
+
onAnimationComplete: (definition) => {
|
|
111
|
+
if (definition === "hide") setBlockScroll(false);
|
|
112
|
+
},
|
|
113
|
+
children: /* @__PURE__ */ jsx(motion.div, {
|
|
114
|
+
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",
|
|
115
|
+
variants: {
|
|
116
|
+
show: {
|
|
117
|
+
y: 0,
|
|
118
|
+
opacity: 1
|
|
119
|
+
},
|
|
120
|
+
hide: {
|
|
121
|
+
y: "80%",
|
|
122
|
+
opacity: 0
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
transition: {
|
|
126
|
+
duration: .4,
|
|
127
|
+
ease: [
|
|
128
|
+
.16,
|
|
129
|
+
1,
|
|
130
|
+
.3,
|
|
131
|
+
1
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
children: /* @__PURE__ */ jsx(motion.aside, {
|
|
135
|
+
id: "nd-sidebar",
|
|
136
|
+
ref: mergeRefs(ref, refProp),
|
|
137
|
+
className: cn("mx-auto sm:max-w-[400px]", className),
|
|
138
|
+
onClick: (e) => e.stopPropagation(),
|
|
139
|
+
...props,
|
|
140
|
+
children
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function SidebarFolder(props) {
|
|
147
|
+
return /* @__PURE__ */ jsx(SidebarFolder$1, { ...props });
|
|
148
|
+
}
|
|
149
|
+
function SidebarSeparator({ className, style, children, ...props }) {
|
|
150
|
+
const depth = useFolderDepth();
|
|
151
|
+
return /* @__PURE__ */ jsx(SidebarSeparator$1, {
|
|
152
|
+
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),
|
|
153
|
+
style: {
|
|
154
|
+
paddingInlineStart: getItemOffset(depth),
|
|
155
|
+
...style
|
|
156
|
+
},
|
|
157
|
+
...props,
|
|
158
|
+
children
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function SidebarItem({ className, style, children, ...props }) {
|
|
162
|
+
const depth = useFolderDepth();
|
|
163
|
+
return /* @__PURE__ */ jsx(MotionSidebarItem, {
|
|
164
|
+
className: cn(itemVariants({
|
|
165
|
+
variant: "link",
|
|
166
|
+
highlight: depth >= 1
|
|
167
|
+
}), className),
|
|
168
|
+
style: {
|
|
169
|
+
paddingInlineStart: getItemOffset(depth),
|
|
170
|
+
...style
|
|
171
|
+
},
|
|
172
|
+
...props,
|
|
173
|
+
children
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function SidebarFolderTrigger({ className, style, ...props }) {
|
|
177
|
+
const { depth, collapsible } = useFolder();
|
|
178
|
+
return /* @__PURE__ */ jsx(MotionSidebarFolderTrigger, {
|
|
179
|
+
className: (state) => cn(itemVariants({ variant: collapsible ? "button" : null }), "w-full", typeof className === "function" ? className(state) : className),
|
|
180
|
+
style: {
|
|
181
|
+
paddingInlineStart: getItemOffset(depth - 1),
|
|
182
|
+
...style
|
|
183
|
+
},
|
|
184
|
+
...props,
|
|
185
|
+
children: props.children
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
function SidebarFolderLink({ className, style, ...props }) {
|
|
189
|
+
const depth = useFolderDepth();
|
|
190
|
+
return /* @__PURE__ */ jsx(MotionSidebarFolderLink, {
|
|
191
|
+
className: cn(itemVariants({
|
|
192
|
+
variant: "link",
|
|
193
|
+
highlight: depth > 1
|
|
194
|
+
}), "w-full", className),
|
|
195
|
+
style: {
|
|
196
|
+
paddingInlineStart: getItemOffset(depth - 1),
|
|
197
|
+
...style
|
|
198
|
+
},
|
|
199
|
+
...props,
|
|
200
|
+
children: props.children
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
function SidebarFolderContent({ className, children, ...props }) {
|
|
204
|
+
const depth = useFolderDepth();
|
|
205
|
+
const { open } = useFolder();
|
|
206
|
+
return /* @__PURE__ */ jsx(MotionSidebarFolderContent, {
|
|
207
|
+
className: (state) => cn("relative", depth === 1 && "before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:start-2.5", typeof className === "function" ? className(state) : className),
|
|
208
|
+
...props,
|
|
209
|
+
children: /* @__PURE__ */ jsx(motion.div, {
|
|
210
|
+
initial: "hide",
|
|
211
|
+
animate: open ? "show" : "hide",
|
|
212
|
+
exit: "hide",
|
|
213
|
+
variants: {
|
|
214
|
+
show: { opacity: 1 },
|
|
215
|
+
hide: { opacity: 0 }
|
|
216
|
+
},
|
|
217
|
+
children
|
|
218
|
+
})
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
const SidebarPageTree = createPageTreeRenderer({
|
|
222
|
+
SidebarFolder,
|
|
223
|
+
SidebarFolderContent,
|
|
224
|
+
SidebarSeparator,
|
|
225
|
+
SidebarFolderLink,
|
|
226
|
+
SidebarFolderTrigger,
|
|
227
|
+
SidebarItem
|
|
228
|
+
});
|
|
229
|
+
const SidebarLinkItem = createLinkItemRenderer({
|
|
230
|
+
SidebarFolder,
|
|
231
|
+
SidebarFolderContent,
|
|
232
|
+
SidebarFolderLink,
|
|
233
|
+
SidebarFolderTrigger,
|
|
234
|
+
SidebarItem
|
|
235
|
+
});
|
|
236
|
+
//#endregion
|
|
237
|
+
export { Sidebar, SidebarProvider, SidebarTrigger, useSidebar };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LayoutTab } from "../../shared/index.js";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/layouts/flux/slots/tab-dropdown.d.ts
|
|
6
|
+
interface TabDropdownProps extends ComponentProps<'button'> {
|
|
7
|
+
placeholder?: ReactNode;
|
|
8
|
+
tabs: LayoutTab[];
|
|
9
|
+
}
|
|
10
|
+
declare function TabDropdown({
|
|
11
|
+
tabs,
|
|
12
|
+
placeholder,
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}: TabDropdownProps): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { TabDropdown, TabDropdownProps };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.js";
|
|
4
|
+
import { isLayoutTabActive } from "../../shared/index.js";
|
|
5
|
+
import { useMemo, useState } from "react";
|
|
6
|
+
import { usePathname } from "@hanzo/docs-core/framework";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import Link from "@hanzo/docs-core/link";
|
|
9
|
+
import { Check, ChevronsUpDown } from "lucide-react";
|
|
10
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
11
|
+
//#region src/layouts/flux/slots/tab-dropdown.tsx
|
|
12
|
+
function TabDropdown({ tabs, placeholder, className, ...props }) {
|
|
13
|
+
const [open, setOpen] = useState(false);
|
|
14
|
+
const pathname = usePathname();
|
|
15
|
+
const selectedIdx = useMemo(() => {
|
|
16
|
+
return tabs.findLastIndex((item) => isLayoutTabActive(item, pathname));
|
|
17
|
+
}, [tabs, pathname]);
|
|
18
|
+
const selected = selectedIdx !== -1 ? tabs[selectedIdx] : void 0;
|
|
19
|
+
const onClick = () => {
|
|
20
|
+
setOpen(false);
|
|
21
|
+
};
|
|
22
|
+
const item = selected ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
23
|
+
className: "size-4.5 shrink-0 empty:hidden",
|
|
24
|
+
children: selected.icon
|
|
25
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
26
|
+
className: "font-medium",
|
|
27
|
+
children: selected.title
|
|
28
|
+
})] }) : placeholder;
|
|
29
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
30
|
+
open,
|
|
31
|
+
onOpenChange: setOpen,
|
|
32
|
+
children: [item && /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
33
|
+
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),
|
|
34
|
+
...props,
|
|
35
|
+
children: [/* @__PURE__ */ jsx(AnimatePresence, {
|
|
36
|
+
mode: "popLayout",
|
|
37
|
+
children: /* @__PURE__ */ jsx(motion.span, {
|
|
38
|
+
className: "flex w-full min-w-0 overflow-hidden items-center text-nowrap gap-1.5",
|
|
39
|
+
initial: {
|
|
40
|
+
opacity: 0,
|
|
41
|
+
y: "100%"
|
|
42
|
+
},
|
|
43
|
+
animate: {
|
|
44
|
+
opacity: 1,
|
|
45
|
+
y: 0
|
|
46
|
+
},
|
|
47
|
+
exit: {
|
|
48
|
+
opacity: 0,
|
|
49
|
+
y: "-100%"
|
|
50
|
+
},
|
|
51
|
+
children: item
|
|
52
|
+
}, selectedIdx)
|
|
53
|
+
}), /* @__PURE__ */ jsx(ChevronsUpDown, { className: "shrink-0 ms-auto size-4 text-fd-muted-foreground" })]
|
|
54
|
+
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
55
|
+
align: "start",
|
|
56
|
+
className: "flex flex-col gap-1 max-w-svw p-1 fd-scroll-container",
|
|
57
|
+
children: tabs.map((item, i) => {
|
|
58
|
+
const isActive = i === selectedIdx;
|
|
59
|
+
if (!isActive && item.unlisted) return;
|
|
60
|
+
return /* @__PURE__ */ jsxs(Link, {
|
|
61
|
+
href: item.url,
|
|
62
|
+
onClick,
|
|
63
|
+
...item.props,
|
|
64
|
+
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),
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx("div", {
|
|
67
|
+
className: "shrink-0 mb-auto size-4.5 empty:hidden",
|
|
68
|
+
children: item.icon
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
71
|
+
className: "text-sm font-medium leading-none",
|
|
72
|
+
children: item.title
|
|
73
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
74
|
+
className: "text-[0.8125rem] text-fd-muted-foreground mt-1 empty:hidden",
|
|
75
|
+
children: item.description
|
|
76
|
+
})] }),
|
|
77
|
+
/* @__PURE__ */ jsx(Check, { className: cn("shrink-0 ms-auto size-3.5 text-fd-primary", !isActive && "invisible") })
|
|
78
|
+
]
|
|
79
|
+
}, item.url);
|
|
80
|
+
})
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
export { TabDropdown };
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { ComponentProps } from "react";
|
|
1
|
+
import { BaseSlots, BaseSlotsProps } from "../shared/client.js";
|
|
2
|
+
import { BaseLayoutProps, LinkItemType, NavOptions } from "../shared/index.js";
|
|
3
|
+
import { ComponentProps, FC } from "react";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
5
|
|
|
5
6
|
//#region src/layouts/home/index.d.ts
|
|
6
|
-
interface HomeLayoutProps extends BaseLayoutProps {
|
|
7
|
-
nav?:
|
|
7
|
+
interface HomeLayoutProps extends BaseLayoutProps, ComponentProps<'main'> {
|
|
8
|
+
nav?: Nav;
|
|
9
|
+
slots?: Partial<HomeSlots>;
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
interface Nav extends NavOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Open mobile menu when hovering the trigger
|
|
14
|
+
*/
|
|
15
|
+
enableHoverToOpen?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface HomeSlots extends BaseSlots {
|
|
18
|
+
header: FC<ComponentProps<'header'>>;
|
|
19
|
+
container: FC<ComponentProps<'main'>>;
|
|
20
|
+
}
|
|
21
|
+
declare function useHomeLayout(): {
|
|
22
|
+
props: BaseSlotsProps<HomeLayoutProps>;
|
|
23
|
+
navItems: LinkItemType[];
|
|
24
|
+
menuItems: LinkItemType[];
|
|
25
|
+
slots: HomeSlots;
|
|
26
|
+
};
|
|
27
|
+
declare function HomeLayout(props: HomeLayoutProps): react_jsx_runtime0.JSX.Element;
|
|
10
28
|
//#endregion
|
|
11
|
-
export { HomeLayout, HomeLayoutProps };
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
29
|
+
export { HomeLayout, HomeLayoutProps, HomeSlots, useHomeLayout };
|
|
@@ -1,25 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { baseSlots } from "../shared/client.js";
|
|
3
|
+
import { useLinkItems } from "../shared/index.js";
|
|
4
|
+
import { Container } from "./slots/container.js";
|
|
5
|
+
import { Header } from "./slots/header.js";
|
|
6
|
+
import { createContext, use } from "react";
|
|
3
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
8
|
//#region src/layouts/home/index.tsx
|
|
9
|
+
const LayoutContext = createContext(null);
|
|
10
|
+
function useHomeLayout() {
|
|
11
|
+
const context = use(LayoutContext);
|
|
12
|
+
if (!context) throw new Error("Please use this component under <HomeLayout /> (`@hanzo/docs-ui/layouts/home`).");
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
const { useProvider } = baseSlots({ useProps() {
|
|
16
|
+
return useHomeLayout().props;
|
|
17
|
+
} });
|
|
6
18
|
function HomeLayout(props) {
|
|
7
|
-
const { nav = {},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const { nav: { enabled: navEnabled = true } = {}, slots: defaultSlots, children, i18n: _i18n, githubUrl: _githubUrl, links: _links, themeSwitch: _themeSwitch, searchToggle: _searchToggle, ...rest } = props;
|
|
20
|
+
const { baseSlots, baseProps } = useProvider(props);
|
|
21
|
+
const linkItems = useLinkItems(props);
|
|
22
|
+
const slots = {
|
|
23
|
+
...baseSlots,
|
|
24
|
+
header: defaultSlots?.header ?? InlineHeader,
|
|
25
|
+
container: defaultSlots?.container ?? Container
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ jsx(LayoutContext, {
|
|
28
|
+
value: {
|
|
29
|
+
props: baseProps,
|
|
30
|
+
slots,
|
|
31
|
+
...linkItems
|
|
32
|
+
},
|
|
33
|
+
children: /* @__PURE__ */ jsxs(slots.container, {
|
|
34
|
+
...rest,
|
|
35
|
+
children: [navEnabled && /* @__PURE__ */ jsx(slots.header, {}), children]
|
|
36
|
+
})
|
|
20
37
|
});
|
|
21
38
|
}
|
|
22
|
-
|
|
39
|
+
function InlineHeader(props) {
|
|
40
|
+
const { nav } = useHomeLayout().props;
|
|
41
|
+
if (nav?.component) return nav.component;
|
|
42
|
+
return /* @__PURE__ */ jsx(Header, { ...props });
|
|
43
|
+
}
|
|
23
44
|
//#endregion
|
|
24
|
-
export { HomeLayout };
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
45
|
+
export { HomeLayout, useHomeLayout };
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import { NavigationMenuContentProps, NavigationMenuTriggerProps } from "../../components/ui/navigation-menu.js";
|
|
1
|
+
import { NavigationMenuContentProps, NavigationMenuItem, NavigationMenuTriggerProps } from "../../components/ui/navigation-menu.js";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
3
|
import { LinkProps } from "@hanzo/docs-core/link";
|
|
3
|
-
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
4
|
-
import * as react7 from "react";
|
|
5
|
-
import * as _base_ui_react6 from "@base-ui/react";
|
|
6
4
|
|
|
7
5
|
//#region src/layouts/home/navbar.d.ts
|
|
8
|
-
declare const NavbarMenu:
|
|
9
|
-
declare function NavbarMenuContent(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}: NavigationMenuContentProps): react_jsx_runtime20.JSX.Element;
|
|
13
|
-
declare function NavbarMenuTrigger({
|
|
14
|
-
className,
|
|
15
|
-
...props
|
|
16
|
-
}: NavigationMenuTriggerProps): react_jsx_runtime20.JSX.Element;
|
|
17
|
-
declare function NavbarMenuLink(props: LinkProps): react_jsx_runtime20.JSX.Element;
|
|
6
|
+
declare const NavbarMenu: typeof NavigationMenuItem;
|
|
7
|
+
declare function NavbarMenuContent(props: NavigationMenuContentProps): react_jsx_runtime0.JSX.Element;
|
|
8
|
+
declare function NavbarMenuTrigger(props: NavigationMenuTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
9
|
+
declare function NavbarMenuLink(props: LinkProps): react_jsx_runtime0.JSX.Element;
|
|
18
10
|
//#endregion
|
|
19
|
-
export { NavbarMenu, NavbarMenuContent, NavbarMenuLink, NavbarMenuTrigger };
|
|
20
|
-
//# sourceMappingURL=navbar.d.ts.map
|
|
11
|
+
export { NavbarMenu, NavbarMenuContent, NavbarMenuLink, NavbarMenuTrigger };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
3
|
import { NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuTrigger } from "../../components/ui/navigation-menu.js";
|
|
4
|
-
import { navItemVariants } from "./
|
|
5
|
-
import Link from "@hanzo/docs-core/link";
|
|
6
|
-
import { cn } from "@hanzo/docs-ui/cn";
|
|
4
|
+
import { navItemVariants } from "./slots/header.js";
|
|
7
5
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
6
|
+
import Link from "@hanzo/docs-core/link";
|
|
9
7
|
//#region src/layouts/home/navbar.tsx
|
|
10
8
|
const NavbarMenu = NavigationMenuItem;
|
|
11
|
-
function NavbarMenuContent(
|
|
9
|
+
function NavbarMenuContent(props) {
|
|
10
|
+
const { className, ...rest } = props;
|
|
12
11
|
return /* @__PURE__ */ jsx(NavigationMenuContent, {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
...rest,
|
|
13
|
+
className: (state) => cn("grid grid-cols-1 gap-2 md:grid-cols-2 lg:grid-cols-3", typeof className === "function" ? className(state) : className),
|
|
15
14
|
children: props.children
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
|
-
function NavbarMenuTrigger(
|
|
17
|
+
function NavbarMenuTrigger(props) {
|
|
18
|
+
const { className, ...rest } = props;
|
|
19
19
|
return /* @__PURE__ */ jsx(NavigationMenuTrigger, {
|
|
20
|
-
...
|
|
21
|
-
className: (
|
|
20
|
+
...rest,
|
|
21
|
+
className: (state) => cn(navItemVariants(), "text-sm rounded-md", typeof className === "function" ? className(state) : className),
|
|
22
22
|
children: props.children
|
|
23
23
|
});
|
|
24
24
|
}
|
|
@@ -29,7 +29,5 @@ function NavbarMenuLink(props) {
|
|
|
29
29
|
children: props.children
|
|
30
30
|
}) });
|
|
31
31
|
}
|
|
32
|
-
|
|
33
32
|
//#endregion
|
|
34
33
|
export { NavbarMenu, NavbarMenuContent, NavbarMenuLink, NavbarMenuTrigger };
|
|
35
|
-
//# sourceMappingURL=navbar.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/layouts/home/not-found.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* the default not found page content, please make your own if you want to customise it.
|
|
6
|
+
*/
|
|
7
|
+
declare function DefaultNotFound(): react_jsx_runtime0.JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { DefaultNotFound };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { buttonVariants } from "../../components/ui/button.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import Link from "@hanzo/docs-core/link";
|
|
5
|
+
import { HomeIcon } from "lucide-react";
|
|
6
|
+
//#region src/layouts/home/not-found.tsx
|
|
7
|
+
/**
|
|
8
|
+
* the default not found page content, please make your own if you want to customise it.
|
|
9
|
+
*/
|
|
10
|
+
function DefaultNotFound() {
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
className: "flex flex-col px-8 justify-center flex-1 text-center items-center gap-4",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsx("h1", {
|
|
15
|
+
className: "text-6xl font-bold text-fd-muted-foreground",
|
|
16
|
+
children: "404"
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ jsx("h2", {
|
|
19
|
+
className: "text-2xl font-semibold",
|
|
20
|
+
children: "Page Not Found"
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ jsx("p", {
|
|
23
|
+
className: "text-fd-muted-foreground max-w-md",
|
|
24
|
+
children: "The page you are looking for might have been removed, had its name changed, or is temporarily unavailable."
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ jsxs(Link, {
|
|
27
|
+
href: "/",
|
|
28
|
+
className: cn(buttonVariants({
|
|
29
|
+
className: "mt-4 gap-1.5",
|
|
30
|
+
variant: "primary"
|
|
31
|
+
})),
|
|
32
|
+
children: [/* @__PURE__ */ jsx(HomeIcon, { className: "size-4" }), "Back to Home"]
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { DefaultNotFound };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/layouts/home/slots/container.d.ts
|
|
5
|
+
declare function Container(props: ComponentProps<'main'>): react_jsx_runtime0.JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Container };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/layouts/home/slots/container.tsx
|
|
5
|
+
function Container(props) {
|
|
6
|
+
return /* @__PURE__ */ jsx("main", {
|
|
7
|
+
id: "nd-home-layout",
|
|
8
|
+
...props,
|
|
9
|
+
className: cn("flex flex-1 flex-col [--fd-layout-width:1400px]", props.className)
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Container };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
|
+
|
|
5
|
+
//#region src/layouts/home/slots/header.d.ts
|
|
6
|
+
declare const navItemVariants: (props?: ({
|
|
7
|
+
variant?: "button" | "main" | "icon" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
9
|
+
declare function Header(props: ComponentProps<'header'>): react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Header, navItemVariants };
|