fumadocs-ui 15.5.5 → 15.6.0
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/css/neutral.css +1 -1
- package/css/preset.css +9 -2
- package/css/shiki.css +7 -1
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +12 -22
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +2 -2
- package/dist/components/codeblock.d.ts +14 -33
- package/dist/components/codeblock.d.ts.map +1 -1
- package/dist/components/codeblock.js +50 -25
- package/dist/components/layout/sidebar.js +1 -1
- package/dist/components/tabs.d.ts +8 -19
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +17 -74
- package/dist/components/tabs.unstyled.d.ts +24 -0
- package/dist/components/tabs.unstyled.d.ts.map +1 -0
- package/dist/components/tabs.unstyled.js +89 -0
- package/dist/layouts/docs.js +3 -3
- package/dist/layouts/notebook-client.js +2 -2
- package/dist/layouts/notebook.d.ts.map +1 -1
- package/dist/layouts/notebook.js +3 -3
- package/dist/mdx.d.ts +5 -0
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +5 -1
- package/dist/style.css +88 -109
- package/package.json +5 -5
- package/dist/components/ui/tabs.d.ts +0 -8
- package/dist/components/ui/tabs.d.ts.map +0 -1
- package/dist/components/ui/tabs.js +0 -16
package/css/neutral.css
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
--color-fd-primary: hsl(0, 0%, 98%);
|
|
31
31
|
--color-fd-primary-foreground: hsl(0, 0%, 9%);
|
|
32
32
|
--color-fd-secondary: hsl(0, 0%, 12.9%);
|
|
33
|
-
--color-fd-secondary-foreground: hsl(0, 0%,
|
|
33
|
+
--color-fd-secondary-foreground: hsl(0, 0%, 92%);
|
|
34
34
|
--color-fd-accent: hsla(0, 0%, 40.9%, 30%);
|
|
35
35
|
--color-fd-accent-foreground: hsl(0, 0%, 90%);
|
|
36
36
|
--color-fd-ring: hsl(0, 0%, 54.9%);
|
package/css/preset.css
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
@source '../dist/**/*.js';
|
|
4
4
|
@plugin '../dist/theme/typography/index.js';
|
|
5
5
|
|
|
6
|
+
@theme static {
|
|
7
|
+
--color-fd-info: oklch(62.3% 0.214 259.815);
|
|
8
|
+
--color-fd-warning: oklch(76.9% 0.188 70.08);
|
|
9
|
+
--color-fd-error: oklch(63.7% 0.237 25.331);
|
|
10
|
+
--color-fd-success: oklch(72.3% 0.219 149.579);
|
|
11
|
+
}
|
|
12
|
+
|
|
6
13
|
@theme {
|
|
7
14
|
--spacing-fd-container: 1400px;
|
|
8
15
|
--fd-page-width: 1200px;
|
|
@@ -110,14 +117,14 @@
|
|
|
110
117
|
@keyframes fd-popover-in {
|
|
111
118
|
from {
|
|
112
119
|
opacity: 0;
|
|
113
|
-
transform:
|
|
120
|
+
transform: scale(0.7);
|
|
114
121
|
}
|
|
115
122
|
}
|
|
116
123
|
|
|
117
124
|
@keyframes fd-popover-out {
|
|
118
125
|
to {
|
|
119
126
|
opacity: 0;
|
|
120
|
-
transform:
|
|
127
|
+
transform: scale(0.7);
|
|
121
128
|
}
|
|
122
129
|
}
|
|
123
130
|
|
package/css/shiki.css
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
.shiki:not(.not-fumadocs-codeblock *) {
|
|
2
|
+
--padding-left: calc(var(--spacing) * 3);
|
|
3
|
+
--padding-right: calc(var(--spacing) * 3);
|
|
4
|
+
|
|
2
5
|
code span {
|
|
3
6
|
color: var(--shiki-light);
|
|
4
7
|
}
|
|
5
8
|
|
|
6
9
|
code .line {
|
|
10
|
+
position: relative;
|
|
7
11
|
min-height: 1lh;
|
|
8
|
-
|
|
12
|
+
padding-left: var(--padding-left);
|
|
13
|
+
padding-right: var(--padding-right);
|
|
9
14
|
}
|
|
10
15
|
|
|
11
16
|
&.has-focused code .line:not(.focused) {
|
|
@@ -24,6 +29,7 @@
|
|
|
24
29
|
&[data-line-numbers] code .line {
|
|
25
30
|
width: calc(100% - 7 * var(--spacing));
|
|
26
31
|
counter-increment: line;
|
|
32
|
+
padding-left: calc(var(--padding-left) - var(--spacing));
|
|
27
33
|
@apply ml-7;
|
|
28
34
|
|
|
29
35
|
&::after {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/components/callout.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/components/callout.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAmBxE,eAAO,MAAM,OAAO;YAZV,SAAS;IACjB;;OAEG;WACI,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS;IAExD;;OAEG;WACI,SAAS;kDAyCjB,CAAC"}
|
|
@@ -2,28 +2,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { CircleCheck, CircleX, Info, TriangleAlert } from '../icons.js';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { cn } from '../utils/cn.js';
|
|
5
|
-
import { cva } from 'class-variance-authority';
|
|
6
|
-
const calloutVariants = cva('my-4 flex gap-2 rounded-lg border border-s-2 bg-fd-card p-3 text-sm text-fd-card-foreground shadow-md', {
|
|
7
|
-
variants: {
|
|
8
|
-
type: {
|
|
9
|
-
info: 'border-s-blue-500/50',
|
|
10
|
-
warn: 'border-s-amber-500/50',
|
|
11
|
-
error: 'border-s-red-500/50',
|
|
12
|
-
success: 'border-s-green-500/50',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
5
|
export const Callout = forwardRef(({ className, children, title, type = 'info', icon, ...props }, ref) => {
|
|
17
|
-
if (type === '
|
|
18
|
-
type = '
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
6
|
+
if (type === 'warn')
|
|
7
|
+
type = 'warning';
|
|
8
|
+
const DefaultIcon = {
|
|
9
|
+
info: Info,
|
|
10
|
+
warning: TriangleAlert,
|
|
11
|
+
error: CircleX,
|
|
12
|
+
success: CircleCheck,
|
|
13
|
+
}[type];
|
|
14
|
+
return (_jsxs("div", { ref: ref, 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), ...props, style: {
|
|
15
|
+
'--callout-color': `var(--color-fd-${type})`,
|
|
16
|
+
...props.style,
|
|
17
|
+
}, children: [_jsx("div", { role: "none", className: "w-1 bg-(--callout-color)/50 rounded-sm" }), icon ?? (_jsx(DefaultIcon, { className: "size-5 -me-0.5 fill-(--callout-color) text-fd-card" })), _jsxs("div", { className: "flex flex-col gap-2 min-w-0 flex-1", children: [title ? _jsx("p", { className: "font-medium !my-0", children: title }) : null, _jsx("div", { className: "text-fd-muted-foreground prose-no-margin empty:hidden", children: children })] })] }));
|
|
28
18
|
});
|
|
29
19
|
Callout.displayName = 'Callout';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,wBAAgB,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,2CAS1D;AAED,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,wBAAgB,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,2CAS1D;AAED,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CA2BrE"}
|
package/dist/components/card.js
CHANGED
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import Link from 'fumadocs-core/link';
|
|
3
3
|
import { cn } from '../utils/cn.js';
|
|
4
4
|
export function Cards(props) {
|
|
5
|
-
return (_jsx("div", { ...props, className: cn('grid grid-cols-2 gap-
|
|
5
|
+
return (_jsx("div", { ...props, className: cn('grid grid-cols-2 gap-3 @container', props.className), children: props.children }));
|
|
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-
|
|
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
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
-
|
|
1
|
+
import { type ComponentProps, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '../components/tabs.unstyled.js';
|
|
3
|
+
export interface CodeBlockProps extends ComponentProps<'figure'> {
|
|
3
4
|
/**
|
|
4
5
|
* Icon of code block
|
|
5
6
|
*
|
|
@@ -27,35 +28,15 @@ export type CodeBlockProps = HTMLAttributes<HTMLElement> & {
|
|
|
27
28
|
* @defaultValue 1
|
|
28
29
|
*/
|
|
29
30
|
'data-line-numbers-start'?: number;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
*
|
|
42
|
-
* @defaultValue true
|
|
43
|
-
*/
|
|
44
|
-
allowCopy?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Keep original background color generated by Shiki or Rehype Code
|
|
47
|
-
*
|
|
48
|
-
* @defaultValue false
|
|
49
|
-
*/
|
|
50
|
-
keepBackground?: boolean;
|
|
51
|
-
viewportProps?: HTMLAttributes<HTMLElement>;
|
|
52
|
-
/**
|
|
53
|
-
* show line numbers
|
|
54
|
-
*/
|
|
55
|
-
'data-line-numbers'?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* @defaultValue 1
|
|
58
|
-
*/
|
|
59
|
-
'data-line-numbers-start'?: number;
|
|
60
|
-
} & import("react").RefAttributes<HTMLElement>>;
|
|
31
|
+
Actions?: (props: {
|
|
32
|
+
className?: string;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}) => ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export declare function Pre(props: ComponentProps<'pre'>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function CodeBlock({ ref, title, allowCopy, keepBackground, icon, viewportProps, children, Actions, ...props }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function CodeBlockTabs({ ref, ...props }: ComponentProps<typeof Tabs>): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare function CodeBlockTabsList(props: ComponentProps<typeof TabsList>): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function CodeBlockTabsTrigger({ children, ...props }: ComponentProps<typeof TabsTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare const CodeBlockTab: (props: ComponentProps<typeof TabsContent>) => import("react/jsx-runtime").JSX.Element;
|
|
61
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,
|
|
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,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,2CAwEhB;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;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,cAAc,CAAC,OAAO,WAAW,CAAC,4CAErE,CAAC"}
|
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Check, Copy } from '../icons.js';
|
|
4
|
-
import {
|
|
4
|
+
import { createContext, useContext, useMemo, useRef, } from 'react';
|
|
5
5
|
import { cn } from '../utils/cn.js';
|
|
6
6
|
import { useCopyButton } from '../utils/use-copy-button.js';
|
|
7
7
|
import { buttonVariants } from '../components/ui/button.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger, } from '../components/tabs.unstyled.js';
|
|
9
|
+
import { mergeRefs } from '../utils/merge-refs.js';
|
|
10
|
+
const TabsContext = createContext(null);
|
|
11
|
+
export function Pre(props) {
|
|
12
|
+
return (_jsx("pre", { ...props, className: cn('min-w-full w-max *:flex *:flex-col', props.className), children: props.children }));
|
|
13
|
+
}
|
|
14
|
+
export function CodeBlock({ ref, title, allowCopy, keepBackground = false, icon, viewportProps = {}, children, Actions = (props) => (_jsx("div", { ...props, className: cn('empty:hidden', props.className) })), ...props }) {
|
|
15
|
+
const isTab = useContext(TabsContext) !== null;
|
|
13
16
|
const areaRef = useRef(null);
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
allowCopy ?? (allowCopy = !isTab);
|
|
18
|
+
const bg = cn('bg-fd-secondary', keepBackground && 'bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)');
|
|
19
|
+
return (_jsxs("figure", { ref: ref, dir: "ltr", ...props, className: cn(isTab ? [bg, 'rounded-lg shadow-sm'] : 'my-4 rounded-xl bg-fd-card p-1', 'shiki relative border outline-none not-prose overflow-hidden text-sm', props.className), children: [title ? (_jsxs("div", { className: cn('flex text-fd-muted-foreground items-center gap-2 ps-3 h-9.5', isTab && 'border-b'), children: [typeof icon === 'string' ? (_jsx("div", { className: "[&_svg]:size-3.5", dangerouslySetInnerHTML: {
|
|
20
|
+
__html: icon,
|
|
21
|
+
} })) : (icon), _jsx("figcaption", { className: "flex-1 truncate", children: title }), Actions({
|
|
22
|
+
children: allowCopy && _jsx(CopyButton, { containerRef: areaRef }),
|
|
23
|
+
})] })) : (Actions({
|
|
24
|
+
className: 'absolute top-1 right-1 z-2 bg-fd-card rounded-bl-lg border-l border-b text-fd-muted-foreground',
|
|
25
|
+
children: allowCopy && _jsx(CopyButton, { containerRef: areaRef }),
|
|
26
|
+
})), _jsx("div", { ref: areaRef, ...viewportProps, className: cn(!isTab && [bg, 'rounded-lg border'], 'text-[13px] py-3.5 overflow-auto max-h-[600px] fd-scroll-container', viewportProps.className), style: {
|
|
27
|
+
// space for toolbar
|
|
28
|
+
'--padding-right': !title ? 'calc(var(--spacing) * 8)' : undefined,
|
|
29
|
+
counterSet: props['data-line-numbers']
|
|
30
|
+
? `line ${Number(props['data-line-numbers-start'] ?? 1) - 1}`
|
|
31
|
+
: undefined,
|
|
32
|
+
...viewportProps.style,
|
|
33
|
+
}, children: children })] }));
|
|
34
|
+
}
|
|
35
|
+
function CopyButton({ className, containerRef, ...props }) {
|
|
36
|
+
const [checked, onClick] = useCopyButton(() => {
|
|
37
|
+
const pre = containerRef.current?.getElementsByTagName('pre').item(0);
|
|
16
38
|
if (!pre)
|
|
17
39
|
return;
|
|
18
40
|
const clone = pre.cloneNode(true);
|
|
@@ -20,22 +42,25 @@ export const CodeBlock = forwardRef(({ title, allowCopy = true, keepBackground =
|
|
|
20
42
|
node.replaceWith('\n');
|
|
21
43
|
});
|
|
22
44
|
void navigator.clipboard.writeText(clone.textContent ?? '');
|
|
23
|
-
};
|
|
24
|
-
return (
|
|
25
|
-
? {
|
|
26
|
-
__html: icon,
|
|
27
|
-
}
|
|
28
|
-
: undefined, children: typeof icon !== 'string' ? icon : null })) : null, _jsx("figcaption", { className: "flex-1 truncate text-fd-muted-foreground", children: title }), allowCopy && _jsx(CopyButton, { className: "-me-2", onCopy: onCopy })] })) : (allowCopy && (_jsx(CopyButton, { className: "absolute right-2 top-2 z-[2] backdrop-blur-md", onCopy: onCopy }))), _jsx("div", { ref: areaRef, ...viewportProps, className: cn('text-[13px] py-3.5 overflow-auto [&_.line]:px-4 max-h-[600px] fd-scroll-container', props['data-line-numbers'] && '[&_.line]:pl-3', viewportProps?.className), style: {
|
|
29
|
-
counterSet: props['data-line-numbers']
|
|
30
|
-
? `line ${Number(props['data-line-numbers-start'] ?? 1) - 1}`
|
|
31
|
-
: undefined,
|
|
32
|
-
...viewportProps?.style,
|
|
33
|
-
}, children: children })] }));
|
|
34
|
-
});
|
|
35
|
-
CodeBlock.displayName = 'CodeBlock';
|
|
36
|
-
function CopyButton({ className, onCopy, ...props }) {
|
|
37
|
-
const [checked, onClick] = useCopyButton(onCopy);
|
|
38
|
-
return (_jsxs("button", { type: "button", className: cn(buttonVariants({
|
|
45
|
+
});
|
|
46
|
+
return (_jsx("button", { type: "button", className: cn(buttonVariants({
|
|
39
47
|
color: 'ghost',
|
|
40
|
-
|
|
48
|
+
className: '[&_svg]:size-3.5',
|
|
49
|
+
}), className), "aria-label": checked ? 'Copied Text' : 'Copy Text', onClick: onClick, ...props, children: checked ? _jsx(Check, {}) : _jsx(Copy, {}) }));
|
|
50
|
+
}
|
|
51
|
+
export function CodeBlockTabs({ ref, ...props }) {
|
|
52
|
+
const containerRef = useRef(null);
|
|
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 && 'my-4', props.className), children: _jsx(TabsContext.Provider, { value: useMemo(() => ({
|
|
55
|
+
containerRef,
|
|
56
|
+
nested,
|
|
57
|
+
}), [nested]), children: props.children }) }));
|
|
58
|
+
}
|
|
59
|
+
export function CodeBlockTabsList(props) {
|
|
60
|
+
const { containerRef, nested } = useContext(TabsContext);
|
|
61
|
+
return (_jsxs(TabsList, { ...props, className: cn('flex flex-row overflow-x-auto px-1 -mx-1 text-fd-muted-foreground', props.className), children: [props.children, !nested && (_jsx(CopyButton, { className: "sticky ms-auto right-0 bg-fd-card backdrop-blur-sm", containerRef: containerRef }))] }));
|
|
62
|
+
}
|
|
63
|
+
export function CodeBlockTabsTrigger({ children, ...props }) {
|
|
64
|
+
return (_jsxs(TabsTrigger, { ...props, className: cn('relative group inline-flex text-sm font-medium items-center gap-2 px-2 first:ms-1 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] }));
|
|
41
65
|
}
|
|
66
|
+
export const CodeBlockTab = (props) => (_jsx(TabsContent, { ...props, asChild: true }));
|
|
@@ -208,5 +208,5 @@ function getOffset(level) {
|
|
|
208
208
|
function Border({ level, active }) {
|
|
209
209
|
if (level <= 1)
|
|
210
210
|
return null;
|
|
211
|
-
return (_jsx("div", { className: cn('absolute w-px inset-y-3 z-
|
|
211
|
+
return (_jsx("div", { className: cn('absolute w-px inset-y-3 z-2 start-2.5 md:inset-y-2', active && 'bg-fd-primary') }));
|
|
212
212
|
}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
-
import * as
|
|
3
|
-
export interface TabsProps extends ComponentProps<typeof
|
|
4
|
-
/**
|
|
5
|
-
* Identifier for Sharing value of tabs
|
|
6
|
-
*/
|
|
7
|
-
groupId?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Enable persistent
|
|
10
|
-
*/
|
|
11
|
-
persist?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* If true, updates the URL hash based on the tab's id
|
|
14
|
-
*/
|
|
15
|
-
updateAnchor?: boolean;
|
|
3
|
+
import * as Unstyled from './tabs.unstyled.js';
|
|
4
|
+
export interface TabsProps extends Omit<ComponentProps<typeof Unstyled.Tabs>, 'value' | 'onValueChange'> {
|
|
16
5
|
/**
|
|
17
6
|
* Use simple mode instead of advanced usage as documented in https://radix-ui.com/primitives/docs/components/tabs.
|
|
18
7
|
*/
|
|
@@ -28,15 +17,15 @@ export interface TabsProps extends ComponentProps<typeof Primitive.Tabs> {
|
|
|
28
17
|
*/
|
|
29
18
|
label?: ReactNode;
|
|
30
19
|
}
|
|
31
|
-
export declare const TabsList:
|
|
32
|
-
export declare const TabsTrigger:
|
|
33
|
-
export declare function Tabs({ ref, className,
|
|
34
|
-
export interface TabProps extends Omit<ComponentProps<typeof
|
|
20
|
+
export declare const TabsList: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-tabs").TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-tabs").TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
export declare function Tabs({ ref, className, items, label, defaultIndex, defaultValue, ...props }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export interface TabProps extends Omit<ComponentProps<typeof Unstyled.TabsContent>, 'value'> {
|
|
35
24
|
/**
|
|
36
25
|
* Value of tab, detect from index if unspecified.
|
|
37
26
|
*/
|
|
38
27
|
value?: string;
|
|
39
28
|
}
|
|
40
29
|
export declare function Tab({ value, ...props }: TabProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
export declare function TabsContent({ value, className, ...props }: ComponentProps<typeof
|
|
30
|
+
export declare function TabsContent({ value, className, ...props }: ComponentProps<typeof Unstyled.TabsContent>): import("react/jsx-runtime").JSX.Element;
|
|
42
31
|
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAI5C,MAAM,WAAW,SACf,SAAQ,IAAI,CACV,cAAc,CAAC,OAAO,QAAQ,CAAC,IAAI,CAAC,EACpC,OAAO,GAAG,eAAe,CAC1B;IACD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAaD,eAAO,MAAM,QAAQ,wKAYnB,CAAC;AAGH,eAAO,MAAM,WAAW,iLAYtB,CAAC;AAGH,wBAAgB,IAAI,CAAC,EACnB,GAAG,EACH,SAAS,EACT,KAAK,EACL,KAAK,EACL,YAAgB,EAChB,YAAmE,EACnE,GAAG,KAAK,EACT,EAAE,SAAS,2CAqCX;AAED,MAAM,WAAW,QACf,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAClE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,2CAgBhD;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,QAAQ,CAAC,WAAW,CAAC,2CAc7C"}
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { createContext, useContext, useEffect, useId, useMemo, useState, } from 'react';
|
|
4
5
|
import { cn } from '../utils/cn.js';
|
|
5
|
-
import * as
|
|
6
|
-
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
|
7
|
-
import { mergeRefs } from '../utils/merge-refs.js';
|
|
8
|
-
const listeners = new Map();
|
|
9
|
-
function addChangeListener(id, listener) {
|
|
10
|
-
const list = listeners.get(id) ?? [];
|
|
11
|
-
list.push(listener);
|
|
12
|
-
listeners.set(id, list);
|
|
13
|
-
}
|
|
14
|
-
function removeChangeListener(id, listener) {
|
|
15
|
-
const list = listeners.get(id) ?? [];
|
|
16
|
-
listeners.set(id, list.filter((item) => item !== listener));
|
|
17
|
-
}
|
|
6
|
+
import * as Unstyled from './tabs.unstyled.js';
|
|
18
7
|
const TabsContext = createContext(null);
|
|
19
8
|
function useTabContext() {
|
|
20
9
|
const ctx = useContext(TabsContext);
|
|
@@ -22,63 +11,18 @@ function useTabContext() {
|
|
|
22
11
|
throw new Error('You must wrap your component in <Tabs>');
|
|
23
12
|
return ctx;
|
|
24
13
|
}
|
|
25
|
-
export const TabsList =
|
|
26
|
-
|
|
27
|
-
export
|
|
28
|
-
|
|
14
|
+
export const TabsList = React.forwardRef((props, ref) => (_jsx(Unstyled.TabsList, { ref: ref, ...props, className: cn('flex gap-3.5 text-fd-secondary-foreground overflow-x-auto px-4 not-prose', props.className) })));
|
|
15
|
+
TabsList.displayName = 'TabsList';
|
|
16
|
+
export const TabsTrigger = React.forwardRef((props, ref) => (_jsx(Unstyled.TabsTrigger, { ref: ref, ...props, className: cn('inline-flex items-center gap-2 whitespace-nowrap text-fd-muted-foreground border-b border-transparent py-2 text-sm font-medium transition-colors [&_svg]:size-4 hover:text-fd-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-fd-primary data-[state=active]:text-fd-primary', props.className) })));
|
|
17
|
+
TabsTrigger.displayName = 'TabsTrigger';
|
|
18
|
+
export function Tabs({ ref, className, items, label, defaultIndex = 0, defaultValue = items ? escapeValue(items[defaultIndex]) : undefined, ...props }) {
|
|
29
19
|
const [value, setValue] = useState(defaultValue);
|
|
30
|
-
const valueToIdMap = useMemo(() => new Map(), []);
|
|
31
20
|
const collection = useMemo(() => [], []);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
useLayoutEffect(() => {
|
|
38
|
-
if (!groupId)
|
|
39
|
-
return;
|
|
40
|
-
const previous = persist
|
|
41
|
-
? localStorage.getItem(groupId)
|
|
42
|
-
: sessionStorage.getItem(groupId);
|
|
43
|
-
if (previous)
|
|
44
|
-
onUpdate(previous);
|
|
45
|
-
addChangeListener(groupId, onUpdate);
|
|
46
|
-
return () => {
|
|
47
|
-
removeChangeListener(groupId, onUpdate);
|
|
48
|
-
};
|
|
49
|
-
}, [groupId, onUpdate, persist]);
|
|
50
|
-
useLayoutEffect(() => {
|
|
51
|
-
const hash = window.location.hash.slice(1);
|
|
52
|
-
if (!hash)
|
|
53
|
-
return;
|
|
54
|
-
for (const [value, id] of valueToIdMap.entries()) {
|
|
55
|
-
if (id === hash) {
|
|
56
|
-
setValue(value);
|
|
57
|
-
tabsRef.current?.scrollIntoView();
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}, [valueToIdMap]);
|
|
62
|
-
return (_jsxs(Primitive.Tabs, { ref: mergeRefs(ref, tabsRef), value: value, onValueChange: (v) => {
|
|
63
|
-
if (updateAnchor) {
|
|
64
|
-
const id = valueToIdMap.get(v);
|
|
65
|
-
if (id) {
|
|
66
|
-
window.history.replaceState(null, '', `#${id}`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (groupId) {
|
|
70
|
-
listeners.get(groupId)?.forEach((item) => {
|
|
71
|
-
item(v);
|
|
72
|
-
});
|
|
73
|
-
if (persist)
|
|
74
|
-
localStorage.setItem(groupId, v);
|
|
75
|
-
else
|
|
76
|
-
sessionStorage.setItem(groupId, v);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
setValue(v);
|
|
80
|
-
}
|
|
81
|
-
}, className: cn('my-4', className), ...props, children: [items && (_jsxs(TabsList, { children: [label && (_jsx("span", { className: "text-sm font-medium my-auto me-auto", children: label })), items.map((item) => (_jsx(TabsTrigger, { value: escapeValue(item), children: item }, item)))] })), _jsx(TabsContext.Provider, { value: useMemo(() => ({ items, valueToIdMap, collection }), [valueToIdMap, collection, items]), children: props.children })] }));
|
|
21
|
+
return (_jsxs(Unstyled.Tabs, { ref: ref, className: cn('flex flex-col overflow-hidden rounded-xl border bg-fd-secondary my-4', className), value: value, onValueChange: (v) => {
|
|
22
|
+
if (items && !items.some((item) => escapeValue(item) === v))
|
|
23
|
+
return;
|
|
24
|
+
setValue(v);
|
|
25
|
+
}, ...props, children: [items && (_jsxs(TabsList, { children: [label && (_jsx("span", { className: "text-sm font-medium my-auto me-auto", children: label })), items.map((item) => (_jsx(TabsTrigger, { value: escapeValue(item), children: item }, item)))] })), _jsx(TabsContext.Provider, { value: useMemo(() => ({ items, collection }), [collection, items]), children: props.children })] }));
|
|
82
26
|
}
|
|
83
27
|
export function Tab({ value, ...props }) {
|
|
84
28
|
const { items } = useTabContext();
|
|
@@ -90,11 +34,7 @@ export function Tab({ value, ...props }) {
|
|
|
90
34
|
return (_jsx(TabsContent, { value: escapeValue(resolved), ...props, children: props.children }));
|
|
91
35
|
}
|
|
92
36
|
export function TabsContent({ value, className, ...props }) {
|
|
93
|
-
|
|
94
|
-
if (props.id) {
|
|
95
|
-
valueToIdMap.set(value, props.id);
|
|
96
|
-
}
|
|
97
|
-
return (_jsx(Primitive.TabsContent, { value: value, forceMount: true, className: cn('prose-no-margin data-[state=inactive]:hidden [&>figure:only-child]:-m-4 [&>figure:only-child]:border-none', className), ...props, children: props.children }));
|
|
37
|
+
return (_jsx(Unstyled.TabsContent, { value: value, forceMount: true, className: cn('p-4 text-[15px] bg-fd-background rounded-xl outline-none prose-no-margin data-[state=inactive]:hidden [&>figure:only-child]:-m-4 [&>figure:only-child]:border-none', className), ...props, children: props.children }));
|
|
98
38
|
}
|
|
99
39
|
/**
|
|
100
40
|
* Inspired by Headless UI.
|
|
@@ -116,6 +56,9 @@ function useCollectionIndex() {
|
|
|
116
56
|
collection.push(key);
|
|
117
57
|
return collection.indexOf(key);
|
|
118
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* only escape whitespaces in values in simple mode
|
|
61
|
+
*/
|
|
119
62
|
function escapeValue(v) {
|
|
120
63
|
return v.toLowerCase().replace(/\s/, '-');
|
|
121
64
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import * as Primitive from '@radix-ui/react-tabs';
|
|
3
|
+
export interface TabsProps extends ComponentProps<typeof Primitive.Tabs> {
|
|
4
|
+
/**
|
|
5
|
+
* Identifier for Sharing value of tabs
|
|
6
|
+
*/
|
|
7
|
+
groupId?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Enable persistent
|
|
10
|
+
*/
|
|
11
|
+
persist?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* If true, updates the URL hash based on the tab's id
|
|
14
|
+
*/
|
|
15
|
+
updateAnchor?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const TabsList: import("react").ForwardRefExoticComponent<Primitive.TabsListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export declare const TabsTrigger: import("react").ForwardRefExoticComponent<Primitive.TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
/**
|
|
20
|
+
* @internal You better not use it
|
|
21
|
+
*/
|
|
22
|
+
export declare function Tabs({ ref, groupId, persist, updateAnchor, defaultValue, value: _value, onValueChange: _onValueChange, ...props }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function TabsContent({ value, ...props }: ComponentProps<typeof Primitive.TabsContent>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=tabs.unstyled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.unstyled.d.ts","sourceRoot":"","sources":["../../src/components/tabs.unstyled.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAOpB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAqBlD,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC;IACtE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAYD,eAAO,MAAM,QAAQ,oHAAqB,CAAC;AAE3C,eAAO,MAAM,WAAW,0HAAwB,CAAC;AAEjD;;GAEG;AACH,wBAAgB,IAAI,CAAC,EACnB,GAAG,EACH,OAAO,EACP,OAAe,EACf,YAAoB,EACpB,YAAY,EACZ,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,cAAc,EAC7B,GAAG,KAAK,EACT,EAAE,SAAS,2CAsEX;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,WAAW,CAAC,2CAY9C"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
4
|
+
import * as Primitive from '@radix-ui/react-tabs';
|
|
5
|
+
import { mergeRefs } from '../utils/merge-refs.js';
|
|
6
|
+
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
|
7
|
+
const listeners = new Map();
|
|
8
|
+
function addChangeListener(id, listener) {
|
|
9
|
+
const list = listeners.get(id) ?? [];
|
|
10
|
+
list.push(listener);
|
|
11
|
+
listeners.set(id, list);
|
|
12
|
+
}
|
|
13
|
+
function removeChangeListener(id, listener) {
|
|
14
|
+
const list = listeners.get(id) ?? [];
|
|
15
|
+
listeners.set(id, list.filter((item) => item !== listener));
|
|
16
|
+
}
|
|
17
|
+
const TabsContext = createContext(null);
|
|
18
|
+
function useTabContext() {
|
|
19
|
+
const ctx = useContext(TabsContext);
|
|
20
|
+
if (!ctx)
|
|
21
|
+
throw new Error('You must wrap your component in <Tabs>');
|
|
22
|
+
return ctx;
|
|
23
|
+
}
|
|
24
|
+
export const TabsList = Primitive.TabsList;
|
|
25
|
+
export const TabsTrigger = Primitive.TabsTrigger;
|
|
26
|
+
/**
|
|
27
|
+
* @internal You better not use it
|
|
28
|
+
*/
|
|
29
|
+
export function Tabs({ ref, groupId, persist = false, updateAnchor = false, defaultValue, value: _value, onValueChange: _onValueChange, ...props }) {
|
|
30
|
+
const tabsRef = useRef(null);
|
|
31
|
+
const [value, setValue] = _value === undefined
|
|
32
|
+
? // eslint-disable-next-line react-hooks/rules-of-hooks -- not supposed to change controlled/uncontrolled
|
|
33
|
+
useState(defaultValue)
|
|
34
|
+
: [_value, _onValueChange ?? (() => undefined)];
|
|
35
|
+
const onChange = useEffectEvent((v) => setValue(v));
|
|
36
|
+
const valueToIdMap = useMemo(() => new Map(), []);
|
|
37
|
+
useLayoutEffect(() => {
|
|
38
|
+
if (!groupId)
|
|
39
|
+
return;
|
|
40
|
+
const previous = persist
|
|
41
|
+
? localStorage.getItem(groupId)
|
|
42
|
+
: sessionStorage.getItem(groupId);
|
|
43
|
+
if (previous)
|
|
44
|
+
onChange(previous);
|
|
45
|
+
addChangeListener(groupId, onChange);
|
|
46
|
+
return () => {
|
|
47
|
+
removeChangeListener(groupId, onChange);
|
|
48
|
+
};
|
|
49
|
+
}, [groupId, onChange, persist]);
|
|
50
|
+
useLayoutEffect(() => {
|
|
51
|
+
const hash = window.location.hash.slice(1);
|
|
52
|
+
if (!hash)
|
|
53
|
+
return;
|
|
54
|
+
for (const [value, id] of valueToIdMap.entries()) {
|
|
55
|
+
if (id === hash) {
|
|
56
|
+
onChange(value);
|
|
57
|
+
tabsRef.current?.scrollIntoView();
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, [onChange, valueToIdMap]);
|
|
62
|
+
return (_jsx(Primitive.Tabs, { ref: mergeRefs(ref, tabsRef), value: value, onValueChange: (v) => {
|
|
63
|
+
if (updateAnchor) {
|
|
64
|
+
const id = valueToIdMap.get(v);
|
|
65
|
+
if (id) {
|
|
66
|
+
window.history.replaceState(null, '', `#${id}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (groupId) {
|
|
70
|
+
listeners.get(groupId)?.forEach((item) => {
|
|
71
|
+
item(v);
|
|
72
|
+
});
|
|
73
|
+
if (persist)
|
|
74
|
+
localStorage.setItem(groupId, v);
|
|
75
|
+
else
|
|
76
|
+
sessionStorage.setItem(groupId, v);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
setValue(v);
|
|
80
|
+
}
|
|
81
|
+
}, ...props, children: _jsx(TabsContext.Provider, { value: useMemo(() => ({ valueToIdMap }), [valueToIdMap]), children: props.children }) }));
|
|
82
|
+
}
|
|
83
|
+
export function TabsContent({ value, ...props }) {
|
|
84
|
+
const { valueToIdMap } = useTabContext();
|
|
85
|
+
if (props.id) {
|
|
86
|
+
valueToIdMap.set(value, props.id);
|
|
87
|
+
}
|
|
88
|
+
return (_jsx(Primitive.TabsContent, { value: value, ...props, children: props.children }));
|
|
89
|
+
}
|
package/dist/layouts/docs.js
CHANGED
|
@@ -22,17 +22,17 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { t
|
|
|
22
22
|
const variables = cn('md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px] xl:[--fd-toc-width:286px]', !nav.component && nav.enabled !== false
|
|
23
23
|
? '[--fd-nav-height:56px] md:[--fd-nav-height:0px]'
|
|
24
24
|
: undefined);
|
|
25
|
-
const sidebar = sidebarComponent ?? (_jsxs(_Fragment, { children: [sidebarCollapsible ? _jsx(CollapsibleControl, {}) : null, _jsxs(Sidebar, { ...sidebarProps, collapsible: sidebarCollapsible, children: [_jsx(HideIfEmpty, { children: _jsxs(SidebarHeader, { children: [_jsxs("div", { className: "flex max-md:hidden", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[15px] items-center gap-2.5 font-medium me-auto", children: nav.title }), nav.children, sidebarCollapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
25
|
+
const sidebar = sidebarComponent ?? (_jsxs(_Fragment, { children: [sidebarCollapsible ? _jsx(CollapsibleControl, {}) : null, _jsxs(Sidebar, { ...sidebarProps, collapsible: sidebarCollapsible, children: [_jsx(HideIfEmpty, { children: _jsxs(SidebarHeader, { className: "data-[empty=true]:hidden", children: [_jsxs("div", { className: "flex max-md:hidden", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[15px] items-center gap-2.5 font-medium me-auto", children: nav.title }), nav.children, sidebarCollapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
26
26
|
color: 'ghost',
|
|
27
27
|
size: 'icon-sm',
|
|
28
28
|
className: 'mb-auto text-fd-muted-foreground max-md:hidden',
|
|
29
29
|
})), children: _jsx(SidebarIcon, {}) }))] }), searchToggle.enabled !== false &&
|
|
30
30
|
(searchToggle.components?.lg ?? (_jsx(LargeSearchToggle, { hideIfDisabled: true, className: "max-md:hidden" }))), tabs.length > 0 && _jsx(RootToggle, { options: tabs }), sidebarBanner] }) }), _jsxs(SidebarViewport, { children: [links
|
|
31
31
|
.filter((v) => v.type !== 'icon')
|
|
32
|
-
.map((item, i, list) => (_jsx(SidebarLinkItem, { item: item, className: cn(i === list.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { className: "empty:hidden", children: [
|
|
32
|
+
.map((item, i, list) => (_jsx(SidebarLinkItem, { item: item, className: cn(i === list.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsx(HideIfEmpty, { children: _jsxs(SidebarFooter, { className: "data-[empty=true]:hidden", children: [_jsxs("div", { className: "flex items-center justify-end empty:hidden", children: [links
|
|
33
33
|
.filter((item) => item.type === 'icon')
|
|
34
34
|
.map((item, i, arr) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({ size: 'icon', color: 'ghost' }), 'text-fd-muted-foreground md:[&_svg]:size-4.5', i === arr.length - 1 && 'me-auto'), "aria-label": item.label, children: item.icon }, i))), i18n ? (_jsxs(LanguageToggle, { className: "me-1.5", children: [_jsx(Languages, { className: "size-4.5" }), _jsx(LanguageToggleText, { className: "md:hidden" })] })) : null, themeSwitch.enabled !== false &&
|
|
35
|
-
(themeSwitch.component ?? (_jsx(ThemeToggle, { className: "p-0", mode: themeSwitch.mode })))] })
|
|
35
|
+
(themeSwitch.component ?? (_jsx(ThemeToggle, { className: "p-0", mode: themeSwitch.mode })))] }), sidebarFooter] }) })] })] }));
|
|
36
36
|
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsxs(NavProvider, { transparentMode: transparentMode, children: [nav.enabled !== false &&
|
|
37
37
|
(nav.component ?? (_jsxs(Navbar, { className: "h-14 md:hidden", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-semibold", children: nav.title }), _jsx("div", { className: "flex-1", children: nav.children }), searchToggle?.enabled !== false &&
|
|
38
38
|
(searchToggle.components?.sm ?? (_jsx(SearchToggle, { className: "p-2", hideIfDisabled: true }))), _jsx(NavbarSidebarTrigger, { className: "p-2 -me-1.5 md:hidden" })] }))), _jsxs(LayoutBody, { ...props.containerProps, className: cn(variables, props.containerProps?.className), children: [sidebarEnabled && sidebar, children] })] }) }));
|
|
@@ -44,8 +44,8 @@ export function LayoutTabs({ options, ...props }) {
|
|
|
44
44
|
return isActive(option.url, pathname, true);
|
|
45
45
|
});
|
|
46
46
|
}, [options, pathname]);
|
|
47
|
-
return (_jsx("div", { ...props, className: cn('flex flex-row items-
|
|
47
|
+
return (_jsx("div", { ...props, className: cn('flex flex-row items-center gap-2 overflow-auto', props.className), children: options.map((option) => (_jsx(LayoutTab, { selected: selected === option, option: option }, option.url))) }));
|
|
48
48
|
}
|
|
49
49
|
function LayoutTab({ option, selected = false, }) {
|
|
50
|
-
return (_jsx(Link, { className: cn('inline-flex items-center py-
|
|
50
|
+
return (_jsx(Link, { className: cn('inline-flex rounded-full items-center px-2 py-1.5 font-medium gap-2 text-fd-muted-foreground text-sm text-nowrap', selected && 'bg-fd-primary/10 text-fd-primary'), href: option.url, children: option.title }));
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,kBAAkB,CAAC;AAqBlE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAGL,MAAM,EACN,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAU3B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE/B,GAAG,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG;QAC7B,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;KACvB,CAAC;IAEF,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAElC,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAiJhD;
|
|
1
|
+
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,kBAAkB,CAAC;AAqBlE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAGL,MAAM,EACN,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAU3B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE/B,GAAG,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG;QAC7B,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;KACvB,CAAC;IAEF,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAElC,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAiJhD;AAiMD,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/layouts/notebook.js
CHANGED
|
@@ -30,9 +30,9 @@ export function DocsLayout(props) {
|
|
|
30
30
|
})), children: _jsx(SidebarIcon, {}) }))] }));
|
|
31
31
|
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsx(NavProvider, { transparentMode: transparentMode, children: _jsxs(LayoutBody, { ...props.containerProps, className: cn(variables, props.containerProps?.className), children: [_jsxs(Sidebar, { ...sidebar, className: cn(navMode === 'top'
|
|
32
32
|
? 'border-e-0 md:bg-transparent'
|
|
33
|
-
: 'md:[--fd-nav-height:0px]', sidebar.className), children: [_jsx(HideIfEmpty, { children: _jsxs(SidebarHeader, { children: [navMode === 'auto' && sidebarHeader, nav.children, sidebarBanner, tabMode === 'sidebar' && tabs.length > 0 ? (_jsx(RootToggle, { className: "mb-2", options: tabs })) : null, tabMode === 'navbar' && tabs.length > 0 && (_jsx(RootToggle, { options: tabs, className: "lg:hidden" }))] }) }), _jsxs(SidebarViewport, { children: [links
|
|
33
|
+
: 'md:[--fd-nav-height:0px]', sidebar.className), children: [_jsx(HideIfEmpty, { children: _jsxs(SidebarHeader, { className: "data-[empty=true]:hidden", children: [navMode === 'auto' && sidebarHeader, nav.children, sidebarBanner, tabMode === 'sidebar' && tabs.length > 0 ? (_jsx(RootToggle, { className: "mb-2", options: tabs })) : null, tabMode === 'navbar' && tabs.length > 0 && (_jsx(RootToggle, { options: tabs, className: "lg:hidden" }))] }) }), _jsxs(SidebarViewport, { children: [links
|
|
34
34
|
.filter((item) => item.type !== 'icon')
|
|
35
|
-
.map((item, i) => (_jsx(SidebarLinkItem, { item: item, className: cn('lg:hidden', i === links.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsx(HideIfEmpty, { children: _jsxs(SidebarFooter, { className: "flex flex-row items-center justify-end", children: [_jsx("div", { className: "flex items-center flex-1 empty:hidden lg:hidden", children: links
|
|
35
|
+
.map((item, i) => (_jsx(SidebarLinkItem, { item: item, className: cn('lg:hidden', i === links.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsx(HideIfEmpty, { children: _jsxs(SidebarFooter, { className: "flex flex-row items-center justify-end data-[empty=true]:hidden", children: [_jsx("div", { className: "flex items-center flex-1 empty:hidden lg:hidden", children: links
|
|
36
36
|
.filter((item) => item.type === 'icon')
|
|
37
37
|
.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({
|
|
38
38
|
size: 'icon-sm',
|
|
@@ -60,7 +60,7 @@ function DocsNavbar({ links, tabs, searchToggle = {}, themeSwitch = {}, ...props
|
|
|
60
60
|
(themeSwitch.component ?? (_jsx(ThemeToggle, { className: "ms-2 max-md:hidden", mode: themeSwitch.mode ?? 'light-dark-system' }))), sidebarCollapsible && navMode === 'top' ? (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
61
61
|
color: 'secondary',
|
|
62
62
|
size: 'icon-sm',
|
|
63
|
-
}), 'ms-2 text-fd-muted-foreground rounded-full max-md:hidden'), children: _jsx(SidebarIcon, {}) })) : null] })] }), tabs.length > 0 && (_jsx(LayoutTabs, { className:
|
|
63
|
+
}), 'ms-2 text-fd-muted-foreground rounded-full max-md:hidden'), children: _jsx(SidebarIcon, {}) })) : null] })] }), tabs.length > 0 && (_jsx(LayoutTabs, { className: cn('border-b h-10 max-lg:hidden', navMode === 'top' ? 'px-4' : 'px-6'), options: tabs }))] }));
|
|
64
64
|
}
|
|
65
65
|
function NavbarLinkItem({ item, ...props }) {
|
|
66
66
|
if (item.type === 'menu') {
|
package/dist/mdx.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
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
4
|
declare function Image(props: ImgHTMLAttributes<HTMLImageElement> & {
|
|
4
5
|
sizes?: string;
|
|
5
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
declare function Table(props: TableHTMLAttributes<HTMLTableElement>): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
declare const defaultMdxComponents: {
|
|
9
|
+
CodeBlockTab: (props: import("react").ComponentProps<typeof import("./components/tabs.unstyled.js").TabsContent>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
CodeBlockTabs: typeof CodeBlockTabs;
|
|
11
|
+
CodeBlockTabsList: typeof CodeBlockTabsList;
|
|
12
|
+
CodeBlockTabsTrigger: typeof CodeBlockTabsTrigger;
|
|
8
13
|
pre: (props: HTMLAttributes<HTMLPreElement>) => import("react/jsx-runtime").JSX.Element;
|
|
9
14
|
Card: typeof Card;
|
|
10
15
|
Cards: typeof Cards;
|
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;
|
|
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,CAAC,GAAG;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,2CAUF;AAED,iBAAS,KAAK,CAAC,KAAK,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,2CAM1D;AAED,QAAA,MAAM,oBAAoB;;;;;iBAKX,cAAc,CAAC,cAAc,CAAC;;;OAOhC,EAAE,CAAC,oBAAoB,CAAC,iBAAiB,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/mdx.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Card, Cards } from './components/card.js';
|
|
|
5
5
|
import { Callout } from './components/callout.js';
|
|
6
6
|
import { Heading } from './components/heading.js';
|
|
7
7
|
import { cn } from './utils/cn.js';
|
|
8
|
-
import { CodeBlock, Pre } from './components/codeblock.js';
|
|
8
|
+
import { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre, } from './components/codeblock.js';
|
|
9
9
|
function Image(props) {
|
|
10
10
|
return (_jsx(FrameworkImage, { sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px", ...props, src: props.src, className: cn('rounded-lg', props.className) }));
|
|
11
11
|
}
|
|
@@ -13,6 +13,10 @@ function Table(props) {
|
|
|
13
13
|
return (_jsx("div", { className: "relative overflow-auto prose-no-margin my-6", children: _jsx("table", { ...props }) }));
|
|
14
14
|
}
|
|
15
15
|
const defaultMdxComponents = {
|
|
16
|
+
CodeBlockTab,
|
|
17
|
+
CodeBlockTabs,
|
|
18
|
+
CodeBlockTabsList,
|
|
19
|
+
CodeBlockTabsTrigger,
|
|
16
20
|
pre: (props) => (_jsx(CodeBlock, { ...props, children: _jsx(Pre, { children: props.children }) })),
|
|
17
21
|
Card,
|
|
18
22
|
Cards,
|
package/dist/style.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.
|
|
1
|
+
/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -7,10 +7,6 @@
|
|
|
7
7
|
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
8
8
|
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
|
9
9
|
"Courier New", monospace;
|
|
10
|
-
--color-red-500: oklch(63.7% 0.237 25.331);
|
|
11
|
-
--color-amber-500: oklch(76.9% 0.188 70.08);
|
|
12
|
-
--color-green-500: oklch(72.3% 0.219 149.579);
|
|
13
|
-
--color-blue-500: oklch(62.3% 0.214 259.815);
|
|
14
10
|
--color-black: #000;
|
|
15
11
|
--spacing: 0.25rem;
|
|
16
12
|
--breakpoint-sm: 40rem;
|
|
@@ -34,7 +30,6 @@
|
|
|
34
30
|
--animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
35
31
|
--blur-xs: 4px;
|
|
36
32
|
--blur-sm: 8px;
|
|
37
|
-
--blur-md: 12px;
|
|
38
33
|
--blur-lg: 16px;
|
|
39
34
|
--blur-xl: 24px;
|
|
40
35
|
--default-transition-duration: 150ms;
|
|
@@ -56,6 +51,10 @@
|
|
|
56
51
|
--color-fd-secondary-foreground: hsl(0, 0%, 9%);
|
|
57
52
|
--color-fd-accent: hsla(0, 0%, 82%, 50%);
|
|
58
53
|
--color-fd-accent-foreground: hsl(0, 0%, 9%);
|
|
54
|
+
--color-fd-info: oklch(62.3% 0.214 259.815);
|
|
55
|
+
--color-fd-warning: oklch(76.9% 0.188 70.08);
|
|
56
|
+
--color-fd-error: oklch(63.7% 0.237 25.331);
|
|
57
|
+
--color-fd-success: oklch(72.3% 0.219 149.579);
|
|
59
58
|
--spacing-fd-container: 1400px;
|
|
60
59
|
--fd-page-width: 1200px;
|
|
61
60
|
--fd-sidebar-width: 0px;
|
|
@@ -304,6 +303,9 @@
|
|
|
304
303
|
.inset-x-0 {
|
|
305
304
|
inset-inline: calc(var(--spacing) * 0);
|
|
306
305
|
}
|
|
306
|
+
.inset-x-2 {
|
|
307
|
+
inset-inline: calc(var(--spacing) * 2);
|
|
308
|
+
}
|
|
307
309
|
.inset-y-0 {
|
|
308
310
|
inset-block: calc(var(--spacing) * 0);
|
|
309
311
|
}
|
|
@@ -349,27 +351,33 @@
|
|
|
349
351
|
.top-0 {
|
|
350
352
|
top: calc(var(--spacing) * 0);
|
|
351
353
|
}
|
|
354
|
+
.top-1 {
|
|
355
|
+
top: calc(var(--spacing) * 1);
|
|
356
|
+
}
|
|
352
357
|
.top-1\.5 {
|
|
353
358
|
top: calc(var(--spacing) * 1.5);
|
|
354
359
|
}
|
|
355
360
|
.top-1\/2 {
|
|
356
361
|
top: calc(1/2 * 100%);
|
|
357
362
|
}
|
|
358
|
-
.top-2 {
|
|
359
|
-
top: calc(var(--spacing) * 2);
|
|
360
|
-
}
|
|
361
363
|
.top-4 {
|
|
362
364
|
top: calc(var(--spacing) * 4);
|
|
363
365
|
}
|
|
364
366
|
.top-14 {
|
|
365
367
|
top: calc(var(--spacing) * 14);
|
|
366
368
|
}
|
|
367
|
-
.right-
|
|
368
|
-
right: calc(var(--spacing) *
|
|
369
|
+
.right-0 {
|
|
370
|
+
right: calc(var(--spacing) * 0);
|
|
371
|
+
}
|
|
372
|
+
.right-1 {
|
|
373
|
+
right: calc(var(--spacing) * 1);
|
|
369
374
|
}
|
|
370
375
|
.bottom-\(--fd-sidebar-margin\) {
|
|
371
376
|
bottom: var(--fd-sidebar-margin);
|
|
372
377
|
}
|
|
378
|
+
.bottom-0 {
|
|
379
|
+
bottom: calc(var(--spacing) * 0);
|
|
380
|
+
}
|
|
373
381
|
.bottom-1\.5 {
|
|
374
382
|
bottom: calc(var(--spacing) * 1.5);
|
|
375
383
|
}
|
|
@@ -379,6 +387,9 @@
|
|
|
379
387
|
.left-1\/2 {
|
|
380
388
|
left: calc(1/2 * 100%);
|
|
381
389
|
}
|
|
390
|
+
.z-2 {
|
|
391
|
+
z-index: 2;
|
|
392
|
+
}
|
|
382
393
|
.z-10 {
|
|
383
394
|
z-index: 10;
|
|
384
395
|
}
|
|
@@ -397,9 +408,6 @@
|
|
|
397
408
|
.z-\[-1\] {
|
|
398
409
|
z-index: -1;
|
|
399
410
|
}
|
|
400
|
-
.z-\[2\] {
|
|
401
|
-
z-index: 2;
|
|
402
|
-
}
|
|
403
411
|
.container {
|
|
404
412
|
width: 100%;
|
|
405
413
|
@media (width >= 40rem) {
|
|
@@ -461,12 +469,12 @@
|
|
|
461
469
|
.ms-px {
|
|
462
470
|
margin-inline-start: 1px;
|
|
463
471
|
}
|
|
472
|
+
.-me-0\.5 {
|
|
473
|
+
margin-inline-end: calc(var(--spacing) * -0.5);
|
|
474
|
+
}
|
|
464
475
|
.-me-1\.5 {
|
|
465
476
|
margin-inline-end: calc(var(--spacing) * -1.5);
|
|
466
477
|
}
|
|
467
|
-
.-me-2 {
|
|
468
|
-
margin-inline-end: calc(var(--spacing) * -2);
|
|
469
|
-
}
|
|
470
478
|
.me-1\.5 {
|
|
471
479
|
margin-inline-end: calc(var(--spacing) * 1.5);
|
|
472
480
|
}
|
|
@@ -973,6 +981,9 @@
|
|
|
973
981
|
.h-1\.5 {
|
|
974
982
|
height: calc(var(--spacing) * 1.5);
|
|
975
983
|
}
|
|
984
|
+
.h-9\.5 {
|
|
985
|
+
height: calc(var(--spacing) * 9.5);
|
|
986
|
+
}
|
|
976
987
|
.h-10 {
|
|
977
988
|
height: calc(var(--spacing) * 10);
|
|
978
989
|
}
|
|
@@ -988,6 +999,9 @@
|
|
|
988
999
|
.h-full {
|
|
989
1000
|
height: 100%;
|
|
990
1001
|
}
|
|
1002
|
+
.h-px {
|
|
1003
|
+
height: 1px;
|
|
1004
|
+
}
|
|
991
1005
|
.max-h-\[50vh\] {
|
|
992
1006
|
max-height: 50vh;
|
|
993
1007
|
}
|
|
@@ -1012,6 +1026,9 @@
|
|
|
1012
1026
|
.w-0 {
|
|
1013
1027
|
width: calc(var(--spacing) * 0);
|
|
1014
1028
|
}
|
|
1029
|
+
.w-1 {
|
|
1030
|
+
width: calc(var(--spacing) * 1);
|
|
1031
|
+
}
|
|
1015
1032
|
.w-1\.5 {
|
|
1016
1033
|
width: calc(var(--spacing) * 1.5);
|
|
1017
1034
|
}
|
|
@@ -1123,12 +1140,6 @@
|
|
|
1123
1140
|
--tw-translate-y: 100%;
|
|
1124
1141
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1125
1142
|
}
|
|
1126
|
-
.scale-0 {
|
|
1127
|
-
--tw-scale-x: 0%;
|
|
1128
|
-
--tw-scale-y: 0%;
|
|
1129
|
-
--tw-scale-z: 0%;
|
|
1130
|
-
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
1131
|
-
}
|
|
1132
1143
|
.-rotate-90 {
|
|
1133
1144
|
rotate: calc(90deg * -1);
|
|
1134
1145
|
}
|
|
@@ -1265,6 +1276,9 @@
|
|
|
1265
1276
|
.rounded-xl {
|
|
1266
1277
|
border-radius: var(--radius-xl);
|
|
1267
1278
|
}
|
|
1279
|
+
.rounded-bl-lg {
|
|
1280
|
+
border-bottom-left-radius: var(--radius-lg);
|
|
1281
|
+
}
|
|
1268
1282
|
.border {
|
|
1269
1283
|
border-style: var(--tw-border-style);
|
|
1270
1284
|
border-width: 1px;
|
|
@@ -1273,10 +1287,6 @@
|
|
|
1273
1287
|
border-inline-start-style: var(--tw-border-style);
|
|
1274
1288
|
border-inline-start-width: 1px;
|
|
1275
1289
|
}
|
|
1276
|
-
.border-s-2 {
|
|
1277
|
-
border-inline-start-style: var(--tw-border-style);
|
|
1278
|
-
border-inline-start-width: 2px;
|
|
1279
|
-
}
|
|
1280
1290
|
.border-e {
|
|
1281
1291
|
border-inline-end-style: var(--tw-border-style);
|
|
1282
1292
|
border-inline-end-width: 1px;
|
|
@@ -1307,34 +1317,13 @@
|
|
|
1307
1317
|
border-color: color-mix(in oklab, var(--color-fd-foreground) 10%, transparent);
|
|
1308
1318
|
}
|
|
1309
1319
|
}
|
|
1310
|
-
.border-fd-primary {
|
|
1311
|
-
border-color: var(--color-fd-primary);
|
|
1312
|
-
}
|
|
1313
1320
|
.border-transparent {
|
|
1314
1321
|
border-color: transparent;
|
|
1315
1322
|
}
|
|
1316
|
-
.
|
|
1317
|
-
|
|
1323
|
+
.bg-\(--callout-color\)\/50 {
|
|
1324
|
+
background-color: var(--callout-color);
|
|
1318
1325
|
@supports (color: color-mix(in lab, red, red)) {
|
|
1319
|
-
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
.border-s-blue-500\/50 {
|
|
1323
|
-
border-inline-start-color: color-mix(in srgb, oklch(62.3% 0.214 259.815) 50%, transparent);
|
|
1324
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1325
|
-
border-inline-start-color: color-mix(in oklab, var(--color-blue-500) 50%, transparent);
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
.border-s-green-500\/50 {
|
|
1329
|
-
border-inline-start-color: color-mix(in srgb, oklch(72.3% 0.219 149.579) 50%, transparent);
|
|
1330
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1331
|
-
border-inline-start-color: color-mix(in oklab, var(--color-green-500) 50%, transparent);
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
.border-s-red-500\/50 {
|
|
1335
|
-
border-inline-start-color: color-mix(in srgb, oklch(63.7% 0.237 25.331) 50%, transparent);
|
|
1336
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1337
|
-
border-inline-start-color: color-mix(in oklab, var(--color-red-500) 50%, transparent);
|
|
1326
|
+
background-color: color-mix(in oklab, var(--callout-color) 50%, transparent);
|
|
1338
1327
|
}
|
|
1339
1328
|
}
|
|
1340
1329
|
.bg-\(--shiki-light-bg\) {
|
|
@@ -1397,17 +1386,8 @@
|
|
|
1397
1386
|
.\[mask-image\:linear-gradient\(to_bottom\,transparent\,white_16px\,white_calc\(100\%-16px\)\,transparent\)\] {
|
|
1398
1387
|
mask-image: linear-gradient(to bottom,transparent,white 16px,white calc(100% - 16px),transparent);
|
|
1399
1388
|
}
|
|
1400
|
-
.fill-
|
|
1401
|
-
fill: var(--color
|
|
1402
|
-
}
|
|
1403
|
-
.fill-blue-500 {
|
|
1404
|
-
fill: var(--color-blue-500);
|
|
1405
|
-
}
|
|
1406
|
-
.fill-green-500 {
|
|
1407
|
-
fill: var(--color-green-500);
|
|
1408
|
-
}
|
|
1409
|
-
.fill-red-500 {
|
|
1410
|
-
fill: var(--color-red-500);
|
|
1389
|
+
.fill-\(--callout-color\) {
|
|
1390
|
+
fill: var(--callout-color);
|
|
1411
1391
|
}
|
|
1412
1392
|
.stroke-current\/25 {
|
|
1413
1393
|
stroke: currentcolor;
|
|
@@ -1445,6 +1425,9 @@
|
|
|
1445
1425
|
.px-\(--fd-layout-offset\) {
|
|
1446
1426
|
padding-inline: var(--fd-layout-offset);
|
|
1447
1427
|
}
|
|
1428
|
+
.px-1 {
|
|
1429
|
+
padding-inline: calc(var(--spacing) * 1);
|
|
1430
|
+
}
|
|
1448
1431
|
.px-1\.5 {
|
|
1449
1432
|
padding-inline: calc(var(--spacing) * 1.5);
|
|
1450
1433
|
}
|
|
@@ -1487,6 +1470,9 @@
|
|
|
1487
1470
|
.py-12 {
|
|
1488
1471
|
padding-block: calc(var(--spacing) * 12);
|
|
1489
1472
|
}
|
|
1473
|
+
.ps-1 {
|
|
1474
|
+
padding-inline-start: calc(var(--spacing) * 1);
|
|
1475
|
+
}
|
|
1490
1476
|
.ps-2 {
|
|
1491
1477
|
padding-inline-start: calc(var(--spacing) * 2);
|
|
1492
1478
|
}
|
|
@@ -1683,11 +1669,6 @@
|
|
|
1683
1669
|
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
1684
1670
|
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
1685
1671
|
}
|
|
1686
|
-
.backdrop-blur-md {
|
|
1687
|
-
--tw-backdrop-blur: blur(var(--blur-md));
|
|
1688
|
-
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
1689
|
-
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
1690
|
-
}
|
|
1691
1672
|
.backdrop-blur-sm {
|
|
1692
1673
|
--tw-backdrop-blur: blur(var(--blur-sm));
|
|
1693
1674
|
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
@@ -1813,11 +1794,9 @@
|
|
|
1813
1794
|
flex-direction: column;
|
|
1814
1795
|
}
|
|
1815
1796
|
}
|
|
1816
|
-
.group-
|
|
1817
|
-
&:is(:where(.group)
|
|
1818
|
-
|
|
1819
|
-
opacity: 100%;
|
|
1820
|
-
}
|
|
1797
|
+
.group-data-\[state\=active\]\:bg-fd-primary {
|
|
1798
|
+
&:is(:where(.group)[data-state="active"] *) {
|
|
1799
|
+
background-color: var(--color-fd-primary);
|
|
1821
1800
|
}
|
|
1822
1801
|
}
|
|
1823
1802
|
.group-data-\[state\=open\]\:rotate-90 {
|
|
@@ -1842,6 +1821,11 @@
|
|
|
1842
1821
|
color: var(--color-fd-muted-foreground);
|
|
1843
1822
|
}
|
|
1844
1823
|
}
|
|
1824
|
+
.first\:ms-1 {
|
|
1825
|
+
&:first-child {
|
|
1826
|
+
margin-inline-start: calc(var(--spacing) * 1);
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1845
1829
|
.first\:mt-0 {
|
|
1846
1830
|
&:first-child {
|
|
1847
1831
|
margin-top: calc(var(--spacing) * 0);
|
|
@@ -1982,6 +1966,11 @@
|
|
|
1982
1966
|
display: none;
|
|
1983
1967
|
}
|
|
1984
1968
|
}
|
|
1969
|
+
.data-\[empty\=true\]\:hidden {
|
|
1970
|
+
&[data-empty="true"] {
|
|
1971
|
+
display: none;
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1985
1974
|
.data-\[motion\=from-end\]\:animate-fd-enterFromRight {
|
|
1986
1975
|
&[data-motion="from-end"] {
|
|
1987
1976
|
animation: var(--animate-fd-enterFromRight);
|
|
@@ -2388,16 +2377,6 @@
|
|
|
2388
2377
|
background-color: var(--shiki-dark-bg);
|
|
2389
2378
|
}
|
|
2390
2379
|
}
|
|
2391
|
-
.\[\&_\.line\]\:px-4 {
|
|
2392
|
-
& .line {
|
|
2393
|
-
padding-inline: calc(var(--spacing) * 4);
|
|
2394
|
-
}
|
|
2395
|
-
}
|
|
2396
|
-
.\[\&_\.line\]\:pl-3 {
|
|
2397
|
-
& .line {
|
|
2398
|
-
padding-left: calc(var(--spacing) * 3);
|
|
2399
|
-
}
|
|
2400
|
-
}
|
|
2401
2380
|
.\[\&_svg\]\:size-3\.5 {
|
|
2402
2381
|
& svg {
|
|
2403
2382
|
width: calc(var(--spacing) * 3.5);
|
|
@@ -2452,11 +2431,6 @@
|
|
|
2452
2431
|
border-style: none;
|
|
2453
2432
|
}
|
|
2454
2433
|
}
|
|
2455
|
-
.\[\@media\(hover\:hover\)\]\:opacity-0 {
|
|
2456
|
-
@media (hover:hover) {
|
|
2457
|
-
opacity: 0%;
|
|
2458
|
-
}
|
|
2459
|
-
}
|
|
2460
2434
|
}
|
|
2461
2435
|
.dark {
|
|
2462
2436
|
--color-fd-background: hsl(0, 0%, 7.04%);
|
|
@@ -2471,7 +2445,7 @@
|
|
|
2471
2445
|
--color-fd-primary: hsl(0, 0%, 98%);
|
|
2472
2446
|
--color-fd-primary-foreground: hsl(0, 0%, 9%);
|
|
2473
2447
|
--color-fd-secondary: hsl(0, 0%, 12.9%);
|
|
2474
|
-
--color-fd-secondary-foreground: hsl(0, 0%,
|
|
2448
|
+
--color-fd-secondary-foreground: hsl(0, 0%, 92%);
|
|
2475
2449
|
--color-fd-accent: hsla(0, 0%, 40.9%, 30%);
|
|
2476
2450
|
--color-fd-accent-foreground: hsl(0, 0%, 90%);
|
|
2477
2451
|
--color-fd-ring: hsl(0, 0%, 54.9%);
|
|
@@ -2482,12 +2456,16 @@
|
|
|
2482
2456
|
--color-fd-muted-foreground: hsl(0, 0%, 72%);
|
|
2483
2457
|
}
|
|
2484
2458
|
.shiki:not(.not-fumadocs-codeblock *) {
|
|
2459
|
+
--padding-left: calc(var(--spacing) * 3);
|
|
2460
|
+
--padding-right: calc(var(--spacing) * 3);
|
|
2485
2461
|
code span {
|
|
2486
2462
|
color: var(--shiki-light);
|
|
2487
2463
|
}
|
|
2488
2464
|
code .line {
|
|
2489
|
-
min-height: 1lh;
|
|
2490
2465
|
position: relative;
|
|
2466
|
+
min-height: 1lh;
|
|
2467
|
+
padding-left: var(--padding-left);
|
|
2468
|
+
padding-right: var(--padding-right);
|
|
2491
2469
|
}
|
|
2492
2470
|
&.has-focused code .line:not(.focused) {
|
|
2493
2471
|
filter: blur(2px);
|
|
@@ -2502,6 +2480,7 @@
|
|
|
2502
2480
|
&[data-line-numbers] code .line {
|
|
2503
2481
|
width: calc(100% - 7 * var(--spacing));
|
|
2504
2482
|
counter-increment: line;
|
|
2483
|
+
padding-left: calc(var(--padding-left) - var(--spacing));
|
|
2505
2484
|
margin-left: calc(var(--spacing) * 7);
|
|
2506
2485
|
&::after {
|
|
2507
2486
|
position: absolute;
|
|
@@ -2614,21 +2593,6 @@
|
|
|
2614
2593
|
inherits: false;
|
|
2615
2594
|
initial-value: 0;
|
|
2616
2595
|
}
|
|
2617
|
-
@property --tw-scale-x {
|
|
2618
|
-
syntax: "*";
|
|
2619
|
-
inherits: false;
|
|
2620
|
-
initial-value: 1;
|
|
2621
|
-
}
|
|
2622
|
-
@property --tw-scale-y {
|
|
2623
|
-
syntax: "*";
|
|
2624
|
-
inherits: false;
|
|
2625
|
-
initial-value: 1;
|
|
2626
|
-
}
|
|
2627
|
-
@property --tw-scale-z {
|
|
2628
|
-
syntax: "*";
|
|
2629
|
-
inherits: false;
|
|
2630
|
-
initial-value: 1;
|
|
2631
|
-
}
|
|
2632
2596
|
@property --tw-rotate-x {
|
|
2633
2597
|
syntax: "*";
|
|
2634
2598
|
inherits: false;
|
|
@@ -2821,6 +2785,21 @@
|
|
|
2821
2785
|
syntax: "*";
|
|
2822
2786
|
inherits: false;
|
|
2823
2787
|
}
|
|
2788
|
+
@property --tw-scale-x {
|
|
2789
|
+
syntax: "*";
|
|
2790
|
+
inherits: false;
|
|
2791
|
+
initial-value: 1;
|
|
2792
|
+
}
|
|
2793
|
+
@property --tw-scale-y {
|
|
2794
|
+
syntax: "*";
|
|
2795
|
+
inherits: false;
|
|
2796
|
+
initial-value: 1;
|
|
2797
|
+
}
|
|
2798
|
+
@property --tw-scale-z {
|
|
2799
|
+
syntax: "*";
|
|
2800
|
+
inherits: false;
|
|
2801
|
+
initial-value: 1;
|
|
2802
|
+
}
|
|
2824
2803
|
@keyframes pulse {
|
|
2825
2804
|
50% {
|
|
2826
2805
|
opacity: 0.5;
|
|
@@ -2883,13 +2862,13 @@
|
|
|
2883
2862
|
@keyframes fd-popover-in {
|
|
2884
2863
|
from {
|
|
2885
2864
|
opacity: 0;
|
|
2886
|
-
transform:
|
|
2865
|
+
transform: scale(0.7);
|
|
2887
2866
|
}
|
|
2888
2867
|
}
|
|
2889
2868
|
@keyframes fd-popover-out {
|
|
2890
2869
|
to {
|
|
2891
2870
|
opacity: 0;
|
|
2892
|
-
transform:
|
|
2871
|
+
transform: scale(0.7);
|
|
2893
2872
|
}
|
|
2894
2873
|
}
|
|
2895
2874
|
@keyframes fd-fade-in {
|
|
@@ -2985,9 +2964,6 @@
|
|
|
2985
2964
|
--tw-translate-x: 0;
|
|
2986
2965
|
--tw-translate-y: 0;
|
|
2987
2966
|
--tw-translate-z: 0;
|
|
2988
|
-
--tw-scale-x: 1;
|
|
2989
|
-
--tw-scale-y: 1;
|
|
2990
|
-
--tw-scale-z: 1;
|
|
2991
2967
|
--tw-rotate-x: initial;
|
|
2992
2968
|
--tw-rotate-y: initial;
|
|
2993
2969
|
--tw-rotate-z: initial;
|
|
@@ -3033,6 +3009,9 @@
|
|
|
3033
3009
|
--tw-backdrop-saturate: initial;
|
|
3034
3010
|
--tw-backdrop-sepia: initial;
|
|
3035
3011
|
--tw-duration: initial;
|
|
3012
|
+
--tw-scale-x: 1;
|
|
3013
|
+
--tw-scale-y: 1;
|
|
3014
|
+
--tw-scale-z: 1;
|
|
3036
3015
|
--radix-collapsible-content-height: 0px;
|
|
3037
3016
|
}
|
|
3038
3017
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.6.0",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -89,20 +89,20 @@
|
|
|
89
89
|
"react-medium-image-zoom": "^5.2.14",
|
|
90
90
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
91
91
|
"tailwind-merge": "^3.3.1",
|
|
92
|
-
"fumadocs-core": "15.
|
|
92
|
+
"fumadocs-core": "15.6.0"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@next/eslint-plugin-next": "^15.3.4",
|
|
96
|
-
"@tailwindcss/cli": "^4.1.
|
|
96
|
+
"@tailwindcss/cli": "^4.1.11",
|
|
97
97
|
"@types/lodash.merge": "^4.6.9",
|
|
98
98
|
"@types/react": "^19.1.8",
|
|
99
99
|
"@types/react-dom": "^19.1.6",
|
|
100
100
|
"next": "15.3.4",
|
|
101
|
-
"tailwindcss": "^4.1.
|
|
101
|
+
"tailwindcss": "^4.1.11",
|
|
102
102
|
"tsc-alias": "^1.8.16",
|
|
103
103
|
"@fumadocs/cli": "0.2.1",
|
|
104
|
-
"fumadocs-core": "15.5.5",
|
|
105
104
|
"eslint-config-custom": "0.0.0",
|
|
105
|
+
"fumadocs-core": "15.6.0",
|
|
106
106
|
"tsconfig": "0.0.0"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
declare const Tabs: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
-
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
8
|
-
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,IAAI,mJAcR,CAAC;AAIH,QAAA,MAAM,QAAQ,uJAYZ,CAAC;AAGH,QAAA,MAAM,WAAW,gKAYf,CAAC;AAGH,QAAA,MAAM,WAAW,0JAYf,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { cn } from '../../utils/cn.js';
|
|
6
|
-
const Tabs = React.forwardRef((props, ref) => {
|
|
7
|
-
return (_jsx(TabsPrimitive.Root, { ref: ref, ...props, className: cn('flex flex-col overflow-hidden rounded-xl border bg-fd-secondary', props.className) }));
|
|
8
|
-
});
|
|
9
|
-
Tabs.displayName = 'Tabs';
|
|
10
|
-
const TabsList = React.forwardRef((props, ref) => (_jsx(TabsPrimitive.List, { ref: ref, ...props, className: cn('flex gap-3.5 text-fd-secondary-foreground overflow-x-auto px-4 not-prose', props.className) })));
|
|
11
|
-
TabsList.displayName = 'TabsList';
|
|
12
|
-
const TabsTrigger = React.forwardRef((props, ref) => (_jsx(TabsPrimitive.Trigger, { ref: ref, ...props, className: cn('inline-flex items-center gap-2 whitespace-nowrap text-fd-muted-foreground border-b border-transparent py-2 text-sm font-medium transition-colors [&_svg]:size-4 hover:text-fd-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-fd-primary data-[state=active]:text-fd-primary', props.className) })));
|
|
13
|
-
TabsTrigger.displayName = 'TabsTrigger';
|
|
14
|
-
const TabsContent = React.forwardRef((props, ref) => (_jsx(TabsPrimitive.Content, { ref: ref, ...props, className: cn('p-4 text-[15px] bg-fd-background rounded-xl outline-none', props.className) })));
|
|
15
|
-
TabsContent.displayName = 'TabsContent';
|
|
16
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent };
|