@fumadocs/base-ui 16.4.2 → 16.4.4

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.
Files changed (71) hide show
  1. package/css/emerald.css +1 -0
  2. package/dist/components/accordion.d.ts +3 -3
  3. package/dist/components/accordion.d.ts.map +1 -1
  4. package/dist/components/banner.d.ts +2 -2
  5. package/dist/components/banner.d.ts.map +1 -1
  6. package/dist/components/callout.d.ts +5 -5
  7. package/dist/components/callout.d.ts.map +1 -1
  8. package/dist/components/card.d.ts +3 -3
  9. package/dist/components/codeblock.d.ts +7 -7
  10. package/dist/components/dialog/search-algolia.d.ts +2 -2
  11. package/dist/components/dialog/search-default.d.ts +2 -2
  12. package/dist/components/dialog/search-orama.d.ts +2 -2
  13. package/dist/components/dialog/search.d.ts +13 -13
  14. package/dist/components/dynamic-codeblock.d.ts +2 -2
  15. package/dist/components/github-info.d.ts +2 -2
  16. package/dist/components/image-zoom.d.ts +2 -2
  17. package/dist/components/inline-toc.d.ts +2 -2
  18. package/dist/components/sidebar/base.d.ts +21 -19
  19. package/dist/components/sidebar/base.d.ts.map +1 -1
  20. package/dist/components/sidebar/base.js +6 -2
  21. package/dist/components/sidebar/base.js.map +1 -1
  22. package/dist/components/sidebar/link-item.d.ts +2 -2
  23. package/dist/components/sidebar/page-tree.d.ts +2 -2
  24. package/dist/components/sidebar/page-tree.d.ts.map +1 -1
  25. package/dist/components/sidebar/tabs/dropdown.d.ts +2 -2
  26. package/dist/components/sidebar/tabs/dropdown.d.ts.map +1 -1
  27. package/dist/components/steps.d.ts +3 -3
  28. package/dist/components/tabs.d.ts +4 -4
  29. package/dist/components/type-table.d.ts +2 -2
  30. package/dist/components/ui/accordion.d.ts +6 -6
  31. package/dist/components/ui/accordion.d.ts.map +1 -1
  32. package/dist/components/ui/collapsible.d.ts +5 -5
  33. package/dist/components/ui/tabs.d.ts +6 -6
  34. package/dist/layouts/docs/client.d.ts +7 -7
  35. package/dist/layouts/docs/client.d.ts.map +1 -1
  36. package/dist/layouts/docs/index.d.ts +2 -2
  37. package/dist/layouts/docs/page/client.d.ts +7 -7
  38. package/dist/layouts/docs/page/index.d.ts +11 -6
  39. package/dist/layouts/docs/page/index.d.ts.map +1 -1
  40. package/dist/layouts/docs/page/index.js +2 -2
  41. package/dist/layouts/docs/page/index.js.map +1 -1
  42. package/dist/layouts/docs/sidebar.d.ts +17 -17
  43. package/dist/layouts/docs/sidebar.d.ts.map +1 -1
  44. package/dist/layouts/home/client.d.ts +3 -3
  45. package/dist/layouts/home/index.d.ts +2 -2
  46. package/dist/layouts/home/navbar.d.ts +6 -6
  47. package/dist/layouts/home/navbar.d.ts.map +1 -1
  48. package/dist/layouts/notebook/client.d.ts +8 -8
  49. package/dist/layouts/notebook/client.d.ts.map +1 -1
  50. package/dist/layouts/notebook/index.d.ts +2 -2
  51. package/dist/layouts/notebook/page/client.d.ts +7 -7
  52. package/dist/layouts/notebook/page/index.d.ts +11 -6
  53. package/dist/layouts/notebook/page/index.d.ts.map +1 -1
  54. package/dist/layouts/notebook/page/index.js +2 -2
  55. package/dist/layouts/notebook/page/index.js.map +1 -1
  56. package/dist/layouts/notebook/sidebar.d.ts +12 -12
  57. package/dist/layouts/notebook/sidebar.d.ts.map +1 -1
  58. package/dist/layouts/shared/index.d.ts +3 -3
  59. package/dist/layouts/shared/language-toggle.d.ts +2 -2
  60. package/dist/layouts/shared/search-toggle.d.ts +3 -3
  61. package/dist/layouts/shared/search-toggle.d.ts.map +1 -1
  62. package/dist/layouts/shared/theme-toggle.d.ts +2 -2
  63. package/dist/page.d.ts +3 -3
  64. package/dist/page.d.ts.map +1 -1
  65. package/dist/provider/base.d.ts +2 -2
  66. package/dist/provider/next.d.ts +2 -2
  67. package/dist/provider/react-router.d.ts +2 -2
  68. package/dist/provider/react-router.d.ts.map +1 -1
  69. package/dist/provider/tanstack.d.ts +2 -2
  70. package/dist/provider/waku.d.ts +2 -2
  71. package/package.json +5 -5
@@ -0,0 +1 @@
1
+ @import '@fumadocs/ui/css/colors/emerald.css';
@@ -1,5 +1,5 @@
1
1
  import { Accordion as Accordion$1, AccordionItem } from "./ui/accordion.js";
2
- import * as react_jsx_runtime24 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime138 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>): react_jsx_runtime24.JSX.Element;
11
+ }: ComponentProps<typeof Accordion$1>): react_jsx_runtime138.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
- }): react_jsx_runtime24.JSX.Element;
21
+ }): react_jsx_runtime138.JSX.Element;
22
22
  //#endregion
23
23
  export { Accordion, Accordions };
24
24
  //# sourceMappingURL=accordion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accordion.d.ts","names":[],"sources":["../../src/components/accordion.tsx"],"sourcesContent":[],"mappings":";;;;;iBAgBgB,UAAA;;;;;GAKb,sBAAsB,eAAK,mBAAA,CAAA,GAAA,CAAA;iBAiCd,SAAA;;;;;;GAMb,KAAK,sBAAsB;kBACZ;EA7CF,KAAA,CAAA,EAAA,MAAU;CACxB,CAAA,EA8CD,mBAAA,CAAA,GAAA,CAAA,OA9CC"}
1
+ {"version":3,"file":"accordion.d.ts","names":[],"sources":["../../src/components/accordion.tsx"],"sourcesContent":[],"mappings":";;;;;iBAgBgB,UAAA;;;;;GAKb,sBAAsB,eAAK,oBAAA,CAAA,GAAA,CAAA;iBAiCd,SAAA;;;;;;GAMb,KAAK,sBAAsB;kBACZ;EA7CF,KAAA,CAAA,EAAA,MAAU;CACxB,CAAA,EA8CD,oBAAA,CAAA,GAAA,CAAA,OA9CC"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime26 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime141 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
- }): react_jsx_runtime26.JSX.Element | null;
32
+ }): react_jsx_runtime141.JSX.Element | null;
33
33
  //#endregion
34
34
  export { Banner };
35
35
  //# sourceMappingURL=banner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"banner.d.ts","names":[],"sources":["../../src/components/banner.tsx"],"sourcesContent":[],"mappings":";;;;KAOK,aAAA;iBAEW,MAAA;;;;;;;GAYb,eAAe;;AAnB+C;AAOjE;EACE,MAAA,CAAA,EAAA,MAAA;EACA;;;EAGA,OAAA,CAAA,EAgBU,aAhBV;EAOgB;;;EAsBjB,aAAA,CAAA,EAAA,MAAA,EAAA;EAAA;;;;;;IAAA,mBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"banner.d.ts","names":[],"sources":["../../src/components/banner.tsx"],"sourcesContent":[],"mappings":";;;;KAOK,aAAA;iBAEW,MAAA;;;;;;;GAYb,eAAe;;AAnB+C;AAOjE;EACE,MAAA,CAAA,EAAA,MAAA;EACA;;;EAGA,OAAA,CAAA,EAgBU,aAhBV;EAOgB;;;EAsBjB,aAAA,CAAA,EAAA,MAAA,EAAA;EAAA;;;;;;IAAA,oBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime27 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 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'>): react_jsx_runtime27.JSX.Element;
12
+ } & Omit<CalloutContainerProps, 'title'>): react_jsx_runtime8.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): react_jsx_runtime27.JSX.Element;
30
+ }: CalloutContainerProps): react_jsx_runtime8.JSX.Element;
31
31
  declare function CalloutTitle({
32
32
  children,
33
33
  className,
34
34
  ...props
35
- }: ComponentProps<'p'>): react_jsx_runtime27.JSX.Element;
35
+ }: ComponentProps<'p'>): react_jsx_runtime8.JSX.Element;
36
36
  declare function CalloutDescription({
37
37
  children,
38
38
  className,
39
39
  ...props
40
- }: ComponentProps<'p'>): react_jsx_runtime27.JSX.Element;
40
+ }: ComponentProps<'p'>): react_jsx_runtime8.JSX.Element;
41
41
  //#endregion
42
42
  export { Callout, CalloutContainer, CalloutContainerProps, CalloutDescription, CalloutTitle, CalloutType };
43
43
  //# sourceMappingURL=callout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"callout.d.ts","names":[],"sources":["../../src/components/callout.tsx"],"sourcesContent":[],"mappings":";;;;KAIY,WAAA;iBAII,OAAA;;;;AAJO;UAQV;AARb,CAAA,GAQ2B,IARf,CAQoB,qBART,EAAA,OAAA,CAAA,CAAA,EAQwC,mBAAA,CAAA,GAAA,CAAA,OARxC;AAIP,UAaC,qBAAA,SAA8B,cAbxB,CAAA,KAAA,CAAA,CAAA;EACrB;;;EAG8B,IAAA,CAAA,EAavB,WAbuB;EAAL;;;EASV,IAAA,CAAA,EASR,SATQ;;AASR,iBASO,gBAAA,CATP;EAAA,IAAA,EAUD,SAVC;EAAA,IAAA;EAAA,QAAA;EAAA,SAAA;EAAA,KAAA;EAAA,GAAA;AAAA,CAAA,EAgBN,qBAhBM,CAAA,EAgBe,mBAAA,CAAA,GAAA,CAAA,OAhBf;AATsC,iBA0D/B,YAAA,CA1D+B;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EA0DiB,cA1DjB,CAAA,GAAA,CAAA,CAAA,EA0DoC,mBAAA,CAAA,GAAA,CAAA,OA1DpC;AAAc,iBAkE7C,kBAAA,CAlE6C;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAkES,cAlET,CAAA,GAAA,CAAA,CAAA,EAkE4B,mBAAA,CAAA,GAAA,CAAA,OAlE5B"}
1
+ {"version":3,"file":"callout.d.ts","names":[],"sources":["../../src/components/callout.tsx"],"sourcesContent":[],"mappings":";;;;KAIY,WAAA;iBAII,OAAA;;;;AAJO;UAQV;AARb,CAAA,GAQ2B,IARf,CAQoB,qBART,EAAA,OAAA,CAAA,CAAA,EAQwC,kBAAA,CAAA,GAAA,CAAA,OARxC;AAIP,UAaC,qBAAA,SAA8B,cAbxB,CAAA,KAAA,CAAA,CAAA;EACrB;;;EAG8B,IAAA,CAAA,EAavB,WAbuB;EAAL;;;EASV,IAAA,CAAA,EASR,SATQ;;AASR,iBASO,gBAAA,CATP;EAAA,IAAA,EAUD,SAVC;EAAA,IAAA;EAAA,QAAA;EAAA,SAAA;EAAA,KAAA;EAAA,GAAA;AAAA,CAAA,EAgBN,qBAhBM,CAAA,EAgBe,kBAAA,CAAA,GAAA,CAAA,OAhBf;AATsC,iBA0D/B,YAAA,CA1D+B;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EA0DiB,cA1DjB,CAAA,GAAA,CAAA,CAAA,EA0DoC,kBAAA,CAAA,GAAA,CAAA,OA1DpC;AAAc,iBAkE7C,kBAAA,CAlE6C;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAkES,cAlET,CAAA,GAAA,CAAA,CAAA,EAkE4B,kBAAA,CAAA,GAAA,CAAA,OAlE5B"}
@@ -1,8 +1,8 @@
1
- import * as react_jsx_runtime31 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime12 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>): react_jsx_runtime31.JSX.Element;
5
+ declare function Cards(props: HTMLAttributes<HTMLDivElement>): react_jsx_runtime12.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): react_jsx_runtime31.JSX.Element;
18
+ }: CardProps): react_jsx_runtime12.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 react_jsx_runtime33 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime14 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'>): react_jsx_runtime33.JSX.Element;
39
+ declare function Pre(props: ComponentProps<'pre'>): react_jsx_runtime14.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): react_jsx_runtime33.JSX.Element;
50
+ }: CodeBlockProps): react_jsx_runtime14.JSX.Element;
51
51
  declare function CodeBlockTabs({
52
52
  ref,
53
53
  className,
54
54
  ...props
55
- }: ComponentProps<typeof Tabs>): react_jsx_runtime33.JSX.Element;
55
+ }: ComponentProps<typeof Tabs>): react_jsx_runtime14.JSX.Element;
56
56
  declare function CodeBlockTabsList({
57
57
  className,
58
58
  ...props
59
- }: ComponentProps<typeof TabsList>): react_jsx_runtime33.JSX.Element;
59
+ }: ComponentProps<typeof TabsList>): react_jsx_runtime14.JSX.Element;
60
60
  declare function CodeBlockTabsTrigger({
61
61
  children,
62
62
  className,
63
63
  ...props
64
- }: ComponentProps<typeof TabsTrigger>): react_jsx_runtime33.JSX.Element;
65
- declare function CodeBlockTab(props: ComponentProps<typeof TabsContent>): react_jsx_runtime33.JSX.Element;
64
+ }: ComponentProps<typeof TabsTrigger>): react_jsx_runtime14.JSX.Element;
65
+ declare function CodeBlockTab(props: ComponentProps<typeof TabsContent>): react_jsx_runtime14.JSX.Element;
66
66
  //#endregion
67
67
  export { CodeBlock, CodeBlockProps, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre };
68
68
  //# sourceMappingURL=codeblock.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 react_jsx_runtime53 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime35 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): react_jsx_runtime53.JSX.Element;
36
+ }: AlgoliaSearchDialogProps): react_jsx_runtime35.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 react_jsx_runtime55 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime36 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): react_jsx_runtime55.JSX.Element;
41
+ }: DefaultSearchDialogProps): react_jsx_runtime36.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 react_jsx_runtime54 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime37 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): react_jsx_runtime54.JSX.Element;
43
+ }: OramaSearchDialogProps): react_jsx_runtime37.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 react_jsx_runtime97 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime38 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): react_jsx_runtime97.JSX.Element;
32
- declare function SearchDialogHeader(props: ComponentProps<'div'>): react_jsx_runtime97.JSX.Element;
33
- declare function SearchDialogInput(props: ComponentProps<'input'>): react_jsx_runtime97.JSX.Element;
31
+ }: SearchDialogProps): react_jsx_runtime38.JSX.Element;
32
+ declare function SearchDialogHeader(props: ComponentProps<'div'>): react_jsx_runtime38.JSX.Element;
33
+ declare function SearchDialogInput(props: ComponentProps<'input'>): react_jsx_runtime38.JSX.Element;
34
34
  declare function SearchDialogClose({
35
35
  children,
36
36
  className,
37
37
  ...props
38
- }: ComponentProps<'button'>): react_jsx_runtime97.JSX.Element;
39
- declare function SearchDialogFooter(props: ComponentProps<'div'>): react_jsx_runtime97.JSX.Element;
38
+ }: ComponentProps<'button'>): react_jsx_runtime38.JSX.Element;
39
+ declare function SearchDialogFooter(props: ComponentProps<'div'>): react_jsx_runtime38.JSX.Element;
40
40
  declare function SearchDialogOverlay({
41
41
  className,
42
42
  ...props
43
- }: ComponentProps<typeof Dialog.Backdrop>): react_jsx_runtime97.JSX.Element;
43
+ }: ComponentProps<typeof Dialog.Backdrop>): react_jsx_runtime38.JSX.Element;
44
44
  declare function SearchDialogContent({
45
45
  children,
46
46
  className,
47
47
  ...props
48
- }: ComponentProps<typeof Dialog.Popup>): react_jsx_runtime97.JSX.Element;
48
+ }: ComponentProps<typeof Dialog.Popup>): react_jsx_runtime38.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
- }): react_jsx_runtime97.JSX.Element;
67
+ }): react_jsx_runtime38.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
- }): react_jsx_runtime97.JSX.Element;
78
- declare function SearchDialogIcon(props: ComponentProps<'svg'>): react_jsx_runtime97.JSX.Element;
77
+ }): react_jsx_runtime38.JSX.Element;
78
+ declare function SearchDialogIcon(props: ComponentProps<'svg'>): react_jsx_runtime38.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): react_jsx_runtime97.JSX.Element;
89
+ }: TagsListProps): react_jsx_runtime38.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
- }): react_jsx_runtime97.JSX.Element;
96
+ }): react_jsx_runtime38.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 react_jsx_runtime39 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime20 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): react_jsx_runtime39.JSX.Element;
29
+ }: DynamicCodeblockProps): react_jsx_runtime20.JSX.Element;
30
30
  //#endregion
31
31
  export { DynamicCodeBlock, DynamicCodeblockProps };
32
32
  //# sourceMappingURL=dynamic-codeblock.d.ts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime40 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime21 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<react_jsx_runtime40.JSX.Element>;
16
+ }): Promise<react_jsx_runtime21.JSX.Element>;
17
17
  //#endregion
18
18
  export { GithubInfo };
19
19
  //# sourceMappingURL=github-info.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { ImageProps } from "fumadocs-core/framework";
2
- import * as react_jsx_runtime41 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime22 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): react_jsx_runtime41.JSX.Element;
22
+ }: ImageZoomProps): react_jsx_runtime22.JSX.Element;
23
23
  //#endregion
24
24
  export { ImageZoom, ImageZoomProps };
25
25
  //# sourceMappingURL=image-zoom.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { Collapsible } from "./ui/collapsible.js";
2
- import * as react_jsx_runtime42 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime23 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): react_jsx_runtime42.JSX.Element;
14
+ }: InlineTocProps): react_jsx_runtime23.JSX.Element;
15
15
  //#endregion
16
16
  export { InlineTOC, InlineTocProps };
17
17
  //# sourceMappingURL=inline-toc.d.ts.map
@@ -1,13 +1,13 @@
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 react_jsx_runtime9 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime50 from "react/jsx-runtime";
5
5
  import * as react0 from "react";
6
6
  import { ComponentProps, PointerEvent, ReactNode, RefObject } from "react";
7
7
 
8
8
  //#region src/components/sidebar/base.d.ts
9
9
  declare namespace base_d_exports {
10
- export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarProviderProps, SidebarSeparator, SidebarTrigger, SidebarViewport, useFolder, useFolderDepth, useSidebar };
10
+ export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarProviderProps, SidebarSeparator, SidebarTrigger, SidebarViewport, useAutoScroll, useFolder, useFolderDepth, useSidebar };
11
11
  }
12
12
  interface SidebarContext {
13
13
  open: boolean;
@@ -19,7 +19,7 @@ interface SidebarContext {
19
19
  */
20
20
  closeOnRedirect: RefObject<boolean>;
21
21
  defaultOpenLevel: number;
22
- prefetch: boolean;
22
+ prefetch?: boolean;
23
23
  mode: Mode;
24
24
  }
25
25
  interface SidebarProviderProps {
@@ -31,9 +31,7 @@ interface SidebarProviderProps {
31
31
  */
32
32
  defaultOpenLevel?: number;
33
33
  /**
34
- * Prefetch links
35
- *
36
- * @defaultValue true
34
+ * Prefetch links, default behaviour depends on your React.js framework.
37
35
  */
38
36
  prefetch?: boolean;
39
37
  children?: ReactNode;
@@ -44,7 +42,7 @@ declare function SidebarProvider({
44
42
  defaultOpenLevel,
45
43
  prefetch,
46
44
  children
47
- }: SidebarProviderProps): react_jsx_runtime9.JSX.Element;
45
+ }: SidebarProviderProps): react_jsx_runtime50.JSX.Element;
48
46
  declare function useSidebar(): SidebarContext;
49
47
  declare function useFolder(): {
50
48
  open: boolean;
@@ -64,24 +62,24 @@ declare function SidebarContent({
64
62
  onPointerLeave: (event: PointerEvent) => void;
65
63
  }) => ReactNode;
66
64
  }): ReactNode;
67
- declare function SidebarDrawerOverlay(props: ComponentProps<'div'>): react_jsx_runtime9.JSX.Element | undefined;
65
+ declare function SidebarDrawerOverlay(props: ComponentProps<'div'>): react_jsx_runtime50.JSX.Element | undefined;
68
66
  declare function SidebarDrawerContent({
69
67
  className,
70
68
  children,
71
69
  ...props
72
- }: ComponentProps<'aside'>): react_jsx_runtime9.JSX.Element | undefined;
70
+ }: ComponentProps<'aside'>): react_jsx_runtime50.JSX.Element | undefined;
73
71
  declare function SidebarViewport({
74
72
  className,
75
73
  ...props
76
- }: ScrollAreaProps): react_jsx_runtime9.JSX.Element;
77
- declare function SidebarSeparator(props: ComponentProps<'p'>): react_jsx_runtime9.JSX.Element;
74
+ }: ScrollAreaProps): react_jsx_runtime50.JSX.Element;
75
+ declare function SidebarSeparator(props: ComponentProps<'p'>): react_jsx_runtime50.JSX.Element;
78
76
  declare function SidebarItem({
79
77
  icon,
80
78
  children,
81
79
  ...props
82
80
  }: LinkProps & {
83
81
  icon?: ReactNode;
84
- }): react_jsx_runtime9.JSX.Element;
82
+ }): react_jsx_runtime50.JSX.Element;
85
83
  declare function SidebarFolder({
86
84
  defaultOpen: defaultOpenProp,
87
85
  collapsible,
@@ -92,21 +90,25 @@ declare function SidebarFolder({
92
90
  active?: boolean;
93
91
  defaultOpen?: boolean;
94
92
  collapsible?: boolean;
95
- }): react_jsx_runtime9.JSX.Element;
93
+ }): react_jsx_runtime50.JSX.Element;
96
94
  declare function SidebarFolderTrigger({
97
95
  children,
98
96
  ...props
99
- }: CollapsibleTriggerProps): react_jsx_runtime9.JSX.Element;
97
+ }: CollapsibleTriggerProps): react_jsx_runtime50.JSX.Element;
100
98
  declare function SidebarFolderLink({
101
99
  children,
102
100
  ...props
103
- }: LinkProps): react_jsx_runtime9.JSX.Element;
104
- declare function SidebarFolderContent(props: CollapsibleContentProps): react_jsx_runtime9.JSX.Element;
101
+ }: LinkProps): react_jsx_runtime50.JSX.Element;
102
+ declare function SidebarFolderContent(props: CollapsibleContentProps): react_jsx_runtime50.JSX.Element;
105
103
  declare function SidebarTrigger({
106
104
  children,
107
105
  ...props
108
- }: ComponentProps<'button'>): react_jsx_runtime9.JSX.Element;
109
- declare function SidebarCollapseTrigger(props: ComponentProps<'button'>): react_jsx_runtime9.JSX.Element;
106
+ }: ComponentProps<'button'>): react_jsx_runtime50.JSX.Element;
107
+ declare function SidebarCollapseTrigger(props: ComponentProps<'button'>): react_jsx_runtime50.JSX.Element;
108
+ /**
109
+ * scroll to the element if `active` is true
110
+ */
111
+ declare function useAutoScroll(active: boolean, ref: RefObject<HTMLElement | null>): void;
110
112
  //#endregion
111
- export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarProviderProps, SidebarSeparator, SidebarTrigger, SidebarViewport, base_d_exports, useFolder, useFolderDepth, useSidebar };
113
+ export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarProviderProps, SidebarSeparator, SidebarTrigger, SidebarViewport, base_d_exports, useAutoScroll, useFolder, useFolderDepth, useSidebar };
112
114
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","names":[],"sources":["../../../src/components/sidebar/base.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;UA+BU,cAAA;;WAEC,KAAA,CAAM,SAAS,KAAA,CAAM;;gBAEhB,KAAA,CAAM,SAAS,KAAA,CAAM;;;;mBAKlB;;;QAGX;;UAGS,oBAAA;;;;;;;;;;;AArBoB;;EAQ1B,QAAM,CAAA,EAAA,OAAA;EAEc,QAAM,CAAA,EA2BxB,SA3BwB;;KA8BhC,IAAA,GAzBc,QAAA,GAAA,MAAA;cA2Bb,cAxBE,EAwBY,MAAA,CAAA,OAxBZ,CAwBY,cAxBZ,GAAA,IAAA,CAAA;AAAI,iBAiCI,eAAA,CAjCJ;EAAA,gBAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAqCT,oBArCS,CAAA,EAqCW,kBAAA,CAAA,GAAA,C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AyK5B,mBAAA,CAAA,GAAA,CAAA,OAzK4B;AAqB/E,iBAwJA,cAAA,CAxJe;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAwJwB,cAxJxB,CAAA,QAAA,CAAA,CAAA,EAwJgD,mBAAA,CAAA,GAAA,CAAA,OAxJhD;AAAG,iBAkKlB,sBAAA,CAlKkB,KAAA,EAkKY,cAlKZ,CAAA,QAAA,CAAA,CAAA,EAkKoC,mBAAA,CAAA,GAAA,CAAA,OAlKpC;;;;AAuBlB,iBAgKA,aAAA,CAhKwB,MAAA,EAAA,OAAmB,EAAA,GAAA,EAgKP,SAhKO,CAgKG,WAhKH,GAAA,IAAA,CAAA,CAAA,EAAA,IAAA"}
@@ -30,13 +30,14 @@ var base_exports = /* @__PURE__ */ __exportAll({
30
30
  SidebarSeparator: () => SidebarSeparator,
31
31
  SidebarTrigger: () => SidebarTrigger,
32
32
  SidebarViewport: () => SidebarViewport,
33
+ useAutoScroll: () => useAutoScroll,
33
34
  useFolder: () => useFolder,
34
35
  useFolderDepth: () => useFolderDepth,
35
36
  useSidebar: () => useSidebar
36
37
  });
37
38
  const SidebarContext = createContext(null);
38
39
  const FolderContext = createContext(null);
39
- function SidebarProvider({ defaultOpenLevel = 0, prefetch = true, children }) {
40
+ function SidebarProvider({ defaultOpenLevel = 0, prefetch, children }) {
40
41
  const closeOnRedirect = useRef(true);
41
42
  const [open, setOpen] = useState(false);
42
43
  const [collapsed, setCollapsed] = useState(false);
@@ -265,6 +266,9 @@ function SidebarCollapseTrigger(props) {
265
266
  children: props.children
266
267
  });
267
268
  }
269
+ /**
270
+ * scroll to the element if `active` is true
271
+ */
268
272
  function useAutoScroll(active, ref) {
269
273
  const { mode } = useSidebar();
270
274
  useEffect(() => {
@@ -280,5 +284,5 @@ function useAutoScroll(active, ref) {
280
284
  }
281
285
 
282
286
  //#endregion
283
- export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarSeparator, SidebarTrigger, SidebarViewport, base_exports, useFolder, useFolderDepth, useSidebar };
287
+ export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarSeparator, SidebarTrigger, SidebarViewport, base_exports, useAutoScroll, useFolder, useFolderDepth, useSidebar };
284
288
  //# sourceMappingURL=base.js.map
@@ -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\n *\n * @defaultValue true\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 = true,\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\nfunction useAutoScroll(active: boolean, ref: RefObject<HTMLAnchorElement | 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA,MAAM,iBAAiB,cAAqC,KAAK;AAEjE,MAAM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SAAS,WAAW,sBAAsB,aAAa;GACzF,YAAY;GACb,CAAC;IAEH;EAAC;EAAQ;EAAM;EAAI,CAAC"}
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,M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,SAAS,UAAa,SAAS,MAAM,MAAM,UAAU,MAAM;AAEhF,eAAc,QAAQ,IAAI;AAE1B,QACE,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,5 +1,5 @@
1
1
  import { base_d_exports } from "./base.js";
2
- import * as react_jsx_runtime23 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime62 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
- }) => react_jsx_runtime23.JSX.Element;
21
+ }) => react_jsx_runtime62.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 react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime63 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>) => react_jsx_runtime0.JSX.Element;
27
+ }: InternalComponents): (components: Partial<SidebarPageTreeComponents>) => react_jsx_runtime63.JSX.Element;
28
28
  //#endregion
29
29
  export { SidebarPageTreeComponents, createPageTreeRenderer };
30
30
  //# sourceMappingURL=page-tree.d.ts.map