fumadocs-ui 14.2.1 → 14.3.1
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/dist/components/accordion.d.ts +4 -7
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +32 -104
- package/dist/components/api.d.ts +4 -13
- package/dist/components/api.d.ts.map +1 -0
- package/dist/components/api.js +3 -16
- package/dist/components/banner.d.ts +3 -5
- package/dist/components/banner.d.ts.map +1 -0
- package/dist/components/banner.js +53 -120
- package/dist/components/callout.d.ts +4 -7
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +13 -9
- package/dist/components/card.d.ts +5 -7
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +10 -10
- package/dist/components/codeblock.d.ts +6 -9
- package/dist/components/codeblock.d.ts.map +1 -0
- package/dist/components/codeblock.js +41 -15
- package/dist/components/dialog/search-algolia.d.ts +7 -11
- package/dist/components/dialog/search-algolia.d.ts.map +1 -0
- package/dist/components/dialog/search-algolia.js +19 -79
- package/dist/components/dialog/search-default.d.ts +6 -10
- package/dist/components/dialog/search-default.d.ts.map +1 -0
- package/dist/components/dialog/search-default.js +24 -73
- package/dist/components/dialog/search-orama.d.ts +7 -11
- package/dist/components/dialog/search-orama.d.ts.map +1 -0
- package/dist/components/dialog/search-orama.js +22 -79
- package/dist/components/dialog/search.d.ts +7 -9
- package/dist/components/dialog/search.d.ts.map +1 -0
- package/dist/components/dialog/search.js +98 -13
- package/dist/components/dialog/tag-list.d.ts +13 -0
- package/dist/components/dialog/tag-list.d.ts.map +1 -0
- package/dist/components/dialog/tag-list.js +20 -0
- package/dist/components/files.d.ts +7 -9
- package/dist/components/files.d.ts.map +1 -0
- package/dist/components/files.js +15 -63
- package/dist/components/heading.d.ts +4 -5
- package/dist/components/heading.d.ts.map +1 -0
- package/dist/components/heading.js +9 -9
- package/dist/components/image-zoom.d.ts +7 -8
- package/dist/components/image-zoom.d.ts.map +1 -0
- package/dist/components/image-zoom.js +16 -40
- package/dist/components/inline-toc.d.ts +4 -6
- package/dist/components/inline-toc.d.ts.map +1 -0
- package/dist/components/inline-toc.js +8 -46
- package/dist/components/layout/breadcrumb.d.ts +11 -0
- package/dist/components/layout/breadcrumb.d.ts.map +1 -0
- package/dist/components/layout/breadcrumb.js +20 -0
- package/dist/components/layout/language-toggle.d.ts +5 -7
- package/dist/components/layout/language-toggle.d.ts.map +1 -0
- package/dist/components/layout/language-toggle.js +24 -14
- package/dist/components/layout/nav.d.ts +28 -0
- package/dist/components/layout/nav.d.ts.map +1 -0
- package/dist/components/layout/nav.js +29 -0
- package/dist/components/layout/root-toggle.d.ts +5 -7
- package/dist/components/layout/root-toggle.d.ts.map +1 -0
- package/dist/components/layout/root-toggle.js +28 -13
- package/dist/components/layout/search-toggle.d.ts +4 -0
- package/dist/components/layout/search-toggle.d.ts.map +1 -0
- package/dist/components/layout/search-toggle.js +24 -0
- package/dist/components/layout/theme-toggle.d.ts +3 -0
- package/dist/components/layout/theme-toggle.d.ts.map +1 -0
- package/dist/components/layout/theme-toggle.js +21 -0
- package/dist/components/layout/toc-clerk.d.ts +6 -0
- package/dist/components/layout/toc-clerk.d.ts.map +1 -0
- package/dist/components/layout/toc-clerk.js +76 -0
- package/dist/components/layout/toc-popover.d.ts +8 -0
- package/dist/components/layout/toc-popover.d.ts.map +1 -0
- package/dist/components/layout/toc-popover.js +20 -0
- package/dist/components/layout/toc-thumb.d.ts +6 -0
- package/dist/components/layout/toc-thumb.d.ts.map +1 -0
- package/dist/components/layout/toc-thumb.js +53 -0
- package/dist/components/layout/toc.d.ts +19 -0
- package/dist/components/layout/toc.d.ts.map +1 -0
- package/dist/components/layout/toc.js +25 -0
- package/dist/components/registry.d.ts +3 -0
- package/dist/components/registry.d.ts.map +1 -0
- package/dist/components/registry.js +70 -0
- package/dist/components/steps.d.ts +4 -6
- package/dist/components/steps.d.ts.map +1 -0
- package/dist/components/steps.js +5 -16
- package/dist/components/tabs.d.ts +7 -21
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +61 -171
- package/dist/components/type-table.d.ts +5 -6
- package/dist/components/type-table.d.ts.map +1 -0
- package/dist/components/type-table.js +18 -59
- package/dist/components/ui/button.d.ts +5 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +14 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +12 -0
- package/dist/components/ui/navigation-menu.d.ts +11 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +15 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +11 -0
- package/dist/components/ui/scroll-area.d.ts +7 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +11 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +16 -0
- package/dist/{i18n-Db2HAPOu.d.ts → contexts/i18n.d.ts} +9 -5
- package/dist/contexts/i18n.d.ts.map +1 -0
- package/dist/contexts/i18n.js +23 -0
- package/dist/contexts/search.d.ts +50 -0
- package/dist/contexts/search.d.ts.map +1 -0
- package/dist/contexts/search.js +50 -0
- package/dist/contexts/sidebar.d.ts +18 -0
- package/dist/contexts/sidebar.d.ts.map +1 -0
- package/dist/contexts/sidebar.js +31 -0
- package/dist/contexts/tree.d.ts +13 -0
- package/dist/contexts/tree.d.ts.map +1 -0
- package/dist/contexts/tree.js +25 -0
- package/dist/i18n.d.ts +5 -6
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +31 -49
- package/dist/layouts/docs/navbar.d.ts +4 -0
- package/dist/layouts/docs/navbar.d.ts.map +1 -0
- package/dist/layouts/docs/navbar.js +22 -0
- package/dist/layouts/docs/sidebar.d.ts +40 -0
- package/dist/layouts/docs/sidebar.d.ts.map +1 -0
- package/dist/layouts/docs/sidebar.js +146 -0
- package/dist/layouts/docs.client.d.ts +14 -25
- package/dist/layouts/docs.client.d.ts.map +1 -0
- package/dist/layouts/docs.client.js +53 -195
- package/dist/layouts/docs.d.ts +34 -19
- package/dist/layouts/docs.d.ts.map +1 -0
- package/dist/layouts/docs.js +67 -202
- package/dist/layouts/home/menu.d.ts +6 -0
- package/dist/layouts/home/menu.d.ts.map +1 -0
- package/dist/layouts/home/menu.js +33 -0
- package/dist/layouts/home/navbar.d.ts +16 -0
- package/dist/layouts/home/navbar.d.ts.map +1 -0
- package/dist/layouts/home/navbar.js +48 -0
- package/dist/layouts/home.d.ts +5 -7
- package/dist/layouts/home.d.ts.map +1 -0
- package/dist/layouts/home.js +51 -59
- package/dist/layouts/links.d.ts +80 -0
- package/dist/layouts/links.d.ts.map +1 -0
- package/dist/layouts/links.js +14 -0
- package/dist/layouts/shared.d.ts +48 -2
- package/dist/layouts/shared.d.ts.map +1 -0
- package/dist/layouts/shared.js +27 -9
- package/dist/mdx.client.d.ts +3 -6
- package/dist/mdx.client.d.ts.map +1 -0
- package/dist/mdx.client.js +12 -19
- package/dist/mdx.d.ts +18 -20
- package/dist/mdx.d.ts.map +1 -0
- package/dist/mdx.js +47 -56
- package/dist/og.d.ts +6 -7
- package/dist/og.d.ts.map +1 -0
- package/dist/og.js +43 -102
- package/dist/page.client.d.ts +8 -41
- package/dist/page.client.d.ts.map +1 -0
- package/dist/page.client.js +71 -261
- package/dist/page.d.ts +28 -30
- package/dist/page.d.ts.map +1 -0
- package/dist/page.js +80 -168
- package/dist/provider.d.ts +12 -72
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +19 -55
- package/dist/style.css +1 -1
- package/dist/tailwind-plugin.d.ts +9 -20
- package/dist/tailwind-plugin.d.ts.map +1 -0
- package/dist/tailwind-plugin.js +191 -699
- package/dist/theme/animations.d.ts +170 -0
- package/dist/theme/animations.d.ts.map +1 -0
- package/dist/theme/animations.js +95 -0
- package/dist/theme/colors.d.ts +11 -0
- package/dist/theme/colors.d.ts.map +1 -0
- package/dist/theme/colors.js +327 -0
- package/dist/theme/typography.d.ts +70 -0
- package/dist/theme/typography.d.ts.map +1 -0
- package/dist/theme/typography.js +71 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/cn.js +1 -0
- package/dist/utils/get-sidebar-tabs.d.ts +7 -0
- package/dist/utils/get-sidebar-tabs.d.ts.map +1 -0
- package/dist/utils/get-sidebar-tabs.js +20 -0
- package/dist/utils/is-active.d.ts +2 -0
- package/dist/utils/is-active.d.ts.map +1 -0
- package/dist/utils/is-active.js +3 -0
- package/dist/utils/use-copy-button.d.ts +3 -0
- package/dist/utils/use-copy-button.d.ts.map +1 -0
- package/dist/utils/use-copy-button.js +25 -0
- package/package.json +9 -9
- package/dist/chunk-27HFSL7N.js +0 -53
- package/dist/chunk-2FLZOPQN.js +0 -54
- package/dist/chunk-2KMKNVSN.js +0 -29
- package/dist/chunk-AFMXKA2S.js +0 -125
- package/dist/chunk-CDPVENXR.js +0 -8
- package/dist/chunk-CLF6ZVYS.js +0 -259
- package/dist/chunk-DGKCMOIC.js +0 -56
- package/dist/chunk-DN6Z5VW6.js +0 -61
- package/dist/chunk-E3VO2QQT.js +0 -29
- package/dist/chunk-EFMHXXHW.js +0 -24
- package/dist/chunk-F534DZID.js +0 -43
- package/dist/chunk-GHOAONNQ.js +0 -48
- package/dist/chunk-IL64LMKR.js +0 -82
- package/dist/chunk-ILBYBJ5C.js +0 -38
- package/dist/chunk-IVBHRX3O.js +0 -31
- package/dist/chunk-J6XGK6ZG.js +0 -212
- package/dist/chunk-KZTWSBYY.js +0 -68
- package/dist/chunk-MCX7E6ZW.js +0 -57
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/chunk-QKOA6KEZ.js +0 -22
- package/dist/chunk-TK3TM3MR.js +0 -6
- package/dist/chunk-TQJ6YPJ3.js +0 -31
- package/dist/chunk-UUGCW3UP.js +0 -84
- package/dist/chunk-VPJMNIJX.js +0 -542
- package/dist/chunk-W36BQGMB.js +0 -69
- package/dist/chunk-YL3MZH7N.js +0 -66
- package/dist/chunk-ZBOI25UW.js +0 -139
- package/dist/components/api.client.d.ts +0 -5
- package/dist/components/api.client.js +0 -8
- package/dist/dynamic-sidebar-SYEETGZL.js +0 -129
- package/dist/edit-on-github-FIYOWWPQ.js +0 -49
- package/dist/layouts/home.client.d.ts +0 -11
- package/dist/layouts/home.client.js +0 -274
- package/dist/shared-SScCiV7b.d.ts +0 -152
- package/dist/sidebar-CQ4HmzQl.d.ts +0 -50
- package/dist/tag-list-BsEgfE3x.d.ts +0 -6
- package/dist/toc-clerk-SKE4LBT7.js +0 -158
- package/dist/tree-06ley65N.d.ts +0 -21
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
declare function Info({ children }: {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export declare function Info({ children }: {
|
|
4
3
|
children: ReactNode;
|
|
5
4
|
}): ReactNode;
|
|
6
5
|
interface ObjectType {
|
|
@@ -16,8 +15,8 @@ interface ObjectType {
|
|
|
16
15
|
typeDescriptionLink?: string;
|
|
17
16
|
default?: string;
|
|
18
17
|
}
|
|
19
|
-
declare function TypeTable({ type, }: {
|
|
18
|
+
export declare function TypeTable({ type, }: {
|
|
20
19
|
type: Record<string, ObjectType>;
|
|
21
20
|
}): React.ReactElement;
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=type-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-table.d.ts","sourceRoot":"","sources":["../../src/components/type-table.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAWrE;AAED,UAAU,UAAU;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAcD,wBAAgB,SAAS,CAAC,EACxB,IAAI,GACL,EAAE;IACD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAClC,GAAG,KAAK,CAAC,YAAY,CA8CrB"}
|
|
@@ -1,62 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
import {
|
|
11
|
-
twMerge
|
|
12
|
-
} from "../chunk-TK3TM3MR.js";
|
|
13
|
-
import "../chunk-MLKGABMK.js";
|
|
14
|
-
|
|
15
|
-
// src/components/type-table.tsx
|
|
16
|
-
import Link from "next/link";
|
|
17
|
-
import { cva } from "class-variance-authority";
|
|
18
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
function Info2({ children }) {
|
|
20
|
-
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
21
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { children: /* @__PURE__ */ jsx(Info, { className: "size-4" }) }),
|
|
22
|
-
/* @__PURE__ */ jsx(PopoverContent, { className: "prose max-h-[400px] min-w-[220px] max-w-[400px] overflow-auto text-sm prose-no-margin", children })
|
|
23
|
-
] });
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { InfoIcon } from 'lucide-react';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '../utils/cn';
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger, } from '../components/ui/popover';
|
|
8
|
+
export function Info({ children }) {
|
|
9
|
+
return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { children: _jsx(InfoIcon, { className: "size-4" }) }), _jsx(PopoverContent, { className: "prose max-h-[400px] min-w-[220px] max-w-[400px] overflow-auto text-sm prose-no-margin", children: children })] }));
|
|
24
10
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"rounded-md bg-fd-secondary p-1 text-fd-secondary-foreground",
|
|
30
|
-
{
|
|
11
|
+
const th = cva('p-2 font-medium first:pl-0 last:pr-0');
|
|
12
|
+
const td = cva('p-2 first:pl-0 last:pr-0');
|
|
13
|
+
const field = cva('inline-flex flex-row items-center gap-1');
|
|
14
|
+
const code = cva('rounded-md bg-fd-secondary p-1 text-fd-secondary-foreground', {
|
|
31
15
|
variants: {
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
type
|
|
38
|
-
}) {
|
|
39
|
-
return /* @__PURE__ */ jsx("div", { className: "not-prose overflow-auto whitespace-nowrap", children: /* @__PURE__ */ jsxs("table", { className: "my-4 w-full text-left text-sm text-fd-muted-foreground", children: [
|
|
40
|
-
/* @__PURE__ */ jsx("thead", { className: "border-b", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
41
|
-
/* @__PURE__ */ jsx("th", { className: twMerge(th(), "w-[45%]"), children: "Prop" }),
|
|
42
|
-
/* @__PURE__ */ jsx("th", { className: twMerge(th(), "w-[30%]"), children: "Type" }),
|
|
43
|
-
/* @__PURE__ */ jsx("th", { className: twMerge(th(), "w-1/4"), children: "Default" })
|
|
44
|
-
] }) }),
|
|
45
|
-
/* @__PURE__ */ jsx("tbody", { className: "border-collapse divide-y divide-fd-border", children: Object.entries(type).map(([key, value]) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
46
|
-
/* @__PURE__ */ jsx("td", { className: td(), children: /* @__PURE__ */ jsxs("div", { className: field(), children: [
|
|
47
|
-
/* @__PURE__ */ jsx("code", { className: twMerge(code({ color: "primary" })), children: key }),
|
|
48
|
-
value.description ? /* @__PURE__ */ jsx(Info2, { children: value.description }) : null
|
|
49
|
-
] }) }),
|
|
50
|
-
/* @__PURE__ */ jsx("td", { className: td(), children: /* @__PURE__ */ jsxs("div", { className: field(), children: [
|
|
51
|
-
/* @__PURE__ */ jsx("code", { className: code(), children: value.type }),
|
|
52
|
-
value.typeDescription ? /* @__PURE__ */ jsx(Info2, { children: value.typeDescription }) : null,
|
|
53
|
-
value.typeDescriptionLink ? /* @__PURE__ */ jsx(Link, { href: value.typeDescriptionLink, children: /* @__PURE__ */ jsx(Info, { className: "size-4" }) }) : null
|
|
54
|
-
] }) }),
|
|
55
|
-
/* @__PURE__ */ jsx("td", { className: td(), children: value.default ? /* @__PURE__ */ jsx("code", { className: code(), children: value.default }) : /* @__PURE__ */ jsx("span", { children: "-" }) })
|
|
56
|
-
] }, key)) })
|
|
57
|
-
] }) });
|
|
16
|
+
color: { primary: 'bg-fd-primary/10 text-fd-primary' },
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export function TypeTable({ type, }) {
|
|
20
|
+
return (_jsx("div", { className: "not-prose overflow-auto whitespace-nowrap", children: _jsxs("table", { className: "my-4 w-full text-left text-sm text-fd-muted-foreground", children: [_jsx("thead", { className: "border-b", children: _jsxs("tr", { children: [_jsx("th", { className: cn(th(), 'w-[45%]'), children: "Prop" }), _jsx("th", { className: cn(th(), 'w-[30%]'), children: "Type" }), _jsx("th", { className: cn(th(), 'w-1/4'), children: "Default" })] }) }), _jsx("tbody", { className: "border-collapse divide-y divide-fd-border", children: Object.entries(type).map(([key, value]) => (_jsxs("tr", { children: [_jsx("td", { className: td(), children: _jsxs("div", { className: field(), children: [_jsx("code", { className: cn(code({ color: 'primary' })), children: key }), value.description ? _jsx(Info, { children: value.description }) : null] }) }), _jsx("td", { className: td(), children: _jsxs("div", { className: field(), children: [_jsx("code", { className: code(), children: value.type }), value.typeDescription ? (_jsx(Info, { children: value.typeDescription })) : null, value.typeDescriptionLink ? (_jsx(Link, { href: value.typeDescriptionLink, children: _jsx(InfoIcon, { className: "size-4" }) })) : null] }) }), _jsx("td", { className: td(), children: value.default ? (_jsx("code", { className: code(), children: value.default })) : (_jsx("span", { children: "-" })) })] }, key))) })] }) }));
|
|
58
21
|
}
|
|
59
|
-
export {
|
|
60
|
-
Info2 as Info,
|
|
61
|
-
TypeTable
|
|
62
|
-
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const buttonVariants: (props?: ({
|
|
2
|
+
color?: "outline" | "ghost" | "secondary" | null | undefined;
|
|
3
|
+
size?: "sm" | "icon" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;8EAgB1B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
export const buttonVariants = cva('inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 disabled:pointer-events-none disabled:opacity-50', {
|
|
3
|
+
variants: {
|
|
4
|
+
color: {
|
|
5
|
+
outline: 'border hover:bg-fd-accent hover:text-fd-accent-foreground',
|
|
6
|
+
ghost: 'hover:bg-fd-accent hover:text-fd-accent-foreground',
|
|
7
|
+
secondary: 'border bg-fd-secondary text-fd-secondary-foreground hover:bg-fd-accent hover:text-fd-accent-foreground',
|
|
8
|
+
},
|
|
9
|
+
size: {
|
|
10
|
+
sm: 'gap-1 p-0.5 text-xs',
|
|
11
|
+
icon: 'p-1.5 [&_svg]:size-5',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
2
|
+
declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const CollapsibleContent: import("react").ForwardRefExoticComponent<Omit<CollapsiblePrimitive.CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
6
|
+
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/components/ui/collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AAIpE,QAAA,MAAM,WAAW,kIAA4B,CAAC;AAE9C,QAAA,MAAM,kBAAkB,4IAA0C,CAAC;AAEnE,QAAA,MAAM,kBAAkB,sMAgBtB,CAAC;AAKH,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
|
+
const Collapsible = CollapsiblePrimitive.Root;
|
|
6
|
+
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
7
|
+
const CollapsibleContent = forwardRef(({ children, ...props }, ref) => {
|
|
8
|
+
return (_jsx(CollapsiblePrimitive.CollapsibleContent, { ref: ref, ...props, className: cn('overflow-hidden [--radix-collapsible-content-height:0px] data-[state=closed]:animate-fd-collapsible-up data-[state=open]:animate-fd-collapsible-down', props.className), children: children }));
|
|
9
|
+
});
|
|
10
|
+
CollapsibleContent.displayName =
|
|
11
|
+
CollapsiblePrimitive.CollapsibleContent.displayName;
|
|
12
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as Primitive from '@radix-ui/react-navigation-menu';
|
|
3
|
+
declare const NavigationMenu: React.ForwardRefExoticComponent<Primitive.NavigationMenuProps & React.RefAttributes<HTMLElement>>;
|
|
4
|
+
declare const NavigationMenuList: React.ForwardRefExoticComponent<Primitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>>;
|
|
5
|
+
declare const NavigationMenuItem: React.ForwardRefExoticComponent<Primitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
6
|
+
declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<Primitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<Primitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const NavigationMenuLink: React.ForwardRefExoticComponent<Primitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
9
|
+
declare const NavigationMenuViewport: React.ForwardRefExoticComponent<Omit<Primitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuViewport, };
|
|
11
|
+
//# sourceMappingURL=navigation-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/navigation-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,SAAS,MAAM,iCAAiC,CAAC;AAG7D,QAAA,MAAM,cAAc,mGAAiB,CAAC;AAEtC,QAAA,MAAM,kBAAkB,4GAAiB,CAAC;AAE1C,QAAA,MAAM,kBAAkB,yGAAiB,CAAC;AAE1C,QAAA,MAAM,qBAAqB,sKAWzB,CAAC;AAGH,QAAA,MAAM,qBAAqB,gKAYzB,CAAC;AAGH,QAAA,MAAM,kBAAkB,6GAAiB,CAAC;AAE1C,QAAA,MAAM,sBAAsB,iKAa1B,CAAC;AAGH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,GACvB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as Primitive from '@radix-ui/react-navigation-menu';
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
|
+
const NavigationMenu = Primitive.Root;
|
|
6
|
+
const NavigationMenuList = Primitive.List;
|
|
7
|
+
const NavigationMenuItem = Primitive.Item;
|
|
8
|
+
const NavigationMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(Primitive.Trigger, { ref: ref, className: cn('data-[state=open]:bg-fd-accent/50', className), ...props, children: children })));
|
|
9
|
+
NavigationMenuTrigger.displayName = Primitive.Trigger.displayName;
|
|
10
|
+
const NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(Primitive.Content, { ref: ref, className: cn('absolute inset-x-0 top-0 data-[motion=from-end]:animate-fd-enterFromRight data-[motion=from-start]:animate-fd-enterFromLeft data-[motion=to-end]:animate-fd-exitToRight data-[motion=to-start]:animate-fd-exitToLeft', className), ...props })));
|
|
11
|
+
NavigationMenuContent.displayName = Primitive.Content.displayName;
|
|
12
|
+
const NavigationMenuLink = Primitive.Link;
|
|
13
|
+
const NavigationMenuViewport = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: "flex w-full justify-center", children: _jsx(Primitive.Viewport, { ...props, className: cn('relative h-[var(--radix-navigation-menu-viewport-height)] w-full origin-[top_center] overflow-hidden text-fd-popover-foreground transition-[width,height] duration-300 data-[state=closed]:animate-fd-nav-menu-out data-[state=open]:animate-fd-nav-menu-in', className) }) })));
|
|
14
|
+
NavigationMenuViewport.displayName = Primitive.Viewport.displayName;
|
|
15
|
+
export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuViewport, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const PopoverClose: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverClose };
|
|
8
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/ui/popover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,OAAO,yCAAwB,CAAC;AAEtC,QAAA,MAAM,cAAc,gHAA2B,CAAC;AAEhD,QAAA,MAAM,cAAc,gKAiBlB,CAAC;AAGH,QAAA,MAAM,YAAY,8GAAgC,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../../utils/cn';
|
|
6
|
+
const Popover = PopoverPrimitive.Root;
|
|
7
|
+
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
8
|
+
const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, side: "bottom", className: cn('z-50 min-w-[220px] max-w-[98vw] rounded-lg border bg-fd-popover p-2 text-sm text-fd-popover-foreground shadow-md focus-visible:outline-none data-[state=closed]:animate-fd-popover-out data-[state=open]:animate-fd-popover-in', className), ...props }) })));
|
|
9
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
10
|
+
const PopoverClose = PopoverPrimitive.PopoverClose;
|
|
11
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverClose };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const ScrollViewport: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { ScrollArea, ScrollBar, ScrollViewport };
|
|
7
|
+
//# sourceMappingURL=scroll-area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../../src/components/ui/scroll-area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,UAAU,+JAad,CAAC;AAIH,QAAA,MAAM,cAAc,uKAWlB,CAAC;AAIH,QAAA,MAAM,SAAS,wKAiBb,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
|
+
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(ScrollAreaPrimitive.Root, { ref: ref, className: cn('overflow-hidden', className), ...props, children: [children, _jsx(ScrollAreaPrimitive.Corner, {}), _jsx(ScrollBar, { orientation: "vertical" })] })));
|
|
6
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
7
|
+
const ScrollViewport = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(ScrollAreaPrimitive.Viewport, { ref: ref, className: cn('size-full rounded-[inherit]', className), ...props, children: children })));
|
|
8
|
+
ScrollViewport.displayName = ScrollAreaPrimitive.Viewport.displayName;
|
|
9
|
+
const ScrollBar = React.forwardRef(({ className, orientation = 'vertical', ...props }, ref) => (_jsx(ScrollAreaPrimitive.Scrollbar, { ref: ref, orientation: orientation, className: cn('flex select-none data-[state=hidden]:animate-fd-fade-out', orientation === 'vertical' && 'h-full w-1.5', orientation === 'horizontal' && 'h-1.5 flex-col', className), ...props, children: _jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-fd-border" }) })));
|
|
10
|
+
ScrollBar.displayName = ScrollAreaPrimitive.Scrollbar.displayName;
|
|
11
|
+
export { ScrollArea, ScrollBar, ScrollViewport };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Tabs: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
8
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,IAAI,mJAcR,CAAC;AAIH,QAAA,MAAM,QAAQ,uJAYZ,CAAC;AAGH,QAAA,MAAM,WAAW,gKAYf,CAAC;AAGH,QAAA,MAAM,WAAW,0JASf,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../../utils/cn';
|
|
6
|
+
const Tabs = React.forwardRef((props, ref) => {
|
|
7
|
+
return (_jsx(TabsPrimitive.Root, { ref: ref, ...props, className: cn('flex flex-col overflow-hidden rounded-xl border bg-fd-card', props.className) }));
|
|
8
|
+
});
|
|
9
|
+
Tabs.displayName = 'Tabs';
|
|
10
|
+
const TabsList = React.forwardRef((props, ref) => (_jsx(TabsPrimitive.List, { ref: ref, ...props, className: cn('flex flex-row items-end gap-4 overflow-x-auto bg-fd-secondary px-4 text-fd-muted-foreground', props.className) })));
|
|
11
|
+
TabsList.displayName = 'TabsList';
|
|
12
|
+
const TabsTrigger = React.forwardRef((props, ref) => (_jsx(TabsPrimitive.Trigger, { ref: ref, ...props, className: cn('whitespace-nowrap border-b border-transparent py-2 text-sm font-medium transition-colors hover:text-fd-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-fd-primary data-[state=active]:text-fd-primary', props.className) })));
|
|
13
|
+
TabsTrigger.displayName = 'TabsTrigger';
|
|
14
|
+
const TabsContent = React.forwardRef((props, ref) => (_jsx(TabsPrimitive.Content, { ref: ref, ...props, className: cn('p-4', props.className) })));
|
|
15
|
+
TabsContent.displayName = 'TabsContent';
|
|
16
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface Translations {
|
|
1
|
+
export interface Translations {
|
|
2
2
|
search: string;
|
|
3
3
|
searchNoResult: string;
|
|
4
4
|
toc: string;
|
|
@@ -10,7 +10,7 @@ interface Translations {
|
|
|
10
10
|
chooseTheme: string;
|
|
11
11
|
editOnGithub: string;
|
|
12
12
|
}
|
|
13
|
-
interface LocaleItem {
|
|
13
|
+
export interface LocaleItem {
|
|
14
14
|
name: string;
|
|
15
15
|
locale: string;
|
|
16
16
|
}
|
|
@@ -20,6 +20,10 @@ interface I18nContextType {
|
|
|
20
20
|
text: Translations;
|
|
21
21
|
locales?: LocaleItem[];
|
|
22
22
|
}
|
|
23
|
-
declare
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
export declare const I18nContext: import("react").Context<I18nContextType>;
|
|
24
|
+
export declare function I18nLabel(props: {
|
|
25
|
+
label: keyof Translations;
|
|
26
|
+
}): string;
|
|
27
|
+
export declare function useI18n(): I18nContextType;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/contexts/i18n.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IAEvB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IAEtB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,eAAe;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,WAAW,0CAatB,CAAC;AAEH,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,YAAY,CAAA;CAAE,GAAG,MAAM,CAItE;AAED,wBAAgB,OAAO,IAAI,eAAe,CAEzC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
export const I18nContext = createContext({
|
|
4
|
+
text: {
|
|
5
|
+
search: 'Search',
|
|
6
|
+
searchNoResult: 'No results found',
|
|
7
|
+
toc: 'On this page',
|
|
8
|
+
tocNoHeadings: 'No Headings',
|
|
9
|
+
lastUpdate: 'Last updated on',
|
|
10
|
+
chooseLanguage: 'Choose a language',
|
|
11
|
+
nextPage: 'Next',
|
|
12
|
+
previousPage: 'Previous',
|
|
13
|
+
chooseTheme: 'Theme',
|
|
14
|
+
editOnGithub: 'Edit on GitHub',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export function I18nLabel(props) {
|
|
18
|
+
const { text } = useI18n();
|
|
19
|
+
return text[props.label];
|
|
20
|
+
}
|
|
21
|
+
export function useI18n() {
|
|
22
|
+
return useContext(I18nContext);
|
|
23
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { SearchLink, SharedProps } from '../components/dialog/search';
|
|
3
|
+
interface HotKey {
|
|
4
|
+
display: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Key code or a function determining whether the key is pressed.
|
|
7
|
+
*/
|
|
8
|
+
key: string | ((e: KeyboardEvent) => boolean);
|
|
9
|
+
}
|
|
10
|
+
export interface SearchProviderProps {
|
|
11
|
+
/**
|
|
12
|
+
* Preload search dialog before opening it
|
|
13
|
+
*
|
|
14
|
+
* @defaultValue `true`
|
|
15
|
+
*/
|
|
16
|
+
preload?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Custom links to be displayed if search is empty
|
|
19
|
+
*/
|
|
20
|
+
links?: SearchLink[];
|
|
21
|
+
/**
|
|
22
|
+
* Hotkeys for triggering search dialog
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue Meta/Ctrl + K
|
|
25
|
+
*/
|
|
26
|
+
hotKey?: HotKey[];
|
|
27
|
+
/**
|
|
28
|
+
* Replace default search dialog, allowing you to use other solutions such as Algolia Search
|
|
29
|
+
*
|
|
30
|
+
* It receives the `open` and `onOpenChange` prop, can be lazy loaded with `next/dynamic`
|
|
31
|
+
*/
|
|
32
|
+
SearchDialog: React.ComponentType<SharedProps>;
|
|
33
|
+
/**
|
|
34
|
+
* Additional props to the dialog
|
|
35
|
+
*/
|
|
36
|
+
options?: Partial<SharedProps>;
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
interface SearchContextType {
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
hotKey: HotKey[];
|
|
42
|
+
setOpenSearch: (value: boolean) => void;
|
|
43
|
+
}
|
|
44
|
+
export declare function useSearchContext(): SearchContextType;
|
|
45
|
+
export declare function SearchProvider({ SearchDialog, children, preload, options, hotKey, links, }: SearchProviderProps): React.ReactElement;
|
|
46
|
+
export declare function SearchOnly({ children }: {
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
}): ReactNode;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/contexts/search.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE1E,UAAU,MAAM;IACd,OAAO,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IAErB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;;;OAIG;IACH,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAE/C;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAE/B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAQD,wBAAgB,gBAAgB,IAAI,iBAAiB,CAEpD;AAcD,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,QAAQ,EACR,OAAc,EACd,OAAO,EACP,MASC,EACD,KAAK,GACN,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CAuC1C;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,aAI/D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useEffect, useMemo, useState, } from 'react';
|
|
4
|
+
const SearchContext = createContext({
|
|
5
|
+
enabled: false,
|
|
6
|
+
hotKey: [],
|
|
7
|
+
setOpenSearch: () => undefined,
|
|
8
|
+
});
|
|
9
|
+
export function useSearchContext() {
|
|
10
|
+
return useContext(SearchContext);
|
|
11
|
+
}
|
|
12
|
+
function MetaOrControl() {
|
|
13
|
+
const [key, setKey] = useState('⌘');
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const isWindows = window.navigator.userAgent.includes('Windows');
|
|
16
|
+
if (isWindows)
|
|
17
|
+
setKey('Ctrl');
|
|
18
|
+
}, []);
|
|
19
|
+
return key;
|
|
20
|
+
}
|
|
21
|
+
export function SearchProvider({ SearchDialog, children, preload = true, options, hotKey = [
|
|
22
|
+
{
|
|
23
|
+
key: (e) => e.metaKey || e.ctrlKey,
|
|
24
|
+
display: _jsx(MetaOrControl, {}),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: 'k',
|
|
28
|
+
display: 'K',
|
|
29
|
+
},
|
|
30
|
+
], links, }) {
|
|
31
|
+
const [isOpen, setIsOpen] = useState(preload ? false : undefined);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const handler = (e) => {
|
|
34
|
+
if (hotKey.every((v) => typeof v.key === 'string' ? e.key === v.key : v.key(e))) {
|
|
35
|
+
setIsOpen(true);
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
window.addEventListener('keydown', handler);
|
|
40
|
+
return () => {
|
|
41
|
+
window.removeEventListener('keydown', handler);
|
|
42
|
+
};
|
|
43
|
+
}, [hotKey]);
|
|
44
|
+
return (_jsxs(SearchContext.Provider, { value: useMemo(() => ({ enabled: true, hotKey, setOpenSearch: setIsOpen }), [hotKey]), children: [isOpen !== undefined && (_jsx(SearchDialog, { open: isOpen, onOpenChange: setIsOpen, links: links, ...options })), children] }));
|
|
45
|
+
}
|
|
46
|
+
export function SearchOnly({ children }) {
|
|
47
|
+
const search = useSearchContext();
|
|
48
|
+
if (search.enabled)
|
|
49
|
+
return children;
|
|
50
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type MutableRefObject, type ReactNode } from 'react';
|
|
2
|
+
interface SidebarContext {
|
|
3
|
+
open: boolean;
|
|
4
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
|
+
collapsed: boolean;
|
|
6
|
+
setCollapsed: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
|
+
/**
|
|
8
|
+
* When set to false, don't close the sidebar when navigate to another page
|
|
9
|
+
*/
|
|
10
|
+
closeOnRedirect: MutableRefObject<boolean>;
|
|
11
|
+
}
|
|
12
|
+
declare const SidebarContext: import("react").Context<SidebarContext | undefined>;
|
|
13
|
+
export declare function useSidebar(): SidebarContext;
|
|
14
|
+
export declare function SidebarProvider({ children, }: {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}): ReactNode;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/contexts/sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,UAAU,cAAc;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACvD,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5D;;OAEG;IACH,eAAe,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAC5C;AAED,QAAA,MAAM,cAAc,qDAAuD,CAAC;AAE5E,wBAAgB,UAAU,IAAI,cAAc,CAI3C;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,SAAS,CAgCZ"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useState, useMemo, useRef, } from 'react';
|
|
3
|
+
import { usePathname } from 'next/navigation';
|
|
4
|
+
import { SidebarProvider as BaseProvider } from 'fumadocs-core/sidebar';
|
|
5
|
+
import { useOnChange } from 'fumadocs-core/utils/use-on-change';
|
|
6
|
+
const SidebarContext = createContext(undefined);
|
|
7
|
+
export function useSidebar() {
|
|
8
|
+
const ctx = useContext(SidebarContext);
|
|
9
|
+
if (!ctx)
|
|
10
|
+
throw new Error('Missing root provider');
|
|
11
|
+
return ctx;
|
|
12
|
+
}
|
|
13
|
+
export function SidebarProvider({ children, }) {
|
|
14
|
+
const closeOnRedirect = useRef(true);
|
|
15
|
+
const [open, setOpen] = useState(false);
|
|
16
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
17
|
+
const pathname = usePathname();
|
|
18
|
+
useOnChange(pathname, () => {
|
|
19
|
+
if (closeOnRedirect.current) {
|
|
20
|
+
setOpen(false);
|
|
21
|
+
}
|
|
22
|
+
closeOnRedirect.current = true;
|
|
23
|
+
});
|
|
24
|
+
return (_jsx(SidebarContext.Provider, { value: useMemo(() => ({
|
|
25
|
+
open,
|
|
26
|
+
setOpen,
|
|
27
|
+
collapsed,
|
|
28
|
+
setCollapsed,
|
|
29
|
+
closeOnRedirect,
|
|
30
|
+
}), [open, collapsed]), children: _jsx(BaseProvider, { open: open, onOpenChange: setOpen, children: children }) }));
|
|
31
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PageTree } from 'fumadocs-core/server';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
interface TreeContextType {
|
|
4
|
+
root: PageTree.Root | PageTree.Folder;
|
|
5
|
+
}
|
|
6
|
+
export declare function TreeContextProvider({ children, tree, }: {
|
|
7
|
+
tree: PageTree.Root;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): ReactNode;
|
|
10
|
+
export declare function useTreePath(): PageTree.Node[];
|
|
11
|
+
export declare function useTreeContext(): TreeContextType;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/contexts/tree.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAGL,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAGf,UAAU,eAAe;IACvB,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;CACvC;AAKD,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,IAAI,GACL,EAAE;IACD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,SAAS,CAiBZ;AAED,wBAAgB,WAAW,IAAI,QAAQ,CAAC,IAAI,EAAE,CAE7C;AAED,wBAAgB,cAAc,IAAI,eAAe,CAMhD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { usePathname } from 'next/navigation';
|
|
4
|
+
import { createContext, useContext, useMemo, useRef, } from 'react';
|
|
5
|
+
import { searchPath } from 'fumadocs-core/breadcrumb';
|
|
6
|
+
const TreeContext = createContext(undefined);
|
|
7
|
+
const PathContext = createContext([]);
|
|
8
|
+
export function TreeContextProvider({ children, tree, }) {
|
|
9
|
+
const pathname = usePathname();
|
|
10
|
+
const path = useMemo(() => searchPath(tree.children, pathname) ?? [], [pathname, tree]);
|
|
11
|
+
const root = (path.findLast((item) => item.type === 'folder' && item.root) ??
|
|
12
|
+
tree);
|
|
13
|
+
const pathnameRef = useRef(pathname);
|
|
14
|
+
pathnameRef.current = pathname;
|
|
15
|
+
return (_jsx(TreeContext.Provider, { value: useMemo(() => ({ root }), [root]), children: _jsx(PathContext.Provider, { value: path, children: children }) }));
|
|
16
|
+
}
|
|
17
|
+
export function useTreePath() {
|
|
18
|
+
return useContext(PathContext);
|
|
19
|
+
}
|
|
20
|
+
export function useTreeContext() {
|
|
21
|
+
const ctx = useContext(TreeContext);
|
|
22
|
+
if (!ctx)
|
|
23
|
+
throw new Error('You must wrap this component under <DocsLayout />');
|
|
24
|
+
return ctx;
|
|
25
|
+
}
|
package/dist/i18n.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type Translations, type LocaleItem } from './contexts/i18n';
|
|
4
3
|
interface I18nProviderProps {
|
|
5
4
|
/**
|
|
6
5
|
* Current locale
|
|
@@ -20,6 +19,6 @@ interface I18nProviderProps {
|
|
|
20
19
|
onChange?: (v: string) => void;
|
|
21
20
|
children: ReactNode;
|
|
22
21
|
}
|
|
23
|
-
declare function I18nProvider({ locales, locale, ...props }: I18nProviderProps):
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
export declare function I18nProvider({ locales, locale, ...props }: I18nProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export { type Translations };
|
|
24
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACzB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAErC;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAE/B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAY,EACZ,MAAM,EACN,GAAG,KAAK,EACT,EAAE,iBAAiB,2CAqCnB;AAED,OAAO,EAAE,KAAK,YAAY,EAAE,CAAC"}
|