@fumadocs/base-ui 16.4.6 → 16.4.7
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 +3 -3
- package/dist/components/banner.d.ts +2 -2
- package/dist/components/callout.d.ts +5 -5
- package/dist/components/card.d.ts +3 -3
- package/dist/components/codeblock.d.ts +7 -7
- package/dist/components/codeblock.d.ts.map +1 -1
- package/dist/components/dialog/search-algolia.d.ts +2 -2
- package/dist/components/dialog/search-default.d.ts +2 -2
- package/dist/components/dialog/search-orama.d.ts +2 -2
- package/dist/components/dialog/search.d.ts +13 -13
- package/dist/components/dynamic-codeblock.d.ts +2 -2
- package/dist/components/dynamic-codeblock.d.ts.map +1 -1
- package/dist/components/github-info.d.ts +2 -2
- package/dist/components/github-info.d.ts.map +1 -1
- package/dist/components/image-zoom.d.ts +2 -2
- package/dist/components/image-zoom.d.ts.map +1 -1
- package/dist/components/inline-toc.d.ts +2 -2
- package/dist/components/inline-toc.d.ts.map +1 -1
- package/dist/components/sidebar/base.d.ts +13 -13
- package/dist/components/sidebar/base.js.map +1 -1
- package/dist/components/sidebar/link-item.d.ts +2 -2
- package/dist/components/sidebar/page-tree.d.ts +2 -2
- package/dist/components/sidebar/tabs/dropdown.d.ts +2 -2
- package/dist/components/sidebar/tabs/dropdown.d.ts.map +1 -1
- package/dist/components/sidebar/tabs/index.js.map +1 -1
- package/dist/components/steps.d.ts +3 -3
- package/dist/components/steps.d.ts.map +1 -1
- package/dist/components/tabs.d.ts +7 -7
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/type-table.d.ts +2 -2
- package/dist/components/type-table.d.ts.map +1 -1
- package/dist/components/ui/accordion.d.ts +6 -6
- package/dist/components/ui/collapsible.d.ts +6 -6
- package/dist/components/ui/navigation-menu.d.ts +7 -7
- package/dist/components/ui/popover.d.ts +3 -3
- package/dist/components/ui/scroll-area.d.ts +4 -4
- package/dist/components/ui/tabs.d.ts +7 -7
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/layouts/docs/client.d.ts +7 -7
- package/dist/layouts/docs/client.d.ts.map +1 -1
- package/dist/layouts/docs/index.d.ts +2 -2
- package/dist/layouts/docs/index.d.ts.map +1 -1
- package/dist/layouts/docs/index.js +3 -3
- package/dist/layouts/docs/page/client.d.ts +7 -7
- package/dist/layouts/docs/page/index.d.ts +5 -5
- package/dist/layouts/docs/sidebar.d.ts +17 -17
- package/dist/layouts/docs/sidebar.d.ts.map +1 -1
- package/dist/layouts/home/client.d.ts +3 -3
- package/dist/layouts/home/client.js +2 -2
- package/dist/layouts/home/client.js.map +1 -1
- package/dist/layouts/home/index.d.ts +2 -2
- package/dist/layouts/home/navbar.d.ts +7 -7
- package/dist/layouts/home/navbar.d.ts.map +1 -1
- package/dist/layouts/notebook/client.d.ts +8 -8
- package/dist/layouts/notebook/client.d.ts.map +1 -1
- package/dist/layouts/notebook/index.d.ts +2 -2
- package/dist/layouts/notebook/index.d.ts.map +1 -1
- package/dist/layouts/notebook/index.js +3 -3
- package/dist/layouts/notebook/page/client.d.ts +7 -7
- package/dist/layouts/notebook/page/client.d.ts.map +1 -1
- package/dist/layouts/notebook/page/index.d.ts +5 -5
- package/dist/layouts/notebook/sidebar.d.ts +12 -12
- package/dist/layouts/notebook/sidebar.d.ts.map +1 -1
- package/dist/layouts/shared/index.d.ts +3 -3
- package/dist/layouts/shared/index.d.ts.map +1 -1
- package/dist/layouts/shared/language-toggle.d.ts +2 -2
- package/dist/layouts/shared/language-toggle.d.ts.map +1 -1
- package/dist/layouts/shared/search-toggle.d.ts +3 -3
- package/dist/layouts/shared/search-toggle.d.ts.map +1 -1
- package/dist/layouts/shared/theme-toggle.d.ts +2 -2
- package/dist/mdx.d.ts +10 -10
- package/dist/mdx.js.map +1 -1
- package/dist/page.d.ts +3 -3
- package/dist/page.d.ts.map +1 -1
- package/dist/provider/base.d.ts +2 -2
- package/dist/provider/next.d.ts +2 -2
- package/dist/provider/react-router.d.ts +2 -2
- package/dist/provider/tanstack.d.ts +2 -2
- package/dist/provider/waku.d.ts +2 -2
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Accordion as Accordion$1, AccordionItem } from "./ui/accordion.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/accordion.d.ts
|
|
@@ -8,7 +8,7 @@ declare function Accordions({
|
|
|
8
8
|
className,
|
|
9
9
|
defaultValue,
|
|
10
10
|
...props
|
|
11
|
-
}: ComponentProps<typeof Accordion$1>):
|
|
11
|
+
}: ComponentProps<typeof Accordion$1>): react_jsx_runtime10.JSX.Element;
|
|
12
12
|
declare function Accordion({
|
|
13
13
|
title,
|
|
14
14
|
id,
|
|
@@ -18,7 +18,7 @@ declare function Accordion({
|
|
|
18
18
|
}: Omit<ComponentProps<typeof AccordionItem>, 'value' | 'title'> & {
|
|
19
19
|
title: string | ReactNode;
|
|
20
20
|
value?: string;
|
|
21
|
-
}):
|
|
21
|
+
}): react_jsx_runtime10.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { Accordion, Accordions };
|
|
24
24
|
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/banner.d.ts
|
|
@@ -29,7 +29,7 @@ declare function Banner({
|
|
|
29
29
|
* @defaultValue true
|
|
30
30
|
*/
|
|
31
31
|
changeLayout?: boolean;
|
|
32
|
-
}):
|
|
32
|
+
}): react_jsx_runtime12.JSX.Element | null;
|
|
33
33
|
//#endregion
|
|
34
34
|
export { Banner };
|
|
35
35
|
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/callout.d.ts
|
|
@@ -9,7 +9,7 @@ declare function Callout({
|
|
|
9
9
|
...props
|
|
10
10
|
}: {
|
|
11
11
|
title?: ReactNode;
|
|
12
|
-
} & Omit<CalloutContainerProps, 'title'>):
|
|
12
|
+
} & Omit<CalloutContainerProps, 'title'>): react_jsx_runtime13.JSX.Element;
|
|
13
13
|
interface CalloutContainerProps extends ComponentProps<'div'> {
|
|
14
14
|
/**
|
|
15
15
|
* @defaultValue info
|
|
@@ -27,17 +27,17 @@ declare function CalloutContainer({
|
|
|
27
27
|
className,
|
|
28
28
|
style,
|
|
29
29
|
...props
|
|
30
|
-
}: CalloutContainerProps):
|
|
30
|
+
}: CalloutContainerProps): react_jsx_runtime13.JSX.Element;
|
|
31
31
|
declare function CalloutTitle({
|
|
32
32
|
children,
|
|
33
33
|
className,
|
|
34
34
|
...props
|
|
35
|
-
}: ComponentProps<'p'>):
|
|
35
|
+
}: ComponentProps<'p'>): react_jsx_runtime13.JSX.Element;
|
|
36
36
|
declare function CalloutDescription({
|
|
37
37
|
children,
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: ComponentProps<'p'>):
|
|
40
|
+
}: ComponentProps<'p'>): react_jsx_runtime13.JSX.Element;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { Callout, CalloutContainer, CalloutContainerProps, CalloutDescription, CalloutTitle, CalloutType };
|
|
43
43
|
//# sourceMappingURL=callout.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime17 from "react/jsx-runtime";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/card.d.ts
|
|
5
|
-
declare function Cards(props: HTMLAttributes<HTMLDivElement>):
|
|
5
|
+
declare function Cards(props: HTMLAttributes<HTMLDivElement>): react_jsx_runtime17.JSX.Element;
|
|
6
6
|
type CardProps = Omit<HTMLAttributes<HTMLElement>, 'title'> & {
|
|
7
7
|
icon?: ReactNode;
|
|
8
8
|
title: ReactNode;
|
|
@@ -15,7 +15,7 @@ declare function Card({
|
|
|
15
15
|
title,
|
|
16
16
|
description,
|
|
17
17
|
...props
|
|
18
|
-
}: CardProps):
|
|
18
|
+
}: CardProps): react_jsx_runtime17.JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { Card, CardProps, Cards };
|
|
21
21
|
//# sourceMappingURL=card.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./ui/tabs.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
3
3
|
import { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/codeblock.d.ts
|
|
@@ -36,7 +36,7 @@ interface CodeBlockProps extends ComponentProps<'figure'> {
|
|
|
36
36
|
children?: ReactNode;
|
|
37
37
|
}) => ReactNode;
|
|
38
38
|
}
|
|
39
|
-
declare function Pre(props: ComponentProps<'pre'>):
|
|
39
|
+
declare function Pre(props: ComponentProps<'pre'>): react_jsx_runtime19.JSX.Element;
|
|
40
40
|
declare function CodeBlock({
|
|
41
41
|
ref,
|
|
42
42
|
title,
|
|
@@ -47,22 +47,22 @@ declare function CodeBlock({
|
|
|
47
47
|
children,
|
|
48
48
|
Actions,
|
|
49
49
|
...props
|
|
50
|
-
}: CodeBlockProps):
|
|
50
|
+
}: CodeBlockProps): react_jsx_runtime19.JSX.Element;
|
|
51
51
|
declare function CodeBlockTabs({
|
|
52
52
|
ref,
|
|
53
53
|
className,
|
|
54
54
|
...props
|
|
55
|
-
}: ComponentProps<typeof Tabs>):
|
|
55
|
+
}: ComponentProps<typeof Tabs>): react_jsx_runtime19.JSX.Element;
|
|
56
56
|
declare function CodeBlockTabsList({
|
|
57
57
|
className,
|
|
58
58
|
...props
|
|
59
|
-
}: ComponentProps<typeof TabsList>):
|
|
59
|
+
}: ComponentProps<typeof TabsList>): react_jsx_runtime19.JSX.Element;
|
|
60
60
|
declare function CodeBlockTabsTrigger({
|
|
61
61
|
children,
|
|
62
62
|
className,
|
|
63
63
|
...props
|
|
64
|
-
}: ComponentProps<typeof TabsTrigger>):
|
|
65
|
-
declare function CodeBlockTab(props: ComponentProps<typeof TabsContent>):
|
|
64
|
+
}: ComponentProps<typeof TabsTrigger>): react_jsx_runtime19.JSX.Element;
|
|
65
|
+
declare function CodeBlockTab(props: ComponentProps<typeof TabsContent>): react_jsx_runtime19.JSX.Element;
|
|
66
66
|
//#endregion
|
|
67
67
|
export { CodeBlock, CodeBlockProps, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre };
|
|
68
68
|
//# sourceMappingURL=codeblock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeblock.d.ts","names":[],"sources":["../../src/components/codeblock.tsx"],"sourcesContent":[],"mappings":";;;;;UAkBiB,cAAA,SAAuB;;;AAAxC;;;EAsBkB,IAAA,CAAA,EAhBT,SAgBS;EAYmC;;;;AAQrD;EAQgB,SAAA,CAAA,EAAS,OAAA;EACvB;;;;;EAKA,cAAA,CAAA,EAAA,OAAA;EACA,aAAA,CAAA,EAnCgB,cAmChB,CAnC+B,WAmC/B,CAAA;EACA;;;EAEe,mBAAA,CAAA,EAAA,OAAA;EA4GD;;;EAAkE,yBAAA,CAAA,EAAA,MAAA;EAAtB,OAAA,CAAA,EAAA,CAAA,KAAA,EAAA;IAA2B,SAAA,CAAA,EAAA,MAAA;IAAA,QAAA,CAAA,EAtIlC,SAsIkC;EA+BvE,CAAA,EAAA,GArKqD,SAqKrD;;AAAiE,iBA7JjE,GAAA,CA6JiE,KAAA,EA7JtD,cA6J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iBAAA,oBAAA,CAAoB;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAIjC,cAJiC,CAAA,OAIX,WAJW,CAAA,CAAA,EAIC,mBAAA,CAAA,GAAA,CAAA,OAJD;AAClC,iBAqBc,YAAA,CArBd,KAAA,EAqBkC,cArBlC,CAAA,OAqBwD,WArBxD,CAAA,CAAA,EAqBoE,mBAAA,CAAA,GAAA,CAAA,OArBpE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { search_d_exports } from "../../contexts/search.js";
|
|
2
2
|
import "./search.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime40 from "react/jsx-runtime";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
import { AlgoliaOptions } from "fumadocs-core/search/client";
|
|
6
6
|
|
|
@@ -33,7 +33,7 @@ declare function AlgoliaSearchDialog({
|
|
|
33
33
|
links,
|
|
34
34
|
footer,
|
|
35
35
|
...props
|
|
36
|
-
}: AlgoliaSearchDialogProps):
|
|
36
|
+
}: AlgoliaSearchDialogProps): react_jsx_runtime40.JSX.Element;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { AlgoliaSearchDialogProps, AlgoliaSearchDialog as default };
|
|
39
39
|
//# sourceMappingURL=search-algolia.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { search_d_exports } from "../../contexts/search.js";
|
|
2
2
|
import "./search.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime41 from "react/jsx-runtime";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dialog/search-default.d.ts
|
|
@@ -38,7 +38,7 @@ declare function DefaultSearchDialog({
|
|
|
38
38
|
links,
|
|
39
39
|
footer,
|
|
40
40
|
...props
|
|
41
|
-
}: DefaultSearchDialogProps):
|
|
41
|
+
}: DefaultSearchDialogProps): react_jsx_runtime41.JSX.Element;
|
|
42
42
|
//#endregion
|
|
43
43
|
export { DefaultSearchDialogProps, DefaultSearchDialog as default };
|
|
44
44
|
//# sourceMappingURL=search-default.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { search_d_exports } from "../../contexts/search.js";
|
|
2
2
|
import "./search.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime42 from "react/jsx-runtime";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
import { OramaCloudOptions } from "fumadocs-core/search/client";
|
|
6
6
|
|
|
@@ -40,7 +40,7 @@ declare function OramaSearchDialog({
|
|
|
40
40
|
footer,
|
|
41
41
|
links,
|
|
42
42
|
...props
|
|
43
|
-
}: OramaSearchDialogProps):
|
|
43
|
+
}: OramaSearchDialogProps): react_jsx_runtime42.JSX.Element;
|
|
44
44
|
//#endregion
|
|
45
45
|
export { OramaSearchDialogProps, OramaSearchDialog as default };
|
|
46
46
|
//# sourceMappingURL=search-orama.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { search_d_exports } from "../../contexts/search.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime43 from "react/jsx-runtime";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
4
|
import { Dialog } from "@base-ui/react/dialog";
|
|
5
5
|
import { HighlightedText, ReactSortedResult } from "fumadocs-core/search";
|
|
@@ -28,24 +28,24 @@ declare function SearchDialog({
|
|
|
28
28
|
isLoading,
|
|
29
29
|
onSelect: onSelectProp,
|
|
30
30
|
children
|
|
31
|
-
}: SearchDialogProps):
|
|
32
|
-
declare function SearchDialogHeader(props: ComponentProps<'div'>):
|
|
33
|
-
declare function SearchDialogInput(props: ComponentProps<'input'>):
|
|
31
|
+
}: SearchDialogProps): react_jsx_runtime43.JSX.Element;
|
|
32
|
+
declare function SearchDialogHeader(props: ComponentProps<'div'>): react_jsx_runtime43.JSX.Element;
|
|
33
|
+
declare function SearchDialogInput(props: ComponentProps<'input'>): react_jsx_runtime43.JSX.Element;
|
|
34
34
|
declare function SearchDialogClose({
|
|
35
35
|
children,
|
|
36
36
|
className,
|
|
37
37
|
...props
|
|
38
|
-
}: ComponentProps<'button'>):
|
|
39
|
-
declare function SearchDialogFooter(props: ComponentProps<'div'>):
|
|
38
|
+
}: ComponentProps<'button'>): react_jsx_runtime43.JSX.Element;
|
|
39
|
+
declare function SearchDialogFooter(props: ComponentProps<'div'>): react_jsx_runtime43.JSX.Element;
|
|
40
40
|
declare function SearchDialogOverlay({
|
|
41
41
|
className,
|
|
42
42
|
...props
|
|
43
|
-
}: ComponentProps<typeof Dialog.Backdrop>):
|
|
43
|
+
}: ComponentProps<typeof Dialog.Backdrop>): react_jsx_runtime43.JSX.Element;
|
|
44
44
|
declare function SearchDialogContent({
|
|
45
45
|
children,
|
|
46
46
|
className,
|
|
47
47
|
...props
|
|
48
|
-
}: ComponentProps<typeof Dialog.Popup>):
|
|
48
|
+
}: ComponentProps<typeof Dialog.Popup>): react_jsx_runtime43.JSX.Element;
|
|
49
49
|
declare function SearchDialogList({
|
|
50
50
|
items,
|
|
51
51
|
Empty,
|
|
@@ -64,7 +64,7 @@ declare function SearchDialogList({
|
|
|
64
64
|
item: SearchItemType;
|
|
65
65
|
onClick: () => void;
|
|
66
66
|
}) => ReactNode;
|
|
67
|
-
}):
|
|
67
|
+
}): react_jsx_runtime43.JSX.Element;
|
|
68
68
|
declare function SearchDialogListItem({
|
|
69
69
|
item,
|
|
70
70
|
className,
|
|
@@ -74,8 +74,8 @@ declare function SearchDialogListItem({
|
|
|
74
74
|
}: ComponentProps<'button'> & {
|
|
75
75
|
renderHighlights?: typeof renderHighlights;
|
|
76
76
|
item: SearchItemType;
|
|
77
|
-
}):
|
|
78
|
-
declare function SearchDialogIcon(props: ComponentProps<'svg'>):
|
|
77
|
+
}): react_jsx_runtime43.JSX.Element;
|
|
78
|
+
declare function SearchDialogIcon(props: ComponentProps<'svg'>): react_jsx_runtime43.JSX.Element;
|
|
79
79
|
interface TagsListProps extends ComponentProps<'div'> {
|
|
80
80
|
tag?: string;
|
|
81
81
|
onTagChange: (tag: string | undefined) => void;
|
|
@@ -86,14 +86,14 @@ declare function TagsList({
|
|
|
86
86
|
onTagChange,
|
|
87
87
|
allowClear,
|
|
88
88
|
...props
|
|
89
|
-
}: TagsListProps):
|
|
89
|
+
}: TagsListProps): react_jsx_runtime43.JSX.Element;
|
|
90
90
|
declare function TagsListItem({
|
|
91
91
|
value,
|
|
92
92
|
className,
|
|
93
93
|
...props
|
|
94
94
|
}: ComponentProps<'button'> & {
|
|
95
95
|
value: string;
|
|
96
|
-
}):
|
|
96
|
+
}): react_jsx_runtime43.JSX.Element;
|
|
97
97
|
declare function renderHighlights(highlights: HighlightedText<ReactNode>[]): ReactNode;
|
|
98
98
|
declare function useSearch(): {
|
|
99
99
|
open: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CodeBlockProps } from "./codeblock.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime25 from "react/jsx-runtime";
|
|
3
3
|
import { HighlightOptionsCommon, HighlightOptionsThemes } from "fumadocs-core/highlight";
|
|
4
4
|
|
|
5
5
|
//#region src/components/dynamic-codeblock.d.ts
|
|
@@ -26,7 +26,7 @@ declare function DynamicCodeBlock({
|
|
|
26
26
|
codeblock,
|
|
27
27
|
options,
|
|
28
28
|
wrapInSuspense
|
|
29
|
-
}: DynamicCodeblockProps):
|
|
29
|
+
}: DynamicCodeblockProps): react_jsx_runtime25.JSX.Element;
|
|
30
30
|
//#endregion
|
|
31
31
|
export { DynamicCodeBlock, DynamicCodeblockProps };
|
|
32
32
|
//# sourceMappingURL=dynamic-codeblock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-codeblock.d.ts","names":[],"sources":["../../src/components/dynamic-codeblock.tsx"],"sourcesContent":[],"mappings":";;;;;UAmBiB,qBAAA;;;EAAA;;;;;EAewD,SAAA,CAAA,EAP3D,cAO2D;EAmBzD;;;;;EAKd,cAAA,CAAA,EAAA,OAAA;EACC,OAAA,CAAA,EAzBS,IAyBT,CAzBc,sBAyBd,EAAA,MAAA,CAAA,GAzBgD,sBAyBhD;;AAAqB,iBANR,gBAAA,CAMQ;EAAA,IAAA;EAAA,IAAA;EAAA,SAAA;EAAA,OAAA;EAAA;AAAA,CAAA,EAArB,qBAAqB,CAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"dynamic-codeblock.d.ts","names":[],"sources":["../../src/components/dynamic-codeblock.tsx"],"sourcesContent":[],"mappings":";;;;;UAmBiB,qBAAA;;;EAAA;;;;;EAewD,SAAA,CAAA,EAP3D,cAO2D;EAmBzD;;;;;EAKd,cAAA,CAAA,EAAA,OAAA;EACC,OAAA,CAAA,EAzBS,IAyBT,CAzBc,sBAyBd,EAAA,MAAA,CAAA,GAzBgD,sBAyBhD;;AAAqB,iBANR,gBAAA,CAMQ;EAAA,IAAA;EAAA,IAAA;EAAA,SAAA;EAAA,OAAA;EAAA;AAAA,CAAA,EAArB,qBAAqB,CAAA,EAAA,mBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime26 from "react/jsx-runtime";
|
|
2
2
|
import { AnchorHTMLAttributes } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/github-info.d.ts
|
|
@@ -13,7 +13,7 @@ declare function GithubInfo({
|
|
|
13
13
|
repo: string;
|
|
14
14
|
token?: string;
|
|
15
15
|
baseUrl?: string;
|
|
16
|
-
}): Promise<
|
|
16
|
+
}): Promise<react_jsx_runtime26.JSX.Element>;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { GithubInfo };
|
|
19
19
|
//# sourceMappingURL=github-info.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-info.d.ts","names":[],"sources":["../../src/components/github-info.tsx"],"sourcesContent":[],"mappings":";;;;iBAwCsB,UAAA;;;;;;GAMnB,qBAAqB;;;EANF,KAAA,CAAA,EAAA,MAAU;EAC9B,OAAA,CAAA,EAAA,MAAA;CACA,CAAA,EASD,OATC,CASD,
|
|
1
|
+
{"version":3,"file":"github-info.d.ts","names":[],"sources":["../../src/components/github-info.tsx"],"sourcesContent":[],"mappings":";;;;iBAwCsB,UAAA;;;;;;GAMnB,qBAAqB;;;EANF,KAAA,CAAA,EAAA,MAAU;EAC9B,OAAA,CAAA,EAAA,MAAA;CACA,CAAA,EASD,OATC,CASD,mBAAA,CAAA,GAAA,CAAA,OAAA,CATC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageProps } from "fumadocs-core/framework";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime27 from "react/jsx-runtime";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
import { UncontrolledProps } from "react-medium-image-zoom";
|
|
5
5
|
|
|
@@ -19,7 +19,7 @@ declare function ImageZoom({
|
|
|
19
19
|
children,
|
|
20
20
|
rmiz,
|
|
21
21
|
...props
|
|
22
|
-
}: ImageZoomProps):
|
|
22
|
+
}: ImageZoomProps): react_jsx_runtime27.JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { ImageZoom, ImageZoomProps };
|
|
25
25
|
//# sourceMappingURL=image-zoom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-zoom.d.ts","names":[],"sources":["../../src/components/image-zoom.tsx"],"sourcesContent":[],"mappings":";;;;;;KAOY,cAAA,GAAiB;;AAA7B;;EAIgB,WAAA,CAAA,EAAA,cAAA,CAAA,KAAA,CAAA;EAKP;;AAeT;EAA4B,IAAA,CAAA,EAfnB,iBAemB;CAAa;AAAU,iBAAnC,SAAA,CAAmC;EAAA,WAAA;EAAA,QAAA;EAAA,IAAA;EAAA,GAAA;AAAA,CAAA,EAAkB,cAAlB,CAAA,EAAgC,
|
|
1
|
+
{"version":3,"file":"image-zoom.d.ts","names":[],"sources":["../../src/components/image-zoom.tsx"],"sourcesContent":[],"mappings":";;;;;;KAOY,cAAA,GAAiB;;AAA7B;;EAIgB,WAAA,CAAA,EAAA,cAAA,CAAA,KAAA,CAAA;EAKP;;AAeT;EAA4B,IAAA,CAAA,EAfnB,iBAemB;CAAa;AAAU,iBAAnC,SAAA,CAAmC;EAAA,WAAA;EAAA,QAAA;EAAA,IAAA;EAAA,GAAA;AAAA,CAAA,EAAkB,cAAlB,CAAA,EAAgC,mBAAA,CAAA,GAAA,CAAA,OAAhC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collapsible } from "./ui/collapsible.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime28 from "react/jsx-runtime";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
import { TOCItemType } from "fumadocs-core/toc";
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ declare function InlineTOC({
|
|
|
11
11
|
items,
|
|
12
12
|
className,
|
|
13
13
|
...props
|
|
14
|
-
}: InlineTocProps):
|
|
14
|
+
}: InlineTocProps): react_jsx_runtime28.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { InlineTOC, InlineTocProps };
|
|
17
17
|
//# sourceMappingURL=inline-toc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-toc.d.ts","names":[],"sources":["../../src/components/inline-toc.tsx"],"sourcesContent":[],"mappings":";;;;;;UAQiB,cAAA,SAAuB,sBAAsB;SACrD;;AADQ,iBAID,SAAA,CAJgB;EAAA,KAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAI0B,cAJ1B,CAAA,EAIwC,
|
|
1
|
+
{"version":3,"file":"inline-toc.d.ts","names":[],"sources":["../../src/components/inline-toc.tsx"],"sourcesContent":[],"mappings":";;;;;;UAQiB,cAAA,SAAuB,sBAAsB;SACrD;;AADQ,iBAID,SAAA,CAJgB;EAAA,KAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAI0B,cAJ1B,CAAA,EAIwC,mBAAA,CAAA,GAAA,CAAA,OAJxC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CollapsibleContentProps, CollapsibleTriggerProps } from "../ui/collapsible.js";
|
|
2
2
|
import { ScrollAreaProps } from "../ui/scroll-area.js";
|
|
3
3
|
import { LinkProps } from "fumadocs-core/link";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime55 from "react/jsx-runtime";
|
|
5
5
|
import * as react0 from "react";
|
|
6
6
|
import { ComponentProps, PointerEvent, ReactNode, RefObject } from "react";
|
|
7
7
|
|
|
@@ -42,7 +42,7 @@ declare function SidebarProvider({
|
|
|
42
42
|
defaultOpenLevel,
|
|
43
43
|
prefetch,
|
|
44
44
|
children
|
|
45
|
-
}: SidebarProviderProps):
|
|
45
|
+
}: SidebarProviderProps): react_jsx_runtime55.JSX.Element;
|
|
46
46
|
declare function useSidebar(): SidebarContext;
|
|
47
47
|
declare function useFolder(): {
|
|
48
48
|
open: boolean;
|
|
@@ -62,24 +62,24 @@ declare function SidebarContent({
|
|
|
62
62
|
onPointerLeave: (event: PointerEvent) => void;
|
|
63
63
|
}) => ReactNode;
|
|
64
64
|
}): ReactNode;
|
|
65
|
-
declare function SidebarDrawerOverlay(props: ComponentProps<'div'>):
|
|
65
|
+
declare function SidebarDrawerOverlay(props: ComponentProps<'div'>): react_jsx_runtime55.JSX.Element | undefined;
|
|
66
66
|
declare function SidebarDrawerContent({
|
|
67
67
|
className,
|
|
68
68
|
children,
|
|
69
69
|
...props
|
|
70
|
-
}: ComponentProps<'aside'>):
|
|
70
|
+
}: ComponentProps<'aside'>): react_jsx_runtime55.JSX.Element | undefined;
|
|
71
71
|
declare function SidebarViewport({
|
|
72
72
|
className,
|
|
73
73
|
...props
|
|
74
|
-
}: ScrollAreaProps):
|
|
75
|
-
declare function SidebarSeparator(props: ComponentProps<'p'>):
|
|
74
|
+
}: ScrollAreaProps): react_jsx_runtime55.JSX.Element;
|
|
75
|
+
declare function SidebarSeparator(props: ComponentProps<'p'>): react_jsx_runtime55.JSX.Element;
|
|
76
76
|
declare function SidebarItem({
|
|
77
77
|
icon,
|
|
78
78
|
children,
|
|
79
79
|
...props
|
|
80
80
|
}: LinkProps & {
|
|
81
81
|
icon?: ReactNode;
|
|
82
|
-
}):
|
|
82
|
+
}): react_jsx_runtime55.JSX.Element;
|
|
83
83
|
declare function SidebarFolder({
|
|
84
84
|
defaultOpen: defaultOpenProp,
|
|
85
85
|
collapsible,
|
|
@@ -90,21 +90,21 @@ declare function SidebarFolder({
|
|
|
90
90
|
active?: boolean;
|
|
91
91
|
defaultOpen?: boolean;
|
|
92
92
|
collapsible?: boolean;
|
|
93
|
-
}):
|
|
93
|
+
}): react_jsx_runtime55.JSX.Element;
|
|
94
94
|
declare function SidebarFolderTrigger({
|
|
95
95
|
children,
|
|
96
96
|
...props
|
|
97
|
-
}: CollapsibleTriggerProps):
|
|
97
|
+
}: CollapsibleTriggerProps): react_jsx_runtime55.JSX.Element;
|
|
98
98
|
declare function SidebarFolderLink({
|
|
99
99
|
children,
|
|
100
100
|
...props
|
|
101
|
-
}: LinkProps):
|
|
102
|
-
declare function SidebarFolderContent(props: CollapsibleContentProps):
|
|
101
|
+
}: LinkProps): react_jsx_runtime55.JSX.Element;
|
|
102
|
+
declare function SidebarFolderContent(props: CollapsibleContentProps): react_jsx_runtime55.JSX.Element;
|
|
103
103
|
declare function SidebarTrigger({
|
|
104
104
|
children,
|
|
105
105
|
...props
|
|
106
|
-
}: ComponentProps<'button'>):
|
|
107
|
-
declare function SidebarCollapseTrigger(props: ComponentProps<'button'>):
|
|
106
|
+
}: ComponentProps<'button'>): react_jsx_runtime55.JSX.Element;
|
|
107
|
+
declare function SidebarCollapseTrigger(props: ComponentProps<'button'>): react_jsx_runtime55.JSX.Element;
|
|
108
108
|
/**
|
|
109
109
|
* scroll to the element if `active` is true
|
|
110
110
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","names":["mode: Mode"],"sources":["../../../src/components/sidebar/base.tsx"],"sourcesContent":["'use client';\nimport { ChevronDown, ExternalLink } from 'lucide-react';\nimport {\n type ComponentProps,\n createContext,\n type PointerEvent,\n type ReactNode,\n type RefObject,\n use,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport Link, { type LinkProps } from 'fumadocs-core/link';\nimport { useOnChange } from 'fumadocs-core/utils/use-on-change';\nimport { cn } from '@fumadocs/ui/cn';\nimport { ScrollArea, type ScrollAreaProps, ScrollViewport } from '@/components/ui/scroll-area';\nimport { isActive } from '@fumadocs/ui/urls';\nimport {\n Collapsible,\n CollapsibleContent,\n type CollapsibleContentProps,\n CollapsibleTrigger,\n type CollapsibleTriggerProps,\n} from '@/components/ui/collapsible';\nimport { useMediaQuery } from 'fumadocs-core/utils/use-media-query';\nimport scrollIntoView from 'scroll-into-view-if-needed';\nimport { usePathname } from 'fumadocs-core/framework';\nimport ReactDOM from 'react-dom';\n\ninterface SidebarContext {\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n collapsed: boolean;\n setCollapsed: React.Dispatch<React.SetStateAction<boolean>>;\n\n /**\n * When set to false, don't close the sidebar when navigate to another page\n */\n closeOnRedirect: RefObject<boolean>;\n defaultOpenLevel: number;\n prefetch?: boolean;\n mode: Mode;\n}\n\nexport interface SidebarProviderProps {\n /**\n * Open folders by default if their level is lower or equal to a specific level\n * (Starting from 1)\n *\n * @defaultValue 0\n */\n defaultOpenLevel?: number;\n\n /**\n * Prefetch links, default behaviour depends on your React.js framework.\n */\n prefetch?: boolean;\n\n children?: ReactNode;\n}\n\ntype Mode = 'drawer' | 'full';\n\nconst SidebarContext = createContext<SidebarContext | null>(null);\n\nconst FolderContext = createContext<{\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n depth: number;\n collapsible: boolean;\n} | null>(null);\n\nexport function SidebarProvider({\n defaultOpenLevel = 0,\n prefetch,\n children,\n}: SidebarProviderProps) {\n const closeOnRedirect = useRef(true);\n const [open, setOpen] = useState(false);\n const [collapsed, setCollapsed] = useState(false);\n const pathname = usePathname();\n const mode: Mode = useMediaQuery('(width < 768px)') ? 'drawer' : 'full';\n\n useOnChange(pathname, () => {\n if (closeOnRedirect.current) {\n setOpen(false);\n }\n closeOnRedirect.current = true;\n });\n\n return (\n <SidebarContext\n value={useMemo(\n () => ({\n open,\n setOpen,\n collapsed,\n setCollapsed,\n closeOnRedirect,\n defaultOpenLevel,\n prefetch,\n mode,\n }),\n [open, collapsed, defaultOpenLevel, prefetch, mode],\n )}\n >\n {children}\n </SidebarContext>\n );\n}\n\nexport function useSidebar(): SidebarContext {\n const ctx = use(SidebarContext);\n if (!ctx)\n throw new Error(\n 'Missing SidebarContext, make sure you have wrapped the component in <DocsLayout /> and the context is available.',\n );\n\n return ctx;\n}\n\nexport function useFolder() {\n return use(FolderContext);\n}\n\nexport function useFolderDepth() {\n return use(FolderContext)?.depth ?? 0;\n}\n\nexport function SidebarContent({\n children,\n}: {\n children: (state: {\n ref: RefObject<HTMLElement | null>;\n collapsed: boolean;\n hovered: boolean;\n onPointerEnter: (event: PointerEvent) => void;\n onPointerLeave: (event: PointerEvent) => void;\n }) => ReactNode;\n}) {\n const { collapsed, mode } = useSidebar();\n const [hover, setHover] = useState(false);\n const ref = useRef<HTMLElement>(null);\n const timerRef = useRef(0);\n\n useOnChange(collapsed, () => {\n if (collapsed) setHover(false);\n });\n\n if (mode !== 'full') return;\n\n function shouldIgnoreHover(e: PointerEvent): boolean {\n const element = ref.current;\n if (!element) return true;\n\n return !collapsed || e.pointerType === 'touch' || element.getAnimations().length > 0;\n }\n\n return children({\n ref,\n collapsed,\n hovered: hover,\n onPointerEnter(e) {\n if (shouldIgnoreHover(e)) return;\n window.clearTimeout(timerRef.current);\n setHover(true);\n },\n onPointerLeave(e) {\n if (shouldIgnoreHover(e)) return;\n window.clearTimeout(timerRef.current);\n\n timerRef.current = window.setTimeout(\n () => setHover(false),\n // if mouse is leaving the viewport, add a close delay\n Math.min(e.clientX, document.body.clientWidth - e.clientX) > 100 ? 0 : 500,\n );\n },\n });\n}\n\nexport function SidebarDrawerOverlay(props: ComponentProps<'div'>) {\n const { open, setOpen, mode } = useSidebar();\n const [hidden, setHidden] = useState(!open);\n\n if (open && hidden) setHidden(false);\n if (mode !== 'drawer' || hidden) return;\n return (\n <div\n data-state={open ? 'open' : 'closed'}\n onClick={() => setOpen(false)}\n onAnimationEnd={() => {\n if (!open) ReactDOM.flushSync(() => setHidden(true));\n }}\n {...props}\n />\n );\n}\n\nexport function SidebarDrawerContent({ className, children, ...props }: ComponentProps<'aside'>) {\n const { open, mode } = useSidebar();\n const [hidden, setHidden] = useState(!open);\n\n if (open && hidden) setHidden(false);\n if (mode !== 'drawer') return;\n return (\n <aside\n id=\"nd-sidebar-mobile\"\n data-state={open ? 'open' : 'closed'}\n className={cn(hidden && 'invisible', className)}\n onAnimationEnd={() => {\n if (!open) ReactDOM.flushSync(() => setHidden(true));\n }}\n {...props}\n >\n {children}\n </aside>\n );\n}\n\nexport function SidebarViewport({ className, ...props }: ScrollAreaProps) {\n return (\n <ScrollArea\n className={(s) =>\n cn('min-h-0 flex-1', typeof className === 'function' ? className(s) : className)\n }\n {...props}\n >\n <ScrollViewport\n className=\"p-4 overscroll-contain\"\n style={\n {\n maskImage:\n 'linear-gradient(to bottom, transparent, white 12px, white calc(100% - 12px), transparent)',\n } as object\n }\n >\n {props.children}\n </ScrollViewport>\n </ScrollArea>\n );\n}\n\nexport function SidebarSeparator(props: ComponentProps<'p'>) {\n const depth = useFolderDepth();\n return (\n <p\n {...props}\n className={cn(\n 'inline-flex items-center gap-2 mb-1.5 px-2 mt-6 empty:mb-0',\n depth === 0 && 'first:mt-0',\n props.className,\n )}\n >\n {props.children}\n </p>\n );\n}\n\nexport function SidebarItem({\n icon,\n children,\n ...props\n}: LinkProps & {\n icon?: ReactNode;\n}) {\n const pathname = usePathname();\n const ref = useRef<HTMLAnchorElement>(null);\n const { prefetch } = useSidebar();\n const active = props.href !== undefined && isActive(props.href, pathname, false);\n\n useAutoScroll(active, ref);\n\n return (\n <Link ref={ref} data-active={active} prefetch={prefetch} {...props}>\n {icon ?? (props.external ? <ExternalLink /> : null)}\n {children}\n </Link>\n );\n}\n\nexport function SidebarFolder({\n defaultOpen: defaultOpenProp,\n collapsible = true,\n active = false,\n children,\n ...props\n}: ComponentProps<'div'> & {\n active?: boolean;\n defaultOpen?: boolean;\n collapsible?: boolean;\n}) {\n const { defaultOpenLevel } = useSidebar();\n const depth = useFolderDepth() + 1;\n const defaultOpen =\n collapsible === false || active || (defaultOpenProp ?? defaultOpenLevel >= depth);\n const [open, setOpen] = useState(defaultOpen);\n\n useOnChange(defaultOpen, (v) => {\n if (v) setOpen(v);\n });\n\n return (\n <Collapsible open={open} onOpenChange={setOpen} disabled={!collapsible} {...props}>\n <FolderContext\n value={useMemo(() => ({ open, setOpen, depth, collapsible }), [collapsible, depth, open])}\n >\n {children}\n </FolderContext>\n </Collapsible>\n );\n}\n\nexport function SidebarFolderTrigger({ children, ...props }: CollapsibleTriggerProps) {\n const { open, collapsible } = use(FolderContext)!;\n\n if (collapsible) {\n return (\n <CollapsibleTrigger {...props}>\n {children}\n <ChevronDown\n data-icon\n className={cn('ms-auto transition-transform', !open && '-rotate-90')}\n />\n </CollapsibleTrigger>\n );\n }\n\n return <div {...(props as ComponentProps<'div'>)}>{children}</div>;\n}\n\nexport function SidebarFolderLink({ children, ...props }: LinkProps) {\n const ref = useRef<HTMLAnchorElement>(null);\n const { open, setOpen, collapsible } = use(FolderContext)!;\n const { prefetch } = useSidebar();\n const pathname = usePathname();\n const active = props.href !== undefined && isActive(props.href, pathname, false);\n\n useAutoScroll(active, ref);\n\n return (\n <Link\n ref={ref}\n data-active={active}\n onClick={(e) => {\n if (!collapsible) return;\n\n if (e.target instanceof Element && e.target.matches('[data-icon], [data-icon] *')) {\n setOpen(!open);\n e.preventDefault();\n } else {\n setOpen(active ? !open : true);\n }\n }}\n prefetch={prefetch}\n {...props}\n >\n {children}\n {collapsible && (\n <ChevronDown\n data-icon\n className={cn('ms-auto transition-transform', !open && '-rotate-90')}\n />\n )}\n </Link>\n );\n}\n\nexport function SidebarFolderContent(props: CollapsibleContentProps) {\n return <CollapsibleContent {...props}>{props.children}</CollapsibleContent>;\n}\n\nexport function SidebarTrigger({ children, ...props }: ComponentProps<'button'>) {\n const { setOpen } = useSidebar();\n\n return (\n <button aria-label=\"Open Sidebar\" onClick={() => setOpen((prev) => !prev)} {...props}>\n {children}\n </button>\n );\n}\n\nexport function SidebarCollapseTrigger(props: ComponentProps<'button'>) {\n const { collapsed, setCollapsed } = useSidebar();\n\n return (\n <button\n type=\"button\"\n aria-label=\"Collapse Sidebar\"\n data-collapsed={collapsed}\n onClick={() => {\n setCollapsed((prev) => !prev);\n }}\n {...props}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * scroll to the element if `active` is true\n */\nexport function useAutoScroll(active: boolean, ref: RefObject<HTMLElement | null>) {\n const { mode } = useSidebar();\n\n useEffect(() => {\n if (active && ref.current) {\n scrollIntoView(ref.current, {\n boundary: document.getElementById(mode === 'drawer' ? 'nd-sidebar-mobile' : 'nd-sidebar'),\n scrollMode: 'if-needed',\n });\n }\n }, [active, mode, ref]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAM,iBAAiB,cAAqC,KAAK;AAEjE,MAAM,gBAAgB,cAKZ,KAAK;AAEf,SAAgB,gBAAgB,EAC9B,mBAAmB,GACnB,UACA,YACuB;CACvB,MAAM,kBAAkB,OAAO,KAAK;CACpC,MAAM,CAAC,MAAM,WAAW,SAAS,MAAM;CACvC,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CACjD,MAAM,WAAW,aAAa;CAC9B,MAAMA,OAAa,cAAc,kBAAkB,GAAG,WAAW;AAEjE,aAAY,gBAAgB;AAC1B,MAAI,gBAAgB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,qBAAC;EACM;EACL,eAAa;EACb,UAAU,MAAM;AACd,OAAI,CAAC,YAAa;AAElB,OAAI,EAAE,kBAAkB,WAAW,EAAE,OAAO,QAAQ,6BAA6B,EAAE;AACjF,YAAQ,CAAC,KAAK;AACd,MAAE,gBAAgB;SAElB,SAAQ,SAAS,CAAC,OAAO,KAAK;;EAGxB;EACV,GAAI;aAEH,UACA,eACC,oBAAC;GACC;GACA,WAAW,GAAG,gCAAgC,CAAC,QAAQ,aAAa;IACpE;GAEC;;AAIX,SAAgB,qBAAqB,OAAgC;AACnE,QAAO,oBAAC;EAAmB,GAAI;YAAQ,MAAM;GAA8B;;AAG7E,SAAgB,eAAe,EAAE,UAAU,GAAG,SAAmC;CAC/E,MAAM,EAAE,YAAY,YAAY;AAEhC,QACE,oBAAC;EAAO,cAAW;EAAe,eAAe,SAAS,SAAS,CAAC,KAAK;EAAE,GAAI;EAC5E;GACM;;AAIb,SAAgB,uBAAuB,OAAiC;CACtE,MAAM,EAAE,WAAW,iBAAiB,YAAY;AAEhD,QACE,oBAAC;EACC,MAAK;EACL,cAAW;EACX,kBAAgB;EAChB,eAAe;AACb,iBAAc,SAAS,CAAC,KAAK;;EAE/B,GAAI;YAEH,MAAM;GACA;;;;;AAOb,SAAgB,cAAc,QAAiB,KAAoC;CACjF,MAAM,EAAE,SAAS,YAAY;AAE7B,iBAAgB;AACd,MAAI,UAAU,IAAI,QAChB,gBAAe,IAAI,SAAS;GAC1B,UAAU,SAAS,eAAe,SAAS,WAAW,sBAAsB,aAAa;GACzF,YAAY;GACb,CAAC;IAEH;EAAC;EAAQ;EAAM;EAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"base.js","names":[],"sources":["../../../src/components/sidebar/base.tsx"],"sourcesContent":["'use client';\nimport { ChevronDown, ExternalLink } from 'lucide-react';\nimport {\n type ComponentProps,\n createContext,\n type PointerEvent,\n type ReactNode,\n type RefObject,\n use,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport Link, { type LinkProps } from 'fumadocs-core/link';\nimport { useOnChange } from 'fumadocs-core/utils/use-on-change';\nimport { cn } from '@fumadocs/ui/cn';\nimport { ScrollArea, type ScrollAreaProps, ScrollViewport } from '@/components/ui/scroll-area';\nimport { isActive } from '@fumadocs/ui/urls';\nimport {\n Collapsible,\n CollapsibleContent,\n type CollapsibleContentProps,\n CollapsibleTrigger,\n type CollapsibleTriggerProps,\n} from '@/components/ui/collapsible';\nimport { useMediaQuery } from 'fumadocs-core/utils/use-media-query';\nimport scrollIntoView from 'scroll-into-view-if-needed';\nimport { usePathname } from 'fumadocs-core/framework';\nimport ReactDOM from 'react-dom';\n\ninterface SidebarContext {\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n collapsed: boolean;\n setCollapsed: React.Dispatch<React.SetStateAction<boolean>>;\n\n /**\n * When set to false, don't close the sidebar when navigate to another page\n */\n closeOnRedirect: RefObject<boolean>;\n defaultOpenLevel: number;\n prefetch?: boolean;\n mode: Mode;\n}\n\nexport interface SidebarProviderProps {\n /**\n * Open folders by default if their level is lower or equal to a specific level\n * (Starting from 1)\n *\n * @defaultValue 0\n */\n defaultOpenLevel?: number;\n\n /**\n * Prefetch links, default behaviour depends on your React.js framework.\n */\n prefetch?: boolean;\n\n children?: ReactNode;\n}\n\ntype Mode = 'drawer' | 'full';\n\nconst SidebarContext = createContext<SidebarContext | null>(null);\n\nconst FolderContext = createContext<{\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n depth: number;\n collapsible: boolean;\n} | null>(null);\n\nexport function SidebarProvider({\n defaultOpenLevel = 0,\n prefetch,\n children,\n}: SidebarProviderProps) {\n const closeOnRedirect = useRef(true);\n const [open, setOpen] = useState(false);\n const [collapsed, setCollapsed] = useState(false);\n const pathname = usePathname();\n const mode: Mode = useMediaQuery('(width < 768px)') ? 'drawer' : 'full';\n\n useOnChange(pathname, () => {\n if (closeOnRedirect.current) {\n setOpen(false);\n }\n closeOnRedirect.current = true;\n });\n\n return (\n <SidebarContext\n value={useMemo(\n () => ({\n open,\n setOpen,\n collapsed,\n setCollapsed,\n closeOnRedirect,\n defaultOpenLevel,\n prefetch,\n mode,\n }),\n [open, collapsed, defaultOpenLevel, prefetch, mode],\n )}\n >\n {children}\n </SidebarContext>\n );\n}\n\nexport function useSidebar(): SidebarContext {\n const ctx = use(SidebarContext);\n if (!ctx)\n throw new Error(\n 'Missing SidebarContext, make sure you have wrapped the component in <DocsLayout /> and the context is available.',\n );\n\n return ctx;\n}\n\nexport function useFolder() {\n return use(FolderContext);\n}\n\nexport function useFolderDepth() {\n return use(FolderContext)?.depth ?? 0;\n}\n\nexport function SidebarContent({\n children,\n}: {\n children: (state: {\n ref: RefObject<HTMLElement | null>;\n collapsed: boolean;\n hovered: boolean;\n onPointerEnter: (event: PointerEvent) => void;\n onPointerLeave: (event: PointerEvent) => void;\n }) => ReactNode;\n}) {\n const { collapsed, mode } = useSidebar();\n const [hover, setHover] = useState(false);\n const ref = useRef<HTMLElement>(null);\n const timerRef = useRef(0);\n\n useOnChange(collapsed, () => {\n if (collapsed) setHover(false);\n });\n\n if (mode !== 'full') return;\n\n function shouldIgnoreHover(e: PointerEvent): boolean {\n const element = ref.current;\n if (!element) return true;\n\n return !collapsed || e.pointerType === 'touch' || element.getAnimations().length > 0;\n }\n\n return children({\n ref,\n collapsed,\n hovered: hover,\n onPointerEnter(e) {\n if (shouldIgnoreHover(e)) return;\n window.clearTimeout(timerRef.current);\n setHover(true);\n },\n onPointerLeave(e) {\n if (shouldIgnoreHover(e)) return;\n window.clearTimeout(timerRef.current);\n\n timerRef.current = window.setTimeout(\n () => setHover(false),\n // if mouse is leaving the viewport, add a close delay\n Math.min(e.clientX, document.body.clientWidth - e.clientX) > 100 ? 0 : 500,\n );\n },\n });\n}\n\nexport function SidebarDrawerOverlay(props: ComponentProps<'div'>) {\n const { open, setOpen, mode } = useSidebar();\n const [hidden, setHidden] = useState(!open);\n\n if (open && hidden) setHidden(false);\n if (mode !== 'drawer' || hidden) return;\n return (\n <div\n data-state={open ? 'open' : 'closed'}\n onClick={() => setOpen(false)}\n onAnimationEnd={() => {\n if (!open) ReactDOM.flushSync(() => setHidden(true));\n }}\n {...props}\n />\n );\n}\n\nexport function SidebarDrawerContent({ className, children, ...props }: ComponentProps<'aside'>) {\n const { open, mode } = useSidebar();\n const [hidden, setHidden] = useState(!open);\n\n if (open && hidden) setHidden(false);\n if (mode !== 'drawer') return;\n return (\n <aside\n id=\"nd-sidebar-mobile\"\n data-state={open ? 'open' : 'closed'}\n className={cn(hidden && 'invisible', className)}\n onAnimationEnd={() => {\n if (!open) ReactDOM.flushSync(() => setHidden(true));\n }}\n {...props}\n >\n {children}\n </aside>\n );\n}\n\nexport function SidebarViewport({ className, ...props }: ScrollAreaProps) {\n return (\n <ScrollArea\n className={(s) =>\n cn('min-h-0 flex-1', typeof className === 'function' ? className(s) : className)\n }\n {...props}\n >\n <ScrollViewport\n className=\"p-4 overscroll-contain\"\n style={\n {\n maskImage:\n 'linear-gradient(to bottom, transparent, white 12px, white calc(100% - 12px), transparent)',\n } as object\n }\n >\n {props.children}\n </ScrollViewport>\n </ScrollArea>\n );\n}\n\nexport function SidebarSeparator(props: ComponentProps<'p'>) {\n const depth = useFolderDepth();\n return (\n <p\n {...props}\n className={cn(\n 'inline-flex items-center gap-2 mb-1.5 px-2 mt-6 empty:mb-0',\n depth === 0 && 'first:mt-0',\n props.className,\n )}\n >\n {props.children}\n </p>\n );\n}\n\nexport function SidebarItem({\n icon,\n children,\n ...props\n}: LinkProps & {\n icon?: ReactNode;\n}) {\n const pathname = usePathname();\n const ref = useRef<HTMLAnchorElement>(null);\n const { prefetch } = useSidebar();\n const active = props.href !== undefined && isActive(props.href, pathname, false);\n\n useAutoScroll(active, ref);\n\n return (\n <Link ref={ref} data-active={active} prefetch={prefetch} {...props}>\n {icon ?? (props.external ? <ExternalLink /> : null)}\n {children}\n </Link>\n );\n}\n\nexport function SidebarFolder({\n defaultOpen: defaultOpenProp,\n collapsible = true,\n active = false,\n children,\n ...props\n}: ComponentProps<'div'> & {\n active?: boolean;\n defaultOpen?: boolean;\n collapsible?: boolean;\n}) {\n const { defaultOpenLevel } = useSidebar();\n const depth = useFolderDepth() + 1;\n const defaultOpen =\n collapsible === false || active || (defaultOpenProp ?? defaultOpenLevel >= depth);\n const [open, setOpen] = useState(defaultOpen);\n\n useOnChange(defaultOpen, (v) => {\n if (v) setOpen(v);\n });\n\n return (\n <Collapsible open={open} onOpenChange={setOpen} disabled={!collapsible} {...props}>\n <FolderContext\n value={useMemo(() => ({ open, setOpen, depth, collapsible }), [collapsible, depth, open])}\n >\n {children}\n </FolderContext>\n </Collapsible>\n );\n}\n\nexport function SidebarFolderTrigger({ children, ...props }: CollapsibleTriggerProps) {\n const { open, collapsible } = use(FolderContext)!;\n\n if (collapsible) {\n return (\n <CollapsibleTrigger {...props}>\n {children}\n <ChevronDown\n data-icon\n className={cn('ms-auto transition-transform', !open && '-rotate-90')}\n />\n </CollapsibleTrigger>\n );\n }\n\n return <div {...(props as ComponentProps<'div'>)}>{children}</div>;\n}\n\nexport function SidebarFolderLink({ children, ...props }: LinkProps) {\n const ref = useRef<HTMLAnchorElement>(null);\n const { open, setOpen, collapsible } = use(FolderContext)!;\n const { prefetch } = useSidebar();\n const pathname = usePathname();\n const active = props.href !== undefined && isActive(props.href, pathname, false);\n\n useAutoScroll(active, ref);\n\n return (\n <Link\n ref={ref}\n data-active={active}\n onClick={(e) => {\n if (!collapsible) return;\n\n if (e.target instanceof Element && e.target.matches('[data-icon], [data-icon] *')) {\n setOpen(!open);\n e.preventDefault();\n } else {\n setOpen(active ? !open : true);\n }\n }}\n prefetch={prefetch}\n {...props}\n >\n {children}\n {collapsible && (\n <ChevronDown\n data-icon\n className={cn('ms-auto transition-transform', !open && '-rotate-90')}\n />\n )}\n </Link>\n );\n}\n\nexport function SidebarFolderContent(props: CollapsibleContentProps) {\n return <CollapsibleContent {...props}>{props.children}</CollapsibleContent>;\n}\n\nexport function SidebarTrigger({ children, ...props }: ComponentProps<'button'>) {\n const { setOpen } = useSidebar();\n\n return (\n <button aria-label=\"Open Sidebar\" onClick={() => setOpen((prev) => !prev)} {...props}>\n {children}\n </button>\n );\n}\n\nexport function SidebarCollapseTrigger(props: ComponentProps<'button'>) {\n const { collapsed, setCollapsed } = useSidebar();\n\n return (\n <button\n type=\"button\"\n aria-label=\"Collapse Sidebar\"\n data-collapsed={collapsed}\n onClick={() => {\n setCollapsed((prev) => !prev);\n }}\n {...props}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * scroll to the element if `active` is true\n */\nexport function useAutoScroll(active: boolean, ref: RefObject<HTMLElement | null>) {\n const { mode } = useSidebar();\n\n useEffect(() => {\n if (active && ref.current) {\n scrollIntoView(ref.current, {\n boundary: document.getElementById(mode === 'drawer' ? 'nd-sidebar-mobile' : 'nd-sidebar'),\n scrollMode: 'if-needed',\n });\n }\n }, [active, mode, ref]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAM,iBAAiB,cAAqC,KAAK;AAEjE,MAAM,gBAAgB,cAKZ,KAAK;AAEf,SAAgB,gBAAgB,EAC9B,mBAAmB,GACnB,UACA,YACuB;CACvB,MAAM,kBAAkB,OAAO,KAAK;CACpC,MAAM,CAAC,MAAM,WAAW,SAAS,MAAM;CACvC,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CACjD,MAAM,WAAW,aAAa;CAC9B,MAAM,OAAa,cAAc,kBAAkB,GAAG,WAAW;AAEjE,aAAY,gBAAgB;AAC1B,MAAI,gBAAgB,QAClB,SAAQ,MAAM;AAEhB,kBAAgB,UAAU;GAC1B;AAEF,QACE,oBAAC;EACC,OAAO,eACE;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,GACD;GAAC;GAAM;GAAW;GAAkB;GAAU;GAAK,CACpD;EAEA;GACc;;AAIrB,SAAgB,aAA6B;CAC3C,MAAM,MAAM,IAAI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AEH,UACA,eACC,oBAAC;GACC;GACA,WAAW,GAAG,gCAAgC,CAAC,QAAQ,aAAa;IACpE;GAEC;;AAIX,SAAgB,qBAAqB,OAAgC;AACnE,QAAO,oBAAC;EAAmB,GAAI;YAAQ,MAAM;GAA8B;;AAG7E,SAAgB,eAAe,EAAE,UAAU,GAAG,SAAmC;CAC/E,MAAM,EAAE,YAAY,YAAY;AAEhC,QACE,oBAAC;EAAO,cAAW;EAAe,eAAe,SAAS,SAAS,CAAC,KAAK;EAAE,GAAI;EAC5E;GACM;;AAIb,SAAgB,uBAAuB,OAAiC;CACtE,MAAM,EAAE,WAAW,iBAAiB,YAAY;AAEhD,QACE,oBAAC;EACC,MAAK;EACL,cAAW;EACX,kBAAgB;EAChB,eAAe;AACb,iBAAc,SAAS,CAAC,KAAK;;EAE/B,GAAI;YAEH,MAAM;GACA;;;;;AAOb,SAAgB,cAAc,QAAiB,KAAoC;CACjF,MAAM,EAAE,SAAS,YAAY;AAE7B,iBAAgB;AACd,MAAI,UAAU,IAAI,QAChB,gBAAe,IAAI,SAAS;GAC1B,UAAU,SAAS,eAAe,SAAS,WAAW,sBAAsB,aAAa;GACzF,YAAY;GACb,CAAC;IAEH;EAAC;EAAQ;EAAM;EAAI,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { base_d_exports } from "./base.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime67 from "react/jsx-runtime";
|
|
3
3
|
import { HTMLAttributes } from "react";
|
|
4
4
|
import { LinkItemType } from "@fumadocs/ui/link-item";
|
|
5
5
|
|
|
@@ -18,7 +18,7 @@ declare function createLinkItemRenderer({
|
|
|
18
18
|
item: Exclude<LinkItemType, {
|
|
19
19
|
type: "icon";
|
|
20
20
|
}>;
|
|
21
|
-
}) =>
|
|
21
|
+
}) => react_jsx_runtime67.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { createLinkItemRenderer };
|
|
24
24
|
//# sourceMappingURL=link-item.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { base_d_exports } from "./base.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime68 from "react/jsx-runtime";
|
|
3
3
|
import { FC, ReactNode } from "react";
|
|
4
4
|
import * as PageTree from "fumadocs-core/page-tree";
|
|
5
5
|
|
|
@@ -24,7 +24,7 @@ declare function createPageTreeRenderer({
|
|
|
24
24
|
SidebarFolderTrigger,
|
|
25
25
|
SidebarSeparator,
|
|
26
26
|
SidebarItem
|
|
27
|
-
}: InternalComponents): (components: Partial<SidebarPageTreeComponents>) =>
|
|
27
|
+
}: InternalComponents): (components: Partial<SidebarPageTreeComponents>) => react_jsx_runtime68.JSX.Element;
|
|
28
28
|
//#endregion
|
|
29
29
|
export { SidebarPageTreeComponents, createPageTreeRenderer };
|
|
30
30
|
//# sourceMappingURL=page-tree.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SidebarTab } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime140 from "react/jsx-runtime";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/sidebar/tabs/dropdown.d.ts
|
|
@@ -13,7 +13,7 @@ declare function SidebarTabsDropdown({
|
|
|
13
13
|
}: {
|
|
14
14
|
placeholder?: ReactNode;
|
|
15
15
|
options: SidebarTabWithProps[];
|
|
16
|
-
} & ComponentProps<'button'>):
|
|
16
|
+
} & ComponentProps<'button'>): react_jsx_runtime140.JSX.Element;
|
|
17
17
|
declare function isTabActive(tab: SidebarTab, pathname: string): boolean;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { SidebarTabWithProps, SidebarTabsDropdown, isTabActive };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.d.ts","names":[],"sources":["../../../../src/components/sidebar/tabs/dropdown.tsx"],"sourcesContent":[],"mappings":";;;;;UAWiB,mBAAA,SAA4B;UACnC;;AADO,iBAID,mBAAA,CAHN;EAAA,OAAA;EADmC,WAAU;EAAA,GAAA;AAMrD,CANqD,EAAA;EAIvC,WAAA,CAAA,EAKA,SALmB;EACjC,OAAA,EAKS,mBALT,EAAA;CACA,GAKE,cALF,CAAA,QAAA,CAAA,CAAA,EAK0B,
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","names":[],"sources":["../../../../src/components/sidebar/tabs/dropdown.tsx"],"sourcesContent":[],"mappings":";;;;;UAWiB,mBAAA,SAA4B;UACnC;;AADO,iBAID,mBAAA,CAHN;EAAA,OAAA;EADmC,WAAU;EAAA,GAAA;AAMrD,CANqD,EAAA;EAIvC,WAAA,CAAA,EAKA,SALmB;EACjC,OAAA,EAKS,mBALT,EAAA;CACA,GAKE,cALF,CAAA,QAAA,CAAA,CAAA,EAK0B,oBAAA,CAAA,GAAA,CAAA,OAL1B;AAGc,iBAkFA,WAAA,CAlFA,GAAA,EAkFiB,UAlFjB,EAAA,QAAA,EAAA,MAAA,CAAA,EAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/sidebar/tabs/index.tsx"],"sourcesContent":["import type * as PageTree from 'fumadocs-core/page-tree';\nimport type { ReactNode } from 'react';\n\nexport interface SidebarTab {\n /**\n * Redirect URL of the folder, usually the index page\n */\n url: string;\n\n icon?: ReactNode;\n title: ReactNode;\n description?: ReactNode;\n\n /**\n * Detect from a list of urls\n */\n urls?: Set<string>;\n unlisted?: boolean;\n}\n\nexport interface GetSidebarTabsOptions {\n transform?: (option: SidebarTab, node: PageTree.Folder) => SidebarTab | null;\n}\n\nconst defaultTransform: GetSidebarTabsOptions['transform'] = (option, node) => {\n if (!node.icon) return option;\n\n return {\n ...option,\n icon: (\n <div className=\"size-full [&_svg]:size-full max-md:p-1.5 max-md:rounded-md max-md:border max-md:bg-fd-secondary\">\n {node.icon}\n </div>\n ),\n };\n};\n\nexport function getSidebarTabs(\n tree: PageTree.Root,\n { transform = defaultTransform }: GetSidebarTabsOptions = {},\n): SidebarTab[] {\n const results: SidebarTab[] = [];\n\n function scanOptions(node: PageTree.Root | PageTree.Folder, unlisted?: boolean) {\n if ('root' in node && node.root) {\n const urls = getFolderUrls(node);\n\n if (urls.size > 0) {\n const option: SidebarTab = {\n url: urls.values().next().value ?? '',\n title: node.name,\n icon: node.icon,\n unlisted,\n description: node.description,\n urls,\n };\n\n const mapped = transform ? transform(option, node) : option;\n if (mapped) results.push(mapped);\n }\n }\n\n for (const child of node.children) {\n if (child.type === 'folder') scanOptions(child, unlisted);\n }\n }\n\n scanOptions(tree);\n if (tree.fallback) scanOptions(tree.fallback, true);\n\n return results;\n}\n\nfunction getFolderUrls(folder: PageTree.Folder, output: Set<string> = new Set()): Set<string> {\n if (folder.index) output.add(folder.index.url);\n\n for (const child of folder.children) {\n if (child.type === 'page' && !child.external) output.add(child.url);\n if (child.type === 'folder') getFolderUrls(child, output);\n }\n\n return output;\n}\n"],"mappings":";;;AAwBA,MAAM,oBAAwD,QAAQ,SAAS;AAC7E,KAAI,CAAC,KAAK,KAAM,QAAO;AAEvB,QAAO;EACL,GAAG;EACH,MACE,oBAAC;GAAI,WAAU;aACZ,KAAK;IACF;EAET;;AAGH,SAAgB,eACd,MACA,EAAE,YAAY,qBAA4C,EAAE,EAC9C;CACd,MAAM,UAAwB,EAAE;CAEhC,SAAS,YAAY,MAAuC,UAAoB;AAC9E,MAAI,UAAU,QAAQ,KAAK,MAAM;GAC/B,MAAM,OAAO,cAAc,KAAK;AAEhC,OAAI,KAAK,OAAO,GAAG;IACjB,MAAM,SAAqB;KACzB,KAAK,KAAK,QAAQ,CAAC,MAAM,CAAC,SAAS;KACnC,OAAO,KAAK;KACZ,MAAM,KAAK;KACX;KACA,aAAa,KAAK;KAClB;KACD;IAED,MAAM,SAAS,YAAY,UAAU,QAAQ,KAAK,GAAG;AACrD,QAAI,OAAQ,SAAQ,KAAK,OAAO;;;AAIpC,OAAK,MAAM,SAAS,KAAK,SACvB,KAAI,MAAM,SAAS,SAAU,aAAY,OAAO,SAAS;;AAI7D,aAAY,KAAK;AACjB,KAAI,KAAK,SAAU,aAAY,KAAK,UAAU,KAAK;AAEnD,QAAO;;AAGT,SAAS,cAAc,QAAyB,yBAAsB,IAAI,KAAK,EAAe;AAC5F,KAAI,OAAO,MAAO,QAAO,IAAI,OAAO,MAAM,IAAI;AAE9C,MAAK,MAAM,SAAS,OAAO,UAAU;AACnC,MAAI,MAAM,SAAS,UAAU,CAAC,MAAM,SAAU,QAAO,IAAI,MAAM,IAAI;AACnE,MAAI,MAAM,SAAS,SAAU,eAAc,OAAO,OAAO;;AAG3D,QAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime29 from "react/jsx-runtime";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/steps.d.ts
|
|
@@ -6,12 +6,12 @@ declare function Steps({
|
|
|
6
6
|
children
|
|
7
7
|
}: {
|
|
8
8
|
children: ReactNode;
|
|
9
|
-
}):
|
|
9
|
+
}): react_jsx_runtime29.JSX.Element;
|
|
10
10
|
declare function Step({
|
|
11
11
|
children
|
|
12
12
|
}: {
|
|
13
13
|
children: ReactNode;
|
|
14
|
-
}):
|
|
14
|
+
}): react_jsx_runtime29.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { Step, Steps };
|
|
17
17
|
//# sourceMappingURL=steps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.d.ts","names":[],"sources":["../../src/components/steps.tsx"],"sourcesContent":[],"mappings":";;;;iBAEgB,KAAA;;;YAAgC;IAAW,
|
|
1
|
+
{"version":3,"file":"steps.d.ts","names":[],"sources":["../../src/components/steps.tsx"],"sourcesContent":[],"mappings":";;;;iBAEgB,KAAA;;;YAAgC;IAAW,mBAAA,CAAA,GAAA,CAAA;AAA3C,iBAIA,IAAA,CAJK;EAAA;CAAA,EAAA;EAAG,QAAA,EAIuB,SAJvB;CAAwB,CAAA,EAIU,mBAAA,CAAA,GAAA,CAAA,OAJV"}
|