fumadocs-ui 16.6.3 → 16.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -537,6 +537,7 @@
537
537
  @source inline("main");
538
538
  @source inline("make");
539
539
  @source inline("mapped");
540
+ @source inline("margin");
540
541
  @source inline("marginBottom");
541
542
  @source inline("mark");
542
543
  @source inline("marked");
package/css/lib/shiki.css CHANGED
@@ -4,45 +4,38 @@
4
4
 
5
5
  code span {
6
6
  color: var(--shiki-light);
7
+ font-style: var(--shiki-light-font-style);
7
8
  }
8
- }
9
-
10
- .dark .shiki:not(.not-fumadocs-codeblock *) {
11
- code span {
12
- color: var(--shiki-dark);
13
- }
14
- }
15
9
 
16
- :is(pre *):is(.shiki *):not(.not-fumadocs-codeblock *) {
17
- .line& {
10
+ .line {
18
11
  position: relative;
19
12
  padding-left: var(--padding-left);
20
13
  padding-right: var(--padding-right);
21
14
  }
22
15
 
23
- .line:empty& {
16
+ .line:empty {
24
17
  height: 1lh;
25
18
  }
26
19
 
27
- .has-focused .line&:not(.focused) {
20
+ &.has-focused .line:not(.focused) {
28
21
  filter: blur(2px);
29
22
  transition: filter 200ms;
30
23
  }
31
24
 
32
- .has-focused:hover .line&:not(.focused) {
25
+ &.has-focused:hover .line:not(.focused) {
33
26
  filter: blur(0);
34
27
  }
35
28
 
36
- [data-line-numbers] .twoslash-meta-line& {
29
+ &[data-line-numbers] .twoslash-meta-line {
37
30
  padding-left: calc(var(--padding-left) + 7 * var(--spacing));
38
31
  }
39
32
 
40
- [data-line-numbers] .line& {
33
+ &[data-line-numbers] .line {
41
34
  counter-increment: line;
42
35
  padding-left: calc(var(--padding-left) + 7 * var(--spacing));
43
36
  }
44
37
 
45
- [data-line-numbers] .line&::after {
38
+ &[data-line-numbers] .line::after {
46
39
  position: absolute;
47
40
  content: counter(line);
48
41
  color: color-mix(
@@ -53,41 +46,48 @@
53
46
  @apply top-0 left-4;
54
47
  }
55
48
 
56
- .diff&::before {
49
+ .diff::before {
57
50
  position: absolute;
58
51
  left: calc(var(--spacing) * 1.5);
59
52
  }
60
53
 
61
- .diff.remove& {
54
+ .diff.remove {
62
55
  opacity: 0.7;
63
56
  --fd-counter-color: var(--color-fd-diff-remove-symbol);
64
57
  @apply bg-fd-diff-remove;
65
58
  }
66
59
 
67
- .diff.remove&::before {
60
+ .diff.remove::before {
68
61
  content: '-';
69
62
  @apply text-fd-diff-remove-symbol;
70
63
  }
71
64
 
72
- .diff.add& {
65
+ .diff.add {
73
66
  --fd-counter-color: var(--color-fd-diff-add-symbol);
74
67
  @apply bg-fd-diff-add;
75
68
  }
76
69
 
77
- .diff.add&::before {
70
+ .diff.add::before {
78
71
  content: '+';
79
72
  @apply text-fd-diff-add-symbol;
80
73
  }
81
74
 
82
- .highlighted& {
75
+ .highlighted {
83
76
  --fd-counter-color: var(--color-fd-primary);
84
77
  padding-left: calc(var(--padding-left) - 2px);
85
78
 
86
79
  @apply border-l-2 border-fd-primary/50 bg-fd-primary/10;
87
80
  }
88
81
 
89
- .highlighted-word& {
82
+ .highlighted-word {
90
83
  padding: 1px;
91
84
  @apply border -my-px border-fd-primary/30 bg-fd-primary/10 rounded-md font-medium;
92
85
  }
93
86
  }
87
+
88
+ .dark .shiki:not(.not-fumadocs-codeblock *) {
89
+ code span {
90
+ color: var(--shiki-dark);
91
+ font-style: var(--shiki-dark-font-style);
92
+ }
93
+ }
@@ -26,6 +26,9 @@ interface TypeNode {
26
26
  default?: ReactNode;
27
27
  required?: boolean;
28
28
  deprecated?: boolean;
29
+ /**
30
+ * a list of parameters info if the type is a function.
31
+ */
29
32
  parameters?: ParameterNode[];
30
33
  returns?: ReactNode;
31
34
  }
@@ -65,45 +65,48 @@ function Header({ nav = {}, i18n = false, links, githubUrl, themeSwitch = {}, se
65
65
  })
66
66
  ]
67
67
  }),
68
- /* @__PURE__ */ jsxs("ul", {
68
+ /* @__PURE__ */ jsxs("div", {
69
69
  className: "flex flex-row items-center ms-auto -me-1.5 lg:hidden",
70
70
  children: [searchToggle.enabled !== false && (searchToggle.components?.sm ?? /* @__PURE__ */ jsx(SearchToggle, {
71
71
  className: "p-2",
72
72
  hideIfDisabled: true
73
- })), /* @__PURE__ */ jsxs(NavigationMenuItem, { children: [/* @__PURE__ */ jsx(NavigationMenuTrigger, {
74
- "aria-label": "Toggle Menu",
75
- className: cn(buttonVariants({
76
- size: "icon",
77
- color: "ghost",
78
- className: "group [&_svg]:size-5.5"
79
- })),
80
- onPointerMove: nav.enableHoverToOpen ? void 0 : (e) => e.preventDefault(),
81
- children: /* @__PURE__ */ jsx(ChevronDown, { className: "transition-transform duration-300 group-data-[state=open]:rotate-180" })
82
- }), /* @__PURE__ */ jsxs(NavigationMenuContent, {
83
- className: "flex flex-col p-4 sm:flex-row sm:items-center sm:justify-end",
84
- children: [menuItems.filter((item) => !isSecondary(item)).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
85
- item,
86
- className: "sm:hidden"
87
- }, i)), /* @__PURE__ */ jsxs("div", {
88
- className: "-ms-1.5 flex flex-row items-center gap-2 max-sm:mt-2",
89
- children: [
90
- menuItems.filter(isSecondary).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
91
- item,
92
- className: cn(item.type === "icon" && "-mx-1 first:ms-0")
93
- }, i)),
94
- /* @__PURE__ */ jsx("div", {
95
- role: "separator",
96
- className: "flex-1"
97
- }),
98
- i18n && /* @__PURE__ */ jsxs(LanguageToggle, { children: [
99
- /* @__PURE__ */ jsx(Languages, { className: "size-5" }),
100
- /* @__PURE__ */ jsx(LanguageToggleText, {}),
101
- /* @__PURE__ */ jsx(ChevronDown, { className: "size-3 text-fd-muted-foreground" })
102
- ] }),
103
- themeSwitch.enabled !== false && (themeSwitch.component ?? /* @__PURE__ */ jsx(ThemeToggle, { mode: themeSwitch?.mode }))
104
- ]
105
- })]
106
- })] })]
73
+ })), /* @__PURE__ */ jsx(NavigationMenuItem, {
74
+ asChild: true,
75
+ children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(NavigationMenuTrigger, {
76
+ "aria-label": "Toggle Menu",
77
+ className: cn(buttonVariants({
78
+ size: "icon",
79
+ color: "ghost",
80
+ className: "group [&_svg]:size-5.5"
81
+ })),
82
+ onPointerMove: nav.enableHoverToOpen ? void 0 : (e) => e.preventDefault(),
83
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "transition-transform duration-300 group-data-[state=open]:rotate-180" })
84
+ }), /* @__PURE__ */ jsxs(NavigationMenuContent, {
85
+ className: "flex flex-col p-4 sm:flex-row sm:items-center sm:justify-end",
86
+ children: [menuItems.filter((item) => !isSecondary(item)).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
87
+ item,
88
+ className: "sm:hidden"
89
+ }, i)), /* @__PURE__ */ jsxs("div", {
90
+ className: "-ms-1.5 flex flex-row items-center gap-2 max-sm:mt-2",
91
+ children: [
92
+ menuItems.filter(isSecondary).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
93
+ item,
94
+ className: cn(item.type === "icon" && "-mx-1 first:ms-0")
95
+ }, i)),
96
+ /* @__PURE__ */ jsx("div", {
97
+ role: "separator",
98
+ className: "flex-1"
99
+ }),
100
+ i18n && /* @__PURE__ */ jsxs(LanguageToggle, { children: [
101
+ /* @__PURE__ */ jsx(Languages, { className: "size-5" }),
102
+ /* @__PURE__ */ jsx(LanguageToggleText, {}),
103
+ /* @__PURE__ */ jsx(ChevronDown, { className: "size-3 text-fd-muted-foreground" })
104
+ ] }),
105
+ themeSwitch.enabled !== false && (themeSwitch.component ?? /* @__PURE__ */ jsx(ThemeToggle, { mode: themeSwitch?.mode }))
106
+ ]
107
+ })]
108
+ })] })
109
+ })]
107
110
  })
108
111
  ]
109
112
  });
@@ -136,10 +139,7 @@ function HeaderNavigationMenu({ transparentMode = "none", ...props }) {
136
139
  });
137
140
  }
138
141
  function NavigationMenuLinkItem({ item, ...props }) {
139
- if (item.type === "custom") return /* @__PURE__ */ jsx("div", {
140
- ...props,
141
- children: item.children
142
- });
142
+ if (item.type === "custom") return item.children;
143
143
  if (item.type === "menu") {
144
144
  const children = item.items.map((child, j) => {
145
145
  if (child.type === "custom") return /* @__PURE__ */ jsx(Fragment, { children: child.children }, j);
@@ -18,7 +18,7 @@ function NavbarMenuContent(props) {
18
18
  function NavbarMenuTrigger(props) {
19
19
  return /* @__PURE__ */ jsx(NavigationMenuTrigger, {
20
20
  ...props,
21
- className: cn(navItemVariants(), "rounded-md", props.className),
21
+ className: cn(navItemVariants(), "text-sm rounded-md", props.className),
22
22
  children: props.children
23
23
  });
24
24
  }
@@ -41,6 +41,6 @@ declare function NavbarLinkItem({
41
41
  ...props
42
42
  }: {
43
43
  item: LinkItemType;
44
- } & HTMLAttributes<HTMLElement>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
44
+ } & HTMLAttributes<HTMLElement>): string | number | bigint | boolean | react_jsx_runtime0.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
45
45
  //#endregion
46
46
  export { LayoutBody, LayoutContext, LayoutContextProvider, LayoutHeader, LayoutHeaderTabs, LayoutInfo, NavbarLinkItem };
@@ -62,7 +62,7 @@ declare function resolveLinkItems({
62
62
  declare function renderTitleNav({
63
63
  title,
64
64
  url
65
- }: Partial<NavOptions>, props: ComponentProps<'a'>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
65
+ }: Partial<NavOptions>, props: ComponentProps<'a'>): string | number | bigint | boolean | react_jsx_runtime0.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
66
66
  declare function useLinkItems({
67
67
  githubUrl,
68
68
  links
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import { ImageResponse, ImageResponseOptions } from "@takumi-rs/image-response";
4
+
5
+ //#region src/og/takumi.d.ts
6
+ interface GenerateProps {
7
+ title: ReactNode;
8
+ description?: ReactNode;
9
+ icon?: ReactNode;
10
+ primaryColor?: string;
11
+ primaryTextColor?: string;
12
+ site?: ReactNode;
13
+ }
14
+ declare function generateOGImage(options: GenerateProps & ImageResponseOptions): ImageResponse;
15
+ declare function generate({
16
+ primaryColor,
17
+ primaryTextColor,
18
+ ...props
19
+ }: GenerateProps): react_jsx_runtime0.JSX.Element;
20
+ //#endregion
21
+ export { generate, generateOGImage };
@@ -0,0 +1,72 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { ImageResponse } from "@takumi-rs/image-response";
3
+
4
+ //#region src/og/takumi.tsx
5
+ function generateOGImage(options) {
6
+ const { title, description, icon, site, primaryColor, primaryTextColor, ...rest } = options;
7
+ return new ImageResponse(generate({
8
+ title,
9
+ description,
10
+ icon,
11
+ site,
12
+ primaryTextColor,
13
+ primaryColor
14
+ }), {
15
+ width: 1200,
16
+ height: 630,
17
+ ...rest
18
+ });
19
+ }
20
+ function generate({ primaryColor = "rgba(255,150,255,0.3)", primaryTextColor = "rgb(255,150,255)", ...props }) {
21
+ return /* @__PURE__ */ jsxs("div", {
22
+ style: {
23
+ display: "flex",
24
+ flexDirection: "column",
25
+ width: "100%",
26
+ height: "100%",
27
+ color: "white",
28
+ padding: "4rem",
29
+ backgroundColor: "#0c0c0c",
30
+ backgroundImage: `linear-gradient(to top right, ${primaryColor}, transparent)`
31
+ },
32
+ children: [
33
+ /* @__PURE__ */ jsxs("div", {
34
+ style: {
35
+ display: "flex",
36
+ flexDirection: "row",
37
+ alignItems: "center",
38
+ gap: "16px",
39
+ marginBottom: "12px",
40
+ color: primaryTextColor
41
+ },
42
+ children: [props.icon, /* @__PURE__ */ jsx("p", {
43
+ style: {
44
+ fontSize: "56px",
45
+ fontWeight: 600,
46
+ margin: 0
47
+ },
48
+ children: props.site
49
+ })]
50
+ }),
51
+ /* @__PURE__ */ jsx("p", {
52
+ style: {
53
+ fontWeight: 800,
54
+ fontSize: "82px",
55
+ margin: 0
56
+ },
57
+ children: props.title
58
+ }),
59
+ /* @__PURE__ */ jsx("p", {
60
+ style: {
61
+ fontSize: "52px",
62
+ color: "rgba(240,240,240,0.8)",
63
+ margin: 0
64
+ },
65
+ children: props.description
66
+ })
67
+ ]
68
+ });
69
+ }
70
+
71
+ //#endregion
72
+ export { generate, generateOGImage };
package/dist/og.js CHANGED
@@ -42,7 +42,8 @@ function generate({ primaryColor = "rgba(255,150,255,0.3)", primaryTextColor = "
42
42
  children: [props.icon, /* @__PURE__ */ jsx("p", {
43
43
  style: {
44
44
  fontSize: "56px",
45
- fontWeight: 600
45
+ fontWeight: 600,
46
+ margin: 0
46
47
  },
47
48
  children: props.site
48
49
  })]
@@ -50,14 +51,16 @@ function generate({ primaryColor = "rgba(255,150,255,0.3)", primaryTextColor = "
50
51
  /* @__PURE__ */ jsx("p", {
51
52
  style: {
52
53
  fontWeight: 800,
53
- fontSize: "82px"
54
+ fontSize: "82px",
55
+ margin: 0
54
56
  },
55
57
  children: props.title
56
58
  }),
57
59
  /* @__PURE__ */ jsx("p", {
58
60
  style: {
59
61
  fontSize: "52px",
60
- color: "rgba(240,240,240,0.8)"
62
+ color: "rgba(240,240,240,0.8)",
63
+ margin: 0
61
64
  },
62
65
  children: props.description
63
66
  })
package/dist/style.css CHANGED
@@ -2855,37 +2855,31 @@
2855
2855
  --padding-right: calc(var(--spacing) * 4);
2856
2856
  code span {
2857
2857
  color: var(--shiki-light);
2858
+ font-style: var(--shiki-light-font-style);
2858
2859
  }
2859
- }
2860
- .dark .shiki:not(.not-fumadocs-codeblock *) {
2861
- code span {
2862
- color: var(--shiki-dark);
2863
- }
2864
- }
2865
- :is(pre *):is(.shiki *):not(.not-fumadocs-codeblock *) {
2866
- .line& {
2860
+ .line {
2867
2861
  position: relative;
2868
2862
  padding-left: var(--padding-left);
2869
2863
  padding-right: var(--padding-right);
2870
2864
  }
2871
- .line:empty& {
2865
+ .line:empty {
2872
2866
  height: 1lh;
2873
2867
  }
2874
- .has-focused .line&:not(.focused) {
2868
+ &.has-focused .line:not(.focused) {
2875
2869
  filter: blur(2px);
2876
2870
  transition: filter 200ms;
2877
2871
  }
2878
- .has-focused:hover .line&:not(.focused) {
2872
+ &.has-focused:hover .line:not(.focused) {
2879
2873
  filter: blur(0);
2880
2874
  }
2881
- [data-line-numbers] .twoslash-meta-line& {
2875
+ &[data-line-numbers] .twoslash-meta-line {
2882
2876
  padding-left: calc(var(--padding-left) + 7 * var(--spacing));
2883
2877
  }
2884
- [data-line-numbers] .line& {
2878
+ &[data-line-numbers] .line {
2885
2879
  counter-increment: line;
2886
2880
  padding-left: calc(var(--padding-left) + 7 * var(--spacing));
2887
2881
  }
2888
- [data-line-numbers] .line&::after {
2882
+ &[data-line-numbers] .line::after {
2889
2883
  position: absolute;
2890
2884
  content: counter(line);
2891
2885
  color: var(--fd-counter-color, hsl(0, 0%, 45.1%));
@@ -2895,28 +2889,28 @@
2895
2889
  top: calc(var(--spacing) * 0);
2896
2890
  left: calc(var(--spacing) * 4);
2897
2891
  }
2898
- .diff&::before {
2892
+ .diff::before {
2899
2893
  position: absolute;
2900
2894
  left: calc(var(--spacing) * 1.5);
2901
2895
  }
2902
- .diff.remove& {
2896
+ .diff.remove {
2903
2897
  opacity: 0.7;
2904
2898
  --fd-counter-color: var(--color-fd-diff-remove-symbol);
2905
2899
  background-color: var(--color-fd-diff-remove);
2906
2900
  }
2907
- .diff.remove&::before {
2901
+ .diff.remove::before {
2908
2902
  content: '-';
2909
2903
  color: var(--color-fd-diff-remove-symbol);
2910
2904
  }
2911
- .diff.add& {
2905
+ .diff.add {
2912
2906
  --fd-counter-color: var(--color-fd-diff-add-symbol);
2913
2907
  background-color: var(--color-fd-diff-add);
2914
2908
  }
2915
- .diff.add&::before {
2909
+ .diff.add::before {
2916
2910
  content: '+';
2917
2911
  color: var(--color-fd-diff-add-symbol);
2918
2912
  }
2919
- .highlighted& {
2913
+ .highlighted {
2920
2914
  --fd-counter-color: var(--color-fd-primary);
2921
2915
  padding-left: calc(var(--padding-left) - 2px);
2922
2916
  border-left-style: var(--tw-border-style);
@@ -2930,7 +2924,7 @@
2930
2924
  background-color: color-mix(in oklab, var(--color-fd-primary) 10%, transparent);
2931
2925
  }
2932
2926
  }
2933
- .highlighted-word& {
2927
+ .highlighted-word {
2934
2928
  padding: 1px;
2935
2929
  margin-block: -1px;
2936
2930
  border-radius: var(--radius-md);
@@ -2948,6 +2942,12 @@
2948
2942
  font-weight: var(--font-weight-medium);
2949
2943
  }
2950
2944
  }
2945
+ .dark .shiki:not(.not-fumadocs-codeblock *) {
2946
+ code span {
2947
+ color: var(--shiki-dark);
2948
+ font-style: var(--shiki-dark-font-style);
2949
+ }
2950
+ }
2951
2951
  :root {
2952
2952
  --fd-sidebar-drawer-offset: 100%;
2953
2953
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "16.6.3",
3
+ "version": "16.6.5",
4
4
  "description": "The Radix UI version of Fumadocs UI",
5
5
  "keywords": [
6
6
  "Docs",
@@ -89,6 +89,10 @@
89
89
  "types": "./dist/og.d.ts",
90
90
  "import": "./dist/og.js"
91
91
  },
92
+ "./og/*": {
93
+ "types": "./dist/og/*.d.ts",
94
+ "import": "./dist/og/*.js"
95
+ },
92
96
  "./utils/get-sidebar-tabs": {
93
97
  "types": "./dist/components/sidebar/tabs/index.d.ts",
94
98
  "import": "./dist/components/sidebar/tabs/index.js"
@@ -135,20 +139,24 @@
135
139
  "unified": "^11.0.5",
136
140
  "@fumadocs/cli": "1.2.4",
137
141
  "eslint-config-custom": "0.0.0",
138
- "fumadocs-core": "16.6.3",
142
+ "fumadocs-core": "16.6.5",
139
143
  "tsconfig": "0.0.0"
140
144
  },
141
145
  "peerDependencies": {
146
+ "@takumi-rs/image-response": "^0.68.17",
142
147
  "@types/react": "*",
143
148
  "next": "16.x.x",
144
149
  "react": "^19.2.0",
145
150
  "react-dom": "^19.2.0",
146
- "fumadocs-core": "16.6.3"
151
+ "fumadocs-core": "16.6.5"
147
152
  },
148
153
  "peerDependenciesMeta": {
149
154
  "next": {
150
155
  "optional": true
151
156
  },
157
+ "@takumi-rs/image-response": {
158
+ "optional": true
159
+ },
152
160
  "@types/react": {
153
161
  "optional": true
154
162
  }