fumadocs-ui 8.2.0 → 9.0.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/dist/{chunk-TSEDUE4C.js → chunk-3YZ7NCMG.js} +9 -9
- package/dist/{chunk-FAZEWBYX.js → chunk-7GZKFBAP.js} +1 -1
- package/dist/{chunk-5EZE3X7G.js → chunk-7XPZOMJ2.js} +3 -3
- package/dist/{chunk-GZQICERS.js → chunk-CYNHK27D.js} +3 -3
- package/dist/{chunk-F62NYOL5.js → chunk-REAI3OOF.js} +4 -4
- package/dist/chunk-TK3TM3MR.js +6 -0
- package/dist/{chunk-CBOHU2VN.js → chunk-UKE65HV3.js} +3 -3
- package/dist/{chunk-UGTA4YYX.js → chunk-WDMDQTHE.js} +15 -15
- package/dist/{chunk-OG3QOLYP.js → chunk-ZOR33LFA.js} +4 -4
- package/dist/components/accordion.d.mts +5 -7
- package/dist/components/accordion.js +49 -72
- package/dist/components/api.js +12 -12
- package/dist/components/callout.d.mts +3 -3
- package/dist/components/callout.js +3 -3
- package/dist/components/card.js +2 -2
- package/dist/components/codeblock.d.mts +4 -4
- package/dist/components/codeblock.js +4 -4
- package/dist/components/dialog/search-algolia.js +3 -3
- package/dist/components/dialog/search-default.js +3 -3
- package/dist/components/dialog/search.js +3 -3
- package/dist/components/files.d.mts +8 -8
- package/dist/components/files.js +27 -21
- package/dist/components/heading.js +2 -2
- package/dist/components/inline-toc.d.mts +1 -3
- package/dist/components/inline-toc.js +10 -21
- package/dist/components/roll-button.js +4 -4
- package/dist/components/tabs.d.mts +5 -5
- package/dist/components/tabs.js +6 -6
- package/dist/components/type-table.js +11 -11
- package/dist/i18n.js +9 -9
- package/dist/layout.client.js +26 -32
- package/dist/layout.js +3 -3
- package/dist/mdx.client.js +4 -4
- package/dist/mdx.js +3 -3
- package/dist/page.client.js +6 -6
- package/dist/page.d.mts +2 -2
- package/dist/page.js +3 -3
- package/dist/provider.d.mts +2 -2
- package/dist/style.css +1 -1
- package/dist/tailwind-plugin.d.ts +7 -3
- package/dist/tailwind-plugin.js +55 -19
- package/dist/twoslash/popup.d.mts +4 -4
- package/dist/twoslash/popup.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-KCGRUOMD.js +0 -13
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ScrollArea
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZOR33LFA.js";
|
|
4
4
|
import {
|
|
5
5
|
useCopyButton
|
|
6
6
|
} from "./chunk-24NYFO7H.js";
|
|
7
7
|
import {
|
|
8
8
|
buttonVariants
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7GZKFBAP.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
twMerge
|
|
12
|
+
} from "./chunk-TK3TM3MR.js";
|
|
13
13
|
|
|
14
14
|
// src/components/codeblock.tsx
|
|
15
15
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
@@ -17,7 +17,7 @@ import { forwardRef, useCallback, useRef } from "react";
|
|
|
17
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
18
|
var Pre = forwardRef(
|
|
19
19
|
({ className, ...props }, ref) => {
|
|
20
|
-
return /* @__PURE__ */ jsx("pre", { ref, className:
|
|
20
|
+
return /* @__PURE__ */ jsx("pre", { ref, className: twMerge("nd-codeblock py-4", className), ...props, children: props.children });
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
23
|
Pre.displayName = "Pre";
|
|
@@ -39,7 +39,7 @@ var CodeBlock = forwardRef(
|
|
|
39
39
|
"figure",
|
|
40
40
|
{
|
|
41
41
|
ref,
|
|
42
|
-
className:
|
|
42
|
+
className: twMerge(
|
|
43
43
|
"not-prose group relative my-6 overflow-hidden rounded-lg border bg-secondary/50 text-sm",
|
|
44
44
|
className
|
|
45
45
|
),
|
|
@@ -73,7 +73,7 @@ function CopyButton({
|
|
|
73
73
|
"button",
|
|
74
74
|
{
|
|
75
75
|
type: "button",
|
|
76
|
-
className:
|
|
76
|
+
className: twMerge(
|
|
77
77
|
buttonVariants({
|
|
78
78
|
color: "ghost",
|
|
79
79
|
className: "transition-all group-hover:opacity-100"
|
|
@@ -88,13 +88,13 @@ function CopyButton({
|
|
|
88
88
|
/* @__PURE__ */ jsx(
|
|
89
89
|
CheckIcon,
|
|
90
90
|
{
|
|
91
|
-
className:
|
|
91
|
+
className: twMerge("size-3.5 transition-transform", !checked && "scale-0")
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
94
|
/* @__PURE__ */ jsx(
|
|
95
95
|
CopyIcon,
|
|
96
96
|
{
|
|
97
|
-
className:
|
|
97
|
+
className: twMerge(
|
|
98
98
|
"absolute size-3.5 transition-transform",
|
|
99
99
|
checked && "scale-0"
|
|
100
100
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
twMerge
|
|
3
|
+
} from "./chunk-TK3TM3MR.js";
|
|
4
4
|
|
|
5
5
|
// src/components/ui/collapsible.tsx
|
|
6
6
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
@@ -13,7 +13,7 @@ var CollapsibleContent2 = forwardRef(({ className, children, ...props }, ref) =>
|
|
|
13
13
|
CollapsiblePrimitive.CollapsibleContent,
|
|
14
14
|
{
|
|
15
15
|
ref,
|
|
16
|
-
className:
|
|
16
|
+
className: twMerge(
|
|
17
17
|
"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
|
|
18
18
|
className
|
|
19
19
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
twMerge
|
|
3
|
+
} from "./chunk-TK3TM3MR.js";
|
|
4
4
|
|
|
5
5
|
// src/components/ui/popover.tsx
|
|
6
6
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
@@ -15,7 +15,7 @@ var PopoverContent = React.forwardRef(({ className, align = "center", sideOffset
|
|
|
15
15
|
align,
|
|
16
16
|
sideOffset,
|
|
17
17
|
side: "bottom",
|
|
18
|
-
className:
|
|
18
|
+
className: twMerge(
|
|
19
19
|
"z-50 max-w-[90vw] rounded-md border bg-popover p-2 text-popover-foreground shadow-md outline-none data-[state=closed]:animate-popover-out data-[state=open]:animate-popover-in",
|
|
20
20
|
className
|
|
21
21
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
twMerge
|
|
3
|
+
} from "./chunk-TK3TM3MR.js";
|
|
4
4
|
|
|
5
5
|
// src/components/card.tsx
|
|
6
6
|
import Link from "fumadocs-core/link";
|
|
@@ -10,7 +10,7 @@ function Cards(props) {
|
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
12
12
|
...props,
|
|
13
|
-
className:
|
|
13
|
+
className: twMerge("grid grid-cols-1 gap-4 sm:grid-cols-2", props.className),
|
|
14
14
|
children: props.children
|
|
15
15
|
}
|
|
16
16
|
);
|
|
@@ -25,7 +25,7 @@ function Card({
|
|
|
25
25
|
Link,
|
|
26
26
|
{
|
|
27
27
|
...props,
|
|
28
|
-
className:
|
|
28
|
+
className: twMerge(
|
|
29
29
|
"not-prose block rounded-lg border bg-card p-4 text-sm text-card-foreground shadow-md transition-colors hover:bg-muted/80",
|
|
30
30
|
props.className
|
|
31
31
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
twMerge
|
|
3
|
+
} from "./chunk-TK3TM3MR.js";
|
|
4
4
|
|
|
5
5
|
// src/components/heading.tsx
|
|
6
6
|
import { LinkIcon } from "lucide-react";
|
|
@@ -11,7 +11,7 @@ function Heading({
|
|
|
11
11
|
...props
|
|
12
12
|
}) {
|
|
13
13
|
const As = as ?? "h1";
|
|
14
|
-
return /* @__PURE__ */ jsx(As, { className:
|
|
14
|
+
return /* @__PURE__ */ jsx(As, { className: twMerge("scroll-m-20", className), ...props, children: props.id ? /* @__PURE__ */ jsxs("a", { href: `#${props.id}`, className: "not-prose group", children: [
|
|
15
15
|
props.children,
|
|
16
16
|
/* @__PURE__ */ jsx(
|
|
17
17
|
LinkIcon,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-YAHHY62W.js";
|
|
7
7
|
import {
|
|
8
8
|
buttonVariants
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7GZKFBAP.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
twMerge
|
|
12
|
+
} from "./chunk-TK3TM3MR.js";
|
|
13
13
|
|
|
14
14
|
// src/components/dialog/search.tsx
|
|
15
15
|
import { FileTextIcon, HashIcon, TextIcon } from "lucide-react";
|
|
@@ -32,7 +32,7 @@ var DialogContent = React.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
32
32
|
DialogPrimitive.Content,
|
|
33
33
|
{
|
|
34
34
|
ref,
|
|
35
|
-
className:
|
|
35
|
+
className: twMerge(
|
|
36
36
|
"fixed left-[50%] top-[10vh] z-50 w-[98vw] max-w-[640px] origin-left translate-x-[-50%] rounded-lg border bg-popover p-6 text-popover-foreground shadow-lg data-[state=closed]:animate-dialog-out data-[state=open]:animate-dialog-in",
|
|
37
37
|
className
|
|
38
38
|
),
|
|
@@ -49,7 +49,7 @@ function DialogHeader({
|
|
|
49
49
|
return /* @__PURE__ */ jsx(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
|
-
className:
|
|
52
|
+
className: twMerge(
|
|
53
53
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
54
54
|
className
|
|
55
55
|
),
|
|
@@ -62,7 +62,7 @@ function DialogFooter({
|
|
|
62
62
|
className,
|
|
63
63
|
...props
|
|
64
64
|
}) {
|
|
65
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
65
|
+
return /* @__PURE__ */ jsx("div", { className: twMerge("mt-auto flex flex-col p-3", className), ...props });
|
|
66
66
|
}
|
|
67
67
|
DialogFooter.displayName = "DialogFooter";
|
|
68
68
|
var DialogClose = DialogPrimitive.Close;
|
|
@@ -73,7 +73,7 @@ var Command = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
73
73
|
CommandPrimitive,
|
|
74
74
|
{
|
|
75
75
|
ref,
|
|
76
|
-
className:
|
|
76
|
+
className: twMerge("flex max-h-[80vh] flex-col", className),
|
|
77
77
|
shouldFilter: false,
|
|
78
78
|
loop: true,
|
|
79
79
|
...props
|
|
@@ -86,7 +86,7 @@ var CommandInput = React2.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
86
86
|
CommandPrimitive.Input,
|
|
87
87
|
{
|
|
88
88
|
ref,
|
|
89
|
-
className:
|
|
89
|
+
className: twMerge(
|
|
90
90
|
"w-full bg-transparent py-3 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed",
|
|
91
91
|
className
|
|
92
92
|
),
|
|
@@ -96,7 +96,7 @@ var CommandInput = React2.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
96
96
|
/* @__PURE__ */ jsx2(
|
|
97
97
|
DialogClose,
|
|
98
98
|
{
|
|
99
|
-
className:
|
|
99
|
+
className: twMerge(
|
|
100
100
|
buttonVariants({
|
|
101
101
|
color: "outline",
|
|
102
102
|
size: "icon",
|
|
@@ -112,7 +112,7 @@ var CommandList = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
112
112
|
CommandPrimitive.List,
|
|
113
113
|
{
|
|
114
114
|
ref,
|
|
115
|
-
className:
|
|
115
|
+
className: twMerge("max-h-[460px] overflow-y-auto border-t p-2", className),
|
|
116
116
|
...props
|
|
117
117
|
}
|
|
118
118
|
));
|
|
@@ -130,7 +130,7 @@ var CommandGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
130
130
|
CommandPrimitive.Group,
|
|
131
131
|
{
|
|
132
132
|
ref,
|
|
133
|
-
className:
|
|
133
|
+
className: twMerge(
|
|
134
134
|
"overflow-hidden [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
135
135
|
className
|
|
136
136
|
),
|
|
@@ -142,7 +142,7 @@ var CommandSeparator = React2.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
142
142
|
CommandPrimitive.Separator,
|
|
143
143
|
{
|
|
144
144
|
ref,
|
|
145
|
-
className:
|
|
145
|
+
className: twMerge("h-px bg-border", className),
|
|
146
146
|
...props
|
|
147
147
|
}
|
|
148
148
|
));
|
|
@@ -151,7 +151,7 @@ var CommandItem = React2.forwardRef(({ className, icon, nested = false, children
|
|
|
151
151
|
CommandPrimitive.Item,
|
|
152
152
|
{
|
|
153
153
|
ref,
|
|
154
|
-
className:
|
|
154
|
+
className: twMerge(
|
|
155
155
|
"select-none rounded-lg px-2 text-sm aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
156
156
|
className
|
|
157
157
|
),
|
|
@@ -159,7 +159,7 @@ var CommandItem = React2.forwardRef(({ className, icon, nested = false, children
|
|
|
159
159
|
children: /* @__PURE__ */ jsxs2(
|
|
160
160
|
"div",
|
|
161
161
|
{
|
|
162
|
-
className:
|
|
162
|
+
className: twMerge(
|
|
163
163
|
"flex min-h-10 items-center gap-3",
|
|
164
164
|
nested && "ml-2 gap-2 border-l pl-4"
|
|
165
165
|
),
|
|
@@ -214,7 +214,7 @@ function Search2({ search, onSearchChange, results }) {
|
|
|
214
214
|
placeholder: text.search
|
|
215
215
|
}
|
|
216
216
|
),
|
|
217
|
-
/* @__PURE__ */ jsxs3(CommandList, { className:
|
|
217
|
+
/* @__PURE__ */ jsxs3(CommandList, { className: twMerge(hideList && "hidden"), children: [
|
|
218
218
|
/* @__PURE__ */ jsx3(CommandEmpty, { children: text.searchNoResult }),
|
|
219
219
|
/* @__PURE__ */ jsx3(CommandGroup, { value: "result", children: items.map((item) => /* @__PURE__ */ jsx3(
|
|
220
220
|
CommandItem,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
twMerge
|
|
3
|
+
} from "./chunk-TK3TM3MR.js";
|
|
4
4
|
|
|
5
5
|
// src/components/ui/scroll-area.tsx
|
|
6
6
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
@@ -10,7 +10,7 @@ var ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => /*
|
|
|
10
10
|
ScrollAreaPrimitive.Root,
|
|
11
11
|
{
|
|
12
12
|
ref,
|
|
13
|
-
className:
|
|
13
|
+
className: twMerge("overflow-hidden", className),
|
|
14
14
|
...props,
|
|
15
15
|
children: [
|
|
16
16
|
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
@@ -26,7 +26,7 @@ var ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...prop
|
|
|
26
26
|
{
|
|
27
27
|
ref,
|
|
28
28
|
orientation,
|
|
29
|
-
className:
|
|
29
|
+
className: twMerge(
|
|
30
30
|
"flex select-none data-[state=hidden]:animate-fade-out",
|
|
31
31
|
orientation === "vertical" && "h-full w-1.5",
|
|
32
32
|
orientation === "horizontal" && "h-1.5 flex-col",
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
3
|
|
|
4
|
-
declare const Accordions:
|
|
5
|
-
declare const
|
|
6
|
-
declare const SingleAccordions: react.ForwardRefExoticComponent<AccordionPrimitive.AccordionSingleProps & react.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
declare const Accordion: react.ForwardRefExoticComponent<Omit<Omit<AccordionPrimitive.AccordionItemProps & react.RefAttributes<HTMLDivElement>, "ref">, "value"> & {
|
|
4
|
+
declare const Accordions: React.ForwardRefExoticComponent<(Omit<AccordionPrimitive.AccordionSingleProps, "value" | "onValueChange"> | Omit<AccordionPrimitive.AccordionMultipleProps, "value" | "onValueChange">) & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const Accordion: React.ForwardRefExoticComponent<Omit<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref">, "value"> & {
|
|
8
6
|
title: string;
|
|
9
|
-
} &
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
8
|
|
|
11
|
-
export { Accordion, Accordions
|
|
9
|
+
export { Accordion, Accordions };
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "../chunk-24NYFO7H.js";
|
|
5
5
|
import {
|
|
6
6
|
buttonVariants
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-7GZKFBAP.js";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
} from "../chunk-
|
|
9
|
+
twMerge
|
|
10
|
+
} from "../chunk-TK3TM3MR.js";
|
|
11
11
|
import "../chunk-6C3VEZWH.js";
|
|
12
12
|
|
|
13
13
|
// src/components/accordion.tsx
|
|
@@ -18,81 +18,60 @@ import {
|
|
|
18
18
|
useState,
|
|
19
19
|
useEffect
|
|
20
20
|
} from "react";
|
|
21
|
-
import { cva } from "class-variance-authority";
|
|
22
21
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return /* @__PURE__ */ jsx(MultipleAccordions, { ref, ...props });
|
|
27
|
-
}
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
-
SingleAccordions,
|
|
30
|
-
{
|
|
31
|
-
ref,
|
|
32
|
-
...props,
|
|
33
|
-
type: "single"
|
|
34
|
-
}
|
|
22
|
+
var Accordions = forwardRef(({ type = "single", className, defaultValue, ...props }, ref) => {
|
|
23
|
+
const [value, setValue] = useState(
|
|
24
|
+
type === "single" ? defaultValue ?? "" : defaultValue ?? []
|
|
35
25
|
);
|
|
36
|
-
});
|
|
37
|
-
Accordions.displayName = "Accordions";
|
|
38
|
-
var MultipleAccordions = forwardRef(({ className, defaultValue, ...props }, ref) => {
|
|
39
|
-
const [defValue, setDefValue] = useState(defaultValue);
|
|
40
|
-
const value = props.value ?? defValue;
|
|
41
|
-
const setValue = props.onValueChange?.bind(props) ?? setDefValue;
|
|
42
26
|
useEffect(() => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
27
|
+
const id = window.location.hash.substring(1);
|
|
28
|
+
if (id.length > 0)
|
|
29
|
+
setValue((prev) => {
|
|
30
|
+
return type === "single" ? id : [id, ...Array.isArray(prev) ? prev : []];
|
|
31
|
+
});
|
|
32
|
+
}, [type]);
|
|
33
|
+
return (
|
|
34
|
+
// @ts-expect-error -- Multiple types
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
AccordionPrimitive.Root,
|
|
37
|
+
{
|
|
38
|
+
type,
|
|
39
|
+
ref,
|
|
40
|
+
value,
|
|
41
|
+
onValueChange: setValue,
|
|
42
|
+
collapsible: true,
|
|
43
|
+
className: twMerge(
|
|
44
|
+
"divide-y divide-border overflow-hidden rounded-lg border bg-card",
|
|
45
|
+
className
|
|
46
|
+
),
|
|
47
|
+
...props
|
|
48
|
+
}
|
|
49
|
+
)
|
|
55
50
|
);
|
|
56
51
|
});
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
const [defValue, setDefValue] = useState(defaultValue);
|
|
60
|
-
const value = props.value ?? defValue;
|
|
61
|
-
const setValue = props.onValueChange?.bind(props) ?? setDefValue;
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
if (window.location.hash.length > 0)
|
|
64
|
-
setValue(window.location.hash.substring(1));
|
|
65
|
-
}, [setValue]);
|
|
66
|
-
return /* @__PURE__ */ jsx(
|
|
67
|
-
AccordionPrimitive.Root,
|
|
68
|
-
{
|
|
69
|
-
ref,
|
|
70
|
-
value,
|
|
71
|
-
onValueChange: setValue,
|
|
72
|
-
collapsible: true,
|
|
73
|
-
className: cn(variants(), className),
|
|
74
|
-
...props
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
});
|
|
78
|
-
SingleAccordions.displayName = "SingleAccordions";
|
|
79
|
-
var Accordion = forwardRef(({ title, className, children, ...props }, ref) => {
|
|
52
|
+
Accordions.displayName = "Accordions";
|
|
53
|
+
var Accordion = forwardRef(({ title, className, id, children, ...props }, ref) => {
|
|
80
54
|
return /* @__PURE__ */ jsxs(
|
|
81
55
|
AccordionPrimitive.Item,
|
|
82
56
|
{
|
|
83
57
|
ref,
|
|
84
|
-
value:
|
|
85
|
-
className:
|
|
58
|
+
value: id ?? title,
|
|
59
|
+
className: twMerge("group/accordion relative scroll-m-20", className),
|
|
86
60
|
...props,
|
|
87
61
|
children: [
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
AccordionPrimitive.Header,
|
|
64
|
+
{
|
|
65
|
+
id,
|
|
66
|
+
className: "not-prose font-medium text-foreground",
|
|
67
|
+
children: /* @__PURE__ */ jsxs(AccordionPrimitive.Trigger, { className: "flex w-full items-center gap-2 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [
|
|
68
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "size-4 text-muted-foreground transition-transform duration-200 group-data-[state=open]/accordion:rotate-90" }),
|
|
69
|
+
title
|
|
70
|
+
] })
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
id ? /* @__PURE__ */ jsx(CopyButton, { id }) : null,
|
|
74
|
+
/* @__PURE__ */ jsx(AccordionPrimitive.Content, { className: "overflow-hidden data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", children: /* @__PURE__ */ jsx("div", { className: "ml-2 p-4 pt-0 prose-no-margin", children }) })
|
|
96
75
|
]
|
|
97
76
|
}
|
|
98
77
|
);
|
|
@@ -108,10 +87,10 @@ function CopyButton({ id }) {
|
|
|
108
87
|
{
|
|
109
88
|
type: "button",
|
|
110
89
|
"aria-label": "Copy Link",
|
|
111
|
-
className:
|
|
90
|
+
className: twMerge(
|
|
112
91
|
buttonVariants({
|
|
113
92
|
color: "ghost",
|
|
114
|
-
className: "
|
|
93
|
+
className: "absolute top-4 right-4 text-muted-foreground"
|
|
115
94
|
})
|
|
116
95
|
),
|
|
117
96
|
onClick,
|
|
@@ -122,7 +101,5 @@ function CopyButton({ id }) {
|
|
|
122
101
|
Accordion.displayName = "Accordion";
|
|
123
102
|
export {
|
|
124
103
|
Accordion,
|
|
125
|
-
Accordions
|
|
126
|
-
MultipleAccordions,
|
|
127
|
-
SingleAccordions
|
|
104
|
+
Accordions
|
|
128
105
|
};
|
package/dist/components/api.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
buttonVariants
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-7GZKFBAP.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../chunk-
|
|
6
|
+
twMerge
|
|
7
|
+
} from "../chunk-TK3TM3MR.js";
|
|
8
8
|
import "../chunk-6C3VEZWH.js";
|
|
9
9
|
|
|
10
10
|
// src/components/api.tsx
|
|
@@ -19,7 +19,7 @@ function Root({
|
|
|
19
19
|
return /* @__PURE__ */ jsx(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
|
-
className:
|
|
22
|
+
className: twMerge("space-y-24 text-sm text-muted-foreground", className),
|
|
23
23
|
...props,
|
|
24
24
|
children
|
|
25
25
|
}
|
|
@@ -33,7 +33,7 @@ function API({
|
|
|
33
33
|
return /* @__PURE__ */ jsx(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
|
-
className:
|
|
36
|
+
className: twMerge("flex flex-col gap-x-6 gap-y-2 xl:flex-row", className),
|
|
37
37
|
...props,
|
|
38
38
|
children
|
|
39
39
|
}
|
|
@@ -62,9 +62,9 @@ function APIInfo({
|
|
|
62
62
|
color = "yellow";
|
|
63
63
|
if (["DELETE"].includes(method))
|
|
64
64
|
color = "red";
|
|
65
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
65
|
+
return /* @__PURE__ */ jsxs("div", { className: twMerge("flex-1", className), ...props, children: [
|
|
66
66
|
/* @__PURE__ */ jsxs("h2", { className: "not-prose mb-2 inline-flex items-center gap-3 font-mono", children: [
|
|
67
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
67
|
+
/* @__PURE__ */ jsx("div", { className: twMerge(badgeVariants({ color })), children: method }),
|
|
68
68
|
/* @__PURE__ */ jsx("p", { className: "text-xs", children: route })
|
|
69
69
|
] }),
|
|
70
70
|
children
|
|
@@ -80,8 +80,8 @@ function Property({
|
|
|
80
80
|
return /* @__PURE__ */ jsxs("div", { className: "mb-4 flex flex-col rounded-lg border bg-card p-3 prose-no-margin", children: [
|
|
81
81
|
/* @__PURE__ */ jsxs("h4", { className: "inline-flex items-center gap-4", children: [
|
|
82
82
|
/* @__PURE__ */ jsx("code", { children: name }),
|
|
83
|
-
required ? /* @__PURE__ */ jsx("div", { className:
|
|
84
|
-
deprecated ? /* @__PURE__ */ jsx("div", { className:
|
|
83
|
+
required ? /* @__PURE__ */ jsx("div", { className: twMerge(badgeVariants({ color: "red" })), children: "Required" }) : null,
|
|
84
|
+
deprecated ? /* @__PURE__ */ jsx("div", { className: twMerge(badgeVariants({ color: "yellow" })), children: "Deprecated" }) : null,
|
|
85
85
|
/* @__PURE__ */ jsx("span", { className: "ml-auto font-mono text-[13px] text-muted-foreground", children: type })
|
|
86
86
|
] }),
|
|
87
87
|
children
|
|
@@ -96,7 +96,7 @@ function APIExample({
|
|
|
96
96
|
return /* @__PURE__ */ jsxs(
|
|
97
97
|
"div",
|
|
98
98
|
{
|
|
99
|
-
className:
|
|
99
|
+
className: twMerge(
|
|
100
100
|
"sticky top-14 h-fit xl:w-[40%] xl:min-w-[400px]",
|
|
101
101
|
className
|
|
102
102
|
),
|
|
@@ -108,7 +108,7 @@ function APIExample({
|
|
|
108
108
|
"button",
|
|
109
109
|
{
|
|
110
110
|
type: "button",
|
|
111
|
-
className:
|
|
111
|
+
className: twMerge(
|
|
112
112
|
buttonVariants({
|
|
113
113
|
color: "secondary",
|
|
114
114
|
size: "lg"
|
|
@@ -122,7 +122,7 @@ function APIExample({
|
|
|
122
122
|
),
|
|
123
123
|
/* @__PURE__ */ jsx("div", { className: "h-px flex-1 bg-border" })
|
|
124
124
|
] }),
|
|
125
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
125
|
+
/* @__PURE__ */ jsx("div", { className: twMerge(!isOpen && "max-xl:hidden"), children })
|
|
126
126
|
]
|
|
127
127
|
}
|
|
128
128
|
);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
declare const Callout:
|
|
4
|
+
declare const Callout: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "type" | "icon"> & {
|
|
5
5
|
title?: ReactNode;
|
|
6
6
|
/**
|
|
7
7
|
* @defaultValue info
|
|
8
8
|
*/
|
|
9
9
|
type?: "info" | "warn" | "error" | undefined;
|
|
10
10
|
icon?: ReactNode;
|
|
11
|
-
} &
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
|
|
13
13
|
export { Callout };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
2
|
+
twMerge
|
|
3
|
+
} from "../chunk-TK3TM3MR.js";
|
|
4
4
|
import "../chunk-6C3VEZWH.js";
|
|
5
5
|
|
|
6
6
|
// src/components/callout.tsx
|
|
@@ -13,7 +13,7 @@ var Callout = forwardRef(
|
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
15
15
|
ref,
|
|
16
|
-
className:
|
|
16
|
+
className: twMerge(
|
|
17
17
|
"my-6 flex flex-row gap-2 rounded-lg border bg-card p-3 text-sm text-muted-foreground shadow-md",
|
|
18
18
|
className
|
|
19
19
|
),
|
package/dist/components/card.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
type CodeBlockProps = HTMLAttributes<HTMLElement> & {
|
|
@@ -8,13 +8,13 @@ type CodeBlockProps = HTMLAttributes<HTMLElement> & {
|
|
|
8
8
|
icon?: ReactNode;
|
|
9
9
|
allowCopy?: boolean;
|
|
10
10
|
};
|
|
11
|
-
declare const Pre:
|
|
12
|
-
declare const CodeBlock:
|
|
11
|
+
declare const Pre: React.ForwardRefExoticComponent<HTMLAttributes<HTMLPreElement> & React.RefAttributes<HTMLPreElement>>;
|
|
12
|
+
declare const CodeBlock: React.ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
13
13
|
/**
|
|
14
14
|
* Icon of code block
|
|
15
15
|
*/
|
|
16
16
|
icon?: ReactNode;
|
|
17
17
|
allowCopy?: boolean | undefined;
|
|
18
|
-
} &
|
|
18
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
19
19
|
|
|
20
20
|
export { CodeBlock, type CodeBlockProps, Pre };
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CodeBlock,
|
|
4
4
|
Pre
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-3YZ7NCMG.js";
|
|
6
|
+
import "../chunk-ZOR33LFA.js";
|
|
7
7
|
import "../chunk-24NYFO7H.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-7GZKFBAP.js";
|
|
9
|
+
import "../chunk-TK3TM3MR.js";
|
|
10
10
|
import "../chunk-6C3VEZWH.js";
|
|
11
11
|
export {
|
|
12
12
|
CodeBlock,
|