@vx-oss/docs-react 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,98 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { LinkItem, baseSlots } from "./client.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { useMemo } from "react";
|
|
5
|
-
import * as PageTree from "@vx-oss/docs-core/page-tree";
|
|
6
|
-
//#region src/layouts/shared/index.tsx
|
|
7
|
-
const defaultTransform = (option, node) => {
|
|
8
|
-
if (!node.icon) return option;
|
|
9
|
-
return {
|
|
10
|
-
...option,
|
|
11
|
-
icon: /* @__PURE__ */ jsx("div", {
|
|
12
|
-
className: "size-full [&_svg]:size-full max-md:p-1.5 max-md:rounded-md max-md:border max-md:bg-fd-secondary",
|
|
13
|
-
children: node.icon
|
|
14
|
-
})
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
function getLayoutTabs(tree, { transform = defaultTransform } = {}) {
|
|
18
|
-
const results = [];
|
|
19
|
-
function next(node, unlisted) {
|
|
20
|
-
if ("root" in node && node.root) {
|
|
21
|
-
const url = node.index?.url ?? node.children.find((node) => node.type === "page")?.url;
|
|
22
|
-
if (url) {
|
|
23
|
-
const option = {
|
|
24
|
-
title: node.name,
|
|
25
|
-
icon: node.icon,
|
|
26
|
-
description: node.description,
|
|
27
|
-
url,
|
|
28
|
-
unlisted,
|
|
29
|
-
$folder: node
|
|
30
|
-
};
|
|
31
|
-
const mapped = transform ? transform(option, node) : option;
|
|
32
|
-
if (mapped) results.push(mapped);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
for (const child of node.children) if (child.type === "folder") next(child, unlisted);
|
|
36
|
-
}
|
|
37
|
-
next(tree);
|
|
38
|
-
if (tree.fallback) next(tree.fallback, true);
|
|
39
|
-
return results;
|
|
40
|
-
}
|
|
41
|
-
function isLayoutTabActive(tab, pathname) {
|
|
42
|
-
if (tab.$folder) return PageTree.findPath(tab.$folder.children, (node) => node.type === "page" && isActive(node.url, pathname)) !== null;
|
|
43
|
-
if (tab.urls) return tab.urls.has(normalize(pathname));
|
|
44
|
-
return isActive(tab.url, pathname, true);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Get link items with shortcuts
|
|
48
|
-
*/
|
|
49
|
-
function resolveLinkItems({ links = [], githubUrl }) {
|
|
50
|
-
const result = [...links];
|
|
51
|
-
if (githubUrl) result.push({
|
|
52
|
-
type: "icon",
|
|
53
|
-
url: githubUrl,
|
|
54
|
-
text: "Github",
|
|
55
|
-
label: "GitHub",
|
|
56
|
-
icon: /* @__PURE__ */ jsx("svg", {
|
|
57
|
-
role: "img",
|
|
58
|
-
viewBox: "0 0 24 24",
|
|
59
|
-
fill: "currentColor",
|
|
60
|
-
children: /* @__PURE__ */ jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })
|
|
61
|
-
}),
|
|
62
|
-
external: true
|
|
63
|
-
});
|
|
64
|
-
return result;
|
|
65
|
-
}
|
|
66
|
-
function useLinkItems({ githubUrl, links }) {
|
|
67
|
-
return useMemo(() => {
|
|
68
|
-
const all = resolveLinkItems({
|
|
69
|
-
links,
|
|
70
|
-
githubUrl
|
|
71
|
-
});
|
|
72
|
-
const navItems = [];
|
|
73
|
-
const menuItems = [];
|
|
74
|
-
for (const item of all) switch (item.on) {
|
|
75
|
-
case "menu":
|
|
76
|
-
menuItems.push(item);
|
|
77
|
-
break;
|
|
78
|
-
case "nav":
|
|
79
|
-
navItems.push(item);
|
|
80
|
-
break;
|
|
81
|
-
default:
|
|
82
|
-
navItems.push(item);
|
|
83
|
-
menuItems.push(item);
|
|
84
|
-
}
|
|
85
|
-
return {
|
|
86
|
-
navItems,
|
|
87
|
-
menuItems,
|
|
88
|
-
all
|
|
89
|
-
};
|
|
90
|
-
}, [links, githubUrl]);
|
|
91
|
-
}
|
|
92
|
-
function isLinkItemActive(link, pathname) {
|
|
93
|
-
if (link.type === "custom" || !link.url) return false;
|
|
94
|
-
if (link.active === "none") return false;
|
|
95
|
-
return isActive(link.url, pathname, link.active === "nested-url");
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
export { LinkItem, baseSlots, getLayoutTabs, isLayoutTabActive, isLinkItemActive, resolveLinkItems, useLinkItems };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/layouts/shared';
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cn } from "../../../utils/cn.js";
|
|
3
|
-
import { buttonVariants } from "../../../components/ui/button.js";
|
|
4
|
-
import { useI18n } from "../../../contexts/i18n.js";
|
|
5
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.js";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { useTranslations } from "@fuma-translate/react";
|
|
8
|
-
//#region src/layouts/shared/slots/language-select.tsx
|
|
9
|
-
function LanguageSelect({ className, variant = "ghost", children, ...rest }) {
|
|
10
|
-
const context = useI18n();
|
|
11
|
-
const t = useTranslations({ note: "language switcher" });
|
|
12
|
-
if (!context.locales) throw new Error("Missing `<I18nProvider />`");
|
|
13
|
-
const chooseLanguage = t("Choose a language");
|
|
14
|
-
return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
15
|
-
"aria-label": t("Choose a language", { note: "aria-label" }),
|
|
16
|
-
className: cn(buttonVariants({ variant }), "gap-1.5 p-1.5 data-[state=open]:bg-fd-accent", className),
|
|
17
|
-
...rest,
|
|
18
|
-
children
|
|
19
|
-
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
20
|
-
className: "flex flex-col gap-0.5 p-1",
|
|
21
|
-
children: [/* @__PURE__ */ jsx("p", {
|
|
22
|
-
className: "p-2 text-xs font-medium text-fd-muted-foreground",
|
|
23
|
-
children: chooseLanguage
|
|
24
|
-
}), context.locales.map((item) => /* @__PURE__ */ jsx("button", {
|
|
25
|
-
type: "button",
|
|
26
|
-
className: cn("px-2 py-1.5 text-start text-sm rounded-lg transition-colors", item.locale === context.locale ? "bg-fd-primary/10 text-fd-primary" : "text-fd-muted-foreground hover:bg-fd-accent hover:text-fd-accent-foreground"),
|
|
27
|
-
onClick: () => {
|
|
28
|
-
context.onChange?.(item.locale);
|
|
29
|
-
},
|
|
30
|
-
children: item.name
|
|
31
|
-
}, item.locale))]
|
|
32
|
-
})] });
|
|
33
|
-
}
|
|
34
|
-
function LanguageSelectText(props) {
|
|
35
|
-
const { locales, locale } = useI18n();
|
|
36
|
-
const text = locales?.find((item) => item.locale === locale)?.name;
|
|
37
|
-
return /* @__PURE__ */ jsx("span", {
|
|
38
|
-
...props,
|
|
39
|
-
children: text
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
export { LanguageSelect, LanguageSelectText };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/layouts/shared/slots/language-select';
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cn } from "../../../utils/cn.js";
|
|
3
|
-
import { buttonVariants } from "../../../components/ui/button.js";
|
|
4
|
-
import { useSearchContext } from "../../../contexts/search.js";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { Search } from "lucide-react";
|
|
7
|
-
import { useTranslations } from "@fuma-translate/react";
|
|
8
|
-
//#region src/layouts/shared/slots/search-trigger.tsx
|
|
9
|
-
function SearchTrigger({ hideIfDisabled, size = "icon-sm", color = "ghost", ...props }) {
|
|
10
|
-
const { setOpenSearch, enabled } = useSearchContext();
|
|
11
|
-
const t = useTranslations({ note: "search trigger" });
|
|
12
|
-
if (hideIfDisabled && !enabled) return null;
|
|
13
|
-
return /* @__PURE__ */ jsx("button", {
|
|
14
|
-
type: "button",
|
|
15
|
-
className: cn(buttonVariants({
|
|
16
|
-
size,
|
|
17
|
-
color
|
|
18
|
-
}), props.className),
|
|
19
|
-
"data-search": "",
|
|
20
|
-
"aria-label": t("Open Search", { note: "aria-label" }),
|
|
21
|
-
onClick: () => {
|
|
22
|
-
setOpenSearch(true);
|
|
23
|
-
},
|
|
24
|
-
children: /* @__PURE__ */ jsx(Search, {})
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function FullSearchTrigger({ hideIfDisabled, ...props }) {
|
|
28
|
-
const { enabled, hotKey, setOpenSearch } = useSearchContext();
|
|
29
|
-
const t = useTranslations({ note: "search trigger" });
|
|
30
|
-
if (hideIfDisabled && !enabled) return null;
|
|
31
|
-
return /* @__PURE__ */ jsxs("button", {
|
|
32
|
-
type: "button",
|
|
33
|
-
"data-search-full": "",
|
|
34
|
-
...props,
|
|
35
|
-
className: cn("inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground", props.className),
|
|
36
|
-
onClick: () => {
|
|
37
|
-
setOpenSearch(true);
|
|
38
|
-
},
|
|
39
|
-
children: [
|
|
40
|
-
/* @__PURE__ */ jsx(Search, { className: "size-4" }),
|
|
41
|
-
t("Search"),
|
|
42
|
-
/* @__PURE__ */ jsx("div", {
|
|
43
|
-
className: "ms-auto inline-flex gap-0.5",
|
|
44
|
-
children: hotKey.map((k, i) => /* @__PURE__ */ jsx("kbd", {
|
|
45
|
-
className: "rounded-md border bg-fd-background px-1.5",
|
|
46
|
-
children: k.display
|
|
47
|
-
}, i))
|
|
48
|
-
})
|
|
49
|
-
]
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
export { FullSearchTrigger, SearchTrigger };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/layouts/shared/slots/search-trigger';
|
|
@@ -1,70 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cn } from "../../../utils/cn.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { Airplay, Moon, Sun } from "lucide-react";
|
|
5
|
-
import { cva } from "class-variance-authority";
|
|
6
|
-
import { useEffect, useState } from "react";
|
|
7
|
-
import { useTranslations } from "@fuma-translate/react";
|
|
8
|
-
import { useTheme } from "next-themes";
|
|
9
|
-
import { flushSync } from "react-dom";
|
|
10
|
-
//#region src/layouts/shared/slots/theme-switch.tsx
|
|
11
|
-
const itemVariants = cva("size-6.5 p-1.5 text-fd-muted-foreground", { variants: { active: {
|
|
12
|
-
true: "bg-fd-accent text-fd-accent-foreground",
|
|
13
|
-
false: "text-fd-muted-foreground"
|
|
14
|
-
} } });
|
|
15
|
-
const full = [
|
|
16
|
-
["light", Sun],
|
|
17
|
-
["dark", Moon],
|
|
18
|
-
["system", Airplay]
|
|
19
|
-
];
|
|
20
|
-
function ThemeSwitch({ className, mode = "light-dark", ...props }) {
|
|
21
|
-
const { setTheme, theme, resolvedTheme } = useTheme();
|
|
22
|
-
const [mounted, setMounted] = useState(false);
|
|
23
|
-
const t = useTranslations({ note: "theme switcher" });
|
|
24
|
-
const themeAriaLabels = {
|
|
25
|
-
light: t("Light", { note: "aria-label" }),
|
|
26
|
-
dark: t("Dark", { note: "aria-label" }),
|
|
27
|
-
system: t("System", { note: "aria-label" })
|
|
28
|
-
};
|
|
29
|
-
const handleThemeChange = (newTheme) => {
|
|
30
|
-
if (document?.startViewTransition) document.startViewTransition(() => flushSync(() => setTheme(newTheme)));
|
|
31
|
-
else setTheme(newTheme);
|
|
32
|
-
};
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
setMounted(true);
|
|
35
|
-
}, []);
|
|
36
|
-
const container = cn("inline-flex items-center rounded-full border p-1 overflow-hidden *:rounded-full", className);
|
|
37
|
-
if (mode === "light-dark") {
|
|
38
|
-
const value = mounted ? resolvedTheme : null;
|
|
39
|
-
return /* @__PURE__ */ jsx("button", {
|
|
40
|
-
className: container,
|
|
41
|
-
"aria-label": t("Toggle Theme", { note: "aria-label" }),
|
|
42
|
-
onClick: () => handleThemeChange(value === "light" ? "dark" : "light"),
|
|
43
|
-
"data-theme-toggle": "",
|
|
44
|
-
children: full.map(([key, Icon]) => {
|
|
45
|
-
if (key === "system") return;
|
|
46
|
-
return /* @__PURE__ */ jsx(Icon, {
|
|
47
|
-
fill: "currentColor",
|
|
48
|
-
className: cn(itemVariants({ active: value === key }))
|
|
49
|
-
}, key);
|
|
50
|
-
})
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
const value = mounted ? theme : null;
|
|
54
|
-
return /* @__PURE__ */ jsx("div", {
|
|
55
|
-
className: container,
|
|
56
|
-
"data-theme-toggle": "",
|
|
57
|
-
...props,
|
|
58
|
-
children: full.map(([key, Icon]) => /* @__PURE__ */ jsx("button", {
|
|
59
|
-
"aria-label": themeAriaLabels[key],
|
|
60
|
-
className: cn(itemVariants({ active: value === key })),
|
|
61
|
-
onClick: () => handleThemeChange(key),
|
|
62
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
63
|
-
className: "size-full",
|
|
64
|
-
fill: "currentColor"
|
|
65
|
-
})
|
|
66
|
-
}, key))
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
70
|
-
export { ThemeSwitch };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/layouts/shared/slots/theme-switch';
|
package/dist/mdx.d.ts
CHANGED
|
@@ -1,44 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger } from "./components/codeblock.js";
|
|
4
|
-
import { createRelativeLink as createRelativeLink$1 } from "./mdx.server.js";
|
|
5
|
-
import React, { AnchorHTMLAttributes, FC, HTMLAttributes, ImgHTMLAttributes, TableHTMLAttributes } from "react";
|
|
6
|
-
//#region src/mdx.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* global types for MDX.js
|
|
9
|
-
*/
|
|
10
|
-
declare module 'mdx/types.js' {
|
|
11
|
-
namespace JSX {
|
|
12
|
-
type Element = React.JSX.Element;
|
|
13
|
-
type ElementClass = React.JSX.ElementClass;
|
|
14
|
-
type ElementType = React.JSX.ElementType;
|
|
15
|
-
type IntrinsicElements = React.JSX.IntrinsicElements;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
declare function Image(props: ImgHTMLAttributes<HTMLImageElement>): React.JSX.Element;
|
|
19
|
-
declare function Table(props: TableHTMLAttributes<HTMLTableElement>): React.JSX.Element;
|
|
20
|
-
declare const defaultMdxComponents: {
|
|
21
|
-
CodeBlockTab: typeof CodeBlockTab;
|
|
22
|
-
CodeBlockTabs: typeof CodeBlockTabs;
|
|
23
|
-
CodeBlockTabsList: typeof CodeBlockTabsList;
|
|
24
|
-
CodeBlockTabsTrigger: typeof CodeBlockTabsTrigger;
|
|
25
|
-
pre: (props: HTMLAttributes<HTMLPreElement>) => React.JSX.Element;
|
|
26
|
-
Card: typeof Card;
|
|
27
|
-
Cards: typeof Cards;
|
|
28
|
-
a: FC<AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
29
|
-
img: typeof Image;
|
|
30
|
-
h1: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
31
|
-
h2: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
32
|
-
h3: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
33
|
-
h4: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
34
|
-
h5: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
35
|
-
h6: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
36
|
-
table: typeof Table;
|
|
37
|
-
Callout: typeof Callout;
|
|
38
|
-
CalloutContainer: typeof CalloutContainer;
|
|
39
|
-
CalloutTitle: typeof CalloutTitle;
|
|
40
|
-
CalloutDescription: typeof CalloutDescription;
|
|
41
|
-
};
|
|
42
|
-
declare const createRelativeLink: typeof createRelativeLink$1;
|
|
43
|
-
//#endregion
|
|
44
|
-
export { createRelativeLink, defaultMdxComponents as default };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/mdx';
|
|
2
|
+
export { default } from '@vx-oss/docs-vezham-ui/mdx';
|
package/dist/mdx.js
CHANGED
|
@@ -1,70 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Callout, CalloutContainer, CalloutDescription, CalloutTitle } from "./components/callout.js";
|
|
4
|
-
import { Heading } from "./components/heading.js";
|
|
5
|
-
import { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre } from "./components/codeblock.js";
|
|
6
|
-
import Link from "@vx-oss/docs-core/link";
|
|
7
|
-
import { Image } from "@vx-oss/docs-core/framework";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
//#region src/mdx.tsx
|
|
10
|
-
function Image$1(props) {
|
|
11
|
-
return /* @__PURE__ */ jsx(Image, {
|
|
12
|
-
sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px",
|
|
13
|
-
...props,
|
|
14
|
-
className: cn("rounded-lg", props.className)
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function Table(props) {
|
|
18
|
-
return /* @__PURE__ */ jsx("div", {
|
|
19
|
-
className: "relative overflow-auto prose-no-margin my-6",
|
|
20
|
-
children: /* @__PURE__ */ jsx("table", { ...props })
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
const defaultMdxComponents = {
|
|
24
|
-
CodeBlockTab,
|
|
25
|
-
CodeBlockTabs,
|
|
26
|
-
CodeBlockTabsList,
|
|
27
|
-
CodeBlockTabsTrigger,
|
|
28
|
-
pre: (props) => /* @__PURE__ */ jsx(CodeBlock, {
|
|
29
|
-
...props,
|
|
30
|
-
children: /* @__PURE__ */ jsx(Pre, { children: props.children })
|
|
31
|
-
}),
|
|
32
|
-
Card,
|
|
33
|
-
Cards,
|
|
34
|
-
a: Link,
|
|
35
|
-
img: Image$1,
|
|
36
|
-
h1: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
37
|
-
as: "h1",
|
|
38
|
-
...props
|
|
39
|
-
}),
|
|
40
|
-
h2: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
41
|
-
as: "h2",
|
|
42
|
-
...props
|
|
43
|
-
}),
|
|
44
|
-
h3: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
45
|
-
as: "h3",
|
|
46
|
-
...props
|
|
47
|
-
}),
|
|
48
|
-
h4: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
49
|
-
as: "h4",
|
|
50
|
-
...props
|
|
51
|
-
}),
|
|
52
|
-
h5: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
53
|
-
as: "h5",
|
|
54
|
-
...props
|
|
55
|
-
}),
|
|
56
|
-
h6: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
57
|
-
as: "h6",
|
|
58
|
-
...props
|
|
59
|
-
}),
|
|
60
|
-
table: Table,
|
|
61
|
-
Callout,
|
|
62
|
-
CalloutContainer,
|
|
63
|
-
CalloutTitle,
|
|
64
|
-
CalloutDescription
|
|
65
|
-
};
|
|
66
|
-
const createRelativeLink = () => {
|
|
67
|
-
throw new Error("`createRelativeLink` is only supported in Node.js environment");
|
|
68
|
-
};
|
|
69
|
-
//#endregion
|
|
70
|
-
export { createRelativeLink, defaultMdxComponents as default };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/mdx';
|
|
2
|
+
export { default } from '@vx-oss/docs-vezham-ui/mdx';
|
package/dist/mdx.server.js
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//#region src/mdx.server.tsx
|
|
4
|
-
/**
|
|
5
|
-
* Extend the default Link component to resolve relative file paths in `href`.
|
|
6
|
-
*
|
|
7
|
-
* @param page the current page
|
|
8
|
-
* @param source the source object
|
|
9
|
-
* @param OverrideLink The component to override from
|
|
10
|
-
*/
|
|
11
|
-
function createRelativeLink(source, page, OverrideLink = defaultMdxComponents.a) {
|
|
12
|
-
return async function RelativeLink({ href, ...props }) {
|
|
13
|
-
return /* @__PURE__ */ jsx(OverrideLink, {
|
|
14
|
-
href: href ? source.resolveHref(href, page) : href,
|
|
15
|
-
...props
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
export { createRelativeLink, defaultMdxComponents as default };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/mdx';
|
|
2
|
+
export { default } from '@vx-oss/docs-vezham-ui/mdx';
|
package/dist/og/takumi.js
CHANGED
|
@@ -1,91 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ImageResponse } from "takumi-js/response";
|
|
3
|
-
//#region src/og/takumi.tsx
|
|
4
|
-
function generateOGImage(options) {
|
|
5
|
-
const { title, description, icon, site, primaryColor, primaryTextColor, ...rest } = options;
|
|
6
|
-
return new ImageResponse(generate({
|
|
7
|
-
title,
|
|
8
|
-
description,
|
|
9
|
-
icon,
|
|
10
|
-
site,
|
|
11
|
-
primaryTextColor,
|
|
12
|
-
primaryColor
|
|
13
|
-
}), {
|
|
14
|
-
width: 1200,
|
|
15
|
-
height: 630,
|
|
16
|
-
...rest
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function generate({ primaryColor = "rgba(255,150,255,0.3)", primaryTextColor = "rgb(255,150,255)", icon = /* @__PURE__ */ jsx("svg", {
|
|
20
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
21
|
-
width: "56",
|
|
22
|
-
height: "56",
|
|
23
|
-
viewBox: "0 0 24 24",
|
|
24
|
-
fill: "none",
|
|
25
|
-
stroke: "currentColor",
|
|
26
|
-
strokeWidth: "2",
|
|
27
|
-
strokeLinecap: "round",
|
|
28
|
-
strokeLinejoin: "round",
|
|
29
|
-
className: "lucide lucide-book-icon lucide-book",
|
|
30
|
-
children: /* @__PURE__ */ jsx("circle", {
|
|
31
|
-
cx: "12",
|
|
32
|
-
cy: "12",
|
|
33
|
-
r: "11",
|
|
34
|
-
stroke: primaryTextColor,
|
|
35
|
-
strokeWidth: "2"
|
|
36
|
-
})
|
|
37
|
-
}), ...props }) {
|
|
38
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
39
|
-
style: {
|
|
40
|
-
display: "flex",
|
|
41
|
-
flexDirection: "column",
|
|
42
|
-
width: "100%",
|
|
43
|
-
height: "100%",
|
|
44
|
-
color: "white",
|
|
45
|
-
padding: "4rem",
|
|
46
|
-
backgroundColor: "#0c0c0c",
|
|
47
|
-
borderBottom: `18px solid ${primaryColor}`
|
|
48
|
-
},
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ jsx("p", {
|
|
51
|
-
style: {
|
|
52
|
-
fontWeight: 800,
|
|
53
|
-
fontSize: "82px",
|
|
54
|
-
margin: 0
|
|
55
|
-
},
|
|
56
|
-
children: props.title
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ jsx("p", {
|
|
59
|
-
style: {
|
|
60
|
-
fontSize: "52px",
|
|
61
|
-
color: "rgba(240,240,240,0.8)",
|
|
62
|
-
margin: 0,
|
|
63
|
-
marginTop: "16px",
|
|
64
|
-
paddingBottom: "28px",
|
|
65
|
-
borderBottom: `10px dashed ${primaryColor}`
|
|
66
|
-
},
|
|
67
|
-
children: props.description
|
|
68
|
-
}),
|
|
69
|
-
/* @__PURE__ */ jsxs("div", {
|
|
70
|
-
style: {
|
|
71
|
-
display: "flex",
|
|
72
|
-
flexDirection: "row",
|
|
73
|
-
alignItems: "center",
|
|
74
|
-
gap: "20px",
|
|
75
|
-
marginTop: "auto",
|
|
76
|
-
color: primaryTextColor
|
|
77
|
-
},
|
|
78
|
-
children: [icon, props.site && /* @__PURE__ */ jsx("p", {
|
|
79
|
-
style: {
|
|
80
|
-
fontSize: "56px",
|
|
81
|
-
fontWeight: 600,
|
|
82
|
-
margin: 0
|
|
83
|
-
},
|
|
84
|
-
children: props.site
|
|
85
|
-
})]
|
|
86
|
-
})
|
|
87
|
-
]
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
//#endregion
|
|
91
|
-
export { generate, generateOGImage };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/og/takumi';
|
package/dist/og.js
CHANGED
|
@@ -1,91 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ImageResponse } from "next/og.js";
|
|
3
|
-
//#region src/og.tsx
|
|
4
|
-
function generateOGImage(options) {
|
|
5
|
-
const { title, description, icon, site, primaryColor, primaryTextColor, ...rest } = options;
|
|
6
|
-
return new ImageResponse(generate({
|
|
7
|
-
title,
|
|
8
|
-
description,
|
|
9
|
-
icon,
|
|
10
|
-
site,
|
|
11
|
-
primaryTextColor,
|
|
12
|
-
primaryColor
|
|
13
|
-
}), {
|
|
14
|
-
width: 1200,
|
|
15
|
-
height: 630,
|
|
16
|
-
...rest
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function generate({ primaryColor = "rgba(255,150,255,0.3)", primaryTextColor = "rgb(255,150,255)", icon = /* @__PURE__ */ jsx("svg", {
|
|
20
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
21
|
-
width: "56",
|
|
22
|
-
height: "56",
|
|
23
|
-
viewBox: "0 0 24 24",
|
|
24
|
-
fill: "none",
|
|
25
|
-
stroke: "currentColor",
|
|
26
|
-
strokeWidth: "2",
|
|
27
|
-
strokeLinecap: "round",
|
|
28
|
-
strokeLinejoin: "round",
|
|
29
|
-
className: "lucide lucide-book-icon lucide-book",
|
|
30
|
-
children: /* @__PURE__ */ jsx("circle", {
|
|
31
|
-
cx: "12",
|
|
32
|
-
cy: "12",
|
|
33
|
-
r: "11",
|
|
34
|
-
stroke: primaryTextColor,
|
|
35
|
-
strokeWidth: "2"
|
|
36
|
-
})
|
|
37
|
-
}), ...props }) {
|
|
38
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
39
|
-
style: {
|
|
40
|
-
display: "flex",
|
|
41
|
-
flexDirection: "column",
|
|
42
|
-
width: "100%",
|
|
43
|
-
height: "100%",
|
|
44
|
-
color: "white",
|
|
45
|
-
padding: "4rem",
|
|
46
|
-
backgroundColor: "#0c0c0c",
|
|
47
|
-
borderBottom: `18px solid ${primaryColor}`
|
|
48
|
-
},
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ jsx("p", {
|
|
51
|
-
style: {
|
|
52
|
-
fontWeight: 800,
|
|
53
|
-
fontSize: "82px",
|
|
54
|
-
margin: 0
|
|
55
|
-
},
|
|
56
|
-
children: props.title
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ jsx("p", {
|
|
59
|
-
style: {
|
|
60
|
-
fontSize: "52px",
|
|
61
|
-
color: "rgba(240,240,240,0.8)",
|
|
62
|
-
margin: 0,
|
|
63
|
-
marginTop: "16px",
|
|
64
|
-
paddingBottom: "28px",
|
|
65
|
-
borderBottom: `10px dashed ${primaryColor}`
|
|
66
|
-
},
|
|
67
|
-
children: props.description
|
|
68
|
-
}),
|
|
69
|
-
/* @__PURE__ */ jsxs("div", {
|
|
70
|
-
style: {
|
|
71
|
-
display: "flex",
|
|
72
|
-
flexDirection: "row",
|
|
73
|
-
alignItems: "center",
|
|
74
|
-
gap: "20px",
|
|
75
|
-
marginTop: "auto",
|
|
76
|
-
color: primaryTextColor
|
|
77
|
-
},
|
|
78
|
-
children: [icon, props.site && /* @__PURE__ */ jsx("p", {
|
|
79
|
-
style: {
|
|
80
|
-
fontSize: "56px",
|
|
81
|
-
fontWeight: 600,
|
|
82
|
-
margin: 0
|
|
83
|
-
},
|
|
84
|
-
children: props.site
|
|
85
|
-
})]
|
|
86
|
-
})
|
|
87
|
-
]
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
//#endregion
|
|
91
|
-
export { generate, generateOGImage };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/og';
|
package/dist/page.js
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cn } from "./utils/cn.js";
|
|
3
|
-
import { useIsDocsLayout } from "./layouts/docs/client.js";
|
|
4
|
-
import { Breadcrumb } from "./layouts/docs/page/slots/breadcrumb.js";
|
|
5
|
-
import { DocsBody, DocsDescription, DocsTitle, EditOnGitHub, PageLastUpdate, page_exports } from "./layouts/docs/page/index.js";
|
|
6
|
-
import { page_exports as page_exports$1 } from "./layouts/notebook/page/index.js";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
//#region src/page.tsx
|
|
9
|
-
/**
|
|
10
|
-
* For separate MDX page
|
|
11
|
-
*/
|
|
12
|
-
function withArticle(props) {
|
|
13
|
-
return /* @__PURE__ */ jsx("main", {
|
|
14
|
-
...props,
|
|
15
|
-
className: cn("w-full max-w-[1400px] mx-auto px-4 py-12", props.className),
|
|
16
|
-
children: /* @__PURE__ */ jsx("article", {
|
|
17
|
-
className: "prose",
|
|
18
|
-
children: props.children
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function DocsPage({ lastUpdate, editOnGithub, children, ...props }) {
|
|
23
|
-
const { DocsPage, EditOnGitHub, PageLastUpdate } = useIsDocsLayout() ? page_exports : page_exports$1;
|
|
24
|
-
return /* @__PURE__ */ jsxs(DocsPage, {
|
|
25
|
-
...props,
|
|
26
|
-
children: [children, /* @__PURE__ */ jsxs("div", {
|
|
27
|
-
className: "flex flex-row flex-wrap items-center justify-between gap-4 empty:hidden",
|
|
28
|
-
children: [editOnGithub && /* @__PURE__ */ jsx(EditOnGitHub, { href: `https://github.com/${editOnGithub.owner}/${editOnGithub.repo}/blob/${editOnGithub.sha}/${editOnGithub.path.startsWith("/") ? editOnGithub.path.slice(1) : editOnGithub.path}` }), lastUpdate && /* @__PURE__ */ jsx(PageLastUpdate, { date: new Date(lastUpdate) })]
|
|
29
|
-
})]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, Breadcrumb as PageBreadcrumb, PageLastUpdate, withArticle };
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/page';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/primitives/accordion';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/primitives/collapsible';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/primitives/dialog';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/primitives/direction-provider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/primitives/drawer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/primitives/navigation-menu';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/primitives/popover';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/primitives/scroll-area';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/primitives/shared';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vx-oss/docs-vezham-ui/primitives/tabs';
|