@vx-oss/docs-react 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/css/generated/docs.css +1 -1
- package/css/generated/flux.css +1 -1
- package/css/generated/glass.css +1 -1
- package/css/generated/home.css +1 -1
- package/css/generated/notebook.css +1 -1
- package/css/generated/shared.css +1 -1
- package/css/lib/base.css +0 -127
- package/css/preset.css +1 -2
- package/css/style.css +1 -0
- package/dist/components/accordion.js +1 -68
- package/dist/components/banner.js +1 -85
- package/dist/components/callout.js +1 -60
- package/dist/components/card.js +1 -39
- package/dist/components/codeblock.js +1 -126
- package/dist/components/codeblock.rsc.js +1 -22
- package/dist/components/dialog/search-algolia.js +2 -64
- package/dist/components/dialog/search-default.js +2 -66
- package/dist/components/dialog/search-orama.js +2 -69
- package/dist/components/dialog/search.js +1 -351
- package/dist/components/dynamic-codeblock.core.js +1 -51
- package/dist/components/dynamic-codeblock.js +1 -17
- package/dist/components/files.js +1 -40
- package/dist/components/github-info.js +1 -75
- package/dist/components/heading.js +1 -38
- package/dist/components/image-zoom.js +1 -32
- package/dist/components/inline-toc.js +1 -28
- package/dist/components/sidebar/base.js +1 -277
- package/dist/components/sidebar/link-item.js +1 -37
- package/dist/components/sidebar/page-tree.js +1 -69
- package/dist/components/sidebar/tabs/dropdown.js +1 -83
- package/dist/components/sidebar/tabs/index.js +1 -46
- package/dist/components/steps.js +1 -16
- package/dist/components/tabs.js +1 -95
- package/dist/components/toc/clerk.js +1 -227
- package/dist/components/toc/default.js +1 -260
- package/dist/components/toc/index.js +1 -45
- package/dist/components/type-table.js +1 -117
- package/dist/components/ui/accordion.js +1 -42
- package/dist/components/ui/button.js +1 -20
- package/dist/components/ui/collapsible.js +1 -21
- package/dist/components/ui/popover.js +1 -20
- package/dist/components/ui/scroll-area.js +1 -34
- package/dist/components/ui/tabs.js +1 -102
- package/dist/contexts/i18n.js +1 -37
- package/dist/contexts/search.js +1 -68
- package/dist/contexts/tree.js +1 -91
- package/dist/i18n.js +1 -38
- package/dist/index.js +1 -0
- package/dist/layouts/docs/index.js +1 -23
- package/dist/layouts/docs/page/index.js +1 -124
- package/dist/layouts/docs/page/slots/breadcrumb.js +1 -44
- package/dist/layouts/docs/page/slots/container.js +1 -22
- package/dist/layouts/docs/page/slots/footer.js +1 -56
- package/dist/layouts/docs/page/slots/toc.js +1 -182
- package/dist/layouts/docs/slots/container.js +1 -36
- package/dist/layouts/docs/slots/header.js +1 -38
- package/dist/layouts/docs/slots/sidebar.js +1 -268
- package/dist/layouts/flux/index.js +1 -146
- package/dist/layouts/flux/page/index.js +1 -104
- package/dist/layouts/flux/page/slots/breadcrumb.js +1 -44
- package/dist/layouts/flux/page/slots/container.js +1 -22
- package/dist/layouts/flux/page/slots/footer.js +1 -56
- package/dist/layouts/flux/page/slots/toc.js +1 -181
- package/dist/layouts/flux/slots/container.js +1 -13
- package/dist/layouts/flux/slots/sidebar.js +1 -243
- package/dist/layouts/flux/slots/tab-dropdown.js +1 -88
- package/dist/layouts/glass/index.js +1 -70
- package/dist/layouts/glass/page/index.js +1 -92
- package/dist/layouts/glass/page/slots/breadcrumb.js +1 -44
- package/dist/layouts/glass/page/slots/footer.js +1 -56
- package/dist/layouts/glass/page/slots/toc.js +1 -108
- package/dist/layouts/glass/slots/header.js +1 -68
- package/dist/layouts/glass/slots/sidebar.js +1 -267
- package/dist/layouts/home/index.js +1 -40
- package/dist/layouts/home/navbar.js +1 -34
- package/dist/layouts/home/not-found.js +1 -41
- package/dist/layouts/home/slots/container.js +1 -13
- package/dist/layouts/home/slots/header.js +1 -239
- package/dist/layouts/notebook/index.js +1 -23
- package/dist/layouts/notebook/page/index.js +1 -124
- package/dist/layouts/notebook/page/slots/breadcrumb.js +1 -44
- package/dist/layouts/notebook/page/slots/container.js +1 -22
- package/dist/layouts/notebook/page/slots/footer.js +1 -56
- package/dist/layouts/notebook/page/slots/toc.js +1 -181
- package/dist/layouts/notebook/slots/container.js +1 -38
- package/dist/layouts/notebook/slots/header.js +1 -204
- package/dist/layouts/notebook/slots/sidebar.js +1 -240
- package/dist/layouts/shared/index.js +1 -98
- package/dist/layouts/shared/slots/language-select.js +1 -43
- package/dist/layouts/shared/slots/search-trigger.js +1 -53
- package/dist/layouts/shared/slots/theme-switch.js +1 -70
- package/dist/mdx.d.ts +2 -44
- package/dist/mdx.js +2 -70
- package/dist/mdx.server.js +2 -20
- package/dist/og/takumi.js +1 -91
- package/dist/og.js +1 -91
- package/dist/page.js +1 -33
- package/dist/primitives/accordion.js +1 -0
- package/dist/primitives/collapsible.js +1 -0
- package/dist/primitives/dialog.js +1 -0
- package/dist/primitives/direction-provider.js +1 -0
- package/dist/primitives/drawer.js +1 -0
- package/dist/primitives/navigation-menu.js +1 -0
- package/dist/primitives/popover.js +1 -0
- package/dist/primitives/scroll-area.js +1 -0
- package/dist/primitives/shared.js +1 -0
- package/dist/primitives/tabs.js +1 -0
- package/dist/provider/astro.js +1 -20
- package/dist/provider/base.js +1 -73
- package/dist/provider/next.js +1 -17
- package/dist/provider/react-router.js +1 -17
- package/dist/provider/tanstack.js +1 -17
- package/dist/provider/waku.js +1 -17
- package/dist/style.css +11577 -310
- package/dist/utils/use-copy-button.js +1 -26
- package/dist/utils/use-footer-items.js +1 -24
- package/dist/utils/use-is-scroll-top.js +1 -20
- package/package.json +28 -66
- package/css/preset-legacy.css +0 -43
- package/dist/.translations/index.d.ts +0 -55
- package/dist/.translations/keys.js +0 -55
- package/dist/_virtual/_rolldown/runtime.js +0 -13
- package/dist/components/accordion.d.ts +0 -10
- package/dist/components/banner.d.ts +0 -25
- package/dist/components/callout.d.ts +0 -21
- package/dist/components/card.d.ts +0 -13
- package/dist/components/codeblock.d.ts +0 -45
- package/dist/components/codeblock.rsc.d.ts +0 -15
- package/dist/components/dialog/search-algolia.d.ts +0 -27
- package/dist/components/dialog/search-default.d.ts +0 -29
- package/dist/components/dialog/search-orama.d.ts +0 -32
- package/dist/components/dialog/search.d.ts +0 -76
- package/dist/components/dynamic-codeblock.core.d.ts +0 -26
- package/dist/components/dynamic-codeblock.d.ts +0 -8
- package/dist/components/files.d.ts +0 -21
- package/dist/components/github-info.d.ts +0 -20
- package/dist/components/heading.d.ts +0 -9
- package/dist/components/image-zoom.d.ts +0 -18
- package/dist/components/inline-toc.d.ts +0 -10
- package/dist/components/sidebar/base.d.ts +0 -85
- package/dist/components/sidebar/link-item.d.ts +0 -12
- package/dist/components/sidebar/page-tree.d.ts +0 -20
- package/dist/components/sidebar/tabs/dropdown.d.ts +0 -15
- package/dist/components/sidebar/tabs/index.d.ts +0 -8
- package/dist/components/steps.d.ts +0 -10
- package/dist/components/tabs.d.ts +0 -33
- package/dist/components/toc/clerk.d.ts +0 -11
- package/dist/components/toc/default.d.ts +0 -13
- package/dist/components/toc/index.d.ts +0 -10
- package/dist/components/type-table.d.ts +0 -37
- package/dist/components/ui/accordion.d.ts +0 -10
- package/dist/components/ui/button.d.ts +0 -10
- package/dist/components/ui/collapsible.d.ts +0 -11
- package/dist/components/ui/navigation-menu.d.ts +0 -14
- package/dist/components/ui/navigation-menu.js +0 -41
- package/dist/components/ui/popover.d.ts +0 -9
- package/dist/components/ui/scroll-area.d.ts +0 -9
- package/dist/components/ui/tabs.d.ts +0 -23
- package/dist/contexts/i18n.d.ts +0 -34
- package/dist/contexts/search.d.ts +0 -64
- package/dist/contexts/tree.d.ts +0 -29
- package/dist/i18n.d.ts +0 -15
- package/dist/layouts/docs/client.d.ts +0 -33
- package/dist/layouts/docs/client.js +0 -94
- package/dist/layouts/docs/index.d.ts +0 -32
- package/dist/layouts/docs/page/index.d.ts +0 -76
- package/dist/layouts/docs/page/slots/breadcrumb.d.ts +0 -7
- package/dist/layouts/docs/page/slots/container.d.ts +0 -5
- package/dist/layouts/docs/page/slots/footer.d.ts +0 -16
- package/dist/layouts/docs/page/slots/toc.d.ts +0 -47
- package/dist/layouts/docs/slots/container.d.ts +0 -5
- package/dist/layouts/docs/slots/header.d.ts +0 -5
- package/dist/layouts/docs/slots/sidebar.d.ts +0 -22
- package/dist/layouts/flux/index.d.ts +0 -61
- package/dist/layouts/flux/page/index.d.ts +0 -67
- package/dist/layouts/flux/page/slots/breadcrumb.d.ts +0 -7
- package/dist/layouts/flux/page/slots/container.d.ts +0 -5
- package/dist/layouts/flux/page/slots/footer.d.ts +0 -16
- package/dist/layouts/flux/page/slots/toc.d.ts +0 -29
- package/dist/layouts/flux/slots/container.d.ts +0 -5
- package/dist/layouts/flux/slots/sidebar.d.ts +0 -16
- package/dist/layouts/flux/slots/tab-dropdown.d.ts +0 -10
- package/dist/layouts/glass/index.d.ts +0 -39
- package/dist/layouts/glass/layout-tabs.js +0 -54
- package/dist/layouts/glass/page/index.d.ts +0 -31
- package/dist/layouts/glass/page/slots/breadcrumb.d.ts +0 -7
- package/dist/layouts/glass/page/slots/footer.d.ts +0 -16
- package/dist/layouts/glass/page/slots/toc.d.ts +0 -19
- package/dist/layouts/glass/slots/header.d.ts +0 -6
- package/dist/layouts/glass/slots/sidebar.d.ts +0 -21
- package/dist/layouts/home/index.d.ts +0 -27
- package/dist/layouts/home/navbar.d.ts +0 -9
- package/dist/layouts/home/not-found.d.ts +0 -7
- package/dist/layouts/home/slots/container.d.ts +0 -5
- package/dist/layouts/home/slots/header.d.ts +0 -8
- package/dist/layouts/notebook/client.d.ts +0 -35
- package/dist/layouts/notebook/client.js +0 -69
- package/dist/layouts/notebook/index.d.ts +0 -26
- package/dist/layouts/notebook/page/index.d.ts +0 -76
- package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +0 -7
- package/dist/layouts/notebook/page/slots/container.d.ts +0 -5
- package/dist/layouts/notebook/page/slots/footer.d.ts +0 -16
- package/dist/layouts/notebook/page/slots/toc.d.ts +0 -47
- package/dist/layouts/notebook/slots/container.d.ts +0 -5
- package/dist/layouts/notebook/slots/header.d.ts +0 -5
- package/dist/layouts/notebook/slots/sidebar.d.ts +0 -23
- package/dist/layouts/shared/client.d.ts +0 -37
- package/dist/layouts/shared/client.js +0 -85
- package/dist/layouts/shared/index.d.ts +0 -169
- package/dist/layouts/shared/page-actions.d.ts +0 -27
- package/dist/layouts/shared/page-actions.js +0 -199
- package/dist/layouts/shared/slots/language-select.d.ts +0 -12
- package/dist/layouts/shared/slots/search-trigger.d.ts +0 -13
- package/dist/layouts/shared/slots/theme-switch.d.ts +0 -8
- package/dist/legacy/layout.d.ts +0 -29
- package/dist/legacy/layout.js +0 -44
- package/dist/legacy/sidebar.d.ts +0 -14
- package/dist/legacy/sidebar.js +0 -34
- package/dist/mdx.server.d.ts +0 -14
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/controlled.d.ts +0 -30
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/controlled.js +0 -461
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/index.d.ts +0 -3
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/uncontrolled.d.ts +0 -6
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/uncontrolled.js +0 -17
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/adjust-svg-ids.js +0 -53
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/compute-positioned-style.js +0 -25
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/element-tests.js +0 -12
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-div-img-style.js +0 -45
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-alt.js +0 -10
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-object-fit-style.js +0 -57
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-regular-style.js +0 -21
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-src.js +0 -14
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-modal-img-transform.js +0 -22
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-scale.js +0 -27
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-style-ghost.js +0 -31
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-style-modal-img.js +0 -75
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-target-dimension.js +0 -4
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/parse-position.js +0 -7
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/test-has-scalable-src.js +0 -5
- package/dist/og/takumi.d.ts +0 -15
- package/dist/og.d.ts +0 -16
- package/dist/page.d.ts +0 -29
- package/dist/provider/astro.d.ts +0 -29
- package/dist/provider/base.d.ts +0 -48
- package/dist/provider/next.d.ts +0 -16
- package/dist/provider/react-router.d.ts +0 -16
- package/dist/provider/tanstack.d.ts +0 -16
- package/dist/provider/waku.d.ts +0 -16
- package/dist/utils/cn.js +0 -2
- package/dist/utils/merge-refs.js +0 -11
- package/dist/utils/urls.js +0 -15
- package/dist/utils/use-copy-button.d.ts +0 -5
- package/dist/utils/use-footer-items.d.ts +0 -8
- package/dist/utils/use-is-scroll-top.d.ts +0 -6
|
@@ -1,56 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cn } from "../../../../utils/cn.js";
|
|
3
|
-
import { isActive } from "../../../../utils/urls.js";
|
|
4
|
-
import { useFooterItems } from "../../../../utils/use-footer-items.js";
|
|
5
|
-
import Link from "@vx-oss/docs-core/link";
|
|
6
|
-
import { usePathname } from "@vx-oss/docs-core/framework";
|
|
7
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
9
|
-
import { useMemo } from "react";
|
|
10
|
-
import { useTranslations } from "@fuma-translate/react";
|
|
11
|
-
//#region src/layouts/docs/page/slots/footer.tsx
|
|
12
|
-
function Footer({ items, children, className, ...props }) {
|
|
13
|
-
const footerList = useFooterItems();
|
|
14
|
-
const pathname = usePathname();
|
|
15
|
-
const { previous, next } = useMemo(() => {
|
|
16
|
-
if (items) return items;
|
|
17
|
-
const idx = footerList.findIndex((item) => isActive(item.url, pathname));
|
|
18
|
-
if (idx === -1) return {};
|
|
19
|
-
return {
|
|
20
|
-
previous: footerList[idx - 1],
|
|
21
|
-
next: footerList[idx + 1]
|
|
22
|
-
};
|
|
23
|
-
}, [
|
|
24
|
-
footerList,
|
|
25
|
-
items,
|
|
26
|
-
pathname
|
|
27
|
-
]);
|
|
28
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
29
|
-
className: cn("@container grid gap-4", previous && next ? "grid-cols-2" : "grid-cols-1", className),
|
|
30
|
-
...props,
|
|
31
|
-
children: [previous && /* @__PURE__ */ jsx(FooterItem, {
|
|
32
|
-
item: previous,
|
|
33
|
-
index: 0
|
|
34
|
-
}), next && /* @__PURE__ */ jsx(FooterItem, {
|
|
35
|
-
item: next,
|
|
36
|
-
index: 1
|
|
37
|
-
})]
|
|
38
|
-
}), children] });
|
|
39
|
-
}
|
|
40
|
-
function FooterItem({ item, index }) {
|
|
41
|
-
const t = useTranslations({ note: "pagination" });
|
|
42
|
-
const Icon = index === 0 ? ChevronLeft : ChevronRight;
|
|
43
|
-
return /* @__PURE__ */ jsxs(Link, {
|
|
44
|
-
href: item.url,
|
|
45
|
-
className: cn("flex flex-col gap-2 rounded-lg border p-4 text-sm transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground @max-lg:col-span-full", index === 1 && "text-end"),
|
|
46
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
47
|
-
className: cn("inline-flex items-center gap-1.5 font-medium", index === 1 && "flex-row-reverse"),
|
|
48
|
-
children: [/* @__PURE__ */ jsx(Icon, { className: "-mx-1 size-4 shrink-0 rtl:rotate-180" }), /* @__PURE__ */ jsx("p", { children: item.name })]
|
|
49
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
50
|
-
className: "text-fd-muted-foreground truncate",
|
|
51
|
-
children: item.description ?? (index === 0 ? t("Previous Page") : t("Next Page"))
|
|
52
|
-
})]
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
|
-
export { Footer };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/layouts/docs/page/slots/footer';
|
|
@@ -1,182 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cn } from "../../../../utils/cn.js";
|
|
3
|
-
import { TOCProvider as TOCProvider$1, TOCScrollArea, useItems, useTOCItems } from "../../../../components/toc/index.js";
|
|
4
|
-
import { default_exports } from "../../../../components/toc/default.js";
|
|
5
|
-
import { clerk_exports } from "../../../../components/toc/clerk.js";
|
|
6
|
-
import { useTreePath } from "../../../../contexts/tree.js";
|
|
7
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../../components/ui/collapsible.js";
|
|
8
|
-
import { useDocsLayout } from "../../client.js";
|
|
9
|
-
import "../../index.js";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { ChevronDown, Text } from "lucide-react";
|
|
12
|
-
import { createContext, use, useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
|
|
13
|
-
import { useTranslations } from "@fuma-translate/react";
|
|
14
|
-
//#region src/layouts/docs/page/slots/toc.tsx
|
|
15
|
-
function TOCProvider(props) {
|
|
16
|
-
return /* @__PURE__ */ jsx(TOCProvider$1, { ...props });
|
|
17
|
-
}
|
|
18
|
-
function TOC({ container, header, footer, style = "normal", list }) {
|
|
19
|
-
const items = useTOCItems();
|
|
20
|
-
const t = useTranslations({ note: "table of contents" });
|
|
21
|
-
const { TOCItems, TOCEmpty, TOCItem } = style === "clerk" ? clerk_exports : default_exports;
|
|
22
|
-
if (items.length === 0 && !header && !footer) return /* @__PURE__ */ jsx("div", {
|
|
23
|
-
id: "nd-toc-placeholder",
|
|
24
|
-
className: "hidden xl:layout:[--fd-toc-width:268px]"
|
|
25
|
-
});
|
|
26
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
27
|
-
id: "nd-toc",
|
|
28
|
-
...container,
|
|
29
|
-
className: cn("sticky top-(--fd-docs-row-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] flex flex-col [grid-area:toc] w-(--fd-toc-width) pt-12 pe-4 pb-2 xl:layout:[--fd-toc-width:268px] max-xl:hidden", container?.className),
|
|
30
|
-
children: [
|
|
31
|
-
header,
|
|
32
|
-
/* @__PURE__ */ jsxs("h3", {
|
|
33
|
-
id: "toc-title",
|
|
34
|
-
className: "inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground",
|
|
35
|
-
children: [/* @__PURE__ */ jsx(Text, { className: "size-4" }), t("On this page")]
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */ jsx(TOCScrollArea, { children: /* @__PURE__ */ jsxs(TOCItems, {
|
|
38
|
-
...list,
|
|
39
|
-
children: [items.length === 0 && /* @__PURE__ */ jsx(TOCEmpty, {}), items.map((item) => /* @__PURE__ */ jsx(TOCItem, { item }, item.url))]
|
|
40
|
-
}) }),
|
|
41
|
-
footer
|
|
42
|
-
]
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
const TocPopoverContext = createContext(null);
|
|
46
|
-
function TOCPopover({ container, trigger, content, header, footer, style = "normal", list }) {
|
|
47
|
-
const items = useTOCItems();
|
|
48
|
-
const ref = useRef(null);
|
|
49
|
-
const [open, setOpen] = useState(false);
|
|
50
|
-
const { isNavTransparent } = useDocsLayout();
|
|
51
|
-
const { TOCItems, TOCItem, TOCEmpty } = style === "clerk" ? clerk_exports : default_exports;
|
|
52
|
-
const onClickOutside = useEffectEvent((e) => {
|
|
53
|
-
if (!open || !(e.target instanceof HTMLElement)) return;
|
|
54
|
-
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
55
|
-
});
|
|
56
|
-
const onClickItem = () => {
|
|
57
|
-
setOpen(false);
|
|
58
|
-
};
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
window.addEventListener("click", onClickOutside);
|
|
61
|
-
return () => {
|
|
62
|
-
window.removeEventListener("click", onClickOutside);
|
|
63
|
-
};
|
|
64
|
-
}, []);
|
|
65
|
-
return /* @__PURE__ */ jsx(TocPopoverContext, {
|
|
66
|
-
value: useMemo(() => ({
|
|
67
|
-
open,
|
|
68
|
-
setOpen
|
|
69
|
-
}), [setOpen, open]),
|
|
70
|
-
children: /* @__PURE__ */ jsx(Collapsible, {
|
|
71
|
-
open,
|
|
72
|
-
onOpenChange: setOpen,
|
|
73
|
-
"data-toc-popover": "",
|
|
74
|
-
...container,
|
|
75
|
-
className: cn("sticky top-(--fd-docs-row-2) z-10 [grid-area:toc-popover] h-(--fd-toc-popover-height) xl:hidden max-xl:layout:[--fd-toc-popover-height:--spacing(10)]", container?.className),
|
|
76
|
-
children: /* @__PURE__ */ jsxs("header", {
|
|
77
|
-
ref,
|
|
78
|
-
className: cn("border-b backdrop-blur-sm transition-colors", (!isNavTransparent || open) && "bg-fd-background/80", open && "shadow-lg"),
|
|
79
|
-
children: [/* @__PURE__ */ jsx(PageTOCPopoverTrigger, { ...trigger }), /* @__PURE__ */ jsxs(PageTOCPopoverContent, {
|
|
80
|
-
...content,
|
|
81
|
-
children: [
|
|
82
|
-
header,
|
|
83
|
-
/* @__PURE__ */ jsx(TOCScrollArea, { children: /* @__PURE__ */ jsxs(TOCItems, {
|
|
84
|
-
...list,
|
|
85
|
-
children: [items.length === 0 && /* @__PURE__ */ jsx(TOCEmpty, {}), items.map((item) => /* @__PURE__ */ jsx(TOCItem, {
|
|
86
|
-
item,
|
|
87
|
-
onClick: onClickItem
|
|
88
|
-
}, item.url))]
|
|
89
|
-
}) }),
|
|
90
|
-
footer
|
|
91
|
-
]
|
|
92
|
-
})]
|
|
93
|
-
})
|
|
94
|
-
})
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function PageTOCPopoverTrigger({ className, ...props }) {
|
|
98
|
-
const t = useTranslations({ note: "table of contents" });
|
|
99
|
-
const { open } = use(TocPopoverContext);
|
|
100
|
-
const items = useItems();
|
|
101
|
-
const selectedIdx = items.findIndex((item) => item.active);
|
|
102
|
-
const path = useTreePath().at(-1);
|
|
103
|
-
const showItem = selectedIdx !== -1 && !open;
|
|
104
|
-
return /* @__PURE__ */ jsxs(CollapsibleTrigger, {
|
|
105
|
-
className: cn("flex w-full h-10 items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:size-4 md:px-6", className),
|
|
106
|
-
"data-toc-popover-trigger": "",
|
|
107
|
-
...props,
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ jsx(ProgressCircle, {
|
|
110
|
-
value: (items.findLastIndex((item) => item.active) + 1) / Math.max(1, items.length),
|
|
111
|
-
max: 1,
|
|
112
|
-
className: cn("shrink-0", open && "text-fd-primary")
|
|
113
|
-
}),
|
|
114
|
-
/* @__PURE__ */ jsxs("span", {
|
|
115
|
-
className: "grid flex-1 *:my-auto *:row-start-1 *:col-start-1",
|
|
116
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
117
|
-
className: cn("truncate transition-[opacity,translate,color]", open && "text-fd-foreground", showItem && "opacity-0 -translate-y-full pointer-events-none"),
|
|
118
|
-
children: path?.name ?? t("On this page")
|
|
119
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
120
|
-
className: cn("truncate transition-[opacity,translate]", !showItem && "opacity-0 translate-y-full pointer-events-none"),
|
|
121
|
-
children: items[selectedIdx]?.original.title
|
|
122
|
-
})]
|
|
123
|
-
}),
|
|
124
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: cn("shrink-0 transition-transform mx-0.5", open && "rotate-180") })
|
|
125
|
-
]
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
function clamp(input, min, max) {
|
|
129
|
-
if (input < min) return min;
|
|
130
|
-
if (input > max) return max;
|
|
131
|
-
return input;
|
|
132
|
-
}
|
|
133
|
-
function ProgressCircle({ value, strokeWidth = 1.5, size = 18, min = 0, max = 100, style, ...restSvgProps }) {
|
|
134
|
-
const normalizedValue = clamp(value, min, max);
|
|
135
|
-
const radius = size / 2 - strokeWidth;
|
|
136
|
-
const circumference = 2 * Math.PI * radius;
|
|
137
|
-
const progress = normalizedValue / max * circumference;
|
|
138
|
-
const circleProps = {
|
|
139
|
-
cx: size / 2,
|
|
140
|
-
cy: size / 2,
|
|
141
|
-
r: radius,
|
|
142
|
-
fill: "none",
|
|
143
|
-
strokeWidth
|
|
144
|
-
};
|
|
145
|
-
return /* @__PURE__ */ jsxs("svg", {
|
|
146
|
-
role: "progressbar",
|
|
147
|
-
viewBox: `0 0 ${size} ${size}`,
|
|
148
|
-
"aria-valuenow": normalizedValue,
|
|
149
|
-
"aria-valuemin": min,
|
|
150
|
-
"aria-valuemax": max,
|
|
151
|
-
style: {
|
|
152
|
-
width: size,
|
|
153
|
-
height: size,
|
|
154
|
-
...style
|
|
155
|
-
},
|
|
156
|
-
...restSvgProps,
|
|
157
|
-
children: [/* @__PURE__ */ jsx("circle", {
|
|
158
|
-
...circleProps,
|
|
159
|
-
className: "stroke-current/25"
|
|
160
|
-
}), /* @__PURE__ */ jsx("circle", {
|
|
161
|
-
...circleProps,
|
|
162
|
-
stroke: "currentColor",
|
|
163
|
-
strokeDasharray: circumference,
|
|
164
|
-
strokeDashoffset: circumference - progress,
|
|
165
|
-
strokeLinecap: "round",
|
|
166
|
-
transform: `rotate(-90 ${size / 2} ${size / 2})`,
|
|
167
|
-
className: "transition-all"
|
|
168
|
-
})]
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
function PageTOCPopoverContent(props) {
|
|
172
|
-
return /* @__PURE__ */ jsx(CollapsibleContent, {
|
|
173
|
-
"data-toc-popover-content": "",
|
|
174
|
-
...props,
|
|
175
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
176
|
-
className: "flex flex-col px-4 max-h-[50vh] md:px-6",
|
|
177
|
-
children: props.children
|
|
178
|
-
})
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
//#endregion
|
|
182
|
-
export { TOC, TOCPopover, TOCProvider };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/layouts/docs/page/slots/toc';
|
|
@@ -1,36 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cn } from "../../../utils/cn.js";
|
|
3
|
-
import { useDocsLayout } from "../client.js";
|
|
4
|
-
import "../index.js";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { useEffect, useState } from "react";
|
|
7
|
-
//#region src/layouts/docs/slots/container.tsx
|
|
8
|
-
function Container(props) {
|
|
9
|
-
const { slots } = useDocsLayout();
|
|
10
|
-
const { collapsed } = slots.sidebar.useSidebar();
|
|
11
|
-
const [previousCollapsed, setPreviousCollapsed] = useState(collapsed);
|
|
12
|
-
const isCollapseChanged = previousCollapsed !== collapsed;
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (isCollapseChanged) setPreviousCollapsed(collapsed);
|
|
15
|
-
}, [collapsed, isCollapseChanged]);
|
|
16
|
-
return /* @__PURE__ */ jsx("div", {
|
|
17
|
-
id: "nd-docs-layout",
|
|
18
|
-
"data-sidebar-collapsed": collapsed,
|
|
19
|
-
"data-column-changed": isCollapseChanged,
|
|
20
|
-
...props,
|
|
21
|
-
style: {
|
|
22
|
-
gridTemplate: `"sidebar sidebar header toc toc"
|
|
23
|
-
"sidebar sidebar toc-popover toc toc"
|
|
24
|
-
"sidebar sidebar main toc toc" 1fr / minmax(min-content, 1fr) var(--fd-sidebar-col) minmax(0, calc(var(--fd-layout-width,97rem) - var(--fd-sidebar-width) - var(--fd-toc-width))) var(--fd-toc-width) minmax(min-content, 1fr)`,
|
|
25
|
-
"--fd-docs-row-1": "var(--fd-banner-height, 0px)",
|
|
26
|
-
"--fd-docs-row-2": "calc(var(--fd-docs-row-1) + var(--fd-header-height))",
|
|
27
|
-
"--fd-docs-row-3": "calc(var(--fd-docs-row-2) + var(--fd-toc-popover-height))",
|
|
28
|
-
"--fd-sidebar-col": collapsed ? "0px" : "var(--fd-sidebar-width)",
|
|
29
|
-
...props.style
|
|
30
|
-
},
|
|
31
|
-
className: cn("grid overflow-x-clip min-h-(--fd-docs-height) [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px] data-[column-changed=true]:transition-[grid-template-columns]", props.className),
|
|
32
|
-
children: props.children
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { Container };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/layouts/docs/slots/container';
|
|
@@ -1,38 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cn } from "../../../utils/cn.js";
|
|
3
|
-
import { buttonVariants } from "../../../components/ui/button.js";
|
|
4
|
-
import { useDocsLayout } from "../client.js";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { SidebarIcon } from "lucide-react";
|
|
7
|
-
//#region src/layouts/docs/slots/header.tsx
|
|
8
|
-
function Header(props) {
|
|
9
|
-
const { isNavTransparent, slots, props: { nav } } = useDocsLayout();
|
|
10
|
-
if (nav?.component) return nav.component;
|
|
11
|
-
return /* @__PURE__ */ jsxs("header", {
|
|
12
|
-
id: "nd-subnav",
|
|
13
|
-
"data-transparent": isNavTransparent,
|
|
14
|
-
...props,
|
|
15
|
-
className: cn("[grid-area:header] sticky top-(--fd-docs-row-1) z-30 flex items-center ps-4 pe-2.5 border-b transition-colors backdrop-blur-sm h-(--fd-header-height) md:hidden max-md:layout:[--fd-header-height:--spacing(14)] data-[transparent=false]:bg-fd-background/80", props.className),
|
|
16
|
-
children: [
|
|
17
|
-
slots.navTitle && /* @__PURE__ */ jsx(slots.navTitle, { className: "inline-flex items-center gap-2.5 font-semibold" }),
|
|
18
|
-
/* @__PURE__ */ jsx("div", {
|
|
19
|
-
className: "flex-1",
|
|
20
|
-
children: nav?.children
|
|
21
|
-
}),
|
|
22
|
-
slots.searchTrigger && /* @__PURE__ */ jsx(slots.searchTrigger.sm, {
|
|
23
|
-
hideIfDisabled: true,
|
|
24
|
-
className: "p-2"
|
|
25
|
-
}),
|
|
26
|
-
slots.sidebar && /* @__PURE__ */ jsx(slots.sidebar.trigger, {
|
|
27
|
-
className: cn(buttonVariants({
|
|
28
|
-
color: "ghost",
|
|
29
|
-
size: "icon-sm",
|
|
30
|
-
className: "p-2"
|
|
31
|
-
})),
|
|
32
|
-
children: /* @__PURE__ */ jsx(SidebarIcon, {})
|
|
33
|
-
})
|
|
34
|
-
]
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
export { Header };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/layouts/docs/slots/header';
|
|
@@ -1,268 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cn } from "../../../utils/cn.js";
|
|
3
|
-
import { buttonVariants } from "../../../components/ui/button.js";
|
|
4
|
-
import { mergeRefs } from "../../../utils/merge-refs.js";
|
|
5
|
-
import { SearchTrigger } from "../../shared/slots/search-trigger.js";
|
|
6
|
-
import { LinkItem } from "../../shared/client.js";
|
|
7
|
-
import "../../shared/index.js";
|
|
8
|
-
import { SidebarCollapseTrigger as SidebarCollapseTrigger$1, SidebarContent as SidebarContent$1, SidebarDrawerContent, SidebarDrawerOverlay, 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, SidebarTrigger as SidebarTrigger$1, SidebarViewport, base_exports, useFolder, useFolderDepth } from "../../../components/sidebar/base.js";
|
|
9
|
-
import { createPageTreeRenderer } from "../../../components/sidebar/page-tree.js";
|
|
10
|
-
import { createLinkItemRenderer } from "../../../components/sidebar/link-item.js";
|
|
11
|
-
import { SidebarTabsDropdown } from "../../../components/sidebar/tabs/dropdown.js";
|
|
12
|
-
import { useDocsLayout } from "../client.js";
|
|
13
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { ChevronDown, Languages, SidebarIcon } from "lucide-react";
|
|
15
|
-
import { cva } from "class-variance-authority";
|
|
16
|
-
import { useRef } from "react";
|
|
17
|
-
//#region src/layouts/docs/slots/sidebar.tsx
|
|
18
|
-
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: {
|
|
19
|
-
variant: {
|
|
20
|
-
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",
|
|
21
|
-
button: "transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none"
|
|
22
|
-
},
|
|
23
|
-
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:inset-s-2.5" }
|
|
24
|
-
} });
|
|
25
|
-
const { useSidebar } = base_exports;
|
|
26
|
-
function SidebarProvider(props) {
|
|
27
|
-
return /* @__PURE__ */ jsx(SidebarProvider$1, { ...props });
|
|
28
|
-
}
|
|
29
|
-
function Sidebar({ footer, banner, collapsible = true, components, ...rest }) {
|
|
30
|
-
const { menuItems, slots, props: { tabs, nav, tabMode } } = useDocsLayout();
|
|
31
|
-
const iconLinks = menuItems.filter((item) => item.type === "icon");
|
|
32
|
-
const viewport = /* @__PURE__ */ jsxs(SidebarViewport, { children: [menuItems.filter((v) => v.type !== "icon").map((item, i, list) => /* @__PURE__ */ jsx(SidebarLinkItem, {
|
|
33
|
-
item,
|
|
34
|
-
className: cn(i === list.length - 1 && "mb-4")
|
|
35
|
-
}, i)), /* @__PURE__ */ jsx(SidebarPageTree, { ...components })] });
|
|
36
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(SidebarContent, {
|
|
37
|
-
...rest,
|
|
38
|
-
children: [
|
|
39
|
-
/* @__PURE__ */ jsxs("div", {
|
|
40
|
-
className: "flex flex-col gap-3 p-4 pb-2",
|
|
41
|
-
children: [
|
|
42
|
-
/* @__PURE__ */ jsxs("div", {
|
|
43
|
-
className: "flex",
|
|
44
|
-
children: [
|
|
45
|
-
slots.navTitle && /* @__PURE__ */ jsx(slots.navTitle, { className: "inline-flex text-[0.9375rem] items-center gap-2.5 font-medium me-auto" }),
|
|
46
|
-
nav?.children,
|
|
47
|
-
collapsible && /* @__PURE__ */ jsx(SidebarCollapseTrigger, {
|
|
48
|
-
className: cn(buttonVariants({
|
|
49
|
-
color: "ghost",
|
|
50
|
-
size: "icon-sm",
|
|
51
|
-
className: "mb-auto text-fd-muted-foreground"
|
|
52
|
-
})),
|
|
53
|
-
children: /* @__PURE__ */ jsx(SidebarIcon, {})
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
}),
|
|
57
|
-
slots.searchTrigger && /* @__PURE__ */ jsx(slots.searchTrigger.full, { hideIfDisabled: true }),
|
|
58
|
-
tabs.length > 0 && /* @__PURE__ */ jsx(SidebarTabsDropdown, { options: tabMode === "auto" ? tabs : tabs.filter((tab) => typeof tab.$folder?.root === "string") }),
|
|
59
|
-
banner
|
|
60
|
-
]
|
|
61
|
-
}),
|
|
62
|
-
viewport,
|
|
63
|
-
(slots.languageSelect || iconLinks.length > 0 || slots.themeSwitch || footer) && /* @__PURE__ */ jsxs("div", {
|
|
64
|
-
className: "flex flex-col p-4 pt-2",
|
|
65
|
-
children: [
|
|
66
|
-
slots.languageSelect && /* @__PURE__ */ jsxs(slots.languageSelect.root, {
|
|
67
|
-
variant: "secondary",
|
|
68
|
-
className: "text-fd-muted-foreground text-start justify-start bg-fd-secondary/50 mb-2",
|
|
69
|
-
children: [
|
|
70
|
-
/* @__PURE__ */ jsx(Languages, { className: "size-4.5" }),
|
|
71
|
-
/* @__PURE__ */ jsx(slots.languageSelect.text, {}),
|
|
72
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: "ms-auto size-3.5" })
|
|
73
|
-
]
|
|
74
|
-
}),
|
|
75
|
-
/* @__PURE__ */ jsxs("div", {
|
|
76
|
-
className: "flex text-fd-muted-foreground items-center border bg-fd-secondary/50 p-0.5 pe-0 rounded-lg empty:hidden",
|
|
77
|
-
children: [iconLinks.map((item, i) => /* @__PURE__ */ jsx(LinkItem, {
|
|
78
|
-
item,
|
|
79
|
-
className: cn(buttonVariants({
|
|
80
|
-
size: "icon-sm",
|
|
81
|
-
color: "ghost"
|
|
82
|
-
})),
|
|
83
|
-
"aria-label": item.label,
|
|
84
|
-
children: item.icon
|
|
85
|
-
}, i)), slots.themeSwitch && /* @__PURE__ */ jsx(slots.themeSwitch, { className: "px-1 py-0 border-y-0 border-e-0 rounded-none ms-auto *:rounded-md" })]
|
|
86
|
-
}),
|
|
87
|
-
footer
|
|
88
|
-
]
|
|
89
|
-
})
|
|
90
|
-
]
|
|
91
|
-
}), /* @__PURE__ */ jsxs(SidebarDrawer, { children: [
|
|
92
|
-
/* @__PURE__ */ jsxs("div", {
|
|
93
|
-
className: "flex flex-col gap-3 p-4 pb-2",
|
|
94
|
-
children: [
|
|
95
|
-
/* @__PURE__ */ jsxs("div", {
|
|
96
|
-
className: "flex text-fd-muted-foreground items-center gap-1.5",
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ jsx("div", {
|
|
99
|
-
className: "flex flex-1",
|
|
100
|
-
children: iconLinks.map((item, i) => /* @__PURE__ */ jsx(LinkItem, {
|
|
101
|
-
item,
|
|
102
|
-
className: cn(buttonVariants({
|
|
103
|
-
size: "icon-sm",
|
|
104
|
-
color: "ghost",
|
|
105
|
-
className: "p-2"
|
|
106
|
-
})),
|
|
107
|
-
"aria-label": item.label,
|
|
108
|
-
children: item.icon
|
|
109
|
-
}, i))
|
|
110
|
-
}),
|
|
111
|
-
slots.languageSelect && /* @__PURE__ */ jsxs(slots.languageSelect.root, { children: [/* @__PURE__ */ jsx(Languages, { className: "size-4.5" }), /* @__PURE__ */ jsx(slots.languageSelect.text, {})] }),
|
|
112
|
-
slots.themeSwitch && /* @__PURE__ */ jsx(slots.themeSwitch, { className: "p-0" }),
|
|
113
|
-
/* @__PURE__ */ jsx(SidebarTrigger, {
|
|
114
|
-
className: cn(buttonVariants({
|
|
115
|
-
color: "ghost",
|
|
116
|
-
size: "icon-sm",
|
|
117
|
-
className: "p-2"
|
|
118
|
-
})),
|
|
119
|
-
children: /* @__PURE__ */ jsx(SidebarIcon, {})
|
|
120
|
-
})
|
|
121
|
-
]
|
|
122
|
-
}),
|
|
123
|
-
tabs.length > 0 && /* @__PURE__ */ jsx(SidebarTabsDropdown, { options: tabs }),
|
|
124
|
-
banner
|
|
125
|
-
]
|
|
126
|
-
}),
|
|
127
|
-
viewport,
|
|
128
|
-
/* @__PURE__ */ jsx("div", {
|
|
129
|
-
className: "flex flex-col border-t p-4 pt-2 empty:hidden",
|
|
130
|
-
children: footer
|
|
131
|
-
})
|
|
132
|
-
] })] });
|
|
133
|
-
}
|
|
134
|
-
function SidebarFolder(props) {
|
|
135
|
-
return /* @__PURE__ */ jsx(SidebarFolder$1, { ...props });
|
|
136
|
-
}
|
|
137
|
-
function SidebarCollapseTrigger(props) {
|
|
138
|
-
return /* @__PURE__ */ jsx(SidebarCollapseTrigger$1, { ...props });
|
|
139
|
-
}
|
|
140
|
-
function SidebarTrigger(props) {
|
|
141
|
-
return /* @__PURE__ */ jsx(SidebarTrigger$1, { ...props });
|
|
142
|
-
}
|
|
143
|
-
function SidebarContent({ ref: refProp, className, children, ...props }) {
|
|
144
|
-
const ref = useRef(null);
|
|
145
|
-
return /* @__PURE__ */ jsx(SidebarContent$1, { children: ({ collapsed, hovered, ref: asideRef, ...rest }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
146
|
-
"data-sidebar-placeholder": "",
|
|
147
|
-
className: "sticky top-(--fd-docs-row-1) z-20 [grid-area:sidebar] pointer-events-none *:pointer-events-auto h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] md:layout:[--fd-sidebar-width:268px] max-md:hidden",
|
|
148
|
-
children: [collapsed && /* @__PURE__ */ jsx("div", {
|
|
149
|
-
className: "absolute inset-s-0 inset-y-0 w-4",
|
|
150
|
-
...rest
|
|
151
|
-
}), /* @__PURE__ */ jsx("aside", {
|
|
152
|
-
id: "nd-sidebar",
|
|
153
|
-
ref: mergeRefs(ref, refProp, asideRef),
|
|
154
|
-
"data-collapsed": collapsed,
|
|
155
|
-
"data-hovered": collapsed && hovered,
|
|
156
|
-
className: cn("absolute flex flex-col w-full inset-s-0 inset-y-0 items-end bg-fd-card text-sm border-e duration-250 *:w-(--fd-sidebar-width)", collapsed && ["inset-y-2 rounded-xl transition-transform border w-(--fd-sidebar-width)", hovered ? "shadow-lg translate-x-2 rtl:-translate-x-2" : "-translate-x-(--fd-sidebar-width) rtl:translate-x-full"], ref.current && ref.current.getAttribute("data-collapsed") === "true" !== collapsed && "transition-[width,inset-block,translate,background-color]", className),
|
|
157
|
-
...props,
|
|
158
|
-
...rest,
|
|
159
|
-
children
|
|
160
|
-
})]
|
|
161
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
162
|
-
"data-sidebar-panel": "",
|
|
163
|
-
className: cn("fixed flex top-[calc(--spacing(4)+var(--fd-docs-row-3))] inset-s-4 shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10", (!collapsed || hovered) && "pointer-events-none opacity-0"),
|
|
164
|
-
children: [/* @__PURE__ */ jsx(SidebarCollapseTrigger$1, {
|
|
165
|
-
className: cn(buttonVariants({
|
|
166
|
-
color: "ghost",
|
|
167
|
-
size: "icon-sm",
|
|
168
|
-
className: "rounded-lg"
|
|
169
|
-
})),
|
|
170
|
-
children: /* @__PURE__ */ jsx(SidebarIcon, {})
|
|
171
|
-
}), /* @__PURE__ */ jsx(SearchTrigger, {
|
|
172
|
-
className: "rounded-lg",
|
|
173
|
-
hideIfDisabled: true
|
|
174
|
-
})]
|
|
175
|
-
})] }) });
|
|
176
|
-
}
|
|
177
|
-
function SidebarDrawer({ children, className, ...props }) {
|
|
178
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SidebarDrawerOverlay, { className: "fixed z-40 inset-0 backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out" }), /* @__PURE__ */ jsx(SidebarDrawerContent, {
|
|
179
|
-
className: cn("fixed text-[0.9375rem] flex flex-col shadow-lg border-s inset-e-0 inset-y-0 w-[85%] max-w-[380px] z-40 bg-fd-background data-[state=open]:animate-fd-sidebar-in data-[state=closed]:animate-fd-sidebar-out", className),
|
|
180
|
-
...props,
|
|
181
|
-
children
|
|
182
|
-
})] });
|
|
183
|
-
}
|
|
184
|
-
function SidebarSeparator({ className, style, children, ...props }) {
|
|
185
|
-
const depth = useFolderDepth();
|
|
186
|
-
return /* @__PURE__ */ jsx(SidebarSeparator$1, {
|
|
187
|
-
className: cn("inline-flex items-center gap-2 mb-1 px-2 mt-6 empty:mb-0 [&_svg]:size-4 [&_svg]:shrink-0", depth === 0 && "first:mt-0", className),
|
|
188
|
-
style: {
|
|
189
|
-
paddingInlineStart: getItemOffset(depth),
|
|
190
|
-
...style
|
|
191
|
-
},
|
|
192
|
-
...props,
|
|
193
|
-
children
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
function SidebarItem({ className, style, children, ...props }) {
|
|
197
|
-
const depth = useFolderDepth();
|
|
198
|
-
return /* @__PURE__ */ jsx(SidebarItem$1, {
|
|
199
|
-
className: cn(itemVariants({
|
|
200
|
-
variant: "link",
|
|
201
|
-
highlight: depth >= 1
|
|
202
|
-
}), className),
|
|
203
|
-
style: {
|
|
204
|
-
paddingInlineStart: getItemOffset(depth),
|
|
205
|
-
...style
|
|
206
|
-
},
|
|
207
|
-
...props,
|
|
208
|
-
children
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
function SidebarFolderTrigger({ className, style, ...props }) {
|
|
212
|
-
const { depth, collapsible } = useFolder();
|
|
213
|
-
return /* @__PURE__ */ jsx(SidebarFolderTrigger$1, {
|
|
214
|
-
className: cn(itemVariants({ variant: collapsible ? "button" : null }), "w-full", className),
|
|
215
|
-
style: {
|
|
216
|
-
paddingInlineStart: getItemOffset(depth - 1),
|
|
217
|
-
...style
|
|
218
|
-
},
|
|
219
|
-
...props,
|
|
220
|
-
children: props.children
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
function SidebarFolderLink({ className, style, ...props }) {
|
|
224
|
-
const depth = useFolderDepth();
|
|
225
|
-
return /* @__PURE__ */ jsx(SidebarFolderLink$1, {
|
|
226
|
-
className: cn(itemVariants({
|
|
227
|
-
variant: "link",
|
|
228
|
-
highlight: depth > 1
|
|
229
|
-
}), "w-full", className),
|
|
230
|
-
style: {
|
|
231
|
-
paddingInlineStart: getItemOffset(depth - 1),
|
|
232
|
-
...style
|
|
233
|
-
},
|
|
234
|
-
...props,
|
|
235
|
-
children: props.children
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
function SidebarFolderContent({ className, children, ...props }) {
|
|
239
|
-
const depth = useFolderDepth();
|
|
240
|
-
return /* @__PURE__ */ jsx(SidebarFolderContent$1, {
|
|
241
|
-
className: cn("relative", depth === 1 && "before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:inset-s-2.5", className),
|
|
242
|
-
...props,
|
|
243
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
244
|
-
className: "flex flex-col gap-0.5 pt-0.5",
|
|
245
|
-
children
|
|
246
|
-
})
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
function getItemOffset(depth) {
|
|
250
|
-
return `calc(${2 + 3 * depth} * var(--spacing))`;
|
|
251
|
-
}
|
|
252
|
-
const SidebarPageTree = createPageTreeRenderer({
|
|
253
|
-
SidebarFolder,
|
|
254
|
-
SidebarFolderContent,
|
|
255
|
-
SidebarFolderLink,
|
|
256
|
-
SidebarFolderTrigger,
|
|
257
|
-
SidebarItem,
|
|
258
|
-
SidebarSeparator
|
|
259
|
-
});
|
|
260
|
-
const SidebarLinkItem = createLinkItemRenderer({
|
|
261
|
-
SidebarFolder,
|
|
262
|
-
SidebarFolderContent,
|
|
263
|
-
SidebarFolderLink,
|
|
264
|
-
SidebarFolderTrigger,
|
|
265
|
-
SidebarItem
|
|
266
|
-
});
|
|
267
|
-
//#endregion
|
|
268
|
-
export { Sidebar, SidebarProvider, SidebarTrigger, useSidebar };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/layouts/docs/slots/sidebar';
|