fumadocs-ui 15.7.4 → 15.7.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.
@@ -38,5 +38,5 @@ export declare function CodeBlock({ ref, title, allowCopy, keepBackground, icon,
38
38
  export declare function CodeBlockTabs({ ref, ...props }: ComponentProps<typeof Tabs>): import("react/jsx-runtime").JSX.Element;
39
39
  export declare function CodeBlockTabsList(props: ComponentProps<typeof TabsList>): import("react/jsx-runtime").JSX.Element;
40
40
  export declare function CodeBlockTabsTrigger({ children, ...props }: ComponentProps<typeof TabsTrigger>): import("react/jsx-runtime").JSX.Element;
41
- export declare const CodeBlockTab: typeof TabsContent;
41
+ export declare function CodeBlockTab({ className, ...props }: ComponentProps<typeof TabsContent>): import("react/jsx-runtime").JSX.Element;
42
42
  //# sourceMappingURL=codeblock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codeblock.d.ts","sourceRoot":"","sources":["../../src/components/codeblock.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAGpC,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC9D;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,aAAa,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IAE5C;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,SAAS,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C;IAE9B;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE,KAAK,SAAS,CAAC;CAC9E;AAOD,wBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAS/C;AAED,wBAAgB,SAAS,CAAC,EACxB,GAAG,EACH,KAAK,EACL,SAAS,EACT,cAAsB,EACtB,IAAI,EACJ,aAAkB,EAClB,QAAQ,EACR,OAEC,EACD,GAAG,KAAK,EACT,EAAE,cAAc,2CAiEhB;AAwCD,wBAAgB,aAAa,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,2CA2B3E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,QAAQ,CAAC,2CAoBvE;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,WAAW,CAAC,2CAapC;AAGD,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,WAAW,CAAC,2CAEpC"}
@@ -15,7 +15,7 @@ export function CodeBlock({ ref, title, allowCopy, keepBackground = false, icon,
15
15
  const inTab = useContext(TabsContext) !== null;
16
16
  const areaRef = useRef(null);
17
17
  allowCopy ?? (allowCopy = !inTab);
18
- return (_jsxs("figure", { ref: ref, dir: "ltr", ...props, className: cn(inTab ? 'rounded-lg bg-fd-secondary' : 'my-4 rounded-xl bg-fd-card', keepBackground && 'bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)', 'shiki relative border shadow-md outline-none not-prose overflow-hidden text-sm', props.className), children: [title ? (_jsxs("div", { className: "flex text-fd-muted-foreground items-center gap-2 h-9.5 border-b px-4", children: [typeof icon === 'string' ? (_jsx("div", { className: "[&_svg]:size-3.5", dangerouslySetInnerHTML: {
18
+ return (_jsxs("figure", { ref: ref, dir: "ltr", ...props, className: cn(inTab ? 'bg-fd-secondary' : 'my-4 bg-fd-card', keepBackground && 'bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)', 'shiki relative border shadow-md rounded-xl outline-none not-prose overflow-hidden text-sm', props.className), children: [title ? (_jsxs("div", { className: "flex text-fd-muted-foreground items-center gap-2 h-9.5 border-b px-4", children: [typeof icon === 'string' ? (_jsx("div", { className: "[&_svg]:size-3.5", dangerouslySetInnerHTML: {
19
19
  __html: icon,
20
20
  } })) : (icon), _jsx("figcaption", { className: "flex-1 truncate", children: title }), Actions({
21
21
  className: '-me-2',
@@ -51,7 +51,7 @@ function CopyButton({ className, containerRef, ...props }) {
51
51
  export function CodeBlockTabs({ ref, ...props }) {
52
52
  const containerRef = useRef(null);
53
53
  const nested = useContext(TabsContext) !== null;
54
- return (_jsx(Tabs, { ref: mergeRefs(containerRef, ref), ...props, className: cn('bg-fd-card p-1 rounded-xl border overflow-hidden', nested ? 'shadow-sm' : '-m-1 my-4', props.className), children: _jsx(TabsContext.Provider, { value: useMemo(() => ({
54
+ return (_jsx(Tabs, { ref: mergeRefs(containerRef, ref), ...props, className: cn('bg-fd-card rounded-xl border', nested ? 'shadow-sm' : 'my-4', props.className), children: _jsx(TabsContext.Provider, { value: useMemo(() => ({
55
55
  containerRef,
56
56
  nested,
57
57
  }), [nested]), children: props.children }) }));
@@ -64,4 +64,6 @@ export function CodeBlockTabsTrigger({ children, ...props }) {
64
64
  return (_jsxs(TabsTrigger, { ...props, className: cn('relative group inline-flex text-sm font-medium text-nowrap items-center transition-colors gap-2 px-2 py-1.5 hover:text-fd-accent-foreground data-[state=active]:text-fd-primary [&_svg]:size-3.5', props.className), children: [_jsx("div", { className: "absolute inset-x-2 bottom-0 h-px group-data-[state=active]:bg-fd-primary" }), children] }));
65
65
  }
66
66
  // TODO: currently Vite RSC plugin has problem with adding `asChild` here, maybe revisit this in future
67
- export const CodeBlockTab = TabsContent;
67
+ export function CodeBlockTab({ className, ...props }) {
68
+ return _jsx(TabsContent, { className: cn('-mx-px -mb-px', className), ...props });
69
+ }
package/dist/mdx.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import type { AnchorHTMLAttributes, FC, HTMLAttributes, ImgHTMLAttributes, TableHTMLAttributes } from 'react';
2
2
  import { Card, Cards } from './components/card.js';
3
- import { CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger } from './components/codeblock.js';
3
+ import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger } from './components/codeblock.js';
4
4
  declare function Image(props: ImgHTMLAttributes<HTMLImageElement> & {
5
5
  sizes?: string;
6
6
  }): import("react/jsx-runtime").JSX.Element;
7
7
  declare function Table(props: TableHTMLAttributes<HTMLTableElement>): import("react/jsx-runtime").JSX.Element;
8
8
  declare const defaultMdxComponents: {
9
- CodeBlockTab: typeof import("./components/tabs.unstyled.js").TabsContent;
9
+ CodeBlockTab: typeof CodeBlockTab;
10
10
  CodeBlockTabs: typeof CodeBlockTabs;
11
11
  CodeBlockTabsList: typeof CodeBlockTabsList;
12
12
  CodeBlockTabsTrigger: typeof CodeBlockTabsTrigger;
package/dist/mdx.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,EAAE,EACF,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAIhD,OAAO,EAGL,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EAErB,MAAM,wBAAwB,CAAC;AAEhC,iBAAS,KAAK,CACZ,KAAK,EAAE,iBAAiB,CAAC,gBAAgB,C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iB,CAAC,CAAC;;gBAE1C,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;;;;;;;CAK/C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,cAAc,cAAc,EAAE,kBAK5D,CAAC;AAEJ,OAAO,EAAE,oBAAoB,IAAI,OAAO,EAAE,CAAC"}
package/dist/page.js CHANGED
@@ -35,7 +35,7 @@ export function EditOnGitHub(props) {
35
35
  /**
36
36
  * Add typography styles
37
37
  */
38
- export const DocsBody = forwardRef((props, ref) => (_jsx("div", { ref: ref, ...props, className: cn('prose', props.className), children: props.children })));
38
+ export const DocsBody = forwardRef((props, ref) => (_jsx("div", { ref: ref, ...props, className: cn('prose flex-1', props.className), children: props.children })));
39
39
  DocsBody.displayName = 'DocsBody';
40
40
  export const DocsDescription = forwardRef((props, ref) => {
41
41
  // don't render if no description provided
package/dist/style.css CHANGED
@@ -415,9 +415,6 @@
415
415
  max-width: 96rem;
416
416
  }
417
417
  }
418
- .-m-1 {
419
- margin: calc(var(--spacing) * -1);
420
- }
421
418
  .container {
422
419
  margin-inline: auto;
423
420
  padding-inline: 1rem;
@@ -428,6 +425,9 @@
428
425
  .-mx-1 {
429
426
  margin-inline: calc(var(--spacing) * -1);
430
427
  }
428
+ .-mx-px {
429
+ margin-inline: -1px;
430
+ }
431
431
  .mx-\(--fd-layout-offset\) {
432
432
  margin-inline: var(--fd-layout-offset);
433
433
  }
@@ -863,6 +863,9 @@
863
863
  .mr-auto {
864
864
  margin-right: auto;
865
865
  }
866
+ .-mb-px {
867
+ margin-bottom: -1px;
868
+ }
866
869
  .mb-1 {
867
870
  margin-bottom: calc(var(--spacing) * 1);
868
871
  }
@@ -1 +1 @@
1
- {"version":3,"file":"is-active.d.ts","sourceRoot":"","sources":["../../src/utils/is-active.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CACtB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,MAAM,UAAO,GACZ,OAAO,CAKT"}
1
+ {"version":3,"file":"is-active.d.ts","sourceRoot":"","sources":["../../src/utils/is-active.ts"],"names":[],"mappings":"AAKA,wBAAgB,QAAQ,CACtB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,MAAM,UAAO,GACZ,OAAO,CAKT"}
@@ -1,7 +1,10 @@
1
+ function normalize(url) {
2
+ if (url.length > 1 && url.endsWith('/'))
3
+ return url.slice(0, -1);
4
+ return url;
5
+ }
1
6
  export function isActive(url, pathname, nested = true) {
2
- if (url.endsWith('/'))
3
- url = url.slice(0, -1);
4
- if (pathname.endsWith('/'))
5
- pathname = pathname.slice(0, -1);
7
+ url = normalize(url);
8
+ pathname = normalize(pathname);
6
9
  return url === pathname || (nested && pathname.startsWith(`${url}/`));
7
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "15.7.4",
3
+ "version": "15.7.5",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -121,20 +121,20 @@
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.4"
124
+ "fumadocs-core": "15.7.5"
125
125
  },
126
126
  "devDependencies": {
127
- "@next/eslint-plugin-next": "^15.5.0",
127
+ "@next/eslint-plugin-next": "^15.5.2",
128
128
  "@tailwindcss/cli": "^4.1.12",
129
129
  "@types/lodash.merge": "^4.6.9",
130
- "@types/react": "^19.1.11",
131
- "@types/react-dom": "^19.1.7",
132
- "next": "15.5.0",
130
+ "@types/react": "^19.1.12",
131
+ "@types/react-dom": "^19.1.8",
132
+ "next": "15.5.2",
133
133
  "tailwindcss": "^4.1.12",
134
134
  "tsc-alias": "^1.8.16",
135
- "@fumadocs/cli": "1.0.0",
135
+ "@fumadocs/cli": "1.0.1",
136
136
  "eslint-config-custom": "0.0.0",
137
- "fumadocs-core": "15.7.4",
137
+ "fumadocs-core": "15.7.5",
138
138
  "tsconfig": "0.0.0"
139
139
  },
140
140
  "peerDependencies": {