fumadocs-ui 16.0.8 → 16.0.10
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.
- package/dist/components/callout.d.ts +10 -4
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +21 -10
- package/dist/components/card.js +1 -1
- package/dist/components/heading.js +1 -1
- package/dist/mdx.d.ts +5 -5
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +4 -1
- package/dist/style.css +3 -3
- package/package.json +3 -3
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
export type CalloutType = 'info' | 'warn' | 'error' | 'success' | 'warning';
|
|
3
|
+
export declare function Callout({ children, title, ...props }: {
|
|
3
4
|
title?: ReactNode;
|
|
5
|
+
} & Omit<CalloutContainerProps, 'title'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export interface CalloutContainerProps extends ComponentProps<'div'> {
|
|
4
7
|
/**
|
|
5
8
|
* @defaultValue info
|
|
6
9
|
*/
|
|
7
|
-
type?:
|
|
10
|
+
type?: CalloutType;
|
|
8
11
|
/**
|
|
9
12
|
* Force an icon
|
|
10
13
|
*/
|
|
11
14
|
icon?: ReactNode;
|
|
12
|
-
}
|
|
15
|
+
}
|
|
16
|
+
export declare function CalloutContainer({ type: inputType, icon, children, className, style, ...props }: CalloutContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function CalloutTitle({ children, className, ...props }: ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function CalloutDescription({ children, className, ...props }: ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
|
|
13
19
|
//# sourceMappingURL=callout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/components/callout.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/components/callout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAI5E,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,EAAE;IAAE,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC,2CAO9D;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAClE;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAQD,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EAAE,SAAkB,EACxB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,qBAAqB,2CA4BvB;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,GAAG,CAAC,2CAMrB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,GAAG,CAAC,2CAYrB"}
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CircleCheck, CircleX, Info, TriangleAlert } from '../icons.js';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
3
|
import { cn } from '../utils/cn.js';
|
|
5
4
|
const iconClass = 'size-5 -me-0.5 fill-(--callout-color) text-fd-card';
|
|
6
|
-
export
|
|
5
|
+
export function Callout({ children, title, ...props }) {
|
|
6
|
+
return (_jsxs(CalloutContainer, { ...props, children: [title && _jsx(CalloutTitle, { children: title }), _jsx(CalloutDescription, { children: children })] }));
|
|
7
|
+
}
|
|
8
|
+
function resolveAlias(type) {
|
|
7
9
|
if (type === 'warn')
|
|
8
|
-
|
|
10
|
+
return 'warning';
|
|
9
11
|
if (type === 'tip')
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
+
return 'info';
|
|
13
|
+
return type;
|
|
14
|
+
}
|
|
15
|
+
export function CalloutContainer({ type: inputType = 'info', icon, children, className, style, ...props }) {
|
|
16
|
+
const type = resolveAlias(inputType);
|
|
17
|
+
return (_jsxs("div", { className: cn('flex gap-2 my-4 rounded-xl border bg-fd-card p-3 ps-1 text-sm text-fd-card-foreground shadow-md', className), style: {
|
|
12
18
|
'--callout-color': `var(--color-fd-${type}, var(--color-fd-muted))`,
|
|
13
|
-
...
|
|
14
|
-
}, children: [_jsx("div", { role: "none", className: "w-0.5 bg-(--callout-color)/50 rounded-sm" }), icon ??
|
|
19
|
+
...style,
|
|
20
|
+
}, ...props, children: [_jsx("div", { role: "none", className: "w-0.5 bg-(--callout-color)/50 rounded-sm" }), icon ??
|
|
15
21
|
{
|
|
16
22
|
info: _jsx(Info, { className: iconClass }),
|
|
17
23
|
warning: _jsx(TriangleAlert, { className: iconClass }),
|
|
18
24
|
error: _jsx(CircleX, { className: iconClass }),
|
|
19
25
|
success: _jsx(CircleCheck, { className: iconClass }),
|
|
20
|
-
}[type],
|
|
21
|
-
}
|
|
22
|
-
|
|
26
|
+
}[type], _jsx("div", { className: "flex flex-col gap-2 min-w-0 flex-1", children: children })] }));
|
|
27
|
+
}
|
|
28
|
+
export function CalloutTitle({ children, className, ...props }) {
|
|
29
|
+
return (_jsx("p", { className: cn('font-medium my-0!', className), ...props, children: children }));
|
|
30
|
+
}
|
|
31
|
+
export function CalloutDescription({ children, className, ...props }) {
|
|
32
|
+
return (_jsx("div", { className: cn('text-fd-muted-foreground prose-no-margin empty:hidden', className), ...props, children: children }));
|
|
33
|
+
}
|
package/dist/components/card.js
CHANGED
|
@@ -6,5 +6,5 @@ export function Cards(props) {
|
|
|
6
6
|
}
|
|
7
7
|
export function Card({ icon, title, description, ...props }) {
|
|
8
8
|
const E = props.href ? Link : 'div';
|
|
9
|
-
return (_jsxs(E, { ...props, "data-card": true, className: cn('block rounded-xl border bg-fd-card p-4 text-fd-card-foreground transition-colors @max-lg:col-span-full', props.href && 'hover:bg-fd-accent/80', props.className), children: [icon ? (_jsx("div", { className: "not-prose mb-2 w-fit shadow-md rounded-lg border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon })) : null, _jsx("h3", { className: "not-prose mb-1 text-sm font-medium", children: title }), description ? (_jsx("p", { className: "
|
|
9
|
+
return (_jsxs(E, { ...props, "data-card": true, className: cn('block rounded-xl border bg-fd-card p-4 text-fd-card-foreground transition-colors @max-lg:col-span-full', props.href && 'hover:bg-fd-accent/80', props.className), children: [icon ? (_jsx("div", { className: "not-prose mb-2 w-fit shadow-md rounded-lg border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon })) : null, _jsx("h3", { className: "not-prose mb-1 text-sm font-medium", children: title }), description ? (_jsx("p", { className: "my-0! text-sm text-fd-muted-foreground", children: description })) : null, _jsx("div", { className: "text-sm text-fd-muted-foreground prose-no-margin empty:hidden", children: props.children })] }));
|
|
10
10
|
}
|
|
@@ -5,5 +5,5 @@ export function Heading({ as, className, ...props }) {
|
|
|
5
5
|
const As = as ?? 'h1';
|
|
6
6
|
if (!props.id)
|
|
7
7
|
return _jsx(As, { className: className, ...props });
|
|
8
|
-
return (_jsxs(As, { className: cn('flex scroll-m-28 flex-row items-center gap-2', className), ...props, children: [_jsx("a", { "data-card": "", href: `#${props.id}`, className: "peer", children: props.children }), _jsx(Link, { "aria-
|
|
8
|
+
return (_jsxs(As, { className: cn('flex scroll-m-28 flex-row items-center gap-2', className), ...props, children: [_jsx("a", { "data-card": "", href: `#${props.id}`, className: "peer", children: props.children }), _jsx(Link, { "aria-hidden": true, className: "size-3.5 shrink-0 text-fd-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100" })] }));
|
|
9
9
|
}
|
package/dist/mdx.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AnchorHTMLAttributes, FC, HTMLAttributes, ImgHTMLAttributes, TableHTMLAttributes } from 'react';
|
|
2
2
|
import { Card, Cards } from './components/card.js';
|
|
3
|
+
import { Callout, CalloutContainer, CalloutDescription, CalloutTitle } from './components/callout.js';
|
|
3
4
|
import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger } from './components/codeblock.js';
|
|
4
5
|
declare function Image(props: ImgHTMLAttributes<HTMLImageElement> & {
|
|
5
6
|
sizes?: string;
|
|
@@ -22,11 +23,10 @@ declare const defaultMdxComponents: {
|
|
|
22
23
|
h5: (props: HTMLAttributes<HTMLHeadingElement>) => import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
h6: (props: HTMLAttributes<HTMLHeadingElement>) => import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
table: typeof Table;
|
|
25
|
-
Callout:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
Callout: typeof Callout;
|
|
27
|
+
CalloutContainer: typeof CalloutContainer;
|
|
28
|
+
CalloutTitle: typeof CalloutTitle;
|
|
29
|
+
CalloutDescription: typeof CalloutDescription;
|
|
30
30
|
};
|
|
31
31
|
export declare const createRelativeLink: typeof import('./mdx.server.js').createRelativeLink;
|
|
32
32
|
export { defaultMdxComponents as default };
|
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,E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 -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import Link from 'fumadocs-core/link';
|
|
3
3
|
import { Image as FrameworkImage } from 'fumadocs-core/framework';
|
|
4
4
|
import { Card, Cards } from './components/card.js';
|
|
5
|
-
import { Callout } from './components/callout.js';
|
|
5
|
+
import { Callout, CalloutContainer, CalloutDescription, CalloutTitle, } from './components/callout.js';
|
|
6
6
|
import { Heading } from './components/heading.js';
|
|
7
7
|
import { cn } from './utils/cn.js';
|
|
8
8
|
import { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre, } from './components/codeblock.js';
|
|
@@ -30,6 +30,9 @@ const defaultMdxComponents = {
|
|
|
30
30
|
h6: (props) => (_jsx(Heading, { as: "h6", ...props })),
|
|
31
31
|
table: Table,
|
|
32
32
|
Callout,
|
|
33
|
+
CalloutContainer,
|
|
34
|
+
CalloutTitle,
|
|
35
|
+
CalloutDescription,
|
|
33
36
|
};
|
|
34
37
|
export const createRelativeLink = () => {
|
|
35
38
|
throw new Error('`createRelativeLink` is only supported in Node.js environment');
|
package/dist/style.css
CHANGED
|
@@ -447,12 +447,12 @@
|
|
|
447
447
|
.mx-auto {
|
|
448
448
|
margin-inline: auto;
|
|
449
449
|
}
|
|
450
|
-
.\!my-0 {
|
|
451
|
-
margin-block: calc(var(--spacing) * 0) !important;
|
|
452
|
-
}
|
|
453
450
|
.my-0 {
|
|
454
451
|
margin-block: calc(var(--spacing) * 0);
|
|
455
452
|
}
|
|
453
|
+
.my-0\! {
|
|
454
|
+
margin-block: calc(var(--spacing) * 0) !important;
|
|
455
|
+
}
|
|
456
456
|
.my-4 {
|
|
457
457
|
margin-block: calc(var(--spacing) * 4);
|
|
458
458
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.10",
|
|
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.4.0",
|
|
122
122
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
123
123
|
"tailwind-merge": "^3.3.1",
|
|
124
|
-
"fumadocs-core": "16.0.
|
|
124
|
+
"fumadocs-core": "16.0.10"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"@next/eslint-plugin-next": "16.0.1",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"tsc-alias": "^1.8.16",
|
|
136
136
|
"@fumadocs/cli": "1.0.3",
|
|
137
137
|
"eslint-config-custom": "0.0.0",
|
|
138
|
-
"fumadocs-core": "16.0.
|
|
138
|
+
"fumadocs-core": "16.0.10",
|
|
139
139
|
"tsconfig": "0.0.0"
|
|
140
140
|
},
|
|
141
141
|
"peerDependencies": {
|