@hanzo/docs-base-ui 16.5.3 → 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/css/generated/docs.css +68 -33
- package/css/generated/flux.css +44 -34
- package/css/generated/home.css +88 -4
- package/css/generated/notebook.css +65 -31
- package/css/generated/shared.css +199 -59
- package/css/lib/base.css +1 -4
- package/css/lib/shiki.css +49 -41
- package/css/preset.css +3 -0
- package/dist/_virtual/_rolldown/runtime.js +6 -11
- package/dist/components/accordion.d.ts +1 -2
- package/dist/components/accordion.js +3 -7
- package/dist/components/banner.d.ts +1 -2
- package/dist/components/banner.js +1 -5
- package/dist/components/callout.d.ts +1 -2
- package/dist/components/callout.js +0 -3
- package/dist/components/card.d.ts +1 -2
- package/dist/components/card.js +0 -3
- package/dist/components/codeblock.d.ts +1 -2
- package/dist/components/codeblock.js +2 -6
- 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 +1 -3
- package/dist/components/dialog/search-algolia.js +1 -5
- package/dist/components/dialog/search-default.d.ts +1 -3
- package/dist/components/dialog/search-default.js +1 -5
- package/dist/components/dialog/search-orama.d.ts +1 -3
- package/dist/components/dialog/search-orama.js +1 -5
- package/dist/components/dialog/search.d.ts +5 -5
- package/dist/components/dialog/search.js +124 -47
- package/dist/components/dynamic-codeblock.core.d.ts +7 -5
- package/dist/components/dynamic-codeblock.core.js +17 -32
- package/dist/components/dynamic-codeblock.d.ts +5 -3
- package/dist/components/dynamic-codeblock.js +8 -13
- package/dist/components/files.d.ts +1 -2
- package/dist/components/files.js +4 -8
- package/dist/components/github-info.d.ts +22 -9
- package/dist/components/github-info.js +33 -28
- package/dist/components/heading.d.ts +1 -2
- package/dist/components/heading.js +2 -5
- package/dist/components/image-zoom.d.ts +1 -2
- package/dist/components/image-zoom.js +2 -5
- package/dist/components/inline-toc.d.ts +1 -2
- package/dist/components/inline-toc.js +1 -5
- package/dist/components/sidebar/base.d.ts +7 -3
- package/dist/components/sidebar/base.js +6 -16
- package/dist/components/sidebar/link-item.d.ts +2 -3
- package/dist/components/sidebar/link-item.js +6 -3
- package/dist/components/sidebar/page-tree.d.ts +1 -2
- package/dist/components/sidebar/page-tree.js +54 -43
- package/dist/components/sidebar/tabs/dropdown.d.ts +4 -7
- package/dist/components/sidebar/tabs/dropdown.js +4 -11
- 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 +1 -2
- package/dist/components/steps.js +0 -3
- package/dist/components/tabs.d.ts +11 -7
- package/dist/components/tabs.js +13 -18
- package/dist/components/toc/clerk.d.ts +9 -2
- package/dist/components/toc/clerk.js +117 -62
- package/dist/components/toc/default.d.ts +9 -2
- package/dist/components/toc/default.js +28 -21
- package/dist/components/toc/index.d.ts +8 -5
- package/dist/components/toc/index.js +50 -25
- package/dist/components/type-table.d.ts +10 -5
- package/dist/components/type-table.js +22 -17
- package/dist/components/ui/accordion.d.ts +1 -2
- package/dist/components/ui/accordion.js +1 -5
- package/dist/components/ui/button.d.ts +2 -3
- package/dist/components/ui/button.js +0 -3
- package/dist/components/ui/collapsible.d.ts +1 -2
- package/dist/components/ui/collapsible.js +2 -6
- package/dist/components/ui/navigation-menu.d.ts +26 -12
- package/dist/components/ui/navigation-menu.js +52 -30
- package/dist/components/ui/popover.d.ts +10 -5
- package/dist/components/ui/popover.js +14 -18
- package/dist/components/ui/scroll-area.d.ts +17 -7
- package/dist/components/ui/scroll-area.js +26 -30
- package/dist/components/ui/tabs.d.ts +1 -2
- package/dist/components/ui/tabs.js +1 -5
- package/dist/contexts/i18n.d.ts +7 -5
- package/dist/contexts/i18n.js +3 -8
- package/dist/contexts/search.d.ts +2 -2
- package/dist/contexts/search.js +4 -6
- package/dist/contexts/tree.d.ts +1 -2
- package/dist/contexts/tree.js +1 -5
- package/dist/i18n.d.ts +16 -9
- package/dist/i18n.js +14 -14
- package/dist/layouts/docs/client.d.ts +30 -29
- package/dist/layouts/docs/client.js +72 -48
- package/dist/layouts/docs/index.d.ts +19 -33
- package/dist/layouts/docs/index.js +16 -172
- package/dist/layouts/docs/page/index.d.ts +67 -55
- package/dist/layouts/docs/page/index.js +74 -54
- 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 +34 -39
- package/dist/layouts/flux/index.js +77 -99
- package/dist/layouts/flux/page/index.d.ts +56 -49
- package/dist/layouts/flux/page/index.js +63 -35
- 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/{sidebar.js → slots/sidebar.js} +74 -34
- package/dist/layouts/flux/slots/tab-dropdown.d.ts +17 -0
- package/dist/layouts/flux/{tab-dropdown.js → slots/tab-dropdown.js} +13 -24
- package/dist/layouts/home/index.d.ts +24 -7
- package/dist/layouts/home/index.js +39 -19
- package/dist/layouts/home/navbar.d.ts +5 -14
- package/dist/layouts/home/navbar.js +10 -12
- 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 +57 -147
- package/dist/layouts/notebook/index.d.ts +25 -24
- package/dist/layouts/notebook/index.js +16 -212
- package/dist/layouts/notebook/page/index.d.ts +67 -55
- package/dist/layouts/notebook/page/index.js +74 -54
- 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 +136 -34
- package/dist/layouts/shared/index.js +49 -17
- 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} +11 -15
- package/dist/layouts/shared/slots/search-trigger.d.ts +23 -0
- package/dist/layouts/shared/{search-toggle.js → slots/search-trigger.js} +9 -13
- package/dist/layouts/shared/slots/theme-switch.d.ts +14 -0
- package/dist/layouts/shared/{theme-toggle.js → slots/theme-switch.js} +5 -9
- package/dist/mdx.d.ts +13 -3
- package/dist/mdx.js +0 -4
- package/dist/mdx.server.d.ts +1 -2
- 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 +1 -2
- package/dist/og.js +6 -6
- package/dist/page.d.ts +3 -4
- package/dist/page.js +6 -11
- package/dist/provider/base.d.ts +1 -2
- package/dist/provider/base.js +2 -6
- package/dist/provider/next.d.ts +1 -2
- package/dist/provider/next.js +1 -5
- package/dist/provider/react-router.d.ts +1 -2
- package/dist/provider/react-router.js +1 -5
- package/dist/provider/tanstack.d.ts +1 -2
- package/dist/provider/tanstack.js +1 -5
- package/dist/provider/waku.d.ts +1 -2
- package/dist/provider/waku.js +1 -5
- package/dist/style.css +433 -166
- package/dist/tailwind/typography.d.ts +2 -0
- package/dist/tailwind/typography.js +2 -0
- package/dist/utils/cn.js +1 -2
- package/dist/utils/merge-refs.js +0 -2
- package/dist/utils/urls.js +1 -3
- package/dist/utils/use-copy-button.d.ts +1 -2
- package/dist/utils/use-copy-button.js +1 -5
- package/dist/utils/use-footer-items.d.ts +1 -2
- package/dist/utils/use-footer-items.js +4 -8
- package/dist/utils/use-is-scroll-top.d.ts +1 -2
- package/dist/utils/use-is-scroll-top.js +1 -5
- package/package.json +139 -103
- package/LICENSE +0 -21
- 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.core.d.ts.map +0 -1
- package/dist/components/dynamic-codeblock.core.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-DGvp66QF.css +0 -80
- package/dist/components/image-zoom-DGvp66QF.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.d.ts.map +0 -1
- package/dist/components/toc/clerk.js.map +0 -1
- package/dist/components/toc/default.d.ts.map +0 -1
- package/dist/components/toc/default.js.map +0 -1
- package/dist/components/toc/index.d.ts.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.d.ts.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.d.ts.map +0 -1
- package/dist/contexts/tree.js.map +0 -1
- package/dist/i18n.d.ts.map +0 -1
- package/dist/i18n.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 -48
- 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 -64
- 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/flux/index.d.ts.map +0 -1
- package/dist/layouts/flux/index.js.map +0 -1
- package/dist/layouts/flux/page/client.d.ts +0 -45
- package/dist/layouts/flux/page/client.d.ts.map +0 -1
- package/dist/layouts/flux/page/client.js +0 -255
- package/dist/layouts/flux/page/client.js.map +0 -1
- package/dist/layouts/flux/page/index.d.ts.map +0 -1
- package/dist/layouts/flux/page/index.js.map +0 -1
- package/dist/layouts/flux/sidebar.d.ts +0 -59
- package/dist/layouts/flux/sidebar.d.ts.map +0 -1
- package/dist/layouts/flux/sidebar.js.map +0 -1
- package/dist/layouts/flux/tab-dropdown.d.ts +0 -21
- package/dist/layouts/flux/tab-dropdown.d.ts.map +0 -1
- package/dist/layouts/flux/tab-dropdown.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 -267
- 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 -48
- 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 -60
- 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/og.d.ts.map +0 -1
- package/dist/og.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
- package/dist/utils/link-item.d.ts +0 -86
- package/dist/utils/link-item.d.ts.map +0 -1
- package/dist/utils/link-item.js +0 -25
- package/dist/utils/link-item.js.map +0 -1
- package/dist/utils/merge-refs.js.map +0 -1
- package/dist/utils/urls.js.map +0 -1
- package/dist/utils/use-copy-button.d.ts.map +0 -1
- package/dist/utils/use-copy-button.js.map +0 -1
- package/dist/utils/use-footer-items.d.ts.map +0 -1
- package/dist/utils/use-footer-items.js.map +0 -1
- package/dist/utils/use-is-scroll-top.d.ts.map +0 -1
- package/dist/utils/use-is-scroll-top.js.map +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
3
2
|
import "./image-zoom.css";
|
|
3
|
+
/* empty css */
|
|
4
4
|
import { Image } from "@hanzo/docs-core/framework";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import Zoom from "react-medium-image-zoom";
|
|
7
|
-
|
|
8
7
|
//#region src/components/image-zoom.tsx
|
|
9
8
|
function getImageSrc(src) {
|
|
10
9
|
if (typeof src === "string") return src;
|
|
@@ -30,7 +29,5 @@ function ImageZoom({ zoomInProps, children, rmiz, ...props }) {
|
|
|
30
29
|
})
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
|
-
|
|
34
32
|
//#endregion
|
|
35
33
|
export { ImageZoom };
|
|
36
|
-
//# sourceMappingURL=image-zoom.js.map
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
3
2
|
import { cn } from "../utils/cn.js";
|
|
4
3
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible.js";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
import { ChevronDown } from "lucide-react";
|
|
7
|
-
|
|
8
6
|
//#region src/components/inline-toc.tsx
|
|
9
7
|
function InlineTOC({ items, className, ...props }) {
|
|
10
8
|
return /* @__PURE__ */ jsxs(Collapsible, {
|
|
@@ -24,7 +22,5 @@ function InlineTOC({ items, className, ...props }) {
|
|
|
24
22
|
}) })]
|
|
25
23
|
});
|
|
26
24
|
}
|
|
27
|
-
|
|
28
25
|
//#endregion
|
|
29
26
|
export { InlineTOC };
|
|
30
|
-
//# sourceMappingURL=inline-toc.js.map
|
|
@@ -75,9 +75,11 @@ declare function SidebarViewport({
|
|
|
75
75
|
declare function SidebarSeparator(props: ComponentProps<'p'>): react_jsx_runtime0.JSX.Element;
|
|
76
76
|
declare function SidebarItem({
|
|
77
77
|
icon,
|
|
78
|
+
active,
|
|
78
79
|
children,
|
|
79
80
|
...props
|
|
80
81
|
}: LinkProps & {
|
|
82
|
+
active?: boolean;
|
|
81
83
|
icon?: ReactNode;
|
|
82
84
|
}): react_jsx_runtime0.JSX.Element;
|
|
83
85
|
declare function SidebarFolder({
|
|
@@ -97,8 +99,11 @@ declare function SidebarFolderTrigger({
|
|
|
97
99
|
}: CollapsibleTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
98
100
|
declare function SidebarFolderLink({
|
|
99
101
|
children,
|
|
102
|
+
active,
|
|
100
103
|
...props
|
|
101
|
-
}: LinkProps
|
|
104
|
+
}: LinkProps & {
|
|
105
|
+
active?: boolean;
|
|
106
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
102
107
|
declare function SidebarFolderContent(props: CollapsibleContentProps): react_jsx_runtime0.JSX.Element;
|
|
103
108
|
declare function SidebarTrigger({
|
|
104
109
|
children,
|
|
@@ -110,5 +115,4 @@ declare function SidebarCollapseTrigger(props: ComponentProps<'button'>): react_
|
|
|
110
115
|
*/
|
|
111
116
|
declare function useAutoScroll(active: boolean, ref: RefObject<HTMLElement | null>): void;
|
|
112
117
|
//#endregion
|
|
113
|
-
export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarProviderProps, SidebarSeparator, SidebarTrigger, SidebarViewport, base_d_exports, useAutoScroll, useFolder, useFolderDepth, useSidebar };
|
|
114
|
-
//# sourceMappingURL=base.d.ts.map
|
|
118
|
+
export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarProviderProps, SidebarSeparator, SidebarTrigger, SidebarViewport, base_d_exports, useAutoScroll, useFolder, useFolderDepth, useSidebar };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
3
2
|
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
4
3
|
import { cn } from "../../utils/cn.js";
|
|
5
|
-
import { isActive } from "../../utils/urls.js";
|
|
6
4
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible.js";
|
|
7
5
|
import { ScrollArea, ScrollViewport } from "../ui/scroll-area.js";
|
|
8
6
|
import { createContext, use, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -14,7 +12,6 @@ import { useOnChange } from "@hanzo/docs-core/utils/use-on-change";
|
|
|
14
12
|
import { useMediaQuery } from "@hanzo/docs-core/utils/use-media-query";
|
|
15
13
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
16
14
|
import ReactDOM from "react-dom";
|
|
17
|
-
|
|
18
15
|
//#region src/components/sidebar/base.tsx
|
|
19
16
|
var base_exports = /* @__PURE__ */ __exportAll({
|
|
20
17
|
SidebarCollapseTrigger: () => SidebarCollapseTrigger,
|
|
@@ -143,8 +140,7 @@ function SidebarViewport({ className, ...props }) {
|
|
|
143
140
|
className: (s) => cn("min-h-0 flex-1", typeof className === "function" ? className(s) : className),
|
|
144
141
|
...props,
|
|
145
142
|
children: /* @__PURE__ */ jsx(ScrollViewport, {
|
|
146
|
-
className: "p-4 overscroll-contain",
|
|
147
|
-
style: { maskImage: "linear-gradient(to bottom, transparent, white 12px, white calc(100% - 12px), transparent)" },
|
|
143
|
+
className: "p-4 overscroll-contain mask-[linear-gradient(to_bottom,transparent,white_12px,white_calc(100%-12px),transparent)]",
|
|
148
144
|
children: props.children
|
|
149
145
|
})
|
|
150
146
|
});
|
|
@@ -157,11 +153,9 @@ function SidebarSeparator(props) {
|
|
|
157
153
|
children: props.children
|
|
158
154
|
});
|
|
159
155
|
}
|
|
160
|
-
function SidebarItem({ icon, children, ...props }) {
|
|
161
|
-
const pathname = usePathname();
|
|
156
|
+
function SidebarItem({ icon, active = false, children, ...props }) {
|
|
162
157
|
const ref = useRef(null);
|
|
163
158
|
const { prefetch } = useSidebar();
|
|
164
|
-
const active = props.href !== void 0 && isActive(props.href, pathname, false);
|
|
165
159
|
useAutoScroll(active, ref);
|
|
166
160
|
return /* @__PURE__ */ jsxs(Link, {
|
|
167
161
|
ref,
|
|
@@ -205,7 +199,7 @@ function SidebarFolderTrigger({ children, ...props }) {
|
|
|
205
199
|
...props,
|
|
206
200
|
children: [children, /* @__PURE__ */ jsx(ChevronDown, {
|
|
207
201
|
"data-icon": true,
|
|
208
|
-
className: cn("ms-auto transition-transform", !open && "-rotate-90")
|
|
202
|
+
className: cn("ms-auto transition-transform", !open && "-rotate-90 rtl:rotate-90")
|
|
209
203
|
})]
|
|
210
204
|
});
|
|
211
205
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -213,12 +207,10 @@ function SidebarFolderTrigger({ children, ...props }) {
|
|
|
213
207
|
children
|
|
214
208
|
});
|
|
215
209
|
}
|
|
216
|
-
function SidebarFolderLink({ children, ...props }) {
|
|
210
|
+
function SidebarFolderLink({ children, active = false, ...props }) {
|
|
217
211
|
const ref = useRef(null);
|
|
218
212
|
const { open, setOpen, collapsible } = use(FolderContext);
|
|
219
213
|
const { prefetch } = useSidebar();
|
|
220
|
-
const pathname = usePathname();
|
|
221
|
-
const active = props.href !== void 0 && isActive(props.href, pathname, false);
|
|
222
214
|
useAutoScroll(active, ref);
|
|
223
215
|
return /* @__PURE__ */ jsxs(Link, {
|
|
224
216
|
ref,
|
|
@@ -234,7 +226,7 @@ function SidebarFolderLink({ children, ...props }) {
|
|
|
234
226
|
...props,
|
|
235
227
|
children: [children, collapsible && /* @__PURE__ */ jsx(ChevronDown, {
|
|
236
228
|
"data-icon": true,
|
|
237
|
-
className: cn("ms-auto transition-transform", !open && "-rotate-90")
|
|
229
|
+
className: cn("ms-auto transition-transform", !open && "-rotate-90 rtl:rotate-90")
|
|
238
230
|
})]
|
|
239
231
|
});
|
|
240
232
|
}
|
|
@@ -282,7 +274,5 @@ function useAutoScroll(active, ref) {
|
|
|
282
274
|
ref
|
|
283
275
|
]);
|
|
284
276
|
}
|
|
285
|
-
|
|
286
277
|
//#endregion
|
|
287
278
|
export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarSeparator, SidebarTrigger, SidebarViewport, base_exports, useAutoScroll, useFolder, useFolderDepth, useSidebar };
|
|
288
|
-
//# sourceMappingURL=base.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { base_d_exports } from "./base.js";
|
|
2
|
-
import { LinkItemType } from "../../
|
|
2
|
+
import { LinkItemType } from "../../layouts/shared/index.js";
|
|
3
3
|
import { HTMLAttributes } from "react";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
|
|
@@ -20,5 +20,4 @@ declare function createLinkItemRenderer({
|
|
|
20
20
|
}>;
|
|
21
21
|
}) => react_jsx_runtime0.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
|
-
export { createLinkItemRenderer };
|
|
24
|
-
//# sourceMappingURL=link-item.d.ts.map
|
|
23
|
+
export { createLinkItemRenderer };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { isLinkItemActive } from "../../layouts/shared/index.js";
|
|
3
|
+
import { usePathname } from "@hanzo/docs-core/framework";
|
|
1
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
5
|
//#region src/components/sidebar/link-item.tsx
|
|
4
6
|
function createLinkItemRenderer({ SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem }) {
|
|
5
7
|
/**
|
|
6
8
|
* Render sidebar items from page tree
|
|
7
9
|
*/
|
|
8
10
|
return function SidebarLinkItem({ item, ...props }) {
|
|
11
|
+
const active = isLinkItemActive(item, usePathname());
|
|
9
12
|
if (item.type === "custom") return /* @__PURE__ */ jsx("div", {
|
|
10
13
|
...props,
|
|
11
14
|
children: item.children
|
|
@@ -14,6 +17,7 @@ function createLinkItemRenderer({ SidebarFolder, SidebarFolderContent, SidebarFo
|
|
|
14
17
|
...props,
|
|
15
18
|
children: [item.url ? /* @__PURE__ */ jsxs(SidebarFolderLink, {
|
|
16
19
|
href: item.url,
|
|
20
|
+
active,
|
|
17
21
|
external: item.external,
|
|
18
22
|
children: [item.icon, item.text]
|
|
19
23
|
}) : /* @__PURE__ */ jsxs(SidebarFolderTrigger, { children: [item.icon, item.text] }), /* @__PURE__ */ jsx(SidebarFolderContent, { children: item.items.map((child, i) => /* @__PURE__ */ jsx(SidebarLinkItem, { item: child }, i)) })]
|
|
@@ -22,12 +26,11 @@ function createLinkItemRenderer({ SidebarFolder, SidebarFolderContent, SidebarFo
|
|
|
22
26
|
href: item.url,
|
|
23
27
|
icon: item.icon,
|
|
24
28
|
external: item.external,
|
|
29
|
+
active,
|
|
25
30
|
...props,
|
|
26
31
|
children: item.text
|
|
27
32
|
});
|
|
28
33
|
};
|
|
29
34
|
}
|
|
30
|
-
|
|
31
35
|
//#endregion
|
|
32
36
|
export { createLinkItemRenderer };
|
|
33
|
-
//# sourceMappingURL=link-item.js.map
|
|
@@ -26,5 +26,4 @@ declare function createPageTreeRenderer({
|
|
|
26
26
|
SidebarItem
|
|
27
27
|
}: InternalComponents): (components: Partial<SidebarPageTreeComponents>) => react_jsx_runtime0.JSX.Element;
|
|
28
28
|
//#endregion
|
|
29
|
-
export { SidebarPageTreeComponents, createPageTreeRenderer };
|
|
30
|
-
//# sourceMappingURL=page-tree.d.ts.map
|
|
29
|
+
export { SidebarPageTreeComponents, createPageTreeRenderer };
|
|
@@ -1,58 +1,69 @@
|
|
|
1
1
|
import { useTreeContext, useTreePath } from "../../contexts/tree.js";
|
|
2
|
-
import {
|
|
2
|
+
import { isActive } from "../../utils/urls.js";
|
|
3
|
+
import { Fragment, createContext, use, useMemo } from "react";
|
|
4
|
+
import { usePathname } from "@hanzo/docs-core/framework";
|
|
3
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
6
|
//#region src/components/sidebar/page-tree.tsx
|
|
7
|
+
const RendererContext = createContext(null);
|
|
6
8
|
function createPageTreeRenderer({ SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarSeparator, SidebarItem }) {
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
function renderList(nodes) {
|
|
10
|
+
return nodes.map((node, i) => /* @__PURE__ */ jsx(PageTreeNode, { node }, i));
|
|
11
|
+
}
|
|
12
|
+
function PageTreeNode({ node }) {
|
|
13
|
+
const { Separator, Item, Folder, pathname } = use(RendererContext);
|
|
14
|
+
if (node.type === "separator") {
|
|
15
|
+
if (Separator) return /* @__PURE__ */ jsx(Separator, { item: node });
|
|
16
|
+
return /* @__PURE__ */ jsxs(SidebarSeparator, { children: [node.icon, node.name] });
|
|
17
|
+
}
|
|
18
|
+
if (node.type === "folder") {
|
|
19
|
+
const path = useTreePath();
|
|
20
|
+
if (Folder) return /* @__PURE__ */ jsx(Folder, {
|
|
21
|
+
item: node,
|
|
22
|
+
children: renderList(node.children)
|
|
23
|
+
});
|
|
24
|
+
return /* @__PURE__ */ jsxs(SidebarFolder, {
|
|
25
|
+
collapsible: node.collapsible,
|
|
26
|
+
active: path.includes(node),
|
|
27
|
+
defaultOpen: node.defaultOpen,
|
|
28
|
+
children: [node.index ? /* @__PURE__ */ jsxs(SidebarFolderLink, {
|
|
29
|
+
href: node.index.url,
|
|
30
|
+
active: isActive(node.index.url, pathname),
|
|
31
|
+
external: node.index.external,
|
|
32
|
+
children: [node.icon, node.name]
|
|
33
|
+
}) : /* @__PURE__ */ jsxs(SidebarFolderTrigger, { children: [node.icon, node.name] }), /* @__PURE__ */ jsx(SidebarFolderContent, { children: renderList(node.children) })]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (Item) return /* @__PURE__ */ jsx(Item, { item: node });
|
|
37
|
+
return /* @__PURE__ */ jsx(SidebarItem, {
|
|
38
|
+
href: node.url,
|
|
39
|
+
external: node.external,
|
|
40
|
+
active: isActive(node.url, pathname),
|
|
41
|
+
icon: node.icon,
|
|
42
|
+
children: node.name
|
|
18
43
|
});
|
|
19
44
|
}
|
|
20
45
|
/**
|
|
21
46
|
* Render sidebar items from page tree
|
|
22
47
|
*/
|
|
23
48
|
return function SidebarPageTree(components) {
|
|
49
|
+
const { Folder, Item, Separator } = components;
|
|
24
50
|
const { root } = useTreeContext();
|
|
25
|
-
const
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
external: item.external,
|
|
41
|
-
icon: item.icon,
|
|
42
|
-
children: item.name
|
|
43
|
-
}, item.url);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return /* @__PURE__ */ jsx(Fragment, { children: renderSidebarList(root.children) }, root.$id);
|
|
47
|
-
}, [
|
|
48
|
-
Folder,
|
|
49
|
-
Item,
|
|
50
|
-
Separator,
|
|
51
|
-
root
|
|
52
|
-
]);
|
|
51
|
+
const pathname = usePathname();
|
|
52
|
+
return /* @__PURE__ */ jsx(RendererContext, {
|
|
53
|
+
value: useMemo(() => ({
|
|
54
|
+
Folder,
|
|
55
|
+
Item,
|
|
56
|
+
Separator,
|
|
57
|
+
pathname
|
|
58
|
+
}), [
|
|
59
|
+
Folder,
|
|
60
|
+
Item,
|
|
61
|
+
Separator,
|
|
62
|
+
pathname
|
|
63
|
+
]),
|
|
64
|
+
children: /* @__PURE__ */ jsx(Fragment, { children: renderList(root.children) }, root.$id)
|
|
65
|
+
});
|
|
53
66
|
};
|
|
54
67
|
}
|
|
55
|
-
|
|
56
68
|
//#endregion
|
|
57
69
|
export { createPageTreeRenderer };
|
|
58
|
-
//# sourceMappingURL=page-tree.js.map
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LayoutTab, isLayoutTabActive } from "../../../layouts/shared/index.js";
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/sidebar/tabs/dropdown.d.ts
|
|
6
|
-
|
|
7
|
-
props?: ComponentProps<'a'>;
|
|
8
|
-
}
|
|
6
|
+
type SidebarTabWithProps = LayoutTab;
|
|
9
7
|
declare function SidebarTabsDropdown({
|
|
10
8
|
options,
|
|
11
9
|
placeholder,
|
|
@@ -14,7 +12,6 @@ declare function SidebarTabsDropdown({
|
|
|
14
12
|
placeholder?: ReactNode;
|
|
15
13
|
options: SidebarTabWithProps[];
|
|
16
14
|
} & ComponentProps<'button'>): react_jsx_runtime0.JSX.Element;
|
|
17
|
-
declare
|
|
15
|
+
declare const isTabActive: typeof isLayoutTabActive;
|
|
18
16
|
//#endregion
|
|
19
|
-
export { SidebarTabWithProps, SidebarTabsDropdown, isTabActive };
|
|
20
|
-
//# sourceMappingURL=dropdown.d.ts.map
|
|
17
|
+
export { SidebarTabWithProps, SidebarTabsDropdown, isTabActive };
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
3
2
|
import { cn } from "../../../utils/cn.js";
|
|
4
|
-
import { isActive, normalize } from "../../../utils/urls.js";
|
|
5
|
-
import { useSidebar } from "../base.js";
|
|
6
3
|
import { Popover, PopoverContent, PopoverTrigger } from "../../ui/popover.js";
|
|
4
|
+
import { isLayoutTabActive } from "../../../layouts/shared/index.js";
|
|
5
|
+
import { useSidebar } from "../base.js";
|
|
7
6
|
import { useMemo, useState } from "react";
|
|
8
7
|
import { usePathname } from "@hanzo/docs-core/framework";
|
|
9
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import Link from "@hanzo/docs-core/link";
|
|
11
10
|
import { Check, ChevronsUpDown } from "lucide-react";
|
|
12
|
-
|
|
13
11
|
//#region src/components/sidebar/tabs/dropdown.tsx
|
|
14
12
|
function SidebarTabsDropdown({ options, placeholder, ...props }) {
|
|
15
13
|
const [open, setOpen] = useState(false);
|
|
@@ -68,11 +66,6 @@ function SidebarTabsDropdown({ options, placeholder, ...props }) {
|
|
|
68
66
|
})]
|
|
69
67
|
});
|
|
70
68
|
}
|
|
71
|
-
|
|
72
|
-
if (tab.urls) return tab.urls.has(normalize(pathname));
|
|
73
|
-
return isActive(tab.url, pathname, true);
|
|
74
|
-
}
|
|
75
|
-
|
|
69
|
+
const isTabActive = isLayoutTabActive;
|
|
76
70
|
//#endregion
|
|
77
71
|
export { SidebarTabsDropdown, isTabActive };
|
|
78
|
-
//# sourceMappingURL=dropdown.js.map
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LayoutTab } from "../../../layouts/shared/index.js";
|
|
2
2
|
import * as PageTree from "@hanzo/docs-core/page-tree";
|
|
3
3
|
|
|
4
4
|
//#region src/components/sidebar/tabs/index.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Redirect URL of the folder, usually the index page
|
|
8
|
-
*/
|
|
9
|
-
url: string;
|
|
10
|
-
icon?: ReactNode;
|
|
11
|
-
title: ReactNode;
|
|
12
|
-
description?: ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Detect from a list of urls
|
|
15
|
-
*/
|
|
16
|
-
urls?: Set<string>;
|
|
17
|
-
unlisted?: boolean;
|
|
18
|
-
}
|
|
5
|
+
type SidebarTab = LayoutTab;
|
|
19
6
|
interface GetSidebarTabsOptions {
|
|
20
7
|
transform?: (option: SidebarTab, node: PageTree.Folder) => SidebarTab | null;
|
|
21
8
|
}
|
|
@@ -23,5 +10,4 @@ declare function getSidebarTabs(tree: PageTree.Root, {
|
|
|
23
10
|
transform
|
|
24
11
|
}?: GetSidebarTabsOptions): SidebarTab[];
|
|
25
12
|
//#endregion
|
|
26
|
-
export { GetSidebarTabsOptions, SidebarTab, getSidebarTabs };
|
|
27
|
-
//# sourceMappingURL=index.d.ts.map
|
|
13
|
+
export { GetSidebarTabsOptions, SidebarTab, getSidebarTabs };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
2
|
//#region src/components/sidebar/tabs/index.tsx
|
|
4
3
|
const defaultTransform = (option, node) => {
|
|
5
4
|
if (!node.icon) return option;
|
|
@@ -43,7 +42,5 @@ function getFolderUrls(folder, output = /* @__PURE__ */ new Set()) {
|
|
|
43
42
|
}
|
|
44
43
|
return output;
|
|
45
44
|
}
|
|
46
|
-
|
|
47
45
|
//#endregion
|
|
48
46
|
export { getSidebarTabs };
|
|
49
|
-
//# sourceMappingURL=index.js.map
|
package/dist/components/steps.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
2
|
//#region src/components/steps.tsx
|
|
4
3
|
function Steps({ children }) {
|
|
5
4
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -13,7 +12,5 @@ function Step({ children }) {
|
|
|
13
12
|
children
|
|
14
13
|
});
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
//#endregion
|
|
18
16
|
export { Step, Steps };
|
|
19
|
-
//# sourceMappingURL=steps.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Tabs as Tabs$1, TabsContent as TabsContent$1 } from "./ui/tabs.js";
|
|
2
|
-
import * as React from "react";
|
|
1
|
+
import { Tabs as Tabs$1, TabsContent as TabsContent$1, TabsList as TabsList$1, TabsTrigger as TabsTrigger$1 } from "./ui/tabs.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
-
import * as _base_ui_react0 from "@base-ui/react";
|
|
6
5
|
|
|
7
6
|
//#region src/components/tabs.d.ts
|
|
8
7
|
interface TabsProps extends Omit<ComponentProps<typeof Tabs$1>, 'value' | 'onValueChange'> {
|
|
@@ -21,8 +20,14 @@ interface TabsProps extends Omit<ComponentProps<typeof Tabs$1>, 'value' | 'onVal
|
|
|
21
20
|
*/
|
|
22
21
|
label?: ReactNode;
|
|
23
22
|
}
|
|
24
|
-
declare
|
|
25
|
-
|
|
23
|
+
declare function TabsList({
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: React$1.ComponentPropsWithRef<typeof TabsList$1>): react_jsx_runtime0.JSX.Element;
|
|
27
|
+
declare function TabsTrigger({
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
}: React$1.ComponentPropsWithRef<typeof TabsTrigger$1>): react_jsx_runtime0.JSX.Element;
|
|
26
31
|
declare function Tabs({
|
|
27
32
|
ref,
|
|
28
33
|
className,
|
|
@@ -48,5 +53,4 @@ declare function TabsContent({
|
|
|
48
53
|
...props
|
|
49
54
|
}: ComponentProps<typeof TabsContent$1>): react_jsx_runtime0.JSX.Element;
|
|
50
55
|
//#endregion
|
|
51
|
-
export { Tab, TabProps, Tabs, TabsContent, TabsList, TabsProps, TabsTrigger };
|
|
52
|
-
//# sourceMappingURL=tabs.d.ts.map
|
|
56
|
+
export { Tab, TabProps, Tabs, TabsContent, TabsList, TabsProps, TabsTrigger };
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
3
2
|
import { cn } from "../utils/cn.js";
|
|
4
3
|
import { Tabs as Tabs$1, TabsContent as TabsContent$1, TabsList as TabsList$1, TabsTrigger as TabsTrigger$1 } from "./ui/tabs.js";
|
|
5
|
-
import * as React from "react";
|
|
6
4
|
import { createContext, useContext, useEffect, useId, useMemo, useState } from "react";
|
|
7
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
6
|
//#region src/components/tabs.tsx
|
|
10
7
|
const TabsContext = createContext(null);
|
|
11
8
|
function useTabContext() {
|
|
@@ -13,18 +10,18 @@ function useTabContext() {
|
|
|
13
10
|
if (!ctx) throw new Error("You must wrap your component in <Tabs>");
|
|
14
11
|
return ctx;
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
})
|
|
27
|
-
|
|
13
|
+
function TabsList({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(TabsList$1, {
|
|
15
|
+
...props,
|
|
16
|
+
className: (s) => cn("flex gap-3.5 text-fd-secondary-foreground overflow-x-auto px-4 not-prose", typeof className === "function" ? className(s) : className)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function TabsTrigger({ className, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(TabsTrigger$1, {
|
|
21
|
+
...props,
|
|
22
|
+
className: (s) => cn("inline-flex items-center gap-2 whitespace-nowrap text-fd-muted-foreground border-b border-transparent py-2 text-sm font-medium transition-colors [&_svg]:size-4 hover:text-fd-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[active]:border-fd-primary data-[active]:text-fd-primary", typeof className === "function" ? className(s) : className)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
28
25
|
function Tabs({ ref, className, items, label, defaultIndex = 0, defaultValue = items ? escapeValue(items[defaultIndex]) : void 0, ...props }) {
|
|
29
26
|
const [value, setValue] = useState(defaultValue);
|
|
30
27
|
const collection = useMemo(() => [], []);
|
|
@@ -95,7 +92,5 @@ function useCollectionIndex() {
|
|
|
95
92
|
function escapeValue(v) {
|
|
96
93
|
return v.toLowerCase().replace(/\s/, "-");
|
|
97
94
|
}
|
|
98
|
-
|
|
99
95
|
//#endregion
|
|
100
96
|
export { Tab, Tabs, TabsContent, TabsList, TabsTrigger };
|
|
101
|
-
//# sourceMappingURL=tabs.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from "@hanzo/docs-core/toc";
|
|
3
4
|
|
|
4
5
|
//#region src/components/toc/clerk.d.ts
|
|
5
6
|
declare function TOCItems({
|
|
@@ -7,6 +8,12 @@ declare function TOCItems({
|
|
|
7
8
|
className,
|
|
8
9
|
...props
|
|
9
10
|
}: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
|
|
11
|
+
declare function TOCEmpty(): react_jsx_runtime0.JSX.Element;
|
|
12
|
+
declare function TOCItem({
|
|
13
|
+
item,
|
|
14
|
+
...props
|
|
15
|
+
}: Primitive.TOCItemProps & {
|
|
16
|
+
item: Primitive.TOCItemType;
|
|
17
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
10
18
|
//#endregion
|
|
11
|
-
export { TOCItems };
|
|
12
|
-
//# sourceMappingURL=clerk.d.ts.map
|
|
19
|
+
export { TOCEmpty, TOCItem, TOCItems };
|