fumadocs-ui 15.7.0 → 15.7.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/layout/sidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,EAAE,EAEP,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AACf,OAAa,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU1D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAKrD,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AA2BD,wBAAgB,OAAO,CAAC,EACtB,gBAAoB,EACpB,QAAe,EACf,MAAM,EACN,OAAO,GACR,EAAE,YAAY,2CAed;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,2CAoE5D;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,CAAC,2CA+BzB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CASzD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CASzD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,eA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,GAAG,KAAK,EACT,EAAE,SAAS,GAAG;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,2CAiBA;AAED,wBAAgB,aAAa,CAAC,EAC5B,WAAmB,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,2CAgBA;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,uBAAuB,2CAezB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,2CAiCjD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB,2CAkClE;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAY1B;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAgBrE;AAgBD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,EAAE,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAA;KAAE,CAAC,CAAC;IAClC,MAAM,EAAE,EAAE,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAC1E,SAAS,EAAE,EAAE,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAA;KAAE,CAAC,CAAC;CAC7C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACzC,2CAuDA"}
@@ -59,7 +59,7 @@ export function SidebarContent(props) {
59
59
  '--fd-sidebar-top': `calc(var(--fd-banner-height) + var(--fd-nav-height) + var(--fd-sidebar-margin))`,
60
60
  width: collapsed
61
61
  ? 'var(--fd-sidebar-width)'
62
- : 'calc(var(--fd-sidebar-width) + var(--fd-layout-offset))',
62
+ : 'calc(var(--spacing) + var(--fd-sidebar-width) + var(--fd-layout-offset))',
63
63
  }, onPointerEnter: (e) => {
64
64
  if (!collapsed ||
65
65
  e.pointerType === 'touch' ||
@@ -123,8 +123,8 @@ export function SidebarFolderLink(props) {
123
123
  const pathname = usePathname();
124
124
  const active = props.href !== undefined && isActive(props.href, pathname, false);
125
125
  return (_jsxs(Link, { ...props, "data-active": active, className: cn(itemVariants({ active }), 'w-full', props.className), onClick: (e) => {
126
- if (e.target instanceof HTMLElement &&
127
- e.target.hasAttribute('data-icon')) {
126
+ if (e.target instanceof Element &&
127
+ e.target.matches('[data-icon], [data-icon] *')) {
128
128
  setOpen(!open);
129
129
  e.preventDefault();
130
130
  }
@@ -134,16 +134,17 @@ export function SidebarFolderLink(props) {
134
134
  }, prefetch: prefetch, children: [props.children, _jsx(ChevronDown, { "data-icon": true, className: cn('ms-auto transition-transform', !open && '-rotate-90') })] }));
135
135
  }
136
136
  export function SidebarFolderContent(props) {
137
- const ctx = useInternalContext();
138
- const level = ctx.level + 1;
139
- return (_jsxs(CollapsibleContent, { ...props, className: cn('relative', level === 2 &&
140
- "**:data-[active=true]:before:content-[''] **:data-[active=true]:before:bg-fd-primary **:data-[active=true]:before:absolute **:data-[active=true]:before:w-px **:data-[active=true]:before:inset-y-2.5 **:data-[active=true]:before:start-2.5", props.className), style: {
141
- '--sidebar-item-offset': `calc(var(--spacing) * ${level > 1 ? level * 3 : 2})`,
137
+ const { level, ...ctx } = useInternalContext();
138
+ return (_jsx(CollapsibleContent, { ...props, className: cn('relative', level === 1 && [
139
+ "before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:start-2.5",
140
+ "**:data-[active=true]:before:content-[''] **:data-[active=true]:before:bg-fd-primary **:data-[active=true]:before:absolute **:data-[active=true]:before:w-px **:data-[active=true]:before:inset-y-2.5 **:data-[active=true]:before:start-2.5",
141
+ ], props.className), style: {
142
+ '--sidebar-item-offset': `calc(var(--spacing) * ${(level + 1) * 3})`,
142
143
  ...props.style,
143
- }, children: [level === 2 && (_jsx("div", { className: "absolute w-px inset-y-1 bg-fd-border start-2.5" })), _jsx(Context.Provider, { value: useMemo(() => ({
144
- ...ctx,
145
- level,
146
- }), [ctx, level]), children: props.children })] }));
144
+ }, children: _jsx(Context.Provider, { value: useMemo(() => ({
145
+ ...ctx,
146
+ level: level + 1,
147
+ }), [ctx, level]), children: props.children }) }));
147
148
  }
148
149
  export function SidebarTrigger({ children, ...props }) {
149
150
  const { setOpen } = useSidebar();
@@ -13,12 +13,11 @@ export function Navbar(props) {
13
13
  }
14
14
  export function LayoutBody(props) {
15
15
  const { collapsed } = useSidebar();
16
- return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col pt-(--fd-nav-height) transition-[padding]', props.className), style: {
16
+ return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col pt-(--fd-nav-height) transition-[padding]', !collapsed && 'mx-(--fd-layout-offset)', props.className), style: {
17
17
  ...props.style,
18
18
  paddingInlineStart: collapsed
19
19
  ? 'min(calc(100vw - var(--fd-page-width)), var(--fd-sidebar-width))'
20
- : 'calc(var(--fd-sidebar-width) + var(--fd-layout-offset))',
21
- paddingInlineEnd: collapsed ? '0px' : 'var(--fd-layout-offset)',
20
+ : 'var(--fd-sidebar-width)',
22
21
  }, children: props.children }));
23
22
  }
24
23
  export function CollapsibleControl() {
@@ -53,7 +53,7 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { t
53
53
  color: 'ghost',
54
54
  size: 'icon-sm',
55
55
  className: 'p-2',
56
- })), children: _jsx(SidebarIcon, {}) }))] }))), _jsxs(LayoutBody, { ...props.containerProps, className: cn('xl:[--fd-toc-width:286px]', sidebarEnabled && sidebarVariables, !nav.component &&
56
+ })), children: _jsx(SidebarIcon, {}) }))] }))), _jsxs(LayoutBody, { ...props.containerProps, className: cn('md:[&_#nd-page_article]:pt-12 xl:[--fd-toc-width:286px] xl:[&_#nd-page_article]:px-8', sidebarEnabled && sidebarVariables, !nav.component &&
57
57
  nav.enabled !== false &&
58
58
  '[--fd-nav-height:56px] md:[--fd-nav-height:0px]', props.containerProps?.className), children: [sidebarEnabled && sidebar(), children] })] }) }));
59
59
  }
@@ -21,7 +21,7 @@ export function PageTOCPopoverItems({ variant = 'normal', ...props }) {
21
21
  return (_jsx(TOCScrollArea, { ...props, children: variant === 'clerk' ? _jsx(ClerkTOCItems, {}) : _jsx(TOCItems, {}) }));
22
22
  }
23
23
  export function PageArticle(props) {
24
- return (_jsx("article", { ...props, className: cn('flex min-w-0 w-full flex-col gap-4 px-4 pt-8 md:px-6 md:mx-auto 2xl:pt-12 2xl:px-12', props.className), children: props.children }));
24
+ return (_jsx("article", { ...props, className: cn('flex min-w-0 w-full flex-col gap-4 pt-8 px-4 md:px-6 md:mx-auto', props.className), children: props.children }));
25
25
  }
26
26
  export function PageRoot({ toc, children, ...props }) {
27
27
  return (_jsx(TOCProvider, { ...toc, children: _jsx("div", { id: "nd-page", ...props, className: cn('flex flex-1 w-full mx-auto max-w-(--fd-page-width) pt-(--fd-tocnav-height)', props.className), children: children }) }));
@@ -18,12 +18,11 @@ export function Navbar({ mode, ...props }) {
18
18
  }
19
19
  export function LayoutBody(props) {
20
20
  const { collapsed } = useSidebar();
21
- return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col transition-[padding] pt-(--fd-nav-height) fd-notebook-layout', props.className), style: {
21
+ return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col transition-[padding] pt-(--fd-nav-height) fd-notebook-layout', !collapsed && 'mx-(--fd-layout-offset)', props.className), style: {
22
22
  ...props.style,
23
23
  paddingInlineStart: collapsed
24
24
  ? 'min(calc(100vw - var(--fd-page-width)), var(--fd-sidebar-width))'
25
- : 'calc(var(--fd-sidebar-width) + var(--fd-layout-offset))',
26
- paddingInlineEnd: collapsed ? '0px' : 'var(--fd-layout-offset)',
25
+ : 'var(--fd-sidebar-width)',
27
26
  }, children: props.children }));
28
27
  }
29
28
  export function NavbarSidebarTrigger({ className, ...props }) {
@@ -48,5 +47,5 @@ export function LayoutTabs({ options, ...props }) {
48
47
  return (_jsx("div", { ...props, className: cn('flex flex-row items-center gap-4 overflow-auto', props.className), children: options.map((option) => (_jsx(LayoutTab, { selected: selected === option, option: option }, option.url))) }));
49
48
  }
50
49
  function LayoutTab({ option, selected = false, }) {
51
- return (_jsx(Link, { className: cn('inline-flex border-b border-transparent transition-colors items-center py-1.5 font-medium gap-2 text-fd-muted-foreground text-sm text-nowrap', selected && 'border-fd-primary text-fd-primary'), href: option.url, children: option.title }));
50
+ return (_jsx(Link, { className: cn('inline-flex border-b border-transparent transition-colors items-center py-1.5 font-medium gap-2 text-fd-muted-foreground text-sm text-nowrap', option.unlisted && !selected && 'hidden', selected && 'border-fd-primary text-fd-primary'), href: option.url, children: option.title }));
52
51
  }
package/dist/style.css CHANGED
@@ -313,15 +313,9 @@
313
313
  .inset-y-0 {
314
314
  inset-block: calc(var(--spacing) * 0);
315
315
  }
316
- .inset-y-1 {
317
- inset-block: calc(var(--spacing) * 1);
318
- }
319
316
  .start-0 {
320
317
  inset-inline-start: calc(var(--spacing) * 0);
321
318
  }
322
- .start-2\.5 {
323
- inset-inline-start: calc(var(--spacing) * 2.5);
324
- }
325
319
  .start-4\.5 {
326
320
  inset-inline-start: calc(var(--spacing) * 4.5);
327
321
  }
@@ -434,6 +428,9 @@
434
428
  .-mx-1 {
435
429
  margin-inline: calc(var(--spacing) * -1);
436
430
  }
431
+ .mx-\(--fd-layout-offset\) {
432
+ margin-inline: var(--fd-layout-offset);
433
+ }
437
434
  .mx-0\.5 {
438
435
  margin-inline: calc(var(--spacing) * 0.5);
439
436
  }
@@ -1835,6 +1832,43 @@
1835
1832
  color: var(--color-fd-muted-foreground);
1836
1833
  }
1837
1834
  }
1835
+ .before\:absolute {
1836
+ &::before {
1837
+ content: var(--tw-content);
1838
+ position: absolute;
1839
+ }
1840
+ }
1841
+ .before\:inset-y-1 {
1842
+ &::before {
1843
+ content: var(--tw-content);
1844
+ inset-block: calc(var(--spacing) * 1);
1845
+ }
1846
+ }
1847
+ .before\:start-2\.5 {
1848
+ &::before {
1849
+ content: var(--tw-content);
1850
+ inset-inline-start: calc(var(--spacing) * 2.5);
1851
+ }
1852
+ }
1853
+ .before\:w-px {
1854
+ &::before {
1855
+ content: var(--tw-content);
1856
+ width: 1px;
1857
+ }
1858
+ }
1859
+ .before\:bg-fd-border {
1860
+ &::before {
1861
+ content: var(--tw-content);
1862
+ background-color: var(--color-fd-border);
1863
+ }
1864
+ }
1865
+ .before\:content-\[\'\'\] {
1866
+ &::before {
1867
+ content: var(--tw-content);
1868
+ --tw-content: '';
1869
+ content: var(--tw-content);
1870
+ }
1871
+ }
1838
1872
  .first\:ms-1 {
1839
1873
  &:first-child {
1840
1874
  margin-inline-start: calc(var(--spacing) * 1);
@@ -2441,16 +2475,6 @@
2441
2475
  --fd-toc-width: 286px;
2442
2476
  }
2443
2477
  }
2444
- .\32 xl\:px-12 {
2445
- @media (width >= 96rem) {
2446
- padding-inline: calc(var(--spacing) * 12);
2447
- }
2448
- }
2449
- .\32 xl\:pt-12 {
2450
- @media (width >= 96rem) {
2451
- padding-top: calc(var(--spacing) * 12);
2452
- }
2453
- }
2454
2478
  .\@max-lg\:col-span-full {
2455
2479
  @container (width < 32rem) {
2456
2480
  grid-column: 1 / -1;
@@ -2478,6 +2502,20 @@
2478
2502
  background-color: var(--shiki-dark-bg);
2479
2503
  }
2480
2504
  }
2505
+ .md\:\[\&_\#nd-page_article\]\:pt-12 {
2506
+ @media (width >= 48rem) {
2507
+ & #nd-page article {
2508
+ padding-top: calc(var(--spacing) * 12);
2509
+ }
2510
+ }
2511
+ }
2512
+ .xl\:\[\&_\#nd-page_article\]\:px-8 {
2513
+ @media (width >= 80rem) {
2514
+ & #nd-page article {
2515
+ padding-inline: calc(var(--spacing) * 8);
2516
+ }
2517
+ }
2518
+ }
2481
2519
  .\[\&_svg\]\:size-3\.5 {
2482
2520
  & svg {
2483
2521
  width: calc(var(--spacing) * 3.5);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "15.7.0",
3
+ "version": "15.7.1",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -121,7 +121,7 @@
121
121
  "react-medium-image-zoom": "^5.3.0",
122
122
  "scroll-into-view-if-needed": "^3.1.0",
123
123
  "tailwind-merge": "^3.3.1",
124
- "fumadocs-core": "15.7.0"
124
+ "fumadocs-core": "15.7.1"
125
125
  },
126
126
  "devDependencies": {
127
127
  "@next/eslint-plugin-next": "^15.5.0",
@@ -132,10 +132,10 @@
132
132
  "next": "15.5.0",
133
133
  "tailwindcss": "^4.1.12",
134
134
  "tsc-alias": "^1.8.16",
135
- "@fumadocs/cli": "1.0.0",
136
135
  "eslint-config-custom": "0.0.0",
137
- "fumadocs-core": "15.7.0",
138
- "tsconfig": "0.0.0"
136
+ "tsconfig": "0.0.0",
137
+ "fumadocs-core": "15.7.1",
138
+ "@fumadocs/cli": "1.0.0"
139
139
  },
140
140
  "peerDependencies": {
141
141
  "@types/react": "*",