@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
|
@@ -1,12 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { useI18n } from "../../contexts/i18n.js";
|
|
4
|
+
import { cn } from "../../utils/cn.js";
|
|
5
|
+
import { mergeRefs } from "../../utils/merge-refs.js";
|
|
6
|
+
import { TocThumb } from "./index.js";
|
|
7
|
+
import { useRef } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import * as Primitive from "@hanzo/docs-core/toc";
|
|
5
10
|
//#region src/components/toc/default.tsx
|
|
6
|
-
var default_exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
var default_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
TOCEmpty: () => TOCEmpty,
|
|
13
|
+
TOCItem: () => TOCItem,
|
|
14
|
+
TOCItems: () => TOCItems
|
|
15
|
+
});
|
|
16
|
+
function TOCItems({ ref, className, ...props }) {
|
|
17
|
+
const containerRef = useRef(null);
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
className: "relative",
|
|
20
|
+
children: [/* @__PURE__ */ jsx(TocThumb, {
|
|
21
|
+
containerRef,
|
|
22
|
+
className: "absolute inset-y-0 inset-s-0 bg-fd-primary w-px transition-[clip-path]",
|
|
23
|
+
style: { clipPath: "polygon(0 var(--fd-top), 100% var(--fd-top), 100% calc(var(--fd-top) + var(--fd-height)), 0 calc(var(--fd-top) + var(--fd-height)))" }
|
|
24
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
25
|
+
ref: mergeRefs(ref, containerRef),
|
|
26
|
+
className: cn("flex flex-col border-s border-fd-foreground/10", className),
|
|
27
|
+
...props
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function TOCEmpty() {
|
|
32
|
+
const { text } = useI18n();
|
|
33
|
+
return /* @__PURE__ */ jsx("div", {
|
|
34
|
+
className: "rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground",
|
|
35
|
+
children: text.tocNoHeadings
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function TOCItem({ item, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx(Primitive.TOCItem, {
|
|
40
|
+
href: item.url,
|
|
41
|
+
...props,
|
|
42
|
+
className: cn("prose py-1.5 text-sm text-fd-muted-foreground scroll-m-4 transition-colors wrap-anywhere first:pt-0 last:pb-0 data-[active=true]:text-fd-primary hover:text-fd-accent-foreground", item.depth <= 2 && "ps-3", item.depth === 3 && "ps-6", item.depth >= 4 && "ps-8", props.className),
|
|
43
|
+
children: item.title
|
|
44
|
+
});
|
|
45
|
+
}
|
|
10
46
|
//#endregion
|
|
11
|
-
export { default_exports };
|
|
12
|
-
//# sourceMappingURL=default.js.map
|
|
47
|
+
export { TOCEmpty, TOCItem, TOCItems, default_exports };
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import { ComponentProps, RefObject } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from "@hanzo/docs-core/toc";
|
|
4
|
+
|
|
5
|
+
//#region src/components/toc/index.d.ts
|
|
6
|
+
declare function useTOCItems(): Primitive.TOCItemType[];
|
|
7
|
+
type TOCProviderProps = Primitive.AnchorProviderProps;
|
|
8
|
+
declare const useActiveAnchor: typeof Primitive.useActiveAnchor, useActiveAnchors: typeof Primitive.useActiveAnchors, useItems: typeof Primitive.useItems;
|
|
9
|
+
declare function TOCProvider({
|
|
10
|
+
toc,
|
|
11
|
+
children,
|
|
12
|
+
...props
|
|
13
|
+
}: TOCProviderProps): react_jsx_runtime0.JSX.Element;
|
|
14
|
+
declare function TOCScrollArea({
|
|
15
|
+
ref,
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
|
|
19
|
+
interface TocThumbProps extends ComponentProps<'div'> {
|
|
20
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
21
|
+
align?: 'center' | 'end';
|
|
22
|
+
}
|
|
23
|
+
declare function TocThumb({
|
|
24
|
+
containerRef,
|
|
25
|
+
align,
|
|
26
|
+
...props
|
|
27
|
+
}: TocThumbProps): react_jsx_runtime0.JSX.Element;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { TOCProvider, TOCProviderProps, TOCScrollArea, TocThumb, useActiveAnchor, useActiveAnchors, useItems, useTOCItems };
|
|
@@ -1,12 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { mergeRefs } from "../../utils/merge-refs.js";
|
|
5
|
+
import { createContext, use, useEffect, useEffectEvent, useRef } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import * as Primitive from "@hanzo/docs-core/toc";
|
|
8
|
+
import { useOnChange } from "@hanzo/docs-core/utils/use-on-change";
|
|
5
9
|
//#region src/components/toc/index.tsx
|
|
6
|
-
var toc_exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
var toc_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
+
TOCProvider: () => TOCProvider,
|
|
12
|
+
TOCScrollArea: () => TOCScrollArea,
|
|
13
|
+
TocThumb: () => TocThumb,
|
|
14
|
+
useActiveAnchor: () => useActiveAnchor,
|
|
15
|
+
useActiveAnchors: () => useActiveAnchors,
|
|
16
|
+
useItems: () => useItems,
|
|
17
|
+
useTOCItems: () => useTOCItems
|
|
18
|
+
});
|
|
19
|
+
const TOCContext = createContext([]);
|
|
20
|
+
function useTOCItems() {
|
|
21
|
+
return use(TOCContext);
|
|
22
|
+
}
|
|
23
|
+
const { useActiveAnchor, useActiveAnchors, useItems } = Primitive;
|
|
24
|
+
function TOCProvider({ toc, children, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(TOCContext, {
|
|
26
|
+
value: toc,
|
|
27
|
+
children: /* @__PURE__ */ jsx(Primitive.AnchorProvider, {
|
|
28
|
+
toc,
|
|
29
|
+
...props,
|
|
30
|
+
children
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function TOCScrollArea({ ref, className, ...props }) {
|
|
35
|
+
const viewRef = useRef(null);
|
|
36
|
+
return /* @__PURE__ */ jsx("div", {
|
|
37
|
+
ref: mergeRefs(viewRef, ref),
|
|
38
|
+
className: cn("relative min-h-0 text-sm ms-px overflow-auto [scrollbar-width:none] mask-[linear-gradient(to_bottom,transparent,white_16px,white_calc(100%-16px),transparent)] py-3", className),
|
|
39
|
+
...props,
|
|
40
|
+
children: /* @__PURE__ */ jsx(Primitive.ScrollProvider, {
|
|
41
|
+
containerRef: viewRef,
|
|
42
|
+
children: props.children
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function TocThumb({ containerRef, align = "end", ...props }) {
|
|
47
|
+
const thumbRef = useRef(null);
|
|
48
|
+
const active = useActiveAnchors();
|
|
49
|
+
function update(info) {
|
|
50
|
+
const element = thumbRef.current;
|
|
51
|
+
const container = containerRef.current;
|
|
52
|
+
if (!element || !container) return;
|
|
53
|
+
element.style.setProperty("--fd-top", `${info.top}px`);
|
|
54
|
+
element.style.setProperty("--fd-height", `${info.height}px`);
|
|
55
|
+
}
|
|
56
|
+
function calc(active) {
|
|
57
|
+
const container = containerRef.current;
|
|
58
|
+
if (!container || container.clientHeight === 0) return null;
|
|
59
|
+
if (active.length === 0) return {
|
|
60
|
+
height: 0,
|
|
61
|
+
top: 0
|
|
62
|
+
};
|
|
63
|
+
let upper = Number.MAX_VALUE;
|
|
64
|
+
let lower = 0;
|
|
65
|
+
for (const item of active) {
|
|
66
|
+
const element = container.querySelector(`a[href="#${item}"]`);
|
|
67
|
+
if (!element) continue;
|
|
68
|
+
if (align === "center") {
|
|
69
|
+
const y = element.offsetTop + element.clientHeight / 2;
|
|
70
|
+
upper = Math.min(upper, y);
|
|
71
|
+
lower = Math.max(lower, y);
|
|
72
|
+
} else {
|
|
73
|
+
const styles = getComputedStyle(element);
|
|
74
|
+
upper = Math.min(upper, element.offsetTop + parseFloat(styles.paddingTop));
|
|
75
|
+
lower = Math.max(lower, element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
top: upper,
|
|
80
|
+
height: lower - upper
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const onPrint = useEffectEvent(() => {
|
|
84
|
+
const result = calc(active);
|
|
85
|
+
if (result) update(result);
|
|
86
|
+
});
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!containerRef.current) return;
|
|
89
|
+
const container = containerRef.current;
|
|
90
|
+
const observer = new ResizeObserver(onPrint);
|
|
91
|
+
observer.observe(container);
|
|
92
|
+
return () => {
|
|
93
|
+
observer.disconnect();
|
|
94
|
+
};
|
|
95
|
+
}, [containerRef]);
|
|
96
|
+
useOnChange(active, () => {
|
|
97
|
+
const result = calc(active);
|
|
98
|
+
if (result) update(result);
|
|
99
|
+
});
|
|
100
|
+
return /* @__PURE__ */ jsx("div", {
|
|
101
|
+
ref: thumbRef,
|
|
102
|
+
"data-hidden": active.length === 0,
|
|
103
|
+
...props
|
|
104
|
+
});
|
|
105
|
+
}
|
|
10
106
|
//#endregion
|
|
11
|
-
export { toc_exports };
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
107
|
+
export { TOCProvider, TOCScrollArea, TocThumb, toc_exports, useActiveAnchor, useActiveAnchors, useItems, useTOCItems };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/type-table.d.ts
|
|
5
5
|
interface ParameterNode {
|
|
@@ -26,14 +26,19 @@ interface TypeNode {
|
|
|
26
26
|
default?: ReactNode;
|
|
27
27
|
required?: boolean;
|
|
28
28
|
deprecated?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* a list of parameters info if the type is a function.
|
|
31
|
+
*/
|
|
29
32
|
parameters?: ParameterNode[];
|
|
30
33
|
returns?: ReactNode;
|
|
31
34
|
}
|
|
32
35
|
declare function TypeTable({
|
|
33
|
-
|
|
36
|
+
id,
|
|
37
|
+
type,
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
34
40
|
}: {
|
|
35
41
|
type: Record<string, TypeNode>;
|
|
36
|
-
}):
|
|
42
|
+
} & ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
|
|
37
43
|
//#endregion
|
|
38
|
-
export { ParameterNode, TypeNode, TypeTable };
|
|
39
|
-
//# sourceMappingURL=type-table.d.ts.map
|
|
44
|
+
export { ParameterNode, TypeNode, TypeTable };
|
|
@@ -1,48 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../utils/cn.js";
|
|
3
3
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible.js";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
import Link from "@hanzo/docs-core/link";
|
|
5
|
-
import { cn } from "@hanzo/docs-ui/cn";
|
|
6
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { ChevronDown } from "lucide-react";
|
|
8
|
-
import { useState } from "react";
|
|
9
8
|
import { cva } from "class-variance-authority";
|
|
10
|
-
|
|
11
9
|
//#region src/components/type-table.tsx
|
|
12
|
-
const keyVariants = cva("text-fd-primary", { variants: { deprecated: { true: "line-through text-fd-primary/50" } } });
|
|
13
10
|
const fieldVariants = cva("text-fd-muted-foreground not-prose pe-2");
|
|
14
|
-
function TypeTable({ type }) {
|
|
11
|
+
function TypeTable({ id, type, className, ...props }) {
|
|
15
12
|
return /* @__PURE__ */ jsxs("div", {
|
|
16
|
-
|
|
13
|
+
id,
|
|
14
|
+
className: cn("@container flex flex-col p-1 bg-fd-card text-fd-card-foreground rounded-2xl border my-6 text-sm overflow-hidden", className),
|
|
15
|
+
...props,
|
|
17
16
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
18
17
|
className: "flex font-medium items-center px-3 py-1 not-prose text-fd-muted-foreground",
|
|
19
18
|
children: [/* @__PURE__ */ jsx("p", {
|
|
20
|
-
className: "w-
|
|
19
|
+
className: "w-1/4",
|
|
21
20
|
children: "Prop"
|
|
22
21
|
}), /* @__PURE__ */ jsx("p", {
|
|
23
22
|
className: "@max-xl:hidden",
|
|
24
23
|
children: "Type"
|
|
25
24
|
})]
|
|
26
25
|
}), Object.entries(type).map(([key, value]) => /* @__PURE__ */ jsx(Item, {
|
|
26
|
+
parentId: id,
|
|
27
27
|
name: key,
|
|
28
28
|
item: value
|
|
29
29
|
}, key))]
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
function Item({ name, item: { parameters = [], description, required = false, deprecated, typeDescription, default: defaultValue, type, typeDescriptionLink, returns } }) {
|
|
32
|
+
function Item({ parentId, name, item: { parameters = [], description, required = false, deprecated, typeDescription, default: defaultValue, type, typeDescriptionLink, returns } }) {
|
|
33
33
|
const [open, setOpen] = useState(false);
|
|
34
|
+
const id = parentId ? `${parentId}-${name}` : void 0;
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const hash = window.location.hash;
|
|
37
|
+
if (!id || !hash) return;
|
|
38
|
+
if (`#${id}` === hash) setOpen(true);
|
|
39
|
+
}, [id]);
|
|
34
40
|
return /* @__PURE__ */ jsxs(Collapsible, {
|
|
41
|
+
id,
|
|
35
42
|
open,
|
|
36
|
-
onOpenChange:
|
|
37
|
-
|
|
43
|
+
onOpenChange: (v) => {
|
|
44
|
+
if (v && id) window.history.replaceState(null, "", `#${id}`);
|
|
45
|
+
setOpen(v);
|
|
46
|
+
},
|
|
47
|
+
className: cn("rounded-xl border overflow-hidden scroll-m-20 transition-all", open ? "shadow-sm bg-fd-background not-last:mb-2" : "border-transparent"),
|
|
38
48
|
children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
|
|
39
49
|
className: "relative flex flex-row items-center w-full group text-start px-3 py-2 not-prose hover:bg-fd-accent",
|
|
40
50
|
children: [
|
|
41
51
|
/* @__PURE__ */ jsxs("code", {
|
|
42
|
-
className: cn(
|
|
43
|
-
deprecated,
|
|
44
|
-
className: "min-w-fit w-[25%] font-medium pe-2"
|
|
45
|
-
})),
|
|
52
|
+
className: cn("text-fd-primary min-w-fit w-1/4 font-mono font-medium pe-2", deprecated && "line-through text-fd-primary/50"),
|
|
46
53
|
children: [name, !required && "?"]
|
|
47
54
|
}),
|
|
48
55
|
typeDescriptionLink ? /* @__PURE__ */ jsx(Link, {
|
|
@@ -62,21 +69,21 @@ function Item({ name, item: { parameters = [], description, required = false, de
|
|
|
62
69
|
className: "text-sm prose col-span-full prose-no-margin empty:hidden",
|
|
63
70
|
children: description
|
|
64
71
|
}),
|
|
65
|
-
typeDescription && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("p", {
|
|
72
|
+
typeDescription && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", {
|
|
66
73
|
className: cn(fieldVariants()),
|
|
67
74
|
children: "Type"
|
|
68
75
|
}), /* @__PURE__ */ jsx("p", {
|
|
69
76
|
className: "my-auto not-prose",
|
|
70
77
|
children: typeDescription
|
|
71
78
|
})] }),
|
|
72
|
-
defaultValue && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("p", {
|
|
79
|
+
defaultValue && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", {
|
|
73
80
|
className: cn(fieldVariants()),
|
|
74
81
|
children: "Default"
|
|
75
82
|
}), /* @__PURE__ */ jsx("p", {
|
|
76
83
|
className: "my-auto not-prose",
|
|
77
84
|
children: defaultValue
|
|
78
85
|
})] }),
|
|
79
|
-
parameters.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("p", {
|
|
86
|
+
parameters.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", {
|
|
80
87
|
className: cn(fieldVariants()),
|
|
81
88
|
children: "Parameters"
|
|
82
89
|
}), /* @__PURE__ */ jsx("div", {
|
|
@@ -92,7 +99,7 @@ function Item({ name, item: { parameters = [], description, required = false, de
|
|
|
92
99
|
})]
|
|
93
100
|
}, param.name))
|
|
94
101
|
})] }),
|
|
95
|
-
returns && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("p", {
|
|
102
|
+
returns && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", {
|
|
96
103
|
className: cn(fieldVariants()),
|
|
97
104
|
children: "Returns"
|
|
98
105
|
}), /* @__PURE__ */ jsx("div", {
|
|
@@ -103,7 +110,5 @@ function Item({ name, item: { parameters = [], description, required = false, de
|
|
|
103
110
|
}) })]
|
|
104
111
|
});
|
|
105
112
|
}
|
|
106
|
-
|
|
107
113
|
//#endregion
|
|
108
114
|
export { TypeTable };
|
|
109
|
-
//# sourceMappingURL=type-table.js.map
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import * as react_jsx_runtime100 from "react/jsx-runtime";
|
|
2
1
|
import { ComponentProps } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ui/accordion.d.ts
|
|
6
6
|
declare function Accordion({
|
|
7
7
|
className,
|
|
8
8
|
...props
|
|
9
|
-
}: ComponentProps<typeof Accordion$1.Root>):
|
|
9
|
+
}: ComponentProps<typeof Accordion$1.Root>): react_jsx_runtime0.JSX.Element;
|
|
10
10
|
declare function AccordionItem({
|
|
11
11
|
children,
|
|
12
12
|
...props
|
|
13
|
-
}: ComponentProps<typeof Accordion$1.Item>):
|
|
13
|
+
}: ComponentProps<typeof Accordion$1.Item>): react_jsx_runtime0.JSX.Element;
|
|
14
14
|
declare function AccordionHeader({
|
|
15
15
|
className,
|
|
16
16
|
children,
|
|
17
17
|
...props
|
|
18
|
-
}: ComponentProps<typeof Accordion$1.Header>):
|
|
18
|
+
}: ComponentProps<typeof Accordion$1.Header>): react_jsx_runtime0.JSX.Element;
|
|
19
19
|
declare function AccordionTrigger({
|
|
20
20
|
className,
|
|
21
21
|
children,
|
|
22
22
|
...props
|
|
23
|
-
}: ComponentProps<typeof Accordion$1.Trigger>):
|
|
23
|
+
}: ComponentProps<typeof Accordion$1.Trigger>): react_jsx_runtime0.JSX.Element;
|
|
24
24
|
declare function AccordionContent({
|
|
25
25
|
className,
|
|
26
26
|
children,
|
|
27
27
|
...props
|
|
28
|
-
}: ComponentProps<typeof Accordion$1.Panel>):
|
|
28
|
+
}: ComponentProps<typeof Accordion$1.Panel>): react_jsx_runtime0.JSX.Element;
|
|
29
29
|
//#endregion
|
|
30
|
-
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger };
|
|
31
|
-
//# sourceMappingURL=accordion.d.ts.map
|
|
30
|
+
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { cn } from "@hanzo/docs-ui/cn";
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { ChevronRight } from "lucide-react";
|
|
6
5
|
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
7
|
-
|
|
8
6
|
//#region src/components/ui/accordion.tsx
|
|
9
7
|
function Accordion({ className, ...props }) {
|
|
10
8
|
return /* @__PURE__ */ jsx(Accordion$1.Root, {
|
|
@@ -39,7 +37,5 @@ function AccordionContent({ className, children, ...props }) {
|
|
|
39
37
|
children
|
|
40
38
|
});
|
|
41
39
|
}
|
|
42
|
-
|
|
43
40
|
//#endregion
|
|
44
41
|
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger };
|
|
45
|
-
//# sourceMappingURL=accordion.js.map
|
|
@@ -9,5 +9,4 @@ declare const buttonVariants: (props?: ({
|
|
|
9
9
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
10
|
type ButtonProps = VariantProps<typeof buttonVariants>;
|
|
11
11
|
//#endregion
|
|
12
|
-
export { ButtonProps, buttonVariants };
|
|
13
|
-
//# sourceMappingURL=button.d.ts.map
|
|
12
|
+
export { ButtonProps, buttonVariants };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
|
|
3
2
|
//#region src/components/ui/button.tsx
|
|
4
3
|
const variants = {
|
|
5
4
|
primary: "bg-fd-primary text-fd-primary-foreground hover:bg-fd-primary/80",
|
|
@@ -17,7 +16,5 @@ const buttonVariants = cva("inline-flex items-center justify-center rounded-md p
|
|
|
17
16
|
"icon-xs": "p-1 [&_svg]:size-4"
|
|
18
17
|
}
|
|
19
18
|
} });
|
|
20
|
-
|
|
21
19
|
//#endregion
|
|
22
20
|
export { buttonVariants };
|
|
23
|
-
//# sourceMappingURL=button.js.map
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as react0 from "react";
|
|
1
|
+
import * as react from "react";
|
|
3
2
|
import { ComponentProps } from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
|
|
5
5
|
import * as _base_ui_react0 from "@base-ui/react";
|
|
6
6
|
|
|
7
7
|
//#region src/components/ui/collapsible.d.ts
|
|
8
|
-
declare const Collapsible:
|
|
9
|
-
declare const CollapsibleTrigger:
|
|
8
|
+
declare const Collapsible: react.ForwardRefExoticComponent<Omit<_base_ui_react0.CollapsibleRootProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const CollapsibleTrigger: react.ForwardRefExoticComponent<Omit<_base_ui_react0.CollapsibleTriggerProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
10
10
|
declare function CollapsibleContent({
|
|
11
11
|
children,
|
|
12
12
|
className,
|
|
13
13
|
...props
|
|
14
|
-
}: ComponentProps<typeof Collapsible$1.Panel>):
|
|
14
|
+
}: ComponentProps<typeof Collapsible$1.Panel>): react_jsx_runtime0.JSX.Element;
|
|
15
15
|
type CollapsibleProps = Collapsible$1.Root.Props;
|
|
16
16
|
type CollapsibleContentProps = Collapsible$1.Panel.Props;
|
|
17
17
|
type CollapsibleTriggerProps = Collapsible$1.Trigger.Props;
|
|
18
18
|
//#endregion
|
|
19
|
-
export { Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps };
|
|
20
|
-
//# sourceMappingURL=collapsible.d.ts.map
|
|
19
|
+
export { Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps };
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { cn } from "@hanzo/docs-ui/cn";
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
|
|
6
|
-
|
|
7
5
|
//#region src/components/ui/collapsible.tsx
|
|
8
6
|
const Collapsible = Collapsible$1.Root;
|
|
9
7
|
const CollapsibleTrigger = Collapsible$1.Trigger;
|
|
10
8
|
function CollapsibleContent({ children, className, ...props }) {
|
|
11
9
|
return /* @__PURE__ */ jsx(Collapsible$1.Panel, {
|
|
12
10
|
...props,
|
|
13
|
-
className: (s) => cn("overflow-hidden [&[hidden]:not([hidden='until-found'])]:hidden h-(--collapsible-panel-height) transition-[height] data-
|
|
11
|
+
className: (s) => cn("overflow-hidden [&[hidden]:not([hidden='until-found'])]:hidden h-(--collapsible-panel-height) transition-[height,opacity] data-starting-style:opacity-0 data-starting-style:h-0 data-ending-style:h-0 data-ending-style:opacity-0", typeof className === "function" ? className(s) : className),
|
|
14
12
|
children
|
|
15
13
|
});
|
|
16
14
|
}
|
|
17
|
-
|
|
18
15
|
//#endregion
|
|
19
16
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
20
|
-
//# sourceMappingURL=collapsible.js.map
|
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { NavigationMenu as NavigationMenu$1 } from "@base-ui/react/navigation-menu";
|
|
4
|
+
import * as _base_ui_react0 from "@base-ui/react";
|
|
4
5
|
|
|
5
6
|
//#region src/components/ui/navigation-menu.d.ts
|
|
6
|
-
type NavigationMenuContentProps = NavigationMenu.Content.Props;
|
|
7
|
-
type NavigationMenuTriggerProps = NavigationMenu.Trigger.Props;
|
|
8
|
-
declare const
|
|
9
|
-
declare const NavigationMenuList: React.ForwardRefExoticComponent<
|
|
10
|
-
declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
type NavigationMenuContentProps = NavigationMenu$1.Content.Props;
|
|
8
|
+
type NavigationMenuTriggerProps = NavigationMenu$1.Trigger.Props;
|
|
9
|
+
declare const NavigationMenu: React$1.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuRootProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
10
|
+
declare const NavigationMenuList: React$1.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuListProps, "ref"> & React$1.RefAttributes<HTMLUListElement>>;
|
|
11
|
+
declare function NavigationMenuItem({
|
|
12
|
+
className,
|
|
13
|
+
children,
|
|
14
|
+
...props
|
|
15
|
+
}: React$1.ComponentPropsWithRef<typeof NavigationMenu$1.Item>): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
declare function NavigationMenuTrigger({
|
|
17
|
+
children,
|
|
18
|
+
...props
|
|
19
|
+
}: React$1.ComponentPropsWithRef<typeof NavigationMenu$1.Trigger>): react_jsx_runtime0.JSX.Element;
|
|
20
|
+
declare function NavigationMenuContent({
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}: React$1.ComponentPropsWithRef<typeof NavigationMenu$1.Content>): react_jsx_runtime0.JSX.Element;
|
|
24
|
+
declare function NavigationMenuLink({
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}: React$1.ComponentPropsWithRef<typeof NavigationMenu$1.Link>): react_jsx_runtime0.JSX.Element;
|
|
28
|
+
declare function NavigationMenuViewport(props: NavigationMenu$1.Positioner.Props): react_jsx_runtime0.JSX.Element;
|
|
14
29
|
//#endregion
|
|
15
|
-
export { NavigationMenuContent, NavigationMenuContentProps, NavigationMenuItem, NavigationMenuLink, NavigationMenuList,
|
|
16
|
-
//# sourceMappingURL=navigation-menu.d.ts.map
|
|
30
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuContentProps, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuTriggerProps, NavigationMenuViewport };
|
|
@@ -1,34 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import
|
|
6
|
-
import { NavigationMenu } from "@base-ui/react/navigation-menu";
|
|
7
|
-
|
|
5
|
+
import { NavigationMenu as NavigationMenu$1 } from "@base-ui/react/navigation-menu";
|
|
8
6
|
//#region src/components/ui/navigation-menu.tsx
|
|
9
|
-
const
|
|
10
|
-
const NavigationMenuList = NavigationMenu.List;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
const NavigationMenu = NavigationMenu$1.Root;
|
|
8
|
+
const NavigationMenuList = NavigationMenu$1.List;
|
|
9
|
+
function NavigationMenuItem({ className, children, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Item, {
|
|
11
|
+
className: (s) => cn("list-none", typeof className === "function" ? className(s) : className),
|
|
12
|
+
...props,
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function NavigationMenuTrigger({ children, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Trigger, {
|
|
18
|
+
...props,
|
|
19
|
+
children
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function NavigationMenuContent({ className, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Content, {
|
|
24
|
+
className: (s) => cn("size-full p-3", "transition-[opacity,transform,translate] duration-(--duration) ease-(--easing)", "data-starting-style:opacity-0 data-ending-style:opacity-0", "data-starting-style:data-[activation-direction=left]:-translate-x-1/2", "data-starting-style:data-[activation-direction=right]:translate-x-1/2", "data-ending-style:data-[activation-direction=left]:translate-x-1/2", "data-ending-style:data-[activation-direction=right]:-translate-x-1/2", typeof className === "function" ? className(s) : className),
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function NavigationMenuLink({ children, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Link, {
|
|
30
|
+
...props,
|
|
31
|
+
children
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function NavigationMenuViewport(props) {
|
|
35
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Portal, { children: /* @__PURE__ */ jsx(NavigationMenu$1.Positioner, {
|
|
36
|
+
collisionPadding: {
|
|
37
|
+
top: 5,
|
|
38
|
+
bottom: 5,
|
|
39
|
+
left: 20,
|
|
40
|
+
right: 20
|
|
41
|
+
},
|
|
42
|
+
...props,
|
|
43
|
+
className: (s) => cn("box-border h-(--positioner-height) w-(--anchor-width) max-w-(--available-width) duration-(--duration) ease-(--easing) before:absolute before:content-[''] data-instant:transition-none data-[side=bottom]:before:top-[-10px] data-[side=bottom]:before:right-0 data-[side=bottom]:before:left-0 data-[side=bottom]:before:h-2.5 data-[side=left]:before:top-0 data-[side=left]:before:right-[-10px] data-[side=left]:before:bottom-0 data-[side=left]:before:w-2.5 data-[side=right]:before:top-0 data-[side=right]:before:bottom-0 data-[side=right]:before:left-[-10px] data-[side=right]:before:w-2.5 data-[side=top]:before:right-0 data-[side=top]:before:bottom-[-10px] data-[side=top]:before:left-0 data-[side=top]:before:h-2.5", typeof props.className === "function" ? props.className(s) : props.className),
|
|
44
|
+
style: {
|
|
45
|
+
["--duration"]: "0.35s",
|
|
46
|
+
["--easing"]: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
47
|
+
...props.style
|
|
48
|
+
},
|
|
49
|
+
children: /* @__PURE__ */ jsx(NavigationMenu$1.Popup, {
|
|
50
|
+
className: "data-[ending-style]:easing-[ease] relative border h-(--popup-height) origin-(--transform-origin) rounded-xl bg-fd-popover/80 text-fd-popover-foreground backdrop-blur-md shadow-lg transition-[opacity,transform,width,height,scale,translate] duration-(--duration) ease-(--easing) data-ending-style:scale-90 data-ending-style:opacity-0 data-ending-style:duration-150 data-starting-style:scale-90 data-starting-style:opacity-0 w-(--popup-width)",
|
|
51
|
+
children: /* @__PURE__ */ jsx(NavigationMenu$1.Viewport, { className: "relative size-full overflow-hidden" })
|
|
52
|
+
})
|
|
53
|
+
}) });
|
|
54
|
+
}
|
|
32
55
|
//#endregion
|
|
33
|
-
export { NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList,
|
|
34
|
-
//# sourceMappingURL=navigation-menu.js.map
|
|
56
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport };
|