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
package/dist/components/files.js
CHANGED
|
@@ -1,66 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from "../chunk-VPJMNIJX.js";
|
|
12
|
-
import {
|
|
13
|
-
twMerge
|
|
14
|
-
} from "../chunk-TK3TM3MR.js";
|
|
15
|
-
import "../chunk-MLKGABMK.js";
|
|
16
|
-
|
|
17
|
-
// src/components/files.tsx
|
|
18
|
-
import { cva } from "class-variance-authority";
|
|
19
|
-
import { useState } from "react";
|
|
20
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
-
var itemVariants = cva(
|
|
22
|
-
"flex flex-row items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-fd-accent hover:text-fd-accent-foreground [&_svg]:size-4"
|
|
23
|
-
);
|
|
24
|
-
function Files({
|
|
25
|
-
className,
|
|
26
|
-
...props
|
|
27
|
-
}) {
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
-
"div",
|
|
30
|
-
{
|
|
31
|
-
className: twMerge("not-prose rounded-md border bg-fd-card p-2", className),
|
|
32
|
-
...props,
|
|
33
|
-
children: props.children
|
|
34
|
-
}
|
|
35
|
-
);
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { FileIcon, FolderIcon, FolderOpen } from 'lucide-react';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { cn } from '../utils/cn';
|
|
7
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from './ui/collapsible';
|
|
8
|
+
const itemVariants = cva('flex flex-row items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-fd-accent hover:text-fd-accent-foreground [&_svg]:size-4');
|
|
9
|
+
export function Files({ className, ...props }) {
|
|
10
|
+
return (_jsx("div", { className: cn('not-prose rounded-md border bg-fd-card p-2', className), ...props, children: props.children }));
|
|
36
11
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
icon = /* @__PURE__ */ jsx(File, {}),
|
|
40
|
-
className,
|
|
41
|
-
...rest
|
|
42
|
-
}) {
|
|
43
|
-
return /* @__PURE__ */ jsxs("div", { className: twMerge(itemVariants({ className })), ...rest, children: [
|
|
44
|
-
icon,
|
|
45
|
-
name
|
|
46
|
-
] });
|
|
12
|
+
export function File({ name, icon = _jsx(FileIcon, {}), className, ...rest }) {
|
|
13
|
+
return (_jsxs("div", { className: cn(itemVariants({ className })), ...rest, children: [icon, name] }));
|
|
47
14
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
...props
|
|
52
|
-
}) {
|
|
53
|
-
const [open, setOpen] = useState(defaultOpen);
|
|
54
|
-
return /* @__PURE__ */ jsxs(Collapsible, { open, onOpenChange: setOpen, ...props, children: [
|
|
55
|
-
/* @__PURE__ */ jsxs(CollapsibleTrigger, { className: twMerge(itemVariants({ className: "w-full" })), children: [
|
|
56
|
-
open ? /* @__PURE__ */ jsx(FolderOpen, {}) : /* @__PURE__ */ jsx(Folder, {}),
|
|
57
|
-
name
|
|
58
|
-
] }),
|
|
59
|
-
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", { className: "ms-2 flex flex-col border-l ps-2", children: props.children }) })
|
|
60
|
-
] });
|
|
15
|
+
export function Folder({ name, defaultOpen = false, ...props }) {
|
|
16
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
17
|
+
return (_jsxs(Collapsible, { open: open, onOpenChange: setOpen, ...props, children: [_jsxs(CollapsibleTrigger, { className: cn(itemVariants({ className: 'w-full' })), children: [open ? _jsx(FolderOpen, {}) : _jsx(FolderIcon, {}), name] }), _jsx(CollapsibleContent, { children: _jsx("div", { className: "ms-2 flex flex-col border-l ps-2", children: props.children }) })] }));
|
|
61
18
|
}
|
|
62
|
-
export {
|
|
63
|
-
File2 as File,
|
|
64
|
-
Files,
|
|
65
|
-
Folder2 as Folder
|
|
66
|
-
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
3
2
|
type Types = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
4
3
|
type HeadingProps<T extends Types> = Omit<ComponentPropsWithoutRef<T>, 'as'> & {
|
|
5
4
|
as?: T;
|
|
6
5
|
};
|
|
7
|
-
declare function Heading<T extends Types = 'h1'>({ as, className, ...props }: HeadingProps<T>): React.ReactElement;
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export declare function Heading<T extends Types = 'h1'>({ as, className, ...props }: HeadingProps<T>): React.ReactElement;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=heading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/components/heading.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAGtD,KAAK,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACrD,KAAK,YAAY,CAAC,CAAC,SAAS,KAAK,IAAI,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG;IAC7E,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,CAAC;AAEF,wBAAgB,OAAO,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,EAC9C,EAAE,EACF,SAAS,EACT,GAAG,KAAK,EACT,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAmBtC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link } from 'lucide-react';
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
|
+
export function Heading({ as, className, ...props }) {
|
|
5
|
+
const As = as ?? 'h1';
|
|
6
|
+
if (!props.id)
|
|
7
|
+
return _jsx(As, { className: className, ...props });
|
|
8
|
+
return (_jsxs(As, { className: cn('flex scroll-m-28 flex-row items-center gap-2', className), ...props, children: [_jsx("a", { "data-card": "", href: `#${props.id}`, className: "peer", children: props.children }), _jsx(Link, { "aria-label": "Link to section", className: "size-3.5 shrink-0 text-fd-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100" })] }));
|
|
9
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ImageProps } from 'next/image';
|
|
2
|
-
import { ImgHTMLAttributes } from 'react';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
type ImageZoomProps = ImageProps & {
|
|
1
|
+
import { type ImageProps } from 'next/image';
|
|
2
|
+
import { type ImgHTMLAttributes } from 'react';
|
|
3
|
+
import './image-zoom.css';
|
|
4
|
+
import { type UncontrolledProps } from 'react-medium-image-zoom';
|
|
5
|
+
export type ImageZoomProps = ImageProps & {
|
|
6
6
|
/**
|
|
7
7
|
* Image props when zoom in
|
|
8
8
|
*/
|
|
@@ -12,6 +12,5 @@ type ImageZoomProps = ImageProps & {
|
|
|
12
12
|
*/
|
|
13
13
|
rmiz?: UncontrolledProps;
|
|
14
14
|
};
|
|
15
|
-
declare function ImageZoom({ zoomInProps, children, rmiz, ...props }: ImageZoomProps): React.ReactElement;
|
|
16
|
-
|
|
17
|
-
export { ImageZoom, type ImageZoomProps };
|
|
15
|
+
export declare function ImageZoom({ zoomInProps, children, rmiz, ...props }: ImageZoomProps): React.ReactElement;
|
|
16
|
+
//# sourceMappingURL=image-zoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-zoom.d.ts","sourceRoot":"","sources":["../../src/components/image-zoom.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,kBAAkB,CAAC;AAC1B,OAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEvE,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IACxC;;OAEG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAElD;;OAEG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B,CAAC;AAQF,wBAAgB,SAAS,CAAC,EACxB,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAoBrC"}
|
|
@@ -1,43 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
import "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import "./image-zoom.css";
|
|
7
|
-
import Zoom from "react-medium-image-zoom";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import './image-zoom.css';
|
|
5
|
+
import Zoom from 'react-medium-image-zoom';
|
|
9
6
|
function getImageSrc(src) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
if (typeof src === 'string')
|
|
8
|
+
return src;
|
|
9
|
+
if ('default' in src)
|
|
10
|
+
return src.default.src;
|
|
11
|
+
return src.src;
|
|
13
12
|
}
|
|
14
|
-
function ImageZoom({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
21
|
-
Zoom,
|
|
22
|
-
{
|
|
23
|
-
zoomMargin: 20,
|
|
24
|
-
wrapElement: "span",
|
|
25
|
-
...rmiz,
|
|
26
|
-
zoomImg: {
|
|
27
|
-
src: getImageSrc(props.src),
|
|
28
|
-
sizes: void 0,
|
|
29
|
-
...zoomInProps
|
|
30
|
-
},
|
|
31
|
-
children: children ?? /* @__PURE__ */ jsx(
|
|
32
|
-
Image,
|
|
33
|
-
{
|
|
34
|
-
sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px",
|
|
35
|
-
...props
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
);
|
|
13
|
+
export function ImageZoom({ zoomInProps, children, rmiz, ...props }) {
|
|
14
|
+
return (_jsx(Zoom, { zoomMargin: 20, wrapElement: "span", ...rmiz, zoomImg: {
|
|
15
|
+
src: getImageSrc(props.src),
|
|
16
|
+
sizes: undefined,
|
|
17
|
+
...zoomInProps,
|
|
18
|
+
}, children: children ?? (_jsx(Image, { sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px", ...props })) }));
|
|
40
19
|
}
|
|
41
|
-
export {
|
|
42
|
-
ImageZoom
|
|
43
|
-
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { TOCItemType } from 'fumadocs-core/server';
|
|
2
|
-
|
|
3
|
-
interface InlineTocProps {
|
|
1
|
+
import type { TOCItemType } from 'fumadocs-core/server';
|
|
2
|
+
export interface InlineTocProps {
|
|
4
3
|
items: TOCItemType[];
|
|
5
4
|
defaultOpen?: boolean;
|
|
6
5
|
}
|
|
7
|
-
declare function InlineTOC({ items, defaultOpen, }: InlineTocProps): React.ReactElement;
|
|
8
|
-
|
|
9
|
-
export { InlineTOC, type InlineTocProps };
|
|
6
|
+
export declare function InlineTOC({ items, defaultOpen, }: InlineTocProps): React.ReactElement;
|
|
7
|
+
//# sourceMappingURL=inline-toc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-toc.d.ts","sourceRoot":"","sources":["../../src/components/inline-toc.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOxD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,GACZ,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CA4BrC"}
|
|
@@ -1,47 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "../chunk-VPJMNIJX.js";
|
|
10
|
-
import "../chunk-TK3TM3MR.js";
|
|
11
|
-
import "../chunk-MLKGABMK.js";
|
|
12
|
-
|
|
13
|
-
// src/components/inline-toc.tsx
|
|
14
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
function InlineTOC({
|
|
16
|
-
items,
|
|
17
|
-
defaultOpen
|
|
18
|
-
}) {
|
|
19
|
-
return /* @__PURE__ */ jsxs(
|
|
20
|
-
Collapsible,
|
|
21
|
-
{
|
|
22
|
-
defaultOpen,
|
|
23
|
-
className: "not-prose rounded-lg border bg-fd-card text-fd-card-foreground",
|
|
24
|
-
children: [
|
|
25
|
-
/* @__PURE__ */ jsxs(CollapsibleTrigger, { className: "inline-flex w-full items-center justify-between p-4 font-medium [&[data-state=open]>svg]:rotate-180", children: [
|
|
26
|
-
"Table of Contents",
|
|
27
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: "size-4 transition-transform duration-200" })
|
|
28
|
-
] }),
|
|
29
|
-
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-col p-4 pt-0 text-sm text-fd-muted-foreground", children: items.map((item) => /* @__PURE__ */ jsx(
|
|
30
|
-
"a",
|
|
31
|
-
{
|
|
32
|
-
href: item.url,
|
|
33
|
-
className: "border-l py-1.5 hover:text-fd-accent-foreground",
|
|
34
|
-
style: {
|
|
35
|
-
paddingLeft: 12 * Math.max(item.depth - 1, 0)
|
|
36
|
-
},
|
|
37
|
-
children: item.title
|
|
38
|
-
},
|
|
39
|
-
item.url
|
|
40
|
-
)) }) })
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
);
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronDown } from 'lucide-react';
|
|
4
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from './ui/collapsible';
|
|
5
|
+
export function InlineTOC({ items, defaultOpen, }) {
|
|
6
|
+
return (_jsxs(Collapsible, { defaultOpen: defaultOpen, className: "not-prose rounded-lg border bg-fd-card text-fd-card-foreground", children: [_jsxs(CollapsibleTrigger, { className: "inline-flex w-full items-center justify-between p-4 font-medium [&[data-state=open]>svg]:rotate-180", children: ["Table of Contents", _jsx(ChevronDown, { className: "size-4 transition-transform duration-200" })] }), _jsx(CollapsibleContent, { children: _jsx("div", { className: "flex flex-col p-4 pt-0 text-sm text-fd-muted-foreground", children: items.map((item) => (_jsx("a", { href: item.url, className: "border-l py-1.5 hover:text-fd-accent-foreground", style: {
|
|
7
|
+
paddingLeft: 12 * Math.max(item.depth - 1, 0),
|
|
8
|
+
}, children: item.title }, item.url))) }) })] }));
|
|
44
9
|
}
|
|
45
|
-
export {
|
|
46
|
-
InlineTOC
|
|
47
|
-
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type BreadcrumbOptions } from 'fumadocs-core/breadcrumb';
|
|
2
|
+
export interface BreadcrumbProps extends Omit<BreadcrumbOptions, 'includePage'> {
|
|
3
|
+
/**
|
|
4
|
+
* Show the full path to the current page
|
|
5
|
+
*
|
|
6
|
+
* @defaultValue false
|
|
7
|
+
*/
|
|
8
|
+
full?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function Breadcrumb({ full, ...options }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/layout/breadcrumb.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAKlC,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC;IAC9C;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAY,EAAE,GAAG,OAAO,EAAE,EAAE,eAAe,kDAiCvE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronRight } from 'lucide-react';
|
|
4
|
+
import { getBreadcrumbItemsFromPath, } from 'fumadocs-core/breadcrumb';
|
|
5
|
+
import Link from 'next/link';
|
|
6
|
+
import { Fragment, useMemo } from 'react';
|
|
7
|
+
import { useTreeContext, useTreePath } from '../../contexts/tree';
|
|
8
|
+
export function Breadcrumb({ full = false, ...options }) {
|
|
9
|
+
const path = useTreePath();
|
|
10
|
+
const { root } = useTreeContext();
|
|
11
|
+
const items = useMemo(() => {
|
|
12
|
+
return getBreadcrumbItemsFromPath(root, path, {
|
|
13
|
+
includePage: full,
|
|
14
|
+
...options,
|
|
15
|
+
});
|
|
16
|
+
}, [full, options, path, root]);
|
|
17
|
+
if (items.length === 0)
|
|
18
|
+
return null;
|
|
19
|
+
return (_jsx("div", { className: "-mb-3 flex flex-row items-center gap-1 text-sm font-medium text-fd-muted-foreground", children: items.map((item, i) => (_jsxs(Fragment, { children: [i !== 0 && (_jsx(ChevronRight, { className: "size-4 shrink-0 rtl:rotate-180" })), item.url ? (_jsx(Link, { href: item.url, className: "truncate hover:text-fd-accent-foreground", children: item.name })) : (_jsx("span", { className: "truncate", children: item.name }))] }, i))) }));
|
|
20
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes, HTMLAttributes } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { type LanguageSelectProps, LanguageToggle, LanguageToggleText };
|
|
1
|
+
import { type ButtonHTMLAttributes, type HTMLAttributes } from 'react';
|
|
2
|
+
export type LanguageSelectProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
3
|
+
export declare function LanguageToggle(props: LanguageSelectProps): React.ReactElement;
|
|
4
|
+
export declare function LanguageToggleText(props: HTMLAttributes<HTMLSpanElement>): React.ReactElement;
|
|
5
|
+
//# sourceMappingURL=language-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/layout/language-toggle.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAUvE,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE1E,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CA2C7E;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,CAAC,eAAe,CAAC,GACrC,KAAK,CAAC,YAAY,CAOpB"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useI18n } from '../../contexts/i18n';
|
|
4
|
+
import { Popover, PopoverContent, PopoverTrigger, } from '../../components/ui/popover';
|
|
5
|
+
import { cn } from '../../utils/cn';
|
|
6
|
+
import { buttonVariants } from '../../components/ui/button';
|
|
7
|
+
export function LanguageToggle(props) {
|
|
8
|
+
const context = useI18n();
|
|
9
|
+
if (!context.locales)
|
|
10
|
+
throw new Error('Missing `<I18nProvider />`');
|
|
11
|
+
return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { "aria-label": context.text.chooseLanguage, ...props, className: cn(buttonVariants({
|
|
12
|
+
color: 'ghost',
|
|
13
|
+
className: 'gap-1.5 p-1.5',
|
|
14
|
+
}), props.className), children: props.children }), _jsxs(PopoverContent, { className: "flex flex-col overflow-hidden p-0", children: [_jsx("p", { className: "mb-1 p-2 text-xs font-medium text-fd-muted-foreground", children: context.text.chooseLanguage }), context.locales.map((item) => (_jsx("button", { type: "button", className: cn('p-2 text-start text-sm', item.locale === context.locale
|
|
15
|
+
? 'bg-fd-primary/10 font-medium text-fd-primary'
|
|
16
|
+
: 'hover:bg-fd-accent hover:text-fd-accent-foreground'), onClick: () => {
|
|
17
|
+
context.onChange?.(item.locale);
|
|
18
|
+
}, children: item.name }, item.locale)))] })] }));
|
|
19
|
+
}
|
|
20
|
+
export function LanguageToggleText(props) {
|
|
21
|
+
const context = useI18n();
|
|
22
|
+
const text = context.locales?.find((item) => item.locale === context.locale)?.name;
|
|
23
|
+
return _jsx("span", { ...props, children: text });
|
|
24
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type LinkProps } from 'fumadocs-core/link';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
export interface NavProviderProps {
|
|
4
|
+
/**
|
|
5
|
+
* Use transparent background
|
|
6
|
+
*
|
|
7
|
+
* @defaultValue none
|
|
8
|
+
*/
|
|
9
|
+
transparentMode?: 'always' | 'top' | 'none';
|
|
10
|
+
}
|
|
11
|
+
export interface TitleProps {
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Redirect url of title
|
|
15
|
+
* @defaultValue '/'
|
|
16
|
+
*/
|
|
17
|
+
url?: string;
|
|
18
|
+
}
|
|
19
|
+
interface NavContextType {
|
|
20
|
+
isTransparent: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const NavContext: import("react").Context<NavContextType>;
|
|
23
|
+
export declare function NavProvider({ transparentMode, children, }: NavProviderProps & {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}): ReactNode;
|
|
26
|
+
export declare function Title({ title, url, ...props }: TitleProps & Omit<LinkProps, 'title'>): React.ReactElement;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=nav.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../../src/components/layout/nav.tsx"],"names":[],"mappings":"AACA,OAAa,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAI3E,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,eAAe,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;CAC7C;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,UAAU,cAAc;IACtB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,UAAU,yCAErB,CAAC;AAEH,wBAAgB,WAAW,CAAC,EAC1B,eAAwB,EACxB,QAAQ,GACT,EAAE,gBAAgB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAsBxD;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,YAAY,CAe5D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import Link from 'fumadocs-core/link';
|
|
4
|
+
import { createContext, useEffect, useState } from 'react';
|
|
5
|
+
import { cn } from '../../utils/cn';
|
|
6
|
+
import { useI18n } from '../../contexts/i18n';
|
|
7
|
+
export const NavContext = createContext({
|
|
8
|
+
isTransparent: false,
|
|
9
|
+
});
|
|
10
|
+
export function NavProvider({ transparentMode = 'none', children, }) {
|
|
11
|
+
const [transparent, setTransparent] = useState(transparentMode !== 'none');
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (transparentMode !== 'top')
|
|
14
|
+
return;
|
|
15
|
+
const listener = () => {
|
|
16
|
+
setTransparent(window.scrollY < 10);
|
|
17
|
+
};
|
|
18
|
+
listener();
|
|
19
|
+
window.addEventListener('scroll', listener);
|
|
20
|
+
return () => {
|
|
21
|
+
window.removeEventListener('scroll', listener);
|
|
22
|
+
};
|
|
23
|
+
}, [transparentMode]);
|
|
24
|
+
return (_jsx(NavContext.Provider, { value: { isTransparent: transparent }, children: children }));
|
|
25
|
+
}
|
|
26
|
+
export function Title({ title, url, ...props }) {
|
|
27
|
+
const { locale } = useI18n();
|
|
28
|
+
return (_jsx(Link, { href: url ?? (locale ? `/${locale}` : '/'), ...props, className: cn('inline-flex items-center gap-2.5 font-semibold', props.className), children: title }));
|
|
29
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
interface Option {
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface Option {
|
|
4
3
|
/**
|
|
5
4
|
* Redirect URL of the folder, usually the index page
|
|
6
5
|
*/
|
|
@@ -10,8 +9,7 @@ interface Option {
|
|
|
10
9
|
description?: ReactNode;
|
|
11
10
|
props?: HTMLAttributes<HTMLElement>;
|
|
12
11
|
}
|
|
13
|
-
declare function RootToggle({ options, ...props }: {
|
|
12
|
+
export declare function RootToggle({ options, ...props }: {
|
|
14
13
|
options: Option[];
|
|
15
|
-
} & HTMLAttributes<HTMLButtonElement>):
|
|
16
|
-
|
|
17
|
-
export { type Option, RootToggle };
|
|
14
|
+
} & HTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=root-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/layout/root-toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAQ/E,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB,KAAK,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;CACrC;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,GAAG,KAAK,EACT,EAAE;IACD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GAAG,cAAc,CAAC,iBAAiB,CAAC,2CA+CpC"}
|
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
} from
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
};
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronDown } from 'lucide-react';
|
|
4
|
+
import { useMemo, useState } from 'react';
|
|
5
|
+
import Link from 'next/link';
|
|
6
|
+
import { usePathname } from 'next/navigation';
|
|
7
|
+
import { cn } from '../../utils/cn';
|
|
8
|
+
import { isActive } from '../../utils/is-active';
|
|
9
|
+
import { useSidebar } from '../../contexts/sidebar';
|
|
10
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';
|
|
11
|
+
export function RootToggle({ options, ...props }) {
|
|
12
|
+
const [open, setOpen] = useState(false);
|
|
13
|
+
const { closeOnRedirect } = useSidebar();
|
|
14
|
+
const pathname = usePathname();
|
|
15
|
+
const selected = useMemo(() => {
|
|
16
|
+
return options.find((item) => isActive(item.url, pathname, true));
|
|
17
|
+
}, [options, pathname]);
|
|
18
|
+
const onClick = () => {
|
|
19
|
+
closeOnRedirect.current = false;
|
|
20
|
+
setOpen(false);
|
|
21
|
+
};
|
|
22
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsxs(PopoverTrigger, { ...props, className: cn('flex flex-row items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-fd-accent/50 hover:text-fd-accent-foreground', props.className), children: [selected ? _jsx(Item, { ...selected }) : null, _jsx(ChevronDown, { className: "me-1.5 size-4 text-fd-muted-foreground" })] }), _jsx(PopoverContent, { className: "w-[var(--radix-popover-trigger-width)] overflow-hidden p-0", children: options.map((item) => (_jsx(Link, { href: item.url, onClick: onClick, ...item.props, className: cn('flex w-full flex-row items-center gap-2 px-2 py-1.5', selected === item
|
|
23
|
+
? 'bg-fd-accent text-fd-accent-foreground'
|
|
24
|
+
: 'hover:bg-fd-accent/50', item.props?.className), children: _jsx(Item, { ...item }) }, item.url))) })] }));
|
|
25
|
+
}
|
|
26
|
+
function Item(props) {
|
|
27
|
+
return (_jsxs(_Fragment, { children: [props.icon, _jsxs("div", { className: "flex-1 text-start", children: [_jsx("p", { className: "text-sm font-medium", children: props.title }), props.description ? (_jsx("p", { className: "text-xs text-fd-muted-foreground", children: props.description })) : null] })] }));
|
|
28
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export declare function SearchToggle(props: ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function LargeSearchToggle(props: ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=search-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/layout/search-toggle.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAOlD,wBAAgB,YAAY,CAAC,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,2CAsB1E;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,2CA6B/C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { SearchIcon } from 'lucide-react';
|
|
4
|
+
import { useSearchContext } from '../../contexts/search';
|
|
5
|
+
import { useI18n } from '../../contexts/i18n';
|
|
6
|
+
import { cn } from '../../utils/cn';
|
|
7
|
+
import { buttonVariants } from '../../components/ui/button';
|
|
8
|
+
export function SearchToggle(props) {
|
|
9
|
+
const { setOpenSearch } = useSearchContext();
|
|
10
|
+
return (_jsx("button", { type: "button", className: cn(buttonVariants({
|
|
11
|
+
size: 'icon',
|
|
12
|
+
color: 'ghost',
|
|
13
|
+
className: props.className,
|
|
14
|
+
})), "data-search": "", "aria-label": "Open Search", onClick: () => {
|
|
15
|
+
setOpenSearch(true);
|
|
16
|
+
}, children: _jsx(SearchIcon, {}) }));
|
|
17
|
+
}
|
|
18
|
+
export function LargeSearchToggle(props) {
|
|
19
|
+
const { hotKey, setOpenSearch } = useSearchContext();
|
|
20
|
+
const { text } = useI18n();
|
|
21
|
+
return (_jsxs("button", { type: "button", "data-search-full": "", ...props, className: cn('inline-flex items-center gap-2 rounded-full border bg-fd-secondary/50 p-1.5 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground', props.className), onClick: () => {
|
|
22
|
+
setOpenSearch(true);
|
|
23
|
+
}, children: [_jsx(SearchIcon, { className: "ms-1 size-4" }), text.search, _jsx("div", { className: "ms-auto inline-flex gap-0.5", children: hotKey.map((k, i) => (_jsx("kbd", { className: "rounded-md border bg-fd-background px-1.5", children: k.display }, i))) })] }));
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/layout/theme-toggle.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAgBlD,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,GAAG,KAAK,CAAC,YAAY,CAuB9D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { Moon, Sun } from 'lucide-react';
|
|
5
|
+
import { useTheme } from 'next-themes';
|
|
6
|
+
import { cn } from '../../utils/cn';
|
|
7
|
+
const buttonVariants = cva('size-7 rounded-full p-1.5 text-fd-muted-foreground', {
|
|
8
|
+
variants: {
|
|
9
|
+
dark: {
|
|
10
|
+
true: 'dark:bg-fd-accent dark:text-fd-accent-foreground',
|
|
11
|
+
false: 'bg-fd-accent text-fd-accent-foreground dark:bg-transparent dark:text-fd-muted-foreground',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export function ThemeToggle({ className, ...props }) {
|
|
16
|
+
const { setTheme, resolvedTheme } = useTheme();
|
|
17
|
+
const onToggle = () => {
|
|
18
|
+
setTheme(resolvedTheme === 'dark' ? 'light' : 'dark');
|
|
19
|
+
};
|
|
20
|
+
return (_jsxs("button", { type: "button", className: cn('inline-flex items-center rounded-full border p-[3px]', className), "data-theme-toggle": "", "aria-label": "Toggle Theme", onClick: onToggle, ...props, children: [_jsx(Sun, { className: cn(buttonVariants({ dark: false })) }), _jsx(Moon, { className: cn(buttonVariants({ dark: true })) })] }));
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toc-clerk.d.ts","sourceRoot":"","sources":["../../../src/components/layout/toc-clerk.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAQxD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,KAAK,EACL,MAAc,GACf,EAAE;IACD,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,KAAK,CAAC,YAAY,CAsGrB"}
|