@fumadocs/base-ui 16.7.14 → 16.7.16

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.
@@ -15,7 +15,6 @@
15
15
  @source inline("--anchor-width");
16
16
  @source inline("--available-height");
17
17
  @source inline("--available-width");
18
- @source inline("--b");
19
18
  @source inline("--callout-color");
20
19
  @source inline("--collapsible-panel-height");
21
20
  @source inline("--color-fd-");
@@ -24,6 +23,8 @@
24
23
  @source inline("--easing");
25
24
  @source inline("--fd-animated-height");
26
25
  @source inline("--fd-banner-height");
26
+ @source inline("--offset-distance");
27
+ @source inline("--opacity");
27
28
  @source inline("--padding-right");
28
29
  @source inline("--popup-height");
29
30
  @source inline("--popup-width");
@@ -31,7 +32,8 @@
31
32
  @source inline("--shiki-dark-bg");
32
33
  @source inline("--shiki-light-bg");
33
34
  @source inline("--spacing");
34
- @source inline("--t");
35
+ @source inline("--track-bottom");
36
+ @source inline("--track-top");
35
37
  @source inline("--transform-origin");
36
38
  @source inline("-circle");
37
39
  @source inline("-mb-px");
@@ -65,6 +67,7 @@
65
67
  @source inline("[&_svg]:size-5");
66
68
  @source inline("[&_svg]:size-full");
67
69
  @source inline("[&_svg]:text-fd-muted-foreground");
70
+ @source inline("[offset-distance:var(--offset-distance,0)]");
68
71
  @source inline("[scrollbar-width:none]");
69
72
  @source inline("a");
70
73
  @source inline("about");
@@ -337,6 +340,7 @@
337
340
  @source inline("display");
338
341
  @source inline("displayName");
339
342
  @source inline("displayed");
343
+ @source inline("distance");
340
344
  @source inline("div");
341
345
  @source inline("divide-fd-border");
342
346
  @source inline("divide-x");
@@ -459,8 +463,6 @@
459
463
  @source inline("group-data-[open]:rotate-180");
460
464
  @source inline("group-data-[panel-open]:rotate-90");
461
465
  @source inline("group-data-active:bg-fd-primary");
462
- @source inline("group-first:[--t:--spacing(0.75)]");
463
- @source inline("group-last:[--b:--spacing(0.75)]");
464
466
  @source inline("groupListeners");
465
467
  @source inline("guides");
466
468
  @source inline("h");
@@ -542,6 +544,8 @@
542
544
  @source inline("invisible");
543
545
  @source inline("is");
544
546
  @source inline("isActive");
547
+ @source inline("isFirst");
548
+ @source inline("isLast");
545
549
  @source inline("isLoading");
546
550
  @source inline("isOpen");
547
551
  @source inline("isTabActive");
@@ -671,6 +675,7 @@
671
675
  @source inline("my-4");
672
676
  @source inline("my-6");
673
677
  @source inline("my-auto");
678
+ @source inline("n");
674
679
  @source inline("name");
675
680
  @source inline("namespace");
676
681
  @source inline("nav");
@@ -715,7 +720,6 @@
715
720
  @source inline("of");
716
721
  @source inline("official");
717
722
  @source inline("offset");
718
- @source inline("offsetDistance");
719
723
  @source inline("offsetPath");
720
724
  @source inline("offsetTop");
721
725
  @source inline("on");
@@ -741,6 +745,7 @@
741
745
  @source inline("onTagChangeCallback");
742
746
  @source inline("onValueChange");
743
747
  @source inline("only");
748
+ @source inline("opacity-(--opacity,0)");
744
749
  @source inline("opacity-0");
745
750
  @source inline("open");
746
751
  @source inline("opening");
@@ -754,6 +759,7 @@
754
759
  @source inline("origin-(--transform-origin)");
755
760
  @source inline("original");
756
761
  @source inline("other");
762
+ @source inline("out");
757
763
  @source inline("outer");
758
764
  @source inline("outline");
759
765
  @source inline("outline-none");
@@ -786,6 +792,7 @@
786
792
  @source inline("path");
787
793
  @source inline("pathname");
788
794
  @source inline("paths");
795
+ @source inline("pb-0");
789
796
  @source inline("pb-2");
790
797
  @source inline("pe-2");
791
798
  @source inline("peer");
@@ -853,6 +860,7 @@
853
860
  @source inline("rainbowColors");
854
861
  @source inline("raw");
855
862
  @source inline("rawTree");
863
+ @source inline("re-exported");
856
864
  @source inline("react");
857
865
  @source inline("react-dom");
858
866
  @source inline("react-hooks/exhaustive-deps");
@@ -909,7 +917,6 @@
909
917
  @source inline("rtl:rotate-180");
910
918
  @source inline("rtl:rotate-90");
911
919
  @source inline("s");
912
- @source inline("scale");
913
920
  @source inline("scope");
914
921
  @source inline("scroll");
915
922
  @source inline("scroll-into-view-if-needed");
@@ -1067,6 +1074,7 @@
1067
1074
  @source inline("title");
1068
1075
  @source inline("to");
1069
1076
  @source inline("toc");
1077
+ @source inline("tocInfo");
1070
1078
  @source inline("tocNoHeadings");
1071
1079
  @source inline("toolbar");
1072
1080
  @source inline("top");
@@ -1076,14 +1084,12 @@
1076
1084
  @source inline("top-2");
1077
1085
  @source inline("top-2.5");
1078
1086
  @source inline("top-4");
1079
- @source inline("top-[calc(50%-var(--t,0px)+var(--b,0px))]");
1080
- @source inline("topL");
1081
1087
  @source inline("touch");
1082
1088
  @source inline("transform");
1083
1089
  @source inline("transition-[clip-path]");
1084
1090
  @source inline("transition-[height,opacity]");
1085
1091
  @source inline("transition-[height]");
1086
- @source inline("transition-[offset-distance]");
1092
+ @source inline("transition-[opacity,offset-distance]");
1087
1093
  @source inline("transition-[opacity,transform,translate]");
1088
1094
  @source inline("transition-[opacity,transform,width,height,scale,translate]");
1089
1095
  @source inline("transition-all");
package/css/lib/shiki.css CHANGED
@@ -95,3 +95,14 @@
95
95
  font-style: var(--shiki-dark-font-style);
96
96
  }
97
97
  }
98
+
99
+ /* inline code */
100
+ code.shiki span {
101
+ color: var(--shiki-light);
102
+ font-style: var(--shiki-light-font-style);
103
+ }
104
+
105
+ .dark code.shiki span {
106
+ color: var(--shiki-dark);
107
+ font-style: var(--shiki-dark-font-style);
108
+ }
@@ -10,6 +10,7 @@ declare function TOCItems({
10
10
  ref,
11
11
  className,
12
12
  thumbBox,
13
+ children,
13
14
  ...props
14
15
  }: TOCItemsProps): _$react_jsx_runtime0.JSX.Element;
15
16
  declare function TOCEmpty(): _$react_jsx_runtime0.JSX.Element;
@@ -5,7 +5,7 @@ import { cn } from "../../utils/cn.js";
5
5
  import { mergeRefs } from "../../utils/merge-refs.js";
6
6
  import { useTOCItems } from "./index.js";
7
7
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
8
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import * as Primitive from "fumadocs-core/toc";
10
10
  //#region src/components/toc/clerk.tsx
11
11
  var clerk_exports = /* @__PURE__ */ __exportAll({
@@ -13,7 +13,7 @@ var clerk_exports = /* @__PURE__ */ __exportAll({
13
13
  TOCItem: () => TOCItem,
14
14
  TOCItems: () => TOCItems
15
15
  });
16
- function TOCItems({ ref, className, thumbBox = true, ...props }) {
16
+ function TOCItems({ ref, className, thumbBox = true, children, ...props }) {
17
17
  const containerRef = useRef(null);
18
18
  const items = useTOCItems();
19
19
  const [svg, setSvg] = useState(null);
@@ -78,12 +78,12 @@ function TOCItems({ ref, className, thumbBox = true, ...props }) {
78
78
  if (thumbBox) {
79
79
  const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
80
80
  path.setAttribute("d", d);
81
- let l = 0;
82
- for (const [top, bottom] of positions) {
83
- while (path.getPointAtLength(l).y < top) l++;
84
- const topL = l;
85
- while (path.getPointAtLength(l).y < bottom) l++;
86
- itemLineLengths.push([topL, l]);
81
+ const n = path.getTotalLength();
82
+ for (let i = 0; i < positions.length; i++) {
83
+ const [top, bottom] = positions[i];
84
+ let l = i > 0 ? itemLineLengths[i - 1][1] + (top - positions[i - 1][1]) : top;
85
+ while (l < n && path.getPointAtLength(l).y < top) l++;
86
+ itemLineLengths.push([l, l + bottom - top]);
87
87
  }
88
88
  }
89
89
  setSvg({
@@ -105,18 +105,15 @@ function TOCItems({ ref, className, thumbBox = true, ...props }) {
105
105
  observer.unobserve(container);
106
106
  };
107
107
  }, [onPrint]);
108
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [svg && /* @__PURE__ */ jsxs("div", {
109
- className: "absolute top-0 inset-s-0",
110
- style: {
111
- width: svg.width,
112
- height: svg.height
113
- },
114
- children: [/* @__PURE__ */ jsx(ThumbTrack, { computed: svg }), thumbBox && /* @__PURE__ */ jsx(ThumbBox, { computed: svg })]
115
- }), /* @__PURE__ */ jsx("div", {
108
+ return /* @__PURE__ */ jsxs("div", {
116
109
  ref: mergeRefs(containerRef, ref),
117
- className: cn("flex flex-col", className),
118
- ...props
119
- })] });
110
+ className: cn("relative flex flex-col", className),
111
+ ...props,
112
+ children: [svg && /* @__PURE__ */ jsx(ThumbTrack, {
113
+ computed: svg,
114
+ thumbBox
115
+ }), children]
116
+ });
120
117
  }
121
118
  function TOCEmpty() {
122
119
  const { text } = useI18n();
@@ -125,48 +122,60 @@ function TOCEmpty() {
125
122
  children: text.tocNoHeadings
126
123
  });
127
124
  }
128
- function ThumbTrack({ computed }) {
129
- const items = Primitive.useItems();
130
- const startIdx = items.findIndex((item) => item.active);
131
- if (startIdx === -1) return;
132
- const endIdx = items.findLastIndex((item) => item.active);
133
- const top = `${computed.positions[startIdx][0]}px`;
134
- const bottom = `${computed.positions[endIdx][1]}px`;
135
- return /* @__PURE__ */ jsx("svg", {
136
- xmlns: "http://www.w3.org/2000/svg",
137
- viewBox: `0 0 ${computed.width} ${computed.height}`,
138
- className: "absolute transition-[clip-path]",
125
+ function ThumbTrack({ computed, thumbBox }) {
126
+ const ref = useRef(null);
127
+ const previousRef = useRef(null);
128
+ const tocInfo = Primitive.useTOC();
129
+ function calculate(items) {
130
+ const out = {};
131
+ const startIdx = items.findIndex((item) => item.active);
132
+ if (startIdx === -1) return out;
133
+ const endIdx = items.findLastIndex((item) => item.active);
134
+ out["--track-top"] = `${computed.positions[startIdx][0]}px`;
135
+ out["--track-bottom"] = `${computed.positions[endIdx][1]}px`;
136
+ if (thumbBox) {
137
+ let isUp = false;
138
+ if (previousRef.current) {
139
+ const prev = previousRef.current;
140
+ isUp = prev.startIdx > startIdx || prev.endIdx > endIdx || prev.startIdx === startIdx && prev.endIdx === endIdx && prev.isUp;
141
+ }
142
+ previousRef.current = {
143
+ startIdx,
144
+ endIdx,
145
+ isUp
146
+ };
147
+ out["--offset-distance"] = isUp ? `${computed.itemLineLengths[startIdx][0]}px` : `${computed.itemLineLengths[endIdx][1]}px`;
148
+ out["--opacity"] = items[isUp ? startIdx : endIdx].original._step !== void 0 ? "0" : "1";
149
+ }
150
+ return out;
151
+ }
152
+ Primitive.useTOCListener((items) => {
153
+ const element = ref.current;
154
+ if (!element) return;
155
+ for (const [k, v] of Object.entries(calculate(items))) element.style.setProperty(k, v);
156
+ });
157
+ return /* @__PURE__ */ jsxs("div", {
158
+ ref,
159
+ className: "absolute top-0 inset-s-0",
139
160
  style: {
140
161
  width: computed.width,
141
162
  height: computed.height,
142
- clipPath: `polygon(0 ${top}, 100% ${top}, 100% ${bottom}, 0 ${bottom})`
163
+ ...calculate(tocInfo.get())
143
164
  },
144
- children: computed.content
145
- });
146
- }
147
- function ThumbBox({ computed }) {
148
- const items = Primitive.useItems();
149
- const previousRef = useRef(null);
150
- const startIdx = items.findIndex((item) => item.active);
151
- if (startIdx === -1) return;
152
- const endIdx = items.findLastIndex((item) => item.active);
153
- let isUp = false;
154
- if (previousRef.current) {
155
- const prev = previousRef.current;
156
- isUp = prev.startIdx > startIdx || prev.endIdx > endIdx || prev.startIdx === startIdx && prev.endIdx === endIdx && prev.isUp;
157
- }
158
- previousRef.current = {
159
- startIdx,
160
- endIdx,
161
- isUp
162
- };
163
- return /* @__PURE__ */ jsx("div", {
164
- className: "absolute size-1 bg-fd-primary rounded-full transition-[offset-distance]",
165
- style: {
166
- offsetPath: `path("${computed.d}")`,
167
- offsetDistance: isUp ? computed.itemLineLengths[startIdx][0] : computed.itemLineLengths[endIdx][1],
168
- scale: items[isUp ? startIdx : endIdx].original._step !== void 0 ? "0" : "1"
169
- }
165
+ children: [/* @__PURE__ */ jsx("svg", {
166
+ xmlns: "http://www.w3.org/2000/svg",
167
+ viewBox: `0 0 ${computed.width} ${computed.height}`,
168
+ className: "absolute transition-[clip-path]",
169
+ style: {
170
+ width: computed.width,
171
+ height: computed.height,
172
+ clipPath: `polygon(0 var(--track-top,0), 100% var(--track-top,0), 100% var(--track-bottom,0), 0 var(--track-bottom,0))`
173
+ },
174
+ children: computed.content
175
+ }), thumbBox && /* @__PURE__ */ jsx("div", {
176
+ className: "absolute size-1 bg-fd-primary rounded-full [offset-distance:var(--offset-distance,0)] opacity-(--opacity,0) transition-[opacity,offset-distance]",
177
+ style: { offsetPath: `path("${computed.d}")` }
178
+ })]
170
179
  });
171
180
  }
172
181
  const a = 8;
@@ -182,11 +191,13 @@ function getLineOffset(depth) {
182
191
  }
183
192
  function TOCItem({ item, ...props }) {
184
193
  const items = useTOCItems();
185
- const { lowerOffset, offset, upperOffset } = useMemo(() => {
194
+ const { lowerOffset, offset, upperOffset, isFirst, isLast } = useMemo(() => {
186
195
  const index = items.indexOf(item);
187
196
  const offset = getLineOffset(item.depth);
188
197
  return {
189
198
  offset,
199
+ isFirst: index === 0,
200
+ isLast: index === items.length - 1,
190
201
  upperOffset: index > 0 ? getLineOffset(items[index - 1].depth) : offset,
191
202
  lowerOffset: index + 1 < items.length ? getLineOffset(items[index + 1].depth) : offset
192
203
  };
@@ -194,7 +205,7 @@ function TOCItem({ item, ...props }) {
194
205
  return /* @__PURE__ */ jsxs(Primitive.TOCItem, {
195
206
  href: item.url,
196
207
  ...props,
197
- className: cn("group prose relative py-1.5 text-sm scroll-m-4 text-fd-muted-foreground hover:text-fd-accent-foreground transition-colors wrap-anywhere first:pt-0 last:pb-0 data-[active=true]:text-fd-primary", props.className),
208
+ className: cn("prose relative py-1.5 text-sm scroll-m-4 text-fd-muted-foreground hover:text-fd-accent-foreground transition-colors wrap-anywhere data-[active=true]:text-fd-primary", isFirst && "pt-0", isLast && "pb-0", props.className),
198
209
  style: {
199
210
  paddingInlineStart: getItemOffset(item.depth),
200
211
  ...props.style
@@ -222,8 +233,11 @@ function TOCItem({ item, ...props }) {
222
233
  style: { insetInlineStart: offset }
223
234
  }),
224
235
  item._step !== void 0 && /* @__PURE__ */ jsx("div", {
225
- className: "absolute flex items-center justify-center -translate-1/2 -z-1 top-[calc(50%-var(--t,0px)+var(--b,0px))] size-4 font-mono font-medium text-xs bg-fd-muted text-fd-muted-foreground rounded-full leading-none group-first:[--t:--spacing(0.75)] group-last:[--b:--spacing(0.75)]",
226
- style: { insetInlineStart: offset },
236
+ className: "absolute flex items-center justify-center -translate-1/2 -z-1 size-4 font-mono font-medium text-xs bg-fd-muted text-fd-muted-foreground rounded-full leading-none",
237
+ style: {
238
+ top: `calc(50% + ${(isFirst ? -.75 : 0) + (isLast ? .75 : 0)} * var(--spacing))`,
239
+ insetInlineStart: offset
240
+ },
227
241
  children: item._step
228
242
  }),
229
243
  item.title
@@ -53,15 +53,29 @@ function TOCItems({ ref, className, ...props }) {
53
53
  });
54
54
  }
55
55
  function TocThumb({ computed }) {
56
- const items = Primitive.useItems();
57
- const startIdx = items.findIndex((item) => item.active);
58
- if (startIdx === -1) return;
59
- const endIdx = items.findLastIndex((item) => item.active);
60
- const top = `${computed.positions[startIdx][0]}px`;
61
- const bottom = `${computed.positions[endIdx][1]}px`;
56
+ const ref = useRef(null);
57
+ const tocInfo = Primitive.useTOC();
58
+ function calculate(items) {
59
+ const out = {};
60
+ const startIdx = items.findIndex((item) => item.active);
61
+ if (startIdx === -1) return out;
62
+ const endIdx = items.findLastIndex((item) => item.active);
63
+ out["--track-top"] = `${computed.positions[startIdx][0]}px`;
64
+ out["--track-bottom"] = `${computed.positions[endIdx][1]}px`;
65
+ return out;
66
+ }
67
+ Primitive.useTOCListener((items) => {
68
+ const element = ref.current;
69
+ if (!element) return;
70
+ for (const [k, v] of Object.entries(calculate(items))) element.style.setProperty(k, v);
71
+ });
62
72
  return /* @__PURE__ */ jsx("div", {
73
+ ref,
63
74
  className: "absolute inset-y-0 inset-s-0 bg-fd-primary w-px transition-[clip-path]",
64
- style: { clipPath: `polygon(0 ${top}, 100% ${top}, 100% ${bottom}, 0 ${bottom})` }
75
+ style: {
76
+ clipPath: `polygon(0 var(--track-top,0), 100% var(--track-top,0), 100% var(--track-bottom,0), 0 var(--track-bottom,0))`,
77
+ ...calculate(tocInfo.get())
78
+ }
65
79
  });
66
80
  }
67
81
  function TOCEmpty() {
@@ -5,7 +5,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
5
5
  declare const buttonVariants: (props?: ({
6
6
  variant?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
7
7
  color?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
8
- size?: "icon" | "sm" | "icon-sm" | "icon-xs" | null | undefined;
8
+ size?: "sm" | "icon" | "icon-sm" | "icon-xs" | null | undefined;
9
9
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
10
10
  type ButtonProps = VariantProps<typeof buttonVariants>;
11
11
  //#endregion
@@ -6,7 +6,7 @@ import * as _$_base_ui_react0 from "@base-ui/react";
6
6
  //#region src/components/ui/navigation-menu.d.ts
7
7
  type NavigationMenuContentProps = NavigationMenu$1.Content.Props;
8
8
  type NavigationMenuTriggerProps = NavigationMenu$1.Trigger.Props;
9
- declare const NavigationMenu: React$1.ForwardRefExoticComponent<Omit<_$_base_ui_react0.NavigationMenuRootProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
9
+ declare const NavigationMenu: <Value = any>(props: NavigationMenu$1.Root.Props<Value>) => React$1.JSX.Element;
10
10
  declare const NavigationMenuList: React$1.ForwardRefExoticComponent<Omit<_$_base_ui_react0.NavigationMenuListProps, "ref"> & React$1.RefAttributes<HTMLUListElement>>;
11
11
  declare function NavigationMenuItem({
12
12
  className,
@@ -4,7 +4,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
4
4
 
5
5
  //#region src/layouts/home/slots/header.d.ts
6
6
  declare const navItemVariants: (props?: ({
7
- variant?: "icon" | "main" | "button" | null | undefined;
7
+ variant?: "button" | "main" | "icon" | null | undefined;
8
8
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
9
9
  declare function Header(props: ComponentProps<'header'>): _$react_jsx_runtime0.JSX.Element;
10
10
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { SearchProviderProps } from "../contexts/search.js";
2
2
  import { DefaultSearchDialogProps } from "../components/dialog/search-default.js";
3
3
  import { I18nProviderProps } from "../contexts/i18n.js";
4
- import { ComponentPropsWithoutRef, ReactNode } from "react";
4
+ import { ReactNode } from "react";
5
5
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
6
- import { ThemeProvider } from "next-themes";
6
+ import { ThemeProviderProps, UseThemeProps, useTheme } from "next-themes";
7
7
 
8
8
  //#region src/provider/base.d.ts
9
9
  interface SearchOptions extends Omit<SearchProviderProps, 'children'> {
@@ -15,6 +15,14 @@ interface SearchOptions extends Omit<SearchProviderProps, 'children'> {
15
15
  */
16
16
  enabled?: boolean;
17
17
  }
18
+ interface ThemeOptions extends ThemeProviderProps {
19
+ /**
20
+ * Enable `next-themes`
21
+ *
22
+ * @defaultValue true
23
+ */
24
+ enabled?: boolean;
25
+ }
18
26
  interface RootProviderProps {
19
27
  /**
20
28
  * `dir` option for Base UI
@@ -25,16 +33,9 @@ interface RootProviderProps {
25
33
  */
26
34
  search?: Partial<SearchOptions>;
27
35
  /**
28
- * Customise options of `next-themes`
36
+ * Customise options for `next-themes`
29
37
  */
30
- theme?: Partial<ComponentPropsWithoutRef<typeof ThemeProvider>> & {
31
- /**
32
- * Enable `next-themes`
33
- *
34
- * @defaultValue true
35
- */
36
- enabled?: boolean;
37
- };
38
+ theme?: ThemeOptions;
38
39
  i18n?: Omit<I18nProviderProps, 'children'>;
39
40
  children?: ReactNode;
40
41
  }
@@ -46,4 +47,4 @@ declare function RootProvider({
46
47
  i18n
47
48
  }: RootProviderProps): _$react_jsx_runtime0.JSX.Element;
48
49
  //#endregion
49
- export { RootProvider, RootProviderProps };
50
+ export { RootProvider, RootProviderProps, type UseThemeProps, useTheme };
@@ -3,7 +3,7 @@ import { I18nProvider } from "../contexts/i18n.js";
3
3
  import { SearchProvider } from "../contexts/search.js";
4
4
  import { lazy } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
- import { ThemeProvider } from "next-themes";
6
+ import { ThemeProvider, useTheme } from "next-themes";
7
7
  import { DirectionProvider } from "@base-ui/react/direction-provider";
8
8
  //#region src/provider/base.tsx
9
9
  const DefaultSearchDialog = lazy(() => import("../components/dialog/search-default.js"));
@@ -32,4 +32,4 @@ function RootProvider({ children, dir = "ltr", theme = {}, search, i18n }) {
32
32
  });
33
33
  }
34
34
  //#endregion
35
- export { RootProvider };
35
+ export { RootProvider, useTheme };
package/dist/style.css CHANGED
@@ -358,9 +358,6 @@
358
358
  .top-\[calc\(--spacing\(4\)\+var\(--fd-docs-row-3\)\)\] {
359
359
  top: calc(calc(var(--spacing) * 4) + var(--fd-docs-row-3));
360
360
  }
361
- .top-\[calc\(50\%-var\(--t\,0px\)\+var\(--b\,0px\)\)\] {
362
- top: calc(50% - var(--t,0px) + var(--b,0px));
363
- }
364
361
  .right-2 {
365
362
  right: calc(var(--spacing) * 2);
366
363
  }
@@ -920,6 +917,9 @@
920
917
  .hidden {
921
918
  display: none;
922
919
  }
920
+ .inline {
921
+ display: inline;
922
+ }
923
923
  .inline-flex {
924
924
  display: inline-flex;
925
925
  }
@@ -1675,6 +1675,9 @@
1675
1675
  .pr-\(--removed-body-scroll-bar-size\,0\) {
1676
1676
  padding-right: var(--removed-body-scroll-bar-size,0);
1677
1677
  }
1678
+ .pb-0 {
1679
+ padding-bottom: calc(var(--spacing) * 0);
1680
+ }
1678
1681
  .pb-1\.5 {
1679
1682
  padding-bottom: calc(var(--spacing) * 1.5);
1680
1683
  }
@@ -1814,6 +1817,9 @@
1814
1817
  .underline {
1815
1818
  text-decoration-line: underline;
1816
1819
  }
1820
+ .opacity-\(--opacity\,0\) {
1821
+ opacity: var(--opacity,0);
1822
+ }
1817
1823
  .opacity-0 {
1818
1824
  opacity: 0%;
1819
1825
  }
@@ -1885,8 +1891,8 @@
1885
1891
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1886
1892
  transition-duration: var(--tw-duration, var(--default-transition-duration));
1887
1893
  }
1888
- .transition-\[offset-distance\] {
1889
- transition-property: offset-distance;
1894
+ .transition-\[opacity\,offset-distance\] {
1895
+ transition-property: opacity,offset-distance;
1890
1896
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1891
1897
  transition-duration: var(--tw-duration, var(--default-transition-duration));
1892
1898
  }
@@ -2004,6 +2010,9 @@
2004
2010
  .\[grid-area\:toc\] {
2005
2011
  grid-area: toc;
2006
2012
  }
2013
+ .\[offset-distance\:var\(--offset-distance\,0\)\] {
2014
+ offset-distance: var(--offset-distance,0);
2015
+ }
2007
2016
  .\[scrollbar-width\:none\] {
2008
2017
  scrollbar-width: none;
2009
2018
  }
@@ -2078,16 +2087,6 @@
2078
2087
  margin-bottom: calc(var(--spacing) * 2);
2079
2088
  }
2080
2089
  }
2081
- .group-first\:\[--t\:--spacing\(0\.75\)\] {
2082
- &:is(:where(.group):first-child *) {
2083
- --t: calc(var(--spacing) * 0.75);
2084
- }
2085
- }
2086
- .group-last\:\[--b\:--spacing\(0\.75\)\] {
2087
- &:is(:where(.group):last-child *) {
2088
- --b: calc(var(--spacing) * 0.75);
2089
- }
2090
- }
2091
2090
  .group-data-active\:bg-fd-primary {
2092
2091
  &:is(:where(.group)[data-active] *) {
2093
2092
  background-color: var(--color-fd-primary);
@@ -3237,6 +3236,14 @@
3237
3236
  font-style: var(--shiki-dark-font-style);
3238
3237
  }
3239
3238
  }
3239
+ code.shiki span {
3240
+ color: var(--shiki-light);
3241
+ font-style: var(--shiki-light-font-style);
3242
+ }
3243
+ .dark code.shiki span {
3244
+ color: var(--shiki-dark);
3245
+ font-style: var(--shiki-dark-font-style);
3246
+ }
3240
3247
  @layer base {
3241
3248
  body {
3242
3249
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fumadocs/base-ui",
3
- "version": "16.7.14",
3
+ "version": "16.7.16",
4
4
  "description": "The Base UI version of Fumadocs UI",
5
5
  "keywords": [
6
6
  "Docs",
@@ -116,7 +116,7 @@
116
116
  "access": "public"
117
117
  },
118
118
  "dependencies": {
119
- "@base-ui/react": "^1.3.0",
119
+ "@base-ui/react": "^1.4.0",
120
120
  "class-variance-authority": "^0.7.1",
121
121
  "lucide-react": "^1.8.0",
122
122
  "motion": "^12.38.0",
@@ -124,13 +124,14 @@
124
124
  "react-remove-scroll": "^2.7.2",
125
125
  "rehype-raw": "^7.0.0",
126
126
  "scroll-into-view-if-needed": "^3.1.0",
127
+ "shiki": "^4.0.2",
127
128
  "tailwind-merge": "^3.5.0",
128
129
  "unist-util-visit": "^5.1.0",
129
130
  "@fumadocs/tailwind": "0.0.5"
130
131
  },
131
132
  "devDependencies": {
132
133
  "@tailwindcss/cli": "^4.2.2",
133
- "@tsdown/css": "^0.21.6",
134
+ "@tsdown/css": "^0.21.8",
134
135
  "@types/hast": "^3.0.4",
135
136
  "@types/mdx": "^2.0.13",
136
137
  "@types/node": "^25.6.0",
@@ -138,12 +139,11 @@
138
139
  "@types/react-dom": "^19.2.3",
139
140
  "fuma-cli": "^0.0.5",
140
141
  "react-medium-image-zoom": "^5.4.3",
141
- "shiki": "^4.0.2",
142
142
  "tailwindcss": "^4.2.2",
143
- "tsdown": "0.21.7",
143
+ "tsdown": "0.21.8",
144
144
  "unified": "^11.0.5",
145
145
  "@fumadocs/cli": "1.3.7",
146
- "fumadocs-core": "16.7.14",
146
+ "fumadocs-core": "16.7.16",
147
147
  "tsconfig": "0.0.0"
148
148
  },
149
149
  "peerDependencies": {
@@ -153,13 +153,9 @@
153
153
  "next": "16.x.x",
154
154
  "react": "^19.2.0",
155
155
  "react-dom": "^19.2.0",
156
- "shiki": "*",
157
- "fumadocs-core": "16.7.14"
156
+ "fumadocs-core": "16.7.16"
158
157
  },
159
158
  "peerDependenciesMeta": {
160
- "shiki": {
161
- "optional": true
162
- },
163
159
  "next": {
164
160
  "optional": true
165
161
  },