@fumadocs/base-ui 16.7.5 → 16.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,6 +42,7 @@
42
42
  @source inline("after");
43
43
  @source inline("all");
44
44
  @source inline("always");
45
+ @source inline("an");
45
46
  @source inline("and");
46
47
  @source inline("aria-label");
47
48
  @source inline("aria-valuemax");
@@ -50,6 +51,7 @@
50
51
  @source inline("article");
51
52
  @source inline("as");
52
53
  @source inline("aside");
54
+ @source inline("attribute");
53
55
  @source inline("auto");
54
56
  @source inline("available");
55
57
  @source inline("backdrop-blur-sm");
@@ -107,6 +109,7 @@
107
109
  @source inline("cva");
108
110
  @source inline("cx");
109
111
  @source inline("cy");
112
+ @source inline("data");
110
113
  @source inline("data-[active=true]:before:absolute");
111
114
  @source inline("data-[active=true]:before:bg-fd-primary");
112
115
  @source inline("data-[active=true]:before:content-['']");
@@ -116,6 +119,7 @@
116
119
  @source inline("data-[active=true]:bg-fd-primary/10");
117
120
  @source inline("data-[active=true]:hover:transition-colors");
118
121
  @source inline("data-[active=true]:text-fd-primary");
122
+ @source inline("data-[column-changed=true]:transition-[grid-template-columns]");
119
123
  @source inline("data-[state=closed]:animate-fd-fade-out");
120
124
  @source inline("data-[state=closed]:animate-fd-sidebar-out");
121
125
  @source inline("data-[state=open]:animate-fd-fade-in");
@@ -124,6 +128,7 @@
124
128
  @source inline("data-[state=open]:text-fd-accent-foreground");
125
129
  @source inline("data-[transparent=false]:bg-fd-background/80");
126
130
  @source inline("data-collapsed");
131
+ @source inline("data-column-changed");
127
132
  @source inline("data-full");
128
133
  @source inline("data-hovered");
129
134
  @source inline("data-sidebar-collapsed");
@@ -223,9 +228,11 @@
223
228
  @source inline("inset-y-0");
224
229
  @source inline("inset-y-2");
225
230
  @source inline("instanceof");
231
+ @source inline("instant");
226
232
  @source inline("interface");
227
233
  @source inline("invisible");
228
234
  @source inline("isActive");
235
+ @source inline("isCollapseChanged");
229
236
  @source inline("isNavTransparent");
230
237
  @source inline("isTop");
231
238
  @source inline("item");
@@ -303,6 +310,7 @@
303
310
  @source inline("onClickItem");
304
311
  @source inline("onClickOutside");
305
312
  @source inline("onOpenChange");
313
+ @source inline("only");
306
314
  @source inline("opacity-0");
307
315
  @source inline("open");
308
316
  @source inline("option");
@@ -328,6 +336,7 @@
328
336
  @source inline("popover");
329
337
  @source inline("prefetch");
330
338
  @source inline("previous");
339
+ @source inline("previousCollapsed");
331
340
  @source inline("previousPage");
332
341
  @source inline("progress");
333
342
  @source inline("progressbar");
@@ -367,8 +376,10 @@
367
376
  @source inline("secondary");
368
377
  @source inline("selected");
369
378
  @source inline("selectedIdx");
379
+ @source inline("set");
370
380
  @source inline("setDate");
371
381
  @source inline("setOpen");
382
+ @source inline("setPreviousCollapsed");
372
383
  @source inline("shadow-lg");
373
384
  @source inline("showItem");
374
385
  @source inline("shrink-0");
@@ -434,7 +445,6 @@
434
445
  @source inline("top-(--fd-docs-row-2)");
435
446
  @source inline("top-[calc(--spacing(4)+var(--fd-docs-row-3))]");
436
447
  @source inline("transform");
437
- @source inline("transition-[grid-template-columns]");
438
448
  @source inline("transition-[opacity,translate,color]");
439
449
  @source inline("transition-[opacity,translate]");
440
450
  @source inline("transition-[width,inset-block,translate,background-color]");
@@ -481,6 +491,7 @@
481
491
  @source inline("w-4");
482
492
  @source inline("w-[85%]");
483
493
  @source inline("w-full");
494
+ @source inline("will");
484
495
  @source inline("wrap-anywhere");
485
496
  @source inline("xl:hidden");
486
497
  @source inline("xl:layout:[--fd-toc-width:268px]");
@@ -46,6 +46,7 @@
46
46
  @source inline("after");
47
47
  @source inline("all");
48
48
  @source inline("always");
49
+ @source inline("an");
49
50
  @source inline("and");
50
51
  @source inline("aria-label");
51
52
  @source inline("aria-valuemax");
@@ -54,6 +55,7 @@
54
55
  @source inline("article");
55
56
  @source inline("as");
56
57
  @source inline("aside");
58
+ @source inline("attribute");
57
59
  @source inline("auto");
58
60
  @source inline("auto-cols-auto");
59
61
  @source inline("auto-rows-auto");
@@ -115,6 +117,7 @@
115
117
  @source inline("cva");
116
118
  @source inline("cx");
117
119
  @source inline("cy");
120
+ @source inline("data");
118
121
  @source inline("data-[active=true]:before:absolute");
119
122
  @source inline("data-[active=true]:before:bg-fd-primary");
120
123
  @source inline("data-[active=true]:before:content-['']");
@@ -125,6 +128,7 @@
125
128
  @source inline("data-[active=true]:hover:transition-colors");
126
129
  @source inline("data-[active=true]:text-fd-primary");
127
130
  @source inline("data-[collapsed=false]:hidden");
131
+ @source inline("data-[column-changed=true]:transition-[grid-template-columns]");
128
132
  @source inline("data-[state=closed]:animate-fd-fade-out");
129
133
  @source inline("data-[state=closed]:animate-fd-sidebar-out");
130
134
  @source inline("data-[state=open]:animate-fd-fade-in");
@@ -133,6 +137,7 @@
133
137
  @source inline("data-[state=open]:text-fd-accent-foreground");
134
138
  @source inline("data-[transparent=false]:bg-fd-background/80");
135
139
  @source inline("data-collapsed");
140
+ @source inline("data-column-changed");
136
141
  @source inline("data-full");
137
142
  @source inline("data-header-body");
138
143
  @source inline("data-header-tabs");
@@ -240,9 +245,11 @@
240
245
  @source inline("inset-y-0");
241
246
  @source inline("inset-y-2");
242
247
  @source inline("instanceof");
248
+ @source inline("instant");
243
249
  @source inline("interface");
244
250
  @source inline("invisible");
245
251
  @source inline("isActive");
252
+ @source inline("isCollapseChanged");
246
253
  @source inline("isLayoutTabActive");
247
254
  @source inline("isNavTransparent");
248
255
  @source inline("isSelected");
@@ -336,6 +343,7 @@
336
343
  @source inline("onOpenChange");
337
344
  @source inline("onPointerEnter");
338
345
  @source inline("onPointerLeave");
346
+ @source inline("only");
339
347
  @source inline("ontouchstart");
340
348
  @source inline("opacity-0");
341
349
  @source inline("open");
@@ -362,6 +370,7 @@
362
370
  @source inline("popover");
363
371
  @source inline("prefetch");
364
372
  @source inline("previous");
373
+ @source inline("previousCollapsed");
365
374
  @source inline("previousPage");
366
375
  @source inline("progress");
367
376
  @source inline("progressbar");
@@ -403,8 +412,10 @@
403
412
  @source inline("secondary");
404
413
  @source inline("selected");
405
414
  @source inline("selectedIdx");
415
+ @source inline("set");
406
416
  @source inline("setDate");
407
417
  @source inline("setOpen");
418
+ @source inline("setPreviousCollapsed");
408
419
  @source inline("shadow-lg");
409
420
  @source inline("showItem");
410
421
  @source inline("showLayoutTabs");
@@ -472,7 +483,6 @@
472
483
  @source inline("top-(--fd-docs-row-3)");
473
484
  @source inline("touch");
474
485
  @source inline("transform");
475
- @source inline("transition-[grid-template-columns]");
476
486
  @source inline("transition-[opacity,translate,color]");
477
487
  @source inline("transition-[opacity,translate]");
478
488
  @source inline("transition-[width,inset-block,translate,background-color]");
@@ -517,6 +527,7 @@
517
527
  @source inline("w-4");
518
528
  @source inline("w-[85%]");
519
529
  @source inline("w-full");
530
+ @source inline("will");
520
531
  @source inline("window");
521
532
  @source inline("wrap-anywhere");
522
533
  @source inline("xl:hidden");
@@ -15,6 +15,7 @@
15
15
  @source inline("--anchor-width");
16
16
  @source inline("--available-height");
17
17
  @source inline("--available-width");
18
+ @source inline("--b");
18
19
  @source inline("--callout-color");
19
20
  @source inline("--collapsible-panel-height");
20
21
  @source inline("--color-fd-");
@@ -32,15 +33,20 @@
32
33
  @source inline("--shiki-dark-bg");
33
34
  @source inline("--shiki-light-bg");
34
35
  @source inline("--spacing");
36
+ @source inline("--t");
35
37
  @source inline("--transform-origin");
38
+ @source inline("-circle");
36
39
  @source inline("-mb-px");
37
40
  @source inline("-me-0.5");
38
41
  @source inline("-me-2");
39
42
  @source inline("-mx-px");
40
43
  @source inline("-rotate-90");
44
+ @source inline("-text");
41
45
  @source inline("-top-1.5");
46
+ @source inline("-translate-1/2");
42
47
  @source inline("-translate-x-1/2");
43
48
  @source inline("-translate-y-1/2");
49
+ @source inline("-z-1");
44
50
  @source inline("@container");
45
51
  @source inline("@defaultValue");
46
52
  @source inline("@deprecated");
@@ -74,6 +80,7 @@
74
80
  @source inline("algolia");
75
81
  @source inline("align");
76
82
  @source inline("alignItems");
83
+ @source inline("alignmentBaseline");
77
84
  @source inline("all");
78
85
  @source inline("allowClear");
79
86
  @source inline("allowCopy");
@@ -100,7 +107,6 @@
100
107
  @source inline("at");
101
108
  @source inline("attribute");
102
109
  @source inline("await");
103
- @source inline("b0");
104
110
  @source inline("backdrop-blur-lg");
105
111
  @source inline("backdrop-blur-md");
106
112
  @source inline("backdrop-blur-xs");
@@ -167,6 +173,7 @@
167
173
  @source inline("can");
168
174
  @source inline("case");
169
175
  @source inline("center");
176
+ @source inline("central");
170
177
  @source inline("change");
171
178
  @source inline("changeLayout");
172
179
  @source inline("changes");
@@ -225,6 +232,8 @@
225
232
  @source inline("custom");
226
233
  @source inline("customise");
227
234
  @source inline("cva");
235
+ @source inline("cx");
236
+ @source inline("cy");
228
237
  @source inline("d");
229
238
  @source inline("dangerouslySetInnerHTML");
230
239
  @source inline("dark");
@@ -335,6 +344,7 @@
335
344
  @source inline("divide-x");
336
345
  @source inline("divide-y");
337
346
  @source inline("documented");
347
+ @source inline("dominantBaseline");
338
348
  @source inline("don");
339
349
  @source inline("drawer");
340
350
  @source inline("duration-(--duration)");
@@ -352,7 +362,6 @@
352
362
  @source inline("en");
353
363
  @source inline("enableSystem");
354
364
  @source inline("enabled");
355
- @source inline("end");
356
365
  @source inline("end-2");
357
366
  @source inline("endIdx");
358
367
  @source inline("endpoint");
@@ -381,6 +390,8 @@
381
390
  @source inline("file");
382
391
  @source inline("fill");
383
392
  @source inline("fill-(--callout-color)");
393
+ @source inline("fill-fd-primary");
394
+ @source inline("fill-fd-primary-foreground");
384
395
  @source inline("filter");
385
396
  @source inline("filters");
386
397
  @source inline("finally");
@@ -450,6 +461,8 @@
450
461
  @source inline("group-data-[open]:rotate-180");
451
462
  @source inline("group-data-[panel-open]:rotate-90");
452
463
  @source inline("group-data-active:bg-fd-primary");
464
+ @source inline("group-first:[--t:--spacing(0.75)]");
465
+ @source inline("group-last:[--b:--spacing(0.75)]");
453
466
  @source inline("groupListeners");
454
467
  @source inline("guides");
455
468
  @source inline("h");
@@ -533,8 +546,8 @@
533
546
  @source inline("isActive");
534
547
  @source inline("isLoading");
535
548
  @source inline("isOpen");
536
- @source inline("isStart");
537
549
  @source inline("isTabActive");
550
+ @source inline("isUp");
538
551
  @source inline("isWindows");
539
552
  @source inline("it");
540
553
  @source inline("item");
@@ -557,7 +570,6 @@
557
570
  @source inline("languages");
558
571
  @source inline("last:pb-0");
559
572
  @source inline("last:rounded-b-xl");
560
- @source inline("lastInactiveIdx");
561
573
  @source inline("lastUpdate");
562
574
  @source inline("layer");
563
575
  @source inline("layout");
@@ -636,6 +648,7 @@
636
648
  @source inline("mergeRefs");
637
649
  @source inline("message");
638
650
  @source inline("metaKey");
651
+ @source inline("middle");
639
652
  @source inline("min-h-0");
640
653
  @source inline("min-w-0");
641
654
  @source inline("min-w-[240px]");
@@ -760,7 +773,6 @@
760
773
  @source inline("p-2");
761
774
  @source inline("p-3");
762
775
  @source inline("p-4");
763
- @source inline("pOffset");
764
776
  @source inline("padding");
765
777
  @source inline("paddingInlineStart");
766
778
  @source inline("page");
@@ -795,6 +807,7 @@
795
807
  @source inline("prev");
796
808
  @source inline("previous");
797
809
  @source inline("previousPage");
810
+ @source inline("previousRef");
798
811
  @source inline("primary");
799
812
  @source inline("primaryColor");
800
813
  @source inline("primaryTextColor");
@@ -895,6 +908,7 @@
895
908
  @source inline("rtl:rotate-180");
896
909
  @source inline("rtl:rotate-90");
897
910
  @source inline("s");
911
+ @source inline("scale");
898
912
  @source inline("scope");
899
913
  @source inline("scroll");
900
914
  @source inline("scroll-into-view-if-needed");
@@ -1032,6 +1046,7 @@
1032
1046
  @source inline("text-start");
1033
1047
  @source inline("text-xs");
1034
1048
  @source inline("text/plain");
1049
+ @source inline("textAnchor");
1035
1050
  @source inline("textContent");
1036
1051
  @source inline("that");
1037
1052
  @source inline("the");
@@ -1059,6 +1074,7 @@
1059
1074
  @source inline("top-2");
1060
1075
  @source inline("top-2.5");
1061
1076
  @source inline("top-4");
1077
+ @source inline("top-[calc(50%-var(--t,0px)+var(--b,0px))]");
1062
1078
  @source inline("touch");
1063
1079
  @source inline("transform");
1064
1080
  @source inline("transition-[clip-path]");
@@ -1096,7 +1112,9 @@
1096
1112
  @source inline("updated");
1097
1113
  @source inline("updates");
1098
1114
  @source inline("upper");
1115
+ @source inline("upperBottom");
1099
1116
  @source inline("upperOffset");
1117
+ @source inline("upperX");
1100
1118
  @source inline("url");
1101
1119
  @source inline("urlOrPath");
1102
1120
  @source inline("urls");
@@ -1173,8 +1191,8 @@
1173
1191
  @source inline("wrapElement");
1174
1192
  @source inline("wrapInSuspense");
1175
1193
  @source inline("wrapped");
1194
+ @source inline("x");
1176
1195
  @source inline("xmlns");
1177
- @source inline("y");
1178
1196
  @source inline("you");
1179
1197
  @source inline("your");
1180
1198
  @source inline("z-2");
package/css/lib/shiki.css CHANGED
@@ -54,7 +54,6 @@
54
54
 
55
55
  .highlighted {
56
56
  --fd-counter-color: var(--color-fd-primary);
57
- padding-left: calc(var(--padding-left) - 2px);
58
57
  @apply bg-fd-primary/10;
59
58
  }
60
59
 
@@ -22,25 +22,46 @@ function TOCItems({ ref, className, ...props }) {
22
22
  if (!container || container.clientHeight === 0) return;
23
23
  let w = 0;
24
24
  let h = 0;
25
- let b0 = 0;
25
+ let upperBottom = 0;
26
+ let upperX = 0;
26
27
  let d = "";
28
+ const output = [];
27
29
  for (let i = 0; i < items.length; i++) {
28
- const element = container.querySelector(`a[href="#${items[i].url.slice(1)}"]`);
30
+ const item = items[i];
31
+ const element = container.querySelector(`a[href="#${item.url.slice(1)}"]`);
29
32
  if (!element) continue;
30
33
  const styles = getComputedStyle(element);
31
- const offset = getLineOffset(items[i].depth) + 1, top = element.offsetTop + parseFloat(styles.paddingTop), bottom = element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom);
32
- w = Math.max(offset, w);
34
+ const x = getLineOffset(item.depth) + .5, top = element.offsetTop + parseFloat(styles.paddingTop), bottom = element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom);
35
+ w = Math.max(x + 8, w);
33
36
  h = Math.max(h, bottom);
34
- if (i === 0) d += ` M${offset} ${top} L${offset} ${bottom}`;
35
- else {
36
- const pOffset = getLineOffset(items[i - 1].depth) + 1;
37
- d += ` C ${pOffset} ${top - 4} ${offset} ${b0 + 4} ${offset} ${top} L${offset} ${bottom}`;
38
- }
39
- b0 = bottom;
37
+ if (i === 0) d += ` M${x} ${top} L${x} ${bottom}`;
38
+ else d += ` C ${upperX} ${top - 4} ${x} ${upperBottom + 4} ${x} ${top} L${x} ${bottom}`;
39
+ if (item._step !== void 0) output.push(/* @__PURE__ */ jsx("circle", {
40
+ cx: x,
41
+ cy: (top + bottom) / 2,
42
+ r: "8",
43
+ className: "fill-fd-primary"
44
+ }, `${i}-circle`), /* @__PURE__ */ jsx("text", {
45
+ x,
46
+ y: (top + bottom) / 2,
47
+ textAnchor: "middle",
48
+ alignmentBaseline: "central",
49
+ dominantBaseline: "middle",
50
+ className: "fill-fd-primary-foreground font-medium text-xs leading-none font-mono",
51
+ children: item._step
52
+ }, `${i}-text`));
53
+ upperX = x;
54
+ upperBottom = bottom;
40
55
  }
41
- setSvg({
56
+ output.unshift(/* @__PURE__ */ jsx("path", {
42
57
  d,
43
- width: w + 1,
58
+ className: "stroke-fd-primary",
59
+ strokeWidth: "1",
60
+ fill: "none"
61
+ }, "path"));
62
+ setSvg({
63
+ content: output,
64
+ width: w,
44
65
  height: h
45
66
  });
46
67
  });
@@ -69,12 +90,7 @@ function TOCItems({ ref, className, ...props }) {
69
90
  height: svg.height,
70
91
  clipPath: `polygon(0 var(--fd-top), 100% var(--fd-top), 100% calc(var(--fd-top) + var(--fd-height)), 0 calc(var(--fd-top) + var(--fd-height)))`
71
92
  },
72
- children: /* @__PURE__ */ jsx("path", {
73
- d: svg.d,
74
- className: "stroke-fd-primary",
75
- strokeWidth: "1",
76
- fill: "none"
77
- })
93
+ children: svg.content
78
94
  }), /* @__PURE__ */ jsx(ThumbBox, {})]
79
95
  }), /* @__PURE__ */ jsx("div", {
80
96
  ref: mergeRefs(containerRef, ref),
@@ -91,32 +107,39 @@ function TOCEmpty() {
91
107
  }
92
108
  function ThumbBox() {
93
109
  const items = Primitive.useItems();
94
- let startIdx = -1;
95
- let endIdx = -1;
96
- let lastInactiveIdx = -1;
97
- for (let i = 0; i < items.length; i++) {
98
- const item = items[i];
99
- if (item.active) {
100
- if (startIdx === -1) startIdx = i;
101
- endIdx = i;
102
- } else if (lastInactiveIdx === -1 || items[lastInactiveIdx].t < item.t) lastInactiveIdx = i;
103
- }
110
+ const previousRef = useRef(null);
111
+ const startIdx = items.findIndex((item) => item.active);
112
+ const endIdx = items.findLastIndex((item) => item.active);
104
113
  if (startIdx === -1) return;
105
- const isStart = endIdx < lastInactiveIdx;
114
+ let isUp = false;
115
+ if (previousRef.current) {
116
+ const prev = previousRef.current;
117
+ isUp = prev.startIdx > startIdx || prev.endIdx > endIdx || prev.startIdx === startIdx && prev.endIdx === endIdx && prev.isUp;
118
+ }
119
+ previousRef.current = {
120
+ startIdx,
121
+ endIdx,
122
+ isUp
123
+ };
124
+ const original = items[isUp ? startIdx : endIdx].original;
106
125
  return /* @__PURE__ */ jsx("div", {
107
126
  className: "absolute size-1 bg-fd-primary rounded-full transition-transform",
108
- style: { translate: `calc(${getLineOffset(items[isStart ? startIdx : endIdx].original.depth)}px - 1.25px) ${isStart ? "var(--fd-top)" : "calc(var(--fd-top) + var(--fd-height))"}` }
127
+ style: {
128
+ translate: `${getLineOffset(original.depth) - 1.5}px calc(${isUp ? "var(--fd-top)" : "var(--fd-top) + var(--fd-height)"} - 1.5px)`,
129
+ scale: original._step !== void 0 ? "0" : "1"
130
+ }
109
131
  });
110
132
  }
133
+ const a = 8;
111
134
  function getItemOffset(depth) {
112
- if (depth <= 2) return 14;
113
- if (depth === 3) return 26;
114
- return 36;
135
+ if (depth <= 2) return 12 + a;
136
+ if (depth === 3) return 24 + a;
137
+ return 36 + a;
115
138
  }
116
139
  function getLineOffset(depth) {
117
- if (depth <= 2) return 2;
118
- if (depth === 3) return 10;
119
- return 20;
140
+ if (depth <= 2) return a;
141
+ if (depth === 3) return 8 + a;
142
+ return 16 + a;
120
143
  }
121
144
  function TOCItem({ item, ...props }) {
122
145
  const items = useTOCItems();
@@ -132,7 +155,7 @@ function TOCItem({ item, ...props }) {
132
155
  return /* @__PURE__ */ jsxs(Primitive.TOCItem, {
133
156
  href: item.url,
134
157
  ...props,
135
- 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 first:pt-0 last:pb-0 data-[active=true]:text-fd-primary", props.className),
158
+ 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),
136
159
  style: {
137
160
  paddingInlineStart: getItemOffset(item.depth),
138
161
  ...props.style
@@ -141,7 +164,7 @@ function TOCItem({ item, ...props }) {
141
164
  offset !== upperOffset && /* @__PURE__ */ jsx("svg", {
142
165
  xmlns: "http://www.w3.org/2000/svg",
143
166
  viewBox: `${Math.min(offset, upperOffset)} 0 ${Math.abs(upperOffset - offset)} 12`,
144
- className: "absolute -top-1.5",
167
+ className: "absolute -top-1.5 -z-1",
145
168
  style: {
146
169
  width: Math.abs(upperOffset - offset) + 1,
147
170
  height: 12,
@@ -156,9 +179,14 @@ function TOCItem({ item, ...props }) {
156
179
  })
157
180
  }),
158
181
  /* @__PURE__ */ jsx("div", {
159
- className: cn("absolute inset-y-0 w-px bg-fd-foreground/10", offset !== upperOffset && "top-1.5", offset !== lowerOffset && "bottom-1.5"),
182
+ className: cn("absolute inset-y-0 w-px bg-fd-foreground/10 -z-1", offset !== upperOffset && "top-1.5", offset !== lowerOffset && "bottom-1.5"),
160
183
  style: { insetInlineStart: offset }
161
184
  }),
185
+ item._step !== void 0 && /* @__PURE__ */ jsx("div", {
186
+ 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)]",
187
+ style: { insetInlineStart: offset },
188
+ children: item._step
189
+ }),
162
190
  item.title
163
191
  ]
164
192
  });
@@ -18,11 +18,9 @@ declare function TOCScrollArea({
18
18
  }: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
19
19
  interface TocThumbProps extends ComponentProps<'div'> {
20
20
  containerRef: RefObject<HTMLElement | null>;
21
- align?: 'center' | 'end';
22
21
  }
23
22
  declare function TocThumb({
24
23
  containerRef,
25
- align,
26
24
  ...props
27
25
  }: TocThumbProps): react_jsx_runtime0.JSX.Element;
28
26
  //#endregion
@@ -43,7 +43,7 @@ function TOCScrollArea({ ref, className, ...props }) {
43
43
  })
44
44
  });
45
45
  }
46
- function TocThumb({ containerRef, align = "end", ...props }) {
46
+ function TocThumb({ containerRef, ...props }) {
47
47
  const thumbRef = useRef(null);
48
48
  const active = useActiveAnchors();
49
49
  function update(info) {
@@ -65,15 +65,9 @@ function TocThumb({ containerRef, align = "end", ...props }) {
65
65
  for (const item of active) {
66
66
  const element = container.querySelector(`a[href="#${item}"]`);
67
67
  if (!element) continue;
68
- if (align === "center") {
69
- const y = element.offsetTop + element.clientHeight / 2;
70
- upper = Math.min(upper, y);
71
- lower = Math.max(lower, y);
72
- } else {
73
- const styles = getComputedStyle(element);
74
- upper = Math.min(upper, element.offsetTop + parseFloat(styles.paddingTop));
75
- lower = Math.max(lower, element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom));
76
- }
68
+ const styles = getComputedStyle(element);
69
+ upper = Math.min(upper, element.offsetTop + parseFloat(styles.paddingTop));
70
+ lower = Math.max(lower, element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom));
77
71
  }
78
72
  return {
79
73
  top: upper,
@@ -3,6 +3,7 @@ import { LayoutTab, LinkItemType } from "../shared/index.js";
3
3
  import { SidebarProps, SidebarProviderProps } from "./slots/sidebar.js";
4
4
  import { DocsLayoutProps } from "./index.js";
5
5
  import { ComponentProps, FC } from "react";
6
+
6
7
  //#region src/layouts/docs/client.d.ts
7
8
  interface DocsSlots extends BaseSlots {
8
9
  container: FC<ComponentProps<'div'>>;
@@ -2,14 +2,21 @@
2
2
  import { cn } from "../../../utils/cn.js";
3
3
  import { useDocsLayout } from "../client.js";
4
4
  import "../index.js";
5
+ import { useEffect, useState } from "react";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  //#region src/layouts/docs/slots/container.tsx
7
8
  function Container(props) {
8
9
  const { slots } = useDocsLayout();
9
10
  const { collapsed } = slots.sidebar?.useSidebar?.() ?? {};
11
+ const [previousCollapsed, setPreviousCollapsed] = useState(collapsed);
12
+ const isCollapseChanged = previousCollapsed !== collapsed;
13
+ useEffect(() => {
14
+ if (isCollapseChanged) setPreviousCollapsed(collapsed);
15
+ }, [collapsed, isCollapseChanged]);
10
16
  return /* @__PURE__ */ jsx("div", {
11
17
  id: "nd-docs-layout",
12
18
  "data-sidebar-collapsed": collapsed,
19
+ "data-column-changed": isCollapseChanged,
13
20
  ...props,
14
21
  style: {
15
22
  gridTemplate: `"sidebar sidebar header toc toc"
@@ -21,7 +28,7 @@ function Container(props) {
21
28
  "--fd-sidebar-col": collapsed ? "0px" : "var(--fd-sidebar-width)",
22
29
  ...props.style
23
30
  },
24
- className: cn("grid transition-[grid-template-columns] overflow-x-clip min-h-(--fd-docs-height) [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px]", props.className),
31
+ className: cn("grid overflow-x-clip min-h-(--fd-docs-height) [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px] data-[column-changed=true]:transition-[grid-template-columns]", props.className),
25
32
  children: props.children
26
33
  });
27
34
  }
@@ -3,6 +3,7 @@ import { LayoutTab, LinkItemType } from "../shared/index.js";
3
3
  import { SidebarProps, SidebarProviderProps } from "./slots/sidebar.js";
4
4
  import { DocsLayoutProps } from "./index.js";
5
5
  import { ComponentProps, FC } from "react";
6
+
6
7
  //#region src/layouts/notebook/client.d.ts
7
8
  interface DocsSlots extends BaseSlots {
8
9
  container: FC<ComponentProps<'div'>>;
@@ -1,15 +1,22 @@
1
1
  "use client";
2
2
  import { cn } from "../../../utils/cn.js";
3
3
  import { useNotebookLayout } from "../client.js";
4
+ import { useEffect, useState } from "react";
4
5
  import { jsx } from "react/jsx-runtime";
5
6
  //#region src/layouts/notebook/slots/container.tsx
6
7
  function Container(props) {
7
8
  const { props: { nav }, slots } = useNotebookLayout();
8
9
  const pageCol = "calc(var(--fd-layout-width,97rem) - var(--fd-sidebar-col) - var(--fd-toc-width))";
9
10
  const { collapsed } = slots.sidebar?.useSidebar?.() ?? {};
11
+ const [previousCollapsed, setPreviousCollapsed] = useState(collapsed);
12
+ const isCollapseChanged = previousCollapsed !== collapsed;
13
+ useEffect(() => {
14
+ if (isCollapseChanged) setPreviousCollapsed(collapsed);
15
+ }, [collapsed, isCollapseChanged]);
10
16
  return /* @__PURE__ */ jsx("div", {
11
17
  id: "nd-notebook-layout",
12
18
  "data-sidebar-collapsed": collapsed,
19
+ "data-column-changed": isCollapseChanged,
13
20
  ...props,
14
21
  style: {
15
22
  gridTemplate: nav?.mode === "top" ? `". header header header ."
@@ -23,7 +30,7 @@ function Container(props) {
23
30
  "--fd-sidebar-col": collapsed ? "0px" : "var(--fd-sidebar-width)",
24
31
  ...props.style
25
32
  },
26
- className: cn("grid overflow-x-clip min-h-(--fd-docs-height) transition-[grid-template-columns] auto-cols-auto auto-rows-auto [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px]", props.className),
33
+ className: cn("grid overflow-x-clip min-h-(--fd-docs-height) auto-cols-auto auto-rows-auto [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px] data-[column-changed=true]:transition-[grid-template-columns]", props.className),
27
34
  children: props.children
28
35
  });
29
36
  }
package/dist/og.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { ImageResponse } from "next/og";
2
+ import { ImageResponse } from "next/og.js";
3
3
  //#region src/og.tsx
4
4
  function generateOGImage(options) {
5
5
  const { title, description, icon, site, primaryColor, primaryTextColor, ...rest } = options;
package/dist/style.css CHANGED
@@ -316,9 +316,6 @@
316
316
  .start-6 {
317
317
  inset-inline-start: calc(var(--spacing) * 6);
318
318
  }
319
- .end {
320
- inset-inline-end: var(--spacing);
321
- }
322
319
  .end-0 {
323
320
  inset-inline-end: calc(var(--spacing) * 0);
324
321
  }
@@ -358,6 +355,9 @@
358
355
  .top-\[calc\(--spacing\(4\)\+var\(--fd-docs-row-3\)\)\] {
359
356
  top: calc(calc(var(--spacing) * 4) + var(--fd-docs-row-3));
360
357
  }
358
+ .top-\[calc\(50\%-var\(--t\,0px\)\+var\(--b\,0px\)\)\] {
359
+ top: calc(50% - var(--t,0px) + var(--b,0px));
360
+ }
361
361
  .right-2 {
362
362
  right: calc(var(--spacing) * 2);
363
363
  }
@@ -373,6 +373,9 @@
373
373
  .left-1\/2 {
374
374
  left: calc(1 / 2 * 100%);
375
375
  }
376
+ .-z-1 {
377
+ z-index: calc(1 * -1);
378
+ }
376
379
  .z-2 {
377
380
  z-index: 2;
378
381
  }
@@ -1148,6 +1151,11 @@
1148
1151
  .origin-\(--transform-origin\) {
1149
1152
  transform-origin: var(--transform-origin);
1150
1153
  }
1154
+ .-translate-1\/2 {
1155
+ --tw-translate-x: calc(calc(1 / 2 * 100%) * -1);
1156
+ --tw-translate-y: calc(calc(1 / 2 * 100%) * -1);
1157
+ translate: var(--tw-translate-x) var(--tw-translate-y);
1158
+ }
1151
1159
  .-translate-x-\(--fd-sidebar-width\) {
1152
1160
  --tw-translate-x: calc(var(--fd-sidebar-width) * -1);
1153
1161
  translate: var(--tw-translate-x) var(--tw-translate-y);
@@ -1494,6 +1502,12 @@
1494
1502
  .fill-\(--callout-color\) {
1495
1503
  fill: var(--callout-color);
1496
1504
  }
1505
+ .fill-fd-primary {
1506
+ fill: var(--color-fd-primary);
1507
+ }
1508
+ .fill-fd-primary-foreground {
1509
+ fill: var(--color-fd-primary-foreground);
1510
+ }
1497
1511
  .stroke-current\/25 {
1498
1512
  stroke: currentcolor;
1499
1513
  @supports (color: color-mix(in lab, red, red)) {
@@ -1841,11 +1855,6 @@
1841
1855
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1842
1856
  transition-duration: var(--tw-duration, var(--default-transition-duration));
1843
1857
  }
1844
- .transition-\[grid-template-columns\] {
1845
- transition-property: grid-template-columns;
1846
- transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1847
- transition-duration: var(--tw-duration, var(--default-transition-duration));
1848
- }
1849
1858
  .transition-\[height\,opacity\] {
1850
1859
  transition-property: height,opacity;
1851
1860
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
@@ -2039,6 +2048,16 @@
2039
2048
  margin-bottom: calc(var(--spacing) * 2);
2040
2049
  }
2041
2050
  }
2051
+ .group-first\:\[--t\:--spacing\(0\.75\)\] {
2052
+ &:is(:where(.group):first-child *) {
2053
+ --t: calc(var(--spacing) * 0.75);
2054
+ }
2055
+ }
2056
+ .group-last\:\[--b\:--spacing\(0\.75\)\] {
2057
+ &:is(:where(.group):last-child *) {
2058
+ --b: calc(var(--spacing) * 0.75);
2059
+ }
2060
+ }
2042
2061
  .group-data-active\:bg-fd-primary {
2043
2062
  &:is(:where(.group)[data-active] *) {
2044
2063
  background-color: var(--color-fd-primary);
@@ -2491,6 +2510,13 @@
2491
2510
  display: none;
2492
2511
  }
2493
2512
  }
2513
+ .data-\[column-changed\=true\]\:transition-\[grid-template-columns\] {
2514
+ &[data-column-changed="true"] {
2515
+ transition-property: grid-template-columns;
2516
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
2517
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
2518
+ }
2519
+ }
2494
2520
  .\*\:data-\[empty\=true\]\:border-b-0 {
2495
2521
  :is(& > *) {
2496
2522
  &[data-empty="true"] {
@@ -3101,7 +3127,6 @@
3101
3127
  }
3102
3128
  .highlighted {
3103
3129
  --fd-counter-color: var(--color-fd-primary);
3104
- padding-left: calc(var(--padding-left) - 2px);
3105
3130
  background-color: color-mix(in srgb, hsl(0, 0%, 9%) 10%, transparent);
3106
3131
  @supports (color: color-mix(in lab, red, red)) {
3107
3132
  background-color: color-mix(in oklab, var(--color-fd-primary) 10%, transparent);
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { useTreeContext } from "../contexts/tree.js";
3
3
  //#region src/utils/use-footer-items.ts
4
- const footerCache = /* @__PURE__ */ new Map();
4
+ const footerCache = /* @__PURE__ */ new WeakMap();
5
5
  /**
6
6
  * @returns a list of page tree items (linear), that you can obtain footer items
7
7
  */
8
8
  function useFooterItems() {
9
9
  const { root } = useTreeContext();
10
- const cached = footerCache.get(root.$id);
10
+ const cached = footerCache.get(root);
11
11
  if (cached) return cached;
12
12
  const list = [];
13
13
  function onNode(node) {
@@ -17,7 +17,7 @@ function useFooterItems() {
17
17
  } else if (node.type === "page" && !node.external) list.push(node);
18
18
  }
19
19
  for (const child of root.children) onNode(child);
20
- footerCache.set(root.$id, list);
20
+ footerCache.set(root, list);
21
21
  return list;
22
22
  }
23
23
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fumadocs/base-ui",
3
- "version": "16.7.5",
3
+ "version": "16.7.7",
4
4
  "description": "The Base UI version of Fumadocs UI",
5
5
  "keywords": [
6
6
  "Docs",
@@ -117,7 +117,7 @@
117
117
  "dependencies": {
118
118
  "@base-ui/react": "^1.3.0",
119
119
  "class-variance-authority": "^0.7.1",
120
- "lucide-react": "^0.577.0",
120
+ "lucide-react": "^1.6.0",
121
121
  "motion": "^12.38.0",
122
122
  "next-themes": "^0.4.6",
123
123
  "react-medium-image-zoom": "^5.4.1",
@@ -130,7 +130,7 @@
130
130
  },
131
131
  "devDependencies": {
132
132
  "@tailwindcss/cli": "^4.2.2",
133
- "@tsdown/css": "^0.21.4",
133
+ "@tsdown/css": "^0.21.5",
134
134
  "@types/hast": "^3.0.4",
135
135
  "@types/mdx": "^2.0.13",
136
136
  "@types/node": "^25.5.0",
@@ -138,11 +138,11 @@
138
138
  "@types/react-dom": "^19.2.3",
139
139
  "shiki": "^4.0.2",
140
140
  "tailwindcss": "^4.2.2",
141
- "tsdown": "0.21.4",
141
+ "tsdown": "0.21.5",
142
142
  "unified": "^11.0.5",
143
143
  "@fumadocs/cli": "1.3.2",
144
144
  "eslint-config-custom": "0.0.0",
145
- "fumadocs-core": "16.7.5",
145
+ "fumadocs-core": "16.7.7",
146
146
  "tsconfig": "0.0.0"
147
147
  },
148
148
  "peerDependencies": {
@@ -153,7 +153,7 @@
153
153
  "react": "^19.2.0",
154
154
  "react-dom": "^19.2.0",
155
155
  "shiki": "*",
156
- "fumadocs-core": "16.7.5"
156
+ "fumadocs-core": "16.7.7"
157
157
  },
158
158
  "peerDependenciesMeta": {
159
159
  "shiki": {