@docubook/mdx-content 3.4.0 → 3.4.2
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/adapters/next/index.d.ts +54 -5
- package/dist/adapters/next/index.js +420 -4
- package/dist/adapters/next/index.js.map +1 -1
- package/dist/chunk-PSDC53TU.js +1056 -0
- package/dist/chunk-PSDC53TU.js.map +1 -0
- package/dist/client.d.ts +91 -9
- package/dist/client.js +1191 -8
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +91 -20
- package/dist/index.js +1245 -19
- package/dist/index.js.map +1 -1
- package/dist/server-BObcTM97.d.ts +100 -0
- package/dist/server.d.ts +3 -11
- package/dist/server.js +40 -10
- package/dist/server.js.map +1 -1
- package/package.json +5 -4
- package/dist/__test__/AccordionMdx.test.d.ts +0 -2
- package/dist/__test__/AccordionMdx.test.d.ts.map +0 -1
- package/dist/__test__/AccordionMdx.test.js +0 -21
- package/dist/__test__/AccordionMdx.test.js.map +0 -1
- package/dist/__test__/AccordionsMdx.test.d.ts +0 -2
- package/dist/__test__/AccordionsMdx.test.d.ts.map +0 -1
- package/dist/__test__/AccordionsMdx.test.js +0 -22
- package/dist/__test__/AccordionsMdx.test.js.map +0 -1
- package/dist/__test__/ButtonMdx.test.d.ts +0 -2
- package/dist/__test__/ButtonMdx.test.d.ts.map +0 -1
- package/dist/__test__/ButtonMdx.test.js +0 -20
- package/dist/__test__/ButtonMdx.test.js.map +0 -1
- package/dist/__test__/CardMdx.test.d.ts +0 -2
- package/dist/__test__/CardMdx.test.d.ts.map +0 -1
- package/dist/__test__/CardMdx.test.js +0 -29
- package/dist/__test__/CardMdx.test.js.map +0 -1
- package/dist/__test__/CardsMdx.test.d.ts +0 -2
- package/dist/__test__/CardsMdx.test.d.ts.map +0 -1
- package/dist/__test__/CardsMdx.test.js +0 -33
- package/dist/__test__/CardsMdx.test.js.map +0 -1
- package/dist/__test__/CodeBlockMdx.test.d.ts +0 -2
- package/dist/__test__/CodeBlockMdx.test.d.ts.map +0 -1
- package/dist/__test__/CodeBlockMdx.test.js +0 -48
- package/dist/__test__/CodeBlockMdx.test.js.map +0 -1
- package/dist/__test__/FileTreeMdx.test.d.ts +0 -2
- package/dist/__test__/FileTreeMdx.test.d.ts.map +0 -1
- package/dist/__test__/FileTreeMdx.test.js +0 -26
- package/dist/__test__/FileTreeMdx.test.js.map +0 -1
- package/dist/__test__/ImageMdx.test.d.ts +0 -2
- package/dist/__test__/ImageMdx.test.d.ts.map +0 -1
- package/dist/__test__/ImageMdx.test.js +0 -32
- package/dist/__test__/ImageMdx.test.js.map +0 -1
- package/dist/__test__/KbdMdx.test.d.ts +0 -2
- package/dist/__test__/KbdMdx.test.d.ts.map +0 -1
- package/dist/__test__/KbdMdx.test.js +0 -27
- package/dist/__test__/KbdMdx.test.js.map +0 -1
- package/dist/__test__/LinkMdx.test.d.ts +0 -2
- package/dist/__test__/LinkMdx.test.d.ts.map +0 -1
- package/dist/__test__/LinkMdx.test.js +0 -29
- package/dist/__test__/LinkMdx.test.js.map +0 -1
- package/dist/__test__/MermaidMdx.test.d.ts +0 -2
- package/dist/__test__/MermaidMdx.test.d.ts.map +0 -1
- package/dist/__test__/MermaidMdx.test.js +0 -207
- package/dist/__test__/MermaidMdx.test.js.map +0 -1
- package/dist/__test__/NoteMdx.test.d.ts +0 -2
- package/dist/__test__/NoteMdx.test.d.ts.map +0 -1
- package/dist/__test__/NoteMdx.test.js +0 -39
- package/dist/__test__/NoteMdx.test.js.map +0 -1
- package/dist/__test__/ReleaseMdx.test.d.ts +0 -2
- package/dist/__test__/ReleaseMdx.test.d.ts.map +0 -1
- package/dist/__test__/ReleaseMdx.test.js +0 -39
- package/dist/__test__/ReleaseMdx.test.js.map +0 -1
- package/dist/__test__/StepperMdx.test.d.ts +0 -2
- package/dist/__test__/StepperMdx.test.d.ts.map +0 -1
- package/dist/__test__/StepperMdx.test.js +0 -25
- package/dist/__test__/StepperMdx.test.js.map +0 -1
- package/dist/__test__/TableMdx.test.d.ts +0 -2
- package/dist/__test__/TableMdx.test.d.ts.map +0 -1
- package/dist/__test__/TableMdx.test.js +0 -25
- package/dist/__test__/TableMdx.test.js.map +0 -1
- package/dist/__test__/TabsMdx.test.d.ts +0 -2
- package/dist/__test__/TabsMdx.test.d.ts.map +0 -1
- package/dist/__test__/TabsMdx.test.js +0 -30
- package/dist/__test__/TabsMdx.test.js.map +0 -1
- package/dist/__test__/TooltipMdx.test.d.ts +0 -2
- package/dist/__test__/TooltipMdx.test.d.ts.map +0 -1
- package/dist/__test__/TooltipMdx.test.js +0 -23
- package/dist/__test__/TooltipMdx.test.js.map +0 -1
- package/dist/__test__/YoutubeMdx.test.d.ts +0 -2
- package/dist/__test__/YoutubeMdx.test.d.ts.map +0 -1
- package/dist/__test__/YoutubeMdx.test.js +0 -25
- package/dist/__test__/YoutubeMdx.test.js.map +0 -1
- package/dist/__test__/utils/ExpandableCode.test.d.ts +0 -2
- package/dist/__test__/utils/ExpandableCode.test.d.ts.map +0 -1
- package/dist/__test__/utils/ExpandableCode.test.js +0 -62
- package/dist/__test__/utils/ExpandableCode.test.js.map +0 -1
- package/dist/__test__/utils/Icon.test.d.ts +0 -2
- package/dist/__test__/utils/Icon.test.d.ts.map +0 -1
- package/dist/__test__/utils/Icon.test.js +0 -29
- package/dist/__test__/utils/Icon.test.js.map +0 -1
- package/dist/adapters/next/ButtonMdx.d.ts +0 -4
- package/dist/adapters/next/ButtonMdx.d.ts.map +0 -1
- package/dist/adapters/next/ButtonMdx.js +0 -8
- package/dist/adapters/next/ButtonMdx.js.map +0 -1
- package/dist/adapters/next/CardMdx.d.ts +0 -4
- package/dist/adapters/next/CardMdx.d.ts.map +0 -1
- package/dist/adapters/next/CardMdx.js +0 -8
- package/dist/adapters/next/CardMdx.js.map +0 -1
- package/dist/adapters/next/ImageMdx.d.ts +0 -8
- package/dist/adapters/next/ImageMdx.d.ts.map +0 -1
- package/dist/adapters/next/ImageMdx.js +0 -8
- package/dist/adapters/next/ImageMdx.js.map +0 -1
- package/dist/adapters/next/LinkMdx.d.ts +0 -3
- package/dist/adapters/next/LinkMdx.d.ts.map +0 -1
- package/dist/adapters/next/LinkMdx.js +0 -11
- package/dist/adapters/next/LinkMdx.js.map +0 -1
- package/dist/adapters/next/index.d.ts.map +0 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/components/AccordionMdx.d.ts +0 -11
- package/dist/components/AccordionMdx.d.ts.map +0 -1
- package/dist/components/AccordionMdx.js +0 -64
- package/dist/components/AccordionMdx.js.map +0 -1
- package/dist/components/AccordionsMdx.d.ts +0 -7
- package/dist/components/AccordionsMdx.d.ts.map +0 -1
- package/dist/components/AccordionsMdx.js +0 -14
- package/dist/components/AccordionsMdx.js.map +0 -1
- package/dist/components/ButtonMdx.d.ts +0 -17
- package/dist/components/ButtonMdx.d.ts.map +0 -1
- package/dist/components/ButtonMdx.js +0 -57
- package/dist/components/ButtonMdx.js.map +0 -1
- package/dist/components/CardMdx.d.ts +0 -17
- package/dist/components/CardMdx.d.ts.map +0 -1
- package/dist/components/CardMdx.js +0 -52
- package/dist/components/CardMdx.js.map +0 -1
- package/dist/components/CardsMdx.d.ts +0 -9
- package/dist/components/CardsMdx.d.ts.map +0 -1
- package/dist/components/CardsMdx.js +0 -9
- package/dist/components/CardsMdx.js.map +0 -1
- package/dist/components/CodeBlockMdx.d.ts +0 -11
- package/dist/components/CodeBlockMdx.d.ts.map +0 -1
- package/dist/components/CodeBlockMdx.js +0 -135
- package/dist/components/CodeBlockMdx.js.map +0 -1
- package/dist/components/FileTreeMdx.d.ts +0 -19
- package/dist/components/FileTreeMdx.d.ts.map +0 -1
- package/dist/components/FileTreeMdx.js +0 -99
- package/dist/components/FileTreeMdx.js.map +0 -1
- package/dist/components/ImageMdx.d.ts +0 -8
- package/dist/components/ImageMdx.d.ts.map +0 -1
- package/dist/components/ImageMdx.js +0 -111
- package/dist/components/ImageMdx.js.map +0 -1
- package/dist/components/KbdMdx.d.ts +0 -9
- package/dist/components/KbdMdx.d.ts.map +0 -1
- package/dist/components/KbdMdx.js +0 -74
- package/dist/components/KbdMdx.js.map +0 -1
- package/dist/components/LinkMdx.d.ts +0 -4
- package/dist/components/LinkMdx.d.ts.map +0 -1
- package/dist/components/LinkMdx.js +0 -10
- package/dist/components/LinkMdx.js.map +0 -1
- package/dist/components/MermaidMdx.d.ts +0 -13
- package/dist/components/MermaidMdx.d.ts.map +0 -1
- package/dist/components/MermaidMdx.js +0 -211
- package/dist/components/MermaidMdx.js.map +0 -1
- package/dist/components/NoteMdx.d.ts +0 -13
- package/dist/components/NoteMdx.d.ts.map +0 -1
- package/dist/components/NoteMdx.js +0 -79
- package/dist/components/NoteMdx.js.map +0 -1
- package/dist/components/ReleaseMdx.d.ts +0 -16
- package/dist/components/ReleaseMdx.d.ts.map +0 -1
- package/dist/components/ReleaseMdx.js +0 -44
- package/dist/components/ReleaseMdx.js.map +0 -1
- package/dist/components/StepperMdx.d.ts +0 -17
- package/dist/components/StepperMdx.d.ts.map +0 -1
- package/dist/components/StepperMdx.js +0 -74
- package/dist/components/StepperMdx.js.map +0 -1
- package/dist/components/TableMdx.d.ts +0 -9
- package/dist/components/TableMdx.d.ts.map +0 -1
- package/dist/components/TableMdx.js +0 -56
- package/dist/components/TableMdx.js.map +0 -1
- package/dist/components/TabsMdx.d.ts +0 -13
- package/dist/components/TabsMdx.d.ts.map +0 -1
- package/dist/components/TabsMdx.js +0 -67
- package/dist/components/TabsMdx.js.map +0 -1
- package/dist/components/TooltipMdx.d.ts +0 -10
- package/dist/components/TooltipMdx.d.ts.map +0 -1
- package/dist/components/TooltipMdx.js +0 -36
- package/dist/components/TooltipMdx.js.map +0 -1
- package/dist/components/YoutubeMdx.d.ts +0 -7
- package/dist/components/YoutubeMdx.d.ts.map +0 -1
- package/dist/components/YoutubeMdx.js +0 -24
- package/dist/components/YoutubeMdx.js.map +0 -1
- package/dist/components/index.d.ts +0 -19
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -19
- package/dist/components/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/registry/index.d.ts +0 -4
- package/dist/registry/index.d.ts.map +0 -1
- package/dist/registry/index.js +0 -38
- package/dist/registry/index.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/utils/AccordionGroupContext.d.ts +0 -8
- package/dist/utils/AccordionGroupContext.d.ts.map +0 -1
- package/dist/utils/AccordionGroupContext.js +0 -4
- package/dist/utils/AccordionGroupContext.js.map +0 -1
- package/dist/utils/CopyButton.d.ts +0 -6
- package/dist/utils/CopyButton.d.ts.map +0 -1
- package/dist/utils/CopyButton.js +0 -39
- package/dist/utils/CopyButton.js.map +0 -1
- package/dist/utils/ExpandableCode.d.ts +0 -11
- package/dist/utils/ExpandableCode.d.ts.map +0 -1
- package/dist/utils/ExpandableCode.js +0 -78
- package/dist/utils/ExpandableCode.js.map +0 -1
- package/dist/utils/Icon.d.ts +0 -6
- package/dist/utils/Icon.d.ts.map +0 -1
- package/dist/utils/Icon.js +0 -12
- package/dist/utils/Icon.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,1246 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import {
|
|
2
|
+
ButtonMdx,
|
|
3
|
+
CardsMdx,
|
|
4
|
+
ChangesMdx,
|
|
5
|
+
CodeBlock,
|
|
6
|
+
KbdMdx,
|
|
7
|
+
LinkMdx,
|
|
8
|
+
NoteMdx,
|
|
9
|
+
ReleaseMdx,
|
|
10
|
+
StepMdx,
|
|
11
|
+
StepsMdx,
|
|
12
|
+
TableBodyMdx,
|
|
13
|
+
TableCellMdx,
|
|
14
|
+
TableFooterMdx,
|
|
15
|
+
TableHeadMdx,
|
|
16
|
+
TableHeaderMdx,
|
|
17
|
+
TableMdx,
|
|
18
|
+
TableRowMdx,
|
|
19
|
+
YoutubeMdx,
|
|
20
|
+
resolveLucideIcon
|
|
21
|
+
} from "./chunk-PSDC53TU.js";
|
|
22
|
+
|
|
23
|
+
// src/components/AccordionMdx.tsx
|
|
24
|
+
import { useContext, useId, useState } from "react";
|
|
25
|
+
|
|
26
|
+
// src/utils/AccordionGroupContext.tsx
|
|
27
|
+
import { createContext } from "react";
|
|
28
|
+
var AccordionGroupContext = createContext(null);
|
|
29
|
+
|
|
30
|
+
// src/components/AccordionMdx.tsx
|
|
31
|
+
import { ChevronRight } from "lucide-react";
|
|
32
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
function AccordionMdx({ title, icon, className, children }) {
|
|
34
|
+
const groupContext = useContext(AccordionGroupContext);
|
|
35
|
+
const [localOpen, setLocalOpen] = useState(false);
|
|
36
|
+
const panelId = useId();
|
|
37
|
+
const triggerId = `${panelId}-trigger`;
|
|
38
|
+
const isGroup = groupContext?.inGroup === true;
|
|
39
|
+
const isOpen = isGroup ? groupContext?.openTitle === title : localOpen;
|
|
40
|
+
const resolvedIcon = resolveLucideIcon(icon);
|
|
41
|
+
function onToggle() {
|
|
42
|
+
if (isGroup && groupContext) {
|
|
43
|
+
groupContext.setOpenTitle(groupContext.openTitle === title ? null : title);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
setLocalOpen((prev) => !prev);
|
|
47
|
+
}
|
|
48
|
+
return /* @__PURE__ */ jsxs(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: `mdx-accordion ${isGroup ? "mdx-accordion-group-item" : ""} ${className ?? ""}`,
|
|
52
|
+
style: {
|
|
53
|
+
border: "1px solid hsl(var(--border-color, 210 20% 85%))",
|
|
54
|
+
borderRadius: 10,
|
|
55
|
+
overflow: "hidden",
|
|
56
|
+
background: "hsl(var(--card, 0 0% 100%))"
|
|
57
|
+
},
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsxs(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
className: "mdx-accordion-header",
|
|
63
|
+
type: "button",
|
|
64
|
+
onClick: onToggle,
|
|
65
|
+
"aria-expanded": isOpen,
|
|
66
|
+
"aria-controls": panelId,
|
|
67
|
+
id: triggerId,
|
|
68
|
+
onKeyDown: (event) => {
|
|
69
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
onToggle();
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
style: {
|
|
75
|
+
width: "100%",
|
|
76
|
+
display: "flex",
|
|
77
|
+
alignItems: "center",
|
|
78
|
+
justifyContent: "flex-start",
|
|
79
|
+
gap: "0.5rem",
|
|
80
|
+
textAlign: "left",
|
|
81
|
+
border: 0,
|
|
82
|
+
cursor: "pointer",
|
|
83
|
+
background: "hsl(var(--muted, 210 20% 92%))",
|
|
84
|
+
color: "hsl(var(--foreground, 220 30% 15%))",
|
|
85
|
+
fontWeight: 600,
|
|
86
|
+
padding: "0.95rem 1rem"
|
|
87
|
+
},
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
ChevronRight,
|
|
91
|
+
{
|
|
92
|
+
className: "mdx-accordion-chevron",
|
|
93
|
+
"aria-hidden": "true",
|
|
94
|
+
size: 16,
|
|
95
|
+
style: {
|
|
96
|
+
transform: isOpen ? "rotate(90deg)" : "rotate(0deg)",
|
|
97
|
+
transition: "transform 0.2s ease",
|
|
98
|
+
flexShrink: 0,
|
|
99
|
+
color: "hsl(var(--foreground, 220 30% 15%) / 0.74)",
|
|
100
|
+
marginRight: "0.4rem"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: "0.5rem", flex: 1 }, children: [
|
|
105
|
+
resolvedIcon ? /* @__PURE__ */ jsx(
|
|
106
|
+
"span",
|
|
107
|
+
{
|
|
108
|
+
"aria-hidden": "true",
|
|
109
|
+
style: {
|
|
110
|
+
display: "inline-flex",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
justifyContent: "center",
|
|
113
|
+
minWidth: "1.45rem",
|
|
114
|
+
height: "1.45rem",
|
|
115
|
+
color: "hsl(var(--foreground, 220 30% 15%))"
|
|
116
|
+
},
|
|
117
|
+
children: resolvedIcon
|
|
118
|
+
}
|
|
119
|
+
) : null,
|
|
120
|
+
/* @__PURE__ */ jsx("span", { children: title })
|
|
121
|
+
] })
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
id: panelId,
|
|
129
|
+
role: "region",
|
|
130
|
+
"aria-labelledby": triggerId,
|
|
131
|
+
hidden: !isOpen,
|
|
132
|
+
className: "mdx-accordion-content",
|
|
133
|
+
style: {
|
|
134
|
+
padding: "0.75rem 0.8rem",
|
|
135
|
+
background: "hsl(var(--card, 0 0% 100%))",
|
|
136
|
+
color: "hsl(var(--card-foreground, 220 30% 15%))"
|
|
137
|
+
},
|
|
138
|
+
children
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// src/components/AccordionsMdx.tsx
|
|
147
|
+
import { useMemo, useState as useState2 } from "react";
|
|
148
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
149
|
+
function AccordionsMdx({ children }) {
|
|
150
|
+
const [openTitle, setOpenTitle] = useState2(null);
|
|
151
|
+
const value = useMemo(() => ({ inGroup: true, openTitle, setOpenTitle }), [openTitle]);
|
|
152
|
+
return /* @__PURE__ */ jsx2(AccordionGroupContext.Provider, { value, children: /* @__PURE__ */ jsx2(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
className: "mdx-accordion-group",
|
|
156
|
+
style: {
|
|
157
|
+
margin: "1rem 0",
|
|
158
|
+
display: "grid",
|
|
159
|
+
gap: "0.85rem"
|
|
160
|
+
},
|
|
161
|
+
children
|
|
162
|
+
}
|
|
163
|
+
) });
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// src/components/CardMdx.tsx
|
|
167
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
168
|
+
var baseStyle = {
|
|
169
|
+
display: "block",
|
|
170
|
+
border: "1px solid hsl(var(--border-color, 210 20% 85%))",
|
|
171
|
+
borderRadius: 14,
|
|
172
|
+
background: "hsl(var(--card, 0 0% 100%))",
|
|
173
|
+
color: "hsl(var(--foreground, 220 30% 15%))",
|
|
174
|
+
textDecoration: "none",
|
|
175
|
+
padding: "1rem",
|
|
176
|
+
minHeight: 120,
|
|
177
|
+
boxShadow: "0 0 0 rgba(0,0,0,0)",
|
|
178
|
+
transition: "border-color 0.2s ease, box-shadow 0.24s ease, transform 0.24s ease, color 0.2s ease",
|
|
179
|
+
overflow: "hidden"
|
|
180
|
+
};
|
|
181
|
+
function CardMdx({
|
|
182
|
+
title,
|
|
183
|
+
icon,
|
|
184
|
+
href,
|
|
185
|
+
horizontal,
|
|
186
|
+
children,
|
|
187
|
+
style,
|
|
188
|
+
className,
|
|
189
|
+
__LinkComponent,
|
|
190
|
+
...props
|
|
191
|
+
}) {
|
|
192
|
+
const resolvedIcon = resolveLucideIcon(icon);
|
|
193
|
+
const LinkComponent = __LinkComponent ?? LinkMdx;
|
|
194
|
+
const content = /* @__PURE__ */ jsxs2(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
style: {
|
|
198
|
+
display: "grid",
|
|
199
|
+
gridTemplateColumns: horizontal ? "auto 1fr" : "1fr",
|
|
200
|
+
gap: horizontal ? "0.75rem" : "0.4rem",
|
|
201
|
+
alignItems: horizontal ? "flex-start" : "flex-start"
|
|
202
|
+
},
|
|
203
|
+
children: [
|
|
204
|
+
resolvedIcon ? /* @__PURE__ */ jsx3(
|
|
205
|
+
"span",
|
|
206
|
+
{
|
|
207
|
+
"aria-hidden": "true",
|
|
208
|
+
"data-card-icon": "",
|
|
209
|
+
style: {
|
|
210
|
+
display: "block",
|
|
211
|
+
alignItems: "center",
|
|
212
|
+
justifyContent: "center",
|
|
213
|
+
width: "1rem",
|
|
214
|
+
height: "1rem",
|
|
215
|
+
color: "hsl(var(--primary, 210 81% 56%))",
|
|
216
|
+
fontSize: "2rem",
|
|
217
|
+
transition: "transform 0.2s ease, color 0.2s ease"
|
|
218
|
+
},
|
|
219
|
+
children: resolvedIcon
|
|
220
|
+
}
|
|
221
|
+
) : null,
|
|
222
|
+
/* @__PURE__ */ jsxs2("div", { style: { display: "grid", gridAutoRows: "min-content", gap: 0 }, children: [
|
|
223
|
+
/* @__PURE__ */ jsx3(
|
|
224
|
+
"div",
|
|
225
|
+
{
|
|
226
|
+
style: {
|
|
227
|
+
fontWeight: 700,
|
|
228
|
+
fontSize: "1.22rem",
|
|
229
|
+
lineHeight: 1.3,
|
|
230
|
+
color: "hsl(var(--foreground, 220 30% 15%))"
|
|
231
|
+
},
|
|
232
|
+
children: title
|
|
233
|
+
}
|
|
234
|
+
),
|
|
235
|
+
children ? /* @__PURE__ */ jsx3(
|
|
236
|
+
"div",
|
|
237
|
+
{
|
|
238
|
+
style: {
|
|
239
|
+
color: "hsl(var(--muted-foreground, 220 15% 50%))",
|
|
240
|
+
fontSize: "0.96rem",
|
|
241
|
+
lineHeight: 1.42,
|
|
242
|
+
marginTop: "-0.5rem"
|
|
243
|
+
},
|
|
244
|
+
children
|
|
245
|
+
}
|
|
246
|
+
) : null
|
|
247
|
+
] })
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
const combinedStyle = { ...baseStyle, ...style };
|
|
252
|
+
if (href) {
|
|
253
|
+
return /* @__PURE__ */ jsx3(
|
|
254
|
+
LinkComponent,
|
|
255
|
+
{
|
|
256
|
+
href,
|
|
257
|
+
"data-card-hover": "",
|
|
258
|
+
"data-card-link": "",
|
|
259
|
+
style: combinedStyle,
|
|
260
|
+
...className ? { className } : {},
|
|
261
|
+
...props,
|
|
262
|
+
children: content
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
return /* @__PURE__ */ jsx3("div", { style: combinedStyle, ...className ? { className } : {}, ...props, children: content });
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// src/components/FileTreeMdx.tsx
|
|
270
|
+
import React, {
|
|
271
|
+
useId as useId2,
|
|
272
|
+
useState as useState3
|
|
273
|
+
} from "react";
|
|
274
|
+
import { ChevronRight as ChevronRight2, File as FileIcon, Folder as FolderIcon, FolderOpen } from "lucide-react";
|
|
275
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
276
|
+
function FilesMdx({ children, style, className, ...props }) {
|
|
277
|
+
return /* @__PURE__ */ jsx4(
|
|
278
|
+
"div",
|
|
279
|
+
{
|
|
280
|
+
className,
|
|
281
|
+
...props,
|
|
282
|
+
role: "tree",
|
|
283
|
+
"aria-label": props["aria-label"] ?? "File tree",
|
|
284
|
+
style: {
|
|
285
|
+
border: "1px solid hsl(var(--border-color, 210 20% 85%))",
|
|
286
|
+
borderRadius: 12,
|
|
287
|
+
padding: "0.5rem",
|
|
288
|
+
margin: "1rem 0",
|
|
289
|
+
background: "hsla(var(--card, 0 0% 100%) / 0.9)",
|
|
290
|
+
backdropFilter: "blur(8px)",
|
|
291
|
+
boxShadow: "0 10px 20px rgba(0,0,0,0.05)",
|
|
292
|
+
...style
|
|
293
|
+
},
|
|
294
|
+
children
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
function FolderMdx({ name, children, style, className, ...props }) {
|
|
299
|
+
const [isOpen, setIsOpen] = useState3(true);
|
|
300
|
+
const [isHovered, setIsHovered] = useState3(false);
|
|
301
|
+
const [isFocused, setIsFocused] = useState3(false);
|
|
302
|
+
const hasChildren = React.Children.count(children) > 0;
|
|
303
|
+
const groupId = useId2();
|
|
304
|
+
const handleKeyDown = (event) => {
|
|
305
|
+
if (!hasChildren) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
if (event.key === "ArrowRight") {
|
|
309
|
+
event.preventDefault();
|
|
310
|
+
setIsOpen(true);
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
if (event.key === "ArrowLeft") {
|
|
314
|
+
event.preventDefault();
|
|
315
|
+
setIsOpen(false);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
319
|
+
event.preventDefault();
|
|
320
|
+
setIsOpen((prev) => !prev);
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
return /* @__PURE__ */ jsxs3(
|
|
324
|
+
"div",
|
|
325
|
+
{
|
|
326
|
+
className,
|
|
327
|
+
...props,
|
|
328
|
+
role: "treeitem",
|
|
329
|
+
"aria-expanded": hasChildren ? isOpen : void 0,
|
|
330
|
+
style: { marginLeft: "0.35rem", ...style },
|
|
331
|
+
children: [
|
|
332
|
+
/* @__PURE__ */ jsxs3(
|
|
333
|
+
"button",
|
|
334
|
+
{
|
|
335
|
+
type: "button",
|
|
336
|
+
className: "flex items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-150",
|
|
337
|
+
onClick: () => hasChildren && setIsOpen((prev) => !prev),
|
|
338
|
+
onMouseEnter: () => setIsHovered(true),
|
|
339
|
+
onMouseLeave: () => setIsHovered(false),
|
|
340
|
+
onFocus: () => setIsFocused(true),
|
|
341
|
+
onBlur: () => setIsFocused(false),
|
|
342
|
+
onKeyDown: handleKeyDown,
|
|
343
|
+
"aria-label": `${isOpen ? "Collapse" : "Expand"} folder ${name}`,
|
|
344
|
+
"aria-expanded": hasChildren ? isOpen : void 0,
|
|
345
|
+
"aria-controls": hasChildren ? groupId : void 0,
|
|
346
|
+
style: {
|
|
347
|
+
cursor: hasChildren ? "pointer" : "default",
|
|
348
|
+
width: "100%",
|
|
349
|
+
border: "none",
|
|
350
|
+
textAlign: "left",
|
|
351
|
+
background: isHovered || isFocused ? "hsla(var(--muted, 210 20% 92%) / 0.45)" : "transparent"
|
|
352
|
+
},
|
|
353
|
+
children: [
|
|
354
|
+
hasChildren ? /* @__PURE__ */ jsx4(
|
|
355
|
+
ChevronRight2,
|
|
356
|
+
{
|
|
357
|
+
className: "h-3.5 w-3.5 transition-transform duration-200",
|
|
358
|
+
style: {
|
|
359
|
+
transform: isOpen ? "rotate(90deg)" : "rotate(0deg)",
|
|
360
|
+
color: isHovered || isFocused ? "hsl(var(--primary, 210 81% 56%))" : "hsl(var(--muted-foreground, 220 15% 50%))"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
) : /* @__PURE__ */ jsx4("div", { className: "w-3.5" }),
|
|
364
|
+
isOpen ? /* @__PURE__ */ jsx4(
|
|
365
|
+
FolderOpen,
|
|
366
|
+
{
|
|
367
|
+
className: "h-4 w-4",
|
|
368
|
+
style: {
|
|
369
|
+
color: isHovered || isFocused ? "hsl(var(--primary, 210 81% 56%))" : "hsl(var(--muted-foreground, 220 15% 50%))"
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
) : /* @__PURE__ */ jsx4(
|
|
373
|
+
FolderIcon,
|
|
374
|
+
{
|
|
375
|
+
className: "h-4 w-4",
|
|
376
|
+
style: {
|
|
377
|
+
color: isHovered || isFocused ? "hsl(var(--primary, 210 81% 56%))" : "hsl(var(--muted-foreground, 220 15% 50%))"
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
),
|
|
381
|
+
/* @__PURE__ */ jsx4(
|
|
382
|
+
"span",
|
|
383
|
+
{
|
|
384
|
+
style: {
|
|
385
|
+
fontWeight: 600,
|
|
386
|
+
color: isHovered || isFocused ? "hsl(var(--primary, 210 81% 56%))" : "hsl(var(--foreground, 220 30% 15%))"
|
|
387
|
+
},
|
|
388
|
+
children: name
|
|
389
|
+
}
|
|
390
|
+
)
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
),
|
|
394
|
+
isOpen && hasChildren && /* @__PURE__ */ jsx4(
|
|
395
|
+
"div",
|
|
396
|
+
{
|
|
397
|
+
id: groupId,
|
|
398
|
+
role: "group",
|
|
399
|
+
style: {
|
|
400
|
+
marginLeft: "1rem",
|
|
401
|
+
borderLeft: "2px solid hsl(var(--border-color, 210 20% 85%))",
|
|
402
|
+
paddingLeft: "0.6rem"
|
|
403
|
+
},
|
|
404
|
+
children
|
|
405
|
+
}
|
|
406
|
+
)
|
|
407
|
+
]
|
|
408
|
+
}
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
function FileMdx({ name, style, className, ...props }) {
|
|
412
|
+
const [isHovered, setIsHovered] = useState3(false);
|
|
413
|
+
const [isFocused, setIsFocused] = useState3(false);
|
|
414
|
+
const fileExtension = name.split(".").pop()?.toUpperCase();
|
|
415
|
+
return /* @__PURE__ */ jsxs3(
|
|
416
|
+
"div",
|
|
417
|
+
{
|
|
418
|
+
className,
|
|
419
|
+
...props,
|
|
420
|
+
role: "treeitem",
|
|
421
|
+
tabIndex: 0,
|
|
422
|
+
style: {
|
|
423
|
+
display: "flex",
|
|
424
|
+
alignItems: "center",
|
|
425
|
+
gap: "0.5rem",
|
|
426
|
+
padding: "0.33rem 0.5rem",
|
|
427
|
+
borderRadius: "0.45rem",
|
|
428
|
+
userSelect: "none",
|
|
429
|
+
background: isHovered || isFocused ? "hsla(var(--muted, 210 20% 92%) / 0.35)" : "transparent",
|
|
430
|
+
...style
|
|
431
|
+
},
|
|
432
|
+
onMouseEnter: () => setIsHovered(true),
|
|
433
|
+
onMouseLeave: () => setIsHovered(false),
|
|
434
|
+
onFocus: () => setIsFocused(true),
|
|
435
|
+
onBlur: () => setIsFocused(false),
|
|
436
|
+
children: [
|
|
437
|
+
/* @__PURE__ */ jsx4(
|
|
438
|
+
FileIcon,
|
|
439
|
+
{
|
|
440
|
+
className: "h-3.5 w-3.5",
|
|
441
|
+
style: {
|
|
442
|
+
color: isHovered || isFocused ? "hsl(var(--primary, 210 81% 56%))" : "hsl(var(--muted-foreground, 220 15% 50%))"
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
),
|
|
446
|
+
/* @__PURE__ */ jsx4(
|
|
447
|
+
"span",
|
|
448
|
+
{
|
|
449
|
+
style: {
|
|
450
|
+
fontFamily: "SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
|
|
451
|
+
fontSize: "0.9rem",
|
|
452
|
+
color: "hsl(var(--foreground, 220 30% 15%))"
|
|
453
|
+
},
|
|
454
|
+
children: name
|
|
455
|
+
}
|
|
456
|
+
),
|
|
457
|
+
(isHovered || isFocused) && fileExtension && /* @__PURE__ */ jsx4(
|
|
458
|
+
"span",
|
|
459
|
+
{
|
|
460
|
+
style: {
|
|
461
|
+
marginLeft: "auto",
|
|
462
|
+
fontSize: "0.7rem",
|
|
463
|
+
color: "hsl(var(--muted-foreground, 220 15% 50%))"
|
|
464
|
+
},
|
|
465
|
+
children: fileExtension
|
|
466
|
+
}
|
|
467
|
+
)
|
|
468
|
+
]
|
|
469
|
+
}
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// src/components/ImageMdx.tsx
|
|
474
|
+
import { createPortal } from "react-dom";
|
|
475
|
+
import { useEffect, useId as useId3, useRef, useState as useState4 } from "react";
|
|
476
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
477
|
+
function ImageMdx({
|
|
478
|
+
src,
|
|
479
|
+
alt = "image",
|
|
480
|
+
width = 800,
|
|
481
|
+
height = 350,
|
|
482
|
+
zoom = true,
|
|
483
|
+
style,
|
|
484
|
+
ImageComponent,
|
|
485
|
+
...props
|
|
486
|
+
}) {
|
|
487
|
+
const Image = ImageComponent ?? "img";
|
|
488
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
489
|
+
const scrollYRef = useRef(0);
|
|
490
|
+
const closeButtonRef = useRef(null);
|
|
491
|
+
const dialogId = useId3();
|
|
492
|
+
useEffect(() => {
|
|
493
|
+
if (!isOpen) return;
|
|
494
|
+
scrollYRef.current = window.scrollY;
|
|
495
|
+
document.body.style.position = "fixed";
|
|
496
|
+
document.body.style.top = `-${scrollYRef.current}px`;
|
|
497
|
+
document.body.style.width = "100%";
|
|
498
|
+
closeButtonRef.current?.focus();
|
|
499
|
+
const onEsc = (e) => {
|
|
500
|
+
if (e.key === "Escape") setIsOpen(false);
|
|
501
|
+
};
|
|
502
|
+
const onFocusTrap = (e) => {
|
|
503
|
+
if (e.key !== "Tab") return;
|
|
504
|
+
const dialog = document.getElementById(dialogId);
|
|
505
|
+
const focusable = dialog?.querySelectorAll(
|
|
506
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
507
|
+
);
|
|
508
|
+
if (!focusable || focusable.length === 0) return;
|
|
509
|
+
const first = focusable[0];
|
|
510
|
+
const last = focusable[focusable.length - 1];
|
|
511
|
+
if (!e.shiftKey && document.activeElement === last) {
|
|
512
|
+
e.preventDefault();
|
|
513
|
+
first.focus();
|
|
514
|
+
}
|
|
515
|
+
if (e.shiftKey && document.activeElement === first) {
|
|
516
|
+
e.preventDefault();
|
|
517
|
+
last.focus();
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
window.addEventListener("keydown", onEsc);
|
|
521
|
+
window.addEventListener("keydown", onFocusTrap);
|
|
522
|
+
return () => {
|
|
523
|
+
document.body.style.position = "";
|
|
524
|
+
document.body.style.top = "";
|
|
525
|
+
document.body.style.width = "";
|
|
526
|
+
window.scrollTo(0, scrollYRef.current);
|
|
527
|
+
window.removeEventListener("keydown", onEsc);
|
|
528
|
+
window.removeEventListener("keydown", onFocusTrap);
|
|
529
|
+
};
|
|
530
|
+
}, [dialogId, isOpen]);
|
|
531
|
+
if (!src) return null;
|
|
532
|
+
const canZoom = zoom;
|
|
533
|
+
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
534
|
+
/* @__PURE__ */ jsx5(
|
|
535
|
+
"button",
|
|
536
|
+
{
|
|
537
|
+
type: "button",
|
|
538
|
+
onClick: () => canZoom && setIsOpen(true),
|
|
539
|
+
"aria-label": canZoom ? "Zoom image" : "Image",
|
|
540
|
+
style: {
|
|
541
|
+
position: "relative",
|
|
542
|
+
width: "100%",
|
|
543
|
+
border: "none",
|
|
544
|
+
background: "transparent",
|
|
545
|
+
padding: 0,
|
|
546
|
+
margin: "1rem 0",
|
|
547
|
+
cursor: canZoom ? "zoom-in" : "default"
|
|
548
|
+
},
|
|
549
|
+
children: /* @__PURE__ */ jsx5(
|
|
550
|
+
Image,
|
|
551
|
+
{
|
|
552
|
+
src,
|
|
553
|
+
alt,
|
|
554
|
+
width: typeof width === "number" ? width : parseInt(width, 10),
|
|
555
|
+
height: typeof height === "number" ? height : parseInt(height, 10),
|
|
556
|
+
style: {
|
|
557
|
+
width: "100%",
|
|
558
|
+
height: "auto",
|
|
559
|
+
borderRadius: 10,
|
|
560
|
+
objectFit: "contain",
|
|
561
|
+
...style
|
|
562
|
+
},
|
|
563
|
+
...props
|
|
564
|
+
}
|
|
565
|
+
)
|
|
566
|
+
}
|
|
567
|
+
),
|
|
568
|
+
canZoom && isOpen ? /* @__PURE__ */ jsx5(Portal, { children: /* @__PURE__ */ jsxs4(
|
|
569
|
+
"div",
|
|
570
|
+
{
|
|
571
|
+
id: dialogId,
|
|
572
|
+
role: "dialog",
|
|
573
|
+
"aria-modal": "true",
|
|
574
|
+
"aria-label": "Image preview",
|
|
575
|
+
onClick: () => setIsOpen(false),
|
|
576
|
+
style: {
|
|
577
|
+
position: "fixed",
|
|
578
|
+
inset: 0,
|
|
579
|
+
zIndex: 99999,
|
|
580
|
+
background: "rgba(0,0,0,0.88)",
|
|
581
|
+
display: "flex",
|
|
582
|
+
alignItems: "center",
|
|
583
|
+
justifyContent: "center",
|
|
584
|
+
padding: "1rem"
|
|
585
|
+
},
|
|
586
|
+
children: [
|
|
587
|
+
/* @__PURE__ */ jsx5(
|
|
588
|
+
"button",
|
|
589
|
+
{
|
|
590
|
+
ref: closeButtonRef,
|
|
591
|
+
type: "button",
|
|
592
|
+
"aria-label": "Close image preview",
|
|
593
|
+
onClick: (e) => {
|
|
594
|
+
e.stopPropagation();
|
|
595
|
+
setIsOpen(false);
|
|
596
|
+
},
|
|
597
|
+
style: {
|
|
598
|
+
position: "absolute",
|
|
599
|
+
top: 16,
|
|
600
|
+
right: 16,
|
|
601
|
+
border: "1px solid rgba(255,255,255,0.24)",
|
|
602
|
+
borderRadius: 8,
|
|
603
|
+
background: "rgba(0,0,0,0.45)",
|
|
604
|
+
color: "#fff",
|
|
605
|
+
padding: "0.4rem 0.55rem",
|
|
606
|
+
cursor: "pointer"
|
|
607
|
+
},
|
|
608
|
+
children: "Close"
|
|
609
|
+
}
|
|
610
|
+
),
|
|
611
|
+
/* @__PURE__ */ jsx5(
|
|
612
|
+
"div",
|
|
613
|
+
{
|
|
614
|
+
onClick: (e) => e.stopPropagation(),
|
|
615
|
+
style: {
|
|
616
|
+
maxWidth: "92vw",
|
|
617
|
+
maxHeight: "90vh",
|
|
618
|
+
display: "flex",
|
|
619
|
+
alignItems: "center",
|
|
620
|
+
justifyContent: "center"
|
|
621
|
+
},
|
|
622
|
+
children: /* @__PURE__ */ jsx5(
|
|
623
|
+
Image,
|
|
624
|
+
{
|
|
625
|
+
src,
|
|
626
|
+
alt,
|
|
627
|
+
width: 1920,
|
|
628
|
+
height: 1080,
|
|
629
|
+
style: {
|
|
630
|
+
width: "auto",
|
|
631
|
+
height: "auto",
|
|
632
|
+
maxWidth: "92vw",
|
|
633
|
+
maxHeight: "90vh",
|
|
634
|
+
objectFit: "contain",
|
|
635
|
+
borderRadius: 10
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
)
|
|
639
|
+
}
|
|
640
|
+
)
|
|
641
|
+
]
|
|
642
|
+
}
|
|
643
|
+
) }) : null
|
|
644
|
+
] });
|
|
645
|
+
}
|
|
646
|
+
function Portal({ children }) {
|
|
647
|
+
if (typeof window === "undefined") return null;
|
|
648
|
+
return createPortal(children, document.body);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// src/components/MermaidMdx.tsx
|
|
652
|
+
import {
|
|
653
|
+
useId as useId4,
|
|
654
|
+
useRef as useRef2,
|
|
655
|
+
useEffect as useEffect2,
|
|
656
|
+
useState as useState5
|
|
657
|
+
} from "react";
|
|
658
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
659
|
+
var mermaidPromise = null;
|
|
660
|
+
function getTheme() {
|
|
661
|
+
return document.documentElement.classList.contains("dark") ? "dark" : "default";
|
|
662
|
+
}
|
|
663
|
+
var PAN_STEP = 50;
|
|
664
|
+
var ZOOM_STEP = 1.2;
|
|
665
|
+
var MIN_SCALE = 0.4;
|
|
666
|
+
var MAX_SCALE = 4;
|
|
667
|
+
var clampScale = (scale) => Math.min(MAX_SCALE, Math.max(MIN_SCALE, scale));
|
|
668
|
+
var controlButtonStyle = {
|
|
669
|
+
display: "flex",
|
|
670
|
+
alignItems: "center",
|
|
671
|
+
justifyContent: "center",
|
|
672
|
+
width: 28,
|
|
673
|
+
height: 28,
|
|
674
|
+
padding: 0,
|
|
675
|
+
border: "1px solid rgba(127,127,127,0.35)",
|
|
676
|
+
borderRadius: 6,
|
|
677
|
+
background: "rgba(127,127,127,0.12)",
|
|
678
|
+
color: "currentcolor",
|
|
679
|
+
cursor: "pointer"
|
|
680
|
+
};
|
|
681
|
+
function ControlButton({
|
|
682
|
+
label,
|
|
683
|
+
onClick,
|
|
684
|
+
cell,
|
|
685
|
+
children
|
|
686
|
+
}) {
|
|
687
|
+
return /* @__PURE__ */ jsx6(
|
|
688
|
+
"button",
|
|
689
|
+
{
|
|
690
|
+
type: "button",
|
|
691
|
+
"aria-label": label,
|
|
692
|
+
title: label,
|
|
693
|
+
onClick,
|
|
694
|
+
style: { ...controlButtonStyle, gridColumn: cell.col, gridRow: cell.row },
|
|
695
|
+
children: /* @__PURE__ */ jsx6(
|
|
696
|
+
"svg",
|
|
697
|
+
{
|
|
698
|
+
width: "14",
|
|
699
|
+
height: "14",
|
|
700
|
+
viewBox: "0 0 24 24",
|
|
701
|
+
fill: "none",
|
|
702
|
+
stroke: "currentColor",
|
|
703
|
+
strokeWidth: "2",
|
|
704
|
+
strokeLinecap: "round",
|
|
705
|
+
strokeLinejoin: "round",
|
|
706
|
+
"aria-hidden": "true",
|
|
707
|
+
children
|
|
708
|
+
}
|
|
709
|
+
)
|
|
710
|
+
}
|
|
711
|
+
);
|
|
712
|
+
}
|
|
713
|
+
function MermaidMdx({ chart, id, className, panZoom = true }) {
|
|
714
|
+
const generatedId = useId4();
|
|
715
|
+
const domId = id ?? `mermaid-${generatedId.replace(/[:.]/g, "-")}`;
|
|
716
|
+
const ref = useRef2(null);
|
|
717
|
+
const chartRef = useRef2(chart);
|
|
718
|
+
const mermaidRef = useRef2(null);
|
|
719
|
+
const [error, setError] = useState5(null);
|
|
720
|
+
const [rendered, setRendered] = useState5(false);
|
|
721
|
+
const [view, setView] = useState5({ x: 0, y: 0, scale: 1 });
|
|
722
|
+
const [fullscreen, setFullscreen] = useState5(false);
|
|
723
|
+
chartRef.current = chart;
|
|
724
|
+
useEffect2(() => {
|
|
725
|
+
if (typeof window === "undefined") return;
|
|
726
|
+
if (!chart) return;
|
|
727
|
+
let cancelled = false;
|
|
728
|
+
let lazyObserver = null;
|
|
729
|
+
let syncObserver = null;
|
|
730
|
+
let themeTimer = null;
|
|
731
|
+
let lastTheme = getTheme();
|
|
732
|
+
let runChain = Promise.resolve();
|
|
733
|
+
function enqueueRun(run) {
|
|
734
|
+
const next = runChain.then(() => {
|
|
735
|
+
if (cancelled || !ref.current?.isConnected) return;
|
|
736
|
+
return run();
|
|
737
|
+
});
|
|
738
|
+
runChain = next.catch(() => {
|
|
739
|
+
});
|
|
740
|
+
return next;
|
|
741
|
+
}
|
|
742
|
+
async function init() {
|
|
743
|
+
try {
|
|
744
|
+
if (!mermaidPromise) {
|
|
745
|
+
mermaidPromise = import("mermaid");
|
|
746
|
+
}
|
|
747
|
+
const mod = await mermaidPromise;
|
|
748
|
+
const mermaid = mermaidRef.current = mod.default;
|
|
749
|
+
mermaid.initialize({ startOnLoad: false, theme: getTheme() });
|
|
750
|
+
try {
|
|
751
|
+
await mermaid.parse(chart);
|
|
752
|
+
} catch {
|
|
753
|
+
if (!cancelled) setError("Invalid Mermaid syntax");
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
if (cancelled || !ref.current) return;
|
|
757
|
+
lazyObserver = new IntersectionObserver(
|
|
758
|
+
([entry]) => {
|
|
759
|
+
if (!entry.isIntersecting || cancelled || !ref.current) return;
|
|
760
|
+
enqueueRun(() => {
|
|
761
|
+
const node = ref.current;
|
|
762
|
+
if (!node) return Promise.resolve();
|
|
763
|
+
return mermaid.run({ nodes: [node] });
|
|
764
|
+
}).then(() => {
|
|
765
|
+
if (!cancelled) setRendered(true);
|
|
766
|
+
}).catch(() => {
|
|
767
|
+
if (!cancelled) setError("Failed to render diagram");
|
|
768
|
+
});
|
|
769
|
+
lazyObserver?.disconnect();
|
|
770
|
+
},
|
|
771
|
+
{ rootMargin: "200px" }
|
|
772
|
+
);
|
|
773
|
+
lazyObserver.observe(ref.current);
|
|
774
|
+
} catch {
|
|
775
|
+
if (!cancelled) setError("Failed to load Mermaid renderer");
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
init();
|
|
779
|
+
syncObserver = new MutationObserver(() => {
|
|
780
|
+
if (themeTimer) clearTimeout(themeTimer);
|
|
781
|
+
themeTimer = setTimeout(() => {
|
|
782
|
+
if (cancelled || !mermaidRef.current || !ref.current) return;
|
|
783
|
+
if (getTheme() === lastTheme) return;
|
|
784
|
+
enqueueRun(() => {
|
|
785
|
+
const mermaid = mermaidRef.current;
|
|
786
|
+
const node = ref.current;
|
|
787
|
+
if (!mermaid || !node) return Promise.resolve();
|
|
788
|
+
lastTheme = getTheme();
|
|
789
|
+
node.textContent = chartRef.current;
|
|
790
|
+
node.removeAttribute("data-processed");
|
|
791
|
+
mermaid.initialize({ startOnLoad: false, theme: lastTheme });
|
|
792
|
+
return mermaid.run({ nodes: [node] });
|
|
793
|
+
}).catch((e) => {
|
|
794
|
+
console.warn("[mermaid] diagram render error:", e);
|
|
795
|
+
});
|
|
796
|
+
}, 200);
|
|
797
|
+
});
|
|
798
|
+
syncObserver.observe(document.documentElement, {
|
|
799
|
+
attributes: true,
|
|
800
|
+
attributeFilter: ["class"]
|
|
801
|
+
});
|
|
802
|
+
return () => {
|
|
803
|
+
cancelled = true;
|
|
804
|
+
if (themeTimer) clearTimeout(themeTimer);
|
|
805
|
+
lazyObserver?.disconnect();
|
|
806
|
+
syncObserver?.disconnect();
|
|
807
|
+
};
|
|
808
|
+
}, []);
|
|
809
|
+
useEffect2(() => {
|
|
810
|
+
if (!fullscreen) return;
|
|
811
|
+
const previous = document.body.style.overflow;
|
|
812
|
+
document.body.style.overflow = "hidden";
|
|
813
|
+
return () => {
|
|
814
|
+
document.body.style.overflow = previous;
|
|
815
|
+
};
|
|
816
|
+
}, [fullscreen]);
|
|
817
|
+
if (!chart) return null;
|
|
818
|
+
const pan = (dx, dy) => setView((v) => ({ ...v, x: v.x + dx, y: v.y + dy }));
|
|
819
|
+
const zoom = (factor) => setView((v) => ({ ...v, scale: clampScale(v.scale * factor) }));
|
|
820
|
+
const resetView = () => setView({ x: 0, y: 0, scale: 1 });
|
|
821
|
+
const controlsActive = panZoom && rendered;
|
|
822
|
+
const handleKeyDown = (e) => {
|
|
823
|
+
if (!controlsActive || e.ctrlKey || e.metaKey || e.altKey) return;
|
|
824
|
+
const actions = {
|
|
825
|
+
ArrowUp: () => pan(0, -PAN_STEP),
|
|
826
|
+
ArrowDown: () => pan(0, PAN_STEP),
|
|
827
|
+
ArrowLeft: () => pan(-PAN_STEP, 0),
|
|
828
|
+
ArrowRight: () => pan(PAN_STEP, 0),
|
|
829
|
+
"+": () => zoom(ZOOM_STEP),
|
|
830
|
+
"=": () => zoom(ZOOM_STEP),
|
|
831
|
+
"-": () => zoom(1 / ZOOM_STEP),
|
|
832
|
+
"0": resetView,
|
|
833
|
+
...fullscreen ? { Escape: () => setFullscreen(false) } : {}
|
|
834
|
+
};
|
|
835
|
+
const action = actions[e.key];
|
|
836
|
+
if (!action) return;
|
|
837
|
+
e.preventDefault();
|
|
838
|
+
action();
|
|
839
|
+
};
|
|
840
|
+
if (error) {
|
|
841
|
+
return /* @__PURE__ */ jsxs5(
|
|
842
|
+
"div",
|
|
843
|
+
{
|
|
844
|
+
className,
|
|
845
|
+
style: {
|
|
846
|
+
border: "1px solid hsl(var(--destructive, 0 85% 60%))",
|
|
847
|
+
borderRadius: 8,
|
|
848
|
+
padding: "0.75rem 1rem",
|
|
849
|
+
margin: "1em 0"
|
|
850
|
+
},
|
|
851
|
+
children: [
|
|
852
|
+
/* @__PURE__ */ jsx6(
|
|
853
|
+
"p",
|
|
854
|
+
{
|
|
855
|
+
style: {
|
|
856
|
+
color: "hsl(var(--destructive, 0 85% 60%))",
|
|
857
|
+
fontWeight: 600,
|
|
858
|
+
marginBottom: 8,
|
|
859
|
+
fontSize: "0.875rem"
|
|
860
|
+
},
|
|
861
|
+
children: "\u26A0\uFE0F Diagram rendering error"
|
|
862
|
+
}
|
|
863
|
+
),
|
|
864
|
+
/* @__PURE__ */ jsx6(
|
|
865
|
+
"pre",
|
|
866
|
+
{
|
|
867
|
+
style: {
|
|
868
|
+
fontSize: "0.875rem",
|
|
869
|
+
whiteSpace: "pre-wrap",
|
|
870
|
+
margin: 0
|
|
871
|
+
},
|
|
872
|
+
children: chart
|
|
873
|
+
}
|
|
874
|
+
)
|
|
875
|
+
]
|
|
876
|
+
}
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
return /* @__PURE__ */ jsxs5(
|
|
880
|
+
"div",
|
|
881
|
+
{
|
|
882
|
+
className: "max-w-full",
|
|
883
|
+
tabIndex: controlsActive ? 0 : void 0,
|
|
884
|
+
role: controlsActive ? "group" : void 0,
|
|
885
|
+
"aria-label": controlsActive ? "Mermaid diagram. Use arrow keys to pan, + and - to zoom, 0 to reset." : void 0,
|
|
886
|
+
onKeyDown: handleKeyDown,
|
|
887
|
+
style: {
|
|
888
|
+
...fullscreen ? {
|
|
889
|
+
position: "fixed",
|
|
890
|
+
inset: 0,
|
|
891
|
+
zIndex: 50,
|
|
892
|
+
background: "hsl(var(--background, 0 0% 100%))",
|
|
893
|
+
display: "flex",
|
|
894
|
+
alignItems: "center",
|
|
895
|
+
justifyContent: "center"
|
|
896
|
+
} : { position: "relative" },
|
|
897
|
+
...controlsActive ? { overflow: "hidden" } : { overflowX: "auto" }
|
|
898
|
+
},
|
|
899
|
+
children: [
|
|
900
|
+
/* @__PURE__ */ jsx6(
|
|
901
|
+
"div",
|
|
902
|
+
{
|
|
903
|
+
style: controlsActive ? {
|
|
904
|
+
transform: `translate(${view.x}px, ${view.y}px) scale(${view.scale})`,
|
|
905
|
+
transformOrigin: "center center",
|
|
906
|
+
transition: "transform 150ms ease"
|
|
907
|
+
} : void 0,
|
|
908
|
+
children: /* @__PURE__ */ jsx6(
|
|
909
|
+
"pre",
|
|
910
|
+
{
|
|
911
|
+
ref,
|
|
912
|
+
id: domId,
|
|
913
|
+
className: `mermaid not-prose${className ? ` ${className}` : ""}`,
|
|
914
|
+
style: { margin: "1em auto", width: "fit-content", maxWidth: "100%" },
|
|
915
|
+
children: chart
|
|
916
|
+
}
|
|
917
|
+
)
|
|
918
|
+
}
|
|
919
|
+
),
|
|
920
|
+
controlsActive ? /* @__PURE__ */ jsxs5(
|
|
921
|
+
"div",
|
|
922
|
+
{
|
|
923
|
+
role: "group",
|
|
924
|
+
"aria-label": "Pan and zoom controls",
|
|
925
|
+
style: {
|
|
926
|
+
position: "absolute",
|
|
927
|
+
bottom: 8,
|
|
928
|
+
right: 8,
|
|
929
|
+
display: "grid",
|
|
930
|
+
gridTemplateColumns: "repeat(3, 28px)",
|
|
931
|
+
gap: 4
|
|
932
|
+
},
|
|
933
|
+
children: [
|
|
934
|
+
/* @__PURE__ */ jsx6(
|
|
935
|
+
ControlButton,
|
|
936
|
+
{
|
|
937
|
+
label: fullscreen ? "Exit full screen" : "Enter full screen",
|
|
938
|
+
onClick: () => setFullscreen((f) => !f),
|
|
939
|
+
cell: { col: 1, row: 1 },
|
|
940
|
+
children: fullscreen ? /* @__PURE__ */ jsx6("path", { d: "M8 3v3a2 2 0 0 1-2 2H3M21 8h-3a2 2 0 0 1-2-2V3M3 16h3a2 2 0 0 1 2 2v3M16 21v-3a2 2 0 0 1 2-2h3" }) : /* @__PURE__ */ jsx6("path", { d: "M8 3H5a2 2 0 0 0-2 2v3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M16 21h3a2 2 0 0 0 2-2v-3" })
|
|
941
|
+
}
|
|
942
|
+
),
|
|
943
|
+
/* @__PURE__ */ jsx6(ControlButton, { label: "Pan up", onClick: () => pan(0, -PAN_STEP), cell: { col: 2, row: 1 }, children: /* @__PURE__ */ jsx6("path", { d: "m18 15-6-6-6 6" }) }),
|
|
944
|
+
/* @__PURE__ */ jsxs5(ControlButton, { label: "Zoom in", onClick: () => zoom(ZOOM_STEP), cell: { col: 3, row: 1 }, children: [
|
|
945
|
+
/* @__PURE__ */ jsx6("circle", { cx: "11", cy: "11", r: "7" }),
|
|
946
|
+
/* @__PURE__ */ jsx6("path", { d: "m21 21-4-4M8 11h6M11 8v6" })
|
|
947
|
+
] }),
|
|
948
|
+
/* @__PURE__ */ jsx6(
|
|
949
|
+
ControlButton,
|
|
950
|
+
{
|
|
951
|
+
label: "Pan left",
|
|
952
|
+
onClick: () => pan(-PAN_STEP, 0),
|
|
953
|
+
cell: { col: 1, row: 2 },
|
|
954
|
+
children: /* @__PURE__ */ jsx6("path", { d: "m15 18-6-6 6-6" })
|
|
955
|
+
}
|
|
956
|
+
),
|
|
957
|
+
/* @__PURE__ */ jsxs5(ControlButton, { label: "Reset view", onClick: resetView, cell: { col: 2, row: 2 }, children: [
|
|
958
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 12a9 9 0 1 0 2.6-6.3L3 8" }),
|
|
959
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 3v5h5" })
|
|
960
|
+
] }),
|
|
961
|
+
/* @__PURE__ */ jsx6(
|
|
962
|
+
ControlButton,
|
|
963
|
+
{
|
|
964
|
+
label: "Pan right",
|
|
965
|
+
onClick: () => pan(PAN_STEP, 0),
|
|
966
|
+
cell: { col: 3, row: 2 },
|
|
967
|
+
children: /* @__PURE__ */ jsx6("path", { d: "m9 18 6-6-6-6" })
|
|
968
|
+
}
|
|
969
|
+
),
|
|
970
|
+
/* @__PURE__ */ jsx6(
|
|
971
|
+
ControlButton,
|
|
972
|
+
{
|
|
973
|
+
label: "Pan down",
|
|
974
|
+
onClick: () => pan(0, PAN_STEP),
|
|
975
|
+
cell: { col: 2, row: 3 },
|
|
976
|
+
children: /* @__PURE__ */ jsx6("path", { d: "m6 9 6 6 6-6" })
|
|
977
|
+
}
|
|
978
|
+
),
|
|
979
|
+
/* @__PURE__ */ jsxs5(
|
|
980
|
+
ControlButton,
|
|
981
|
+
{
|
|
982
|
+
label: "Zoom out",
|
|
983
|
+
onClick: () => zoom(1 / ZOOM_STEP),
|
|
984
|
+
cell: { col: 3, row: 3 },
|
|
985
|
+
children: [
|
|
986
|
+
/* @__PURE__ */ jsx6("circle", { cx: "11", cy: "11", r: "7" }),
|
|
987
|
+
/* @__PURE__ */ jsx6("path", { d: "m21 21-4-4M8 11h6" })
|
|
988
|
+
]
|
|
989
|
+
}
|
|
990
|
+
)
|
|
991
|
+
]
|
|
992
|
+
}
|
|
993
|
+
) : null
|
|
994
|
+
]
|
|
995
|
+
}
|
|
996
|
+
);
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
// src/components/TabsMdx.tsx
|
|
1000
|
+
import {
|
|
1001
|
+
Children,
|
|
1002
|
+
isValidElement,
|
|
1003
|
+
useId as useId5,
|
|
1004
|
+
useState as useState6
|
|
1005
|
+
} from "react";
|
|
1006
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1007
|
+
function TabMdx({ children }) {
|
|
1008
|
+
return /* @__PURE__ */ jsx7(Fragment2, { children });
|
|
1009
|
+
}
|
|
1010
|
+
function titleToValue(title) {
|
|
1011
|
+
return title.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, "");
|
|
1012
|
+
}
|
|
1013
|
+
function TabsMdx({ className, children }) {
|
|
1014
|
+
const id = useId5();
|
|
1015
|
+
const childArray = Children.toArray(children);
|
|
1016
|
+
const tabItems = childArray.filter(
|
|
1017
|
+
(child) => isValidElement(child) && typeof child.props.title === "string"
|
|
1018
|
+
).map((child, index) => {
|
|
1019
|
+
const title = child.props.title;
|
|
1020
|
+
const fallback = `tab-${index + 1}`;
|
|
1021
|
+
const slug = titleToValue(title) || fallback;
|
|
1022
|
+
return {
|
|
1023
|
+
value: `${slug}-${index + 1}`,
|
|
1024
|
+
title,
|
|
1025
|
+
children: child.props.children
|
|
1026
|
+
};
|
|
1027
|
+
});
|
|
1028
|
+
const [activeValue, setActiveValue] = useState6(tabItems[0]?.value ?? "");
|
|
1029
|
+
const activeItem = tabItems.find((item) => item.value === activeValue) ?? tabItems[0];
|
|
1030
|
+
return /* @__PURE__ */ jsxs6("div", { className, style: { margin: "1rem 0" }, children: [
|
|
1031
|
+
/* @__PURE__ */ jsx7(
|
|
1032
|
+
"div",
|
|
1033
|
+
{
|
|
1034
|
+
role: "tablist",
|
|
1035
|
+
"aria-orientation": "horizontal",
|
|
1036
|
+
style: {
|
|
1037
|
+
display: "flex",
|
|
1038
|
+
flexWrap: "nowrap",
|
|
1039
|
+
gap: "0.75rem",
|
|
1040
|
+
alignItems: "center",
|
|
1041
|
+
overflowX: "auto",
|
|
1042
|
+
borderBottom: "1px solid hsl(var(--border-color, 210 20% 85%))"
|
|
1043
|
+
},
|
|
1044
|
+
children: tabItems.map((item) => {
|
|
1045
|
+
const active = item.value === activeItem?.value;
|
|
1046
|
+
const triggerId = `${id}-tab-${item.value}`;
|
|
1047
|
+
const panelId = `${id}-panel-${item.value}`;
|
|
1048
|
+
return /* @__PURE__ */ jsx7(
|
|
1049
|
+
"button",
|
|
1050
|
+
{
|
|
1051
|
+
id: triggerId,
|
|
1052
|
+
type: "button",
|
|
1053
|
+
role: "tab",
|
|
1054
|
+
"aria-selected": active,
|
|
1055
|
+
"aria-controls": panelId,
|
|
1056
|
+
tabIndex: active ? 0 : -1,
|
|
1057
|
+
onClick: () => setActiveValue(item.value),
|
|
1058
|
+
style: {
|
|
1059
|
+
border: "none",
|
|
1060
|
+
borderBottom: active ? "2px solid hsl(var(--primary, 210 81% 56%))" : "2px solid transparent",
|
|
1061
|
+
background: "transparent",
|
|
1062
|
+
color: active ? "hsl(var(--primary, 210 81% 56%))" : "hsl(var(--foreground, 220 30% 15%))",
|
|
1063
|
+
fontSize: "0.875rem",
|
|
1064
|
+
fontWeight: 600,
|
|
1065
|
+
lineHeight: 1.2,
|
|
1066
|
+
padding: "0.7rem 0.15rem",
|
|
1067
|
+
cursor: "pointer",
|
|
1068
|
+
whiteSpace: "nowrap"
|
|
1069
|
+
},
|
|
1070
|
+
children: item.title
|
|
1071
|
+
},
|
|
1072
|
+
item.value
|
|
1073
|
+
);
|
|
1074
|
+
})
|
|
1075
|
+
}
|
|
1076
|
+
),
|
|
1077
|
+
tabItems.map((item) => {
|
|
1078
|
+
const active = item.value === activeItem?.value;
|
|
1079
|
+
const triggerId = `${id}-tab-${item.value}`;
|
|
1080
|
+
const panelId = `${id}-panel-${item.value}`;
|
|
1081
|
+
return /* @__PURE__ */ jsx7(
|
|
1082
|
+
"div",
|
|
1083
|
+
{
|
|
1084
|
+
role: "tabpanel",
|
|
1085
|
+
id: panelId,
|
|
1086
|
+
"aria-labelledby": triggerId,
|
|
1087
|
+
hidden: !active,
|
|
1088
|
+
tabIndex: 0,
|
|
1089
|
+
style: {
|
|
1090
|
+
marginTop: "1rem"
|
|
1091
|
+
},
|
|
1092
|
+
children: item.children
|
|
1093
|
+
},
|
|
1094
|
+
item.value
|
|
1095
|
+
);
|
|
1096
|
+
})
|
|
1097
|
+
] });
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// src/components/TooltipMdx.tsx
|
|
1101
|
+
import { useId as useId6, useState as useState7 } from "react";
|
|
1102
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1103
|
+
function TooltipMdx({
|
|
1104
|
+
text,
|
|
1105
|
+
tip,
|
|
1106
|
+
side = "top",
|
|
1107
|
+
style,
|
|
1108
|
+
className,
|
|
1109
|
+
...props
|
|
1110
|
+
}) {
|
|
1111
|
+
const [open, setOpen] = useState7(false);
|
|
1112
|
+
const id = useId6();
|
|
1113
|
+
const tooltipContent = tip ?? "";
|
|
1114
|
+
const triggerContent = text ?? "?";
|
|
1115
|
+
const floatingPosition = side === "bottom" ? { top: "calc(100% + 8px)" } : { bottom: "calc(100% + 8px)" };
|
|
1116
|
+
return /* @__PURE__ */ jsxs7(
|
|
1117
|
+
"span",
|
|
1118
|
+
{
|
|
1119
|
+
className,
|
|
1120
|
+
...props,
|
|
1121
|
+
"data-tooltip": typeof tooltipContent === "string" ? tooltipContent : "",
|
|
1122
|
+
"data-tooltip-side": side,
|
|
1123
|
+
style: { position: "relative", display: "inline-block", ...style },
|
|
1124
|
+
onMouseEnter: () => setOpen(true),
|
|
1125
|
+
onMouseLeave: () => setOpen(false),
|
|
1126
|
+
onFocus: () => setOpen(true),
|
|
1127
|
+
onBlur: () => setOpen(false),
|
|
1128
|
+
children: [
|
|
1129
|
+
/* @__PURE__ */ jsx8(
|
|
1130
|
+
"span",
|
|
1131
|
+
{
|
|
1132
|
+
tabIndex: 0,
|
|
1133
|
+
"aria-describedby": id,
|
|
1134
|
+
style: {
|
|
1135
|
+
cursor: "help",
|
|
1136
|
+
color: "hsl(var(--primary, 210 81% 56%))",
|
|
1137
|
+
textDecorationLine: "underline",
|
|
1138
|
+
textDecorationStyle: "dotted",
|
|
1139
|
+
textDecorationColor: "hsl(var(--primary, 210 81% 56%))",
|
|
1140
|
+
textUnderlineOffset: "0.18em"
|
|
1141
|
+
},
|
|
1142
|
+
onKeyDown: (event) => {
|
|
1143
|
+
if (event.key === "Escape") {
|
|
1144
|
+
setOpen(false);
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
children: triggerContent
|
|
1148
|
+
}
|
|
1149
|
+
),
|
|
1150
|
+
open && tooltipContent ? /* @__PURE__ */ jsx8(
|
|
1151
|
+
"span",
|
|
1152
|
+
{
|
|
1153
|
+
id,
|
|
1154
|
+
role: "tooltip",
|
|
1155
|
+
style: {
|
|
1156
|
+
position: "absolute",
|
|
1157
|
+
left: "50%",
|
|
1158
|
+
transform: "translateX(-50%)",
|
|
1159
|
+
...floatingPosition,
|
|
1160
|
+
border: "1px solid hsl(var(--border-color, 210 20% 85%))",
|
|
1161
|
+
background: "hsl(var(--card, 0 0% 100%))",
|
|
1162
|
+
color: "hsl(var(--foreground, 220 30% 15%))",
|
|
1163
|
+
borderRadius: 8,
|
|
1164
|
+
padding: "0.35rem 0.5rem",
|
|
1165
|
+
fontSize: "0.78rem",
|
|
1166
|
+
whiteSpace: "nowrap",
|
|
1167
|
+
zIndex: 20
|
|
1168
|
+
},
|
|
1169
|
+
children: tooltipContent
|
|
1170
|
+
}
|
|
1171
|
+
) : null
|
|
1172
|
+
]
|
|
1173
|
+
}
|
|
1174
|
+
);
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
// src/registry/index.ts
|
|
1178
|
+
function createMdxComponents(customComponents = {}) {
|
|
1179
|
+
return {
|
|
1180
|
+
Tabs: TabsMdx,
|
|
1181
|
+
Tab: TabMdx,
|
|
1182
|
+
table: TableMdx,
|
|
1183
|
+
thead: TableHeaderMdx,
|
|
1184
|
+
tbody: TableBodyMdx,
|
|
1185
|
+
tfoot: TableFooterMdx,
|
|
1186
|
+
tr: TableRowMdx,
|
|
1187
|
+
th: TableHeadMdx,
|
|
1188
|
+
td: TableCellMdx,
|
|
1189
|
+
pre: CodeBlock,
|
|
1190
|
+
a: LinkMdx,
|
|
1191
|
+
Link: LinkMdx,
|
|
1192
|
+
Card: CardMdx,
|
|
1193
|
+
Button: ButtonMdx,
|
|
1194
|
+
Note: NoteMdx,
|
|
1195
|
+
Steps: StepsMdx,
|
|
1196
|
+
Step: StepMdx,
|
|
1197
|
+
Accordion: AccordionMdx,
|
|
1198
|
+
Accordions: AccordionsMdx,
|
|
1199
|
+
Cards: CardsMdx,
|
|
1200
|
+
Kbd: KbdMdx,
|
|
1201
|
+
Release: ReleaseMdx,
|
|
1202
|
+
Changes: ChangesMdx,
|
|
1203
|
+
File: FileMdx,
|
|
1204
|
+
Files: FilesMdx,
|
|
1205
|
+
Folder: FolderMdx,
|
|
1206
|
+
Image: ImageMdx,
|
|
1207
|
+
img: ImageMdx,
|
|
1208
|
+
Youtube: YoutubeMdx,
|
|
1209
|
+
Tooltip: TooltipMdx,
|
|
1210
|
+
Mermaid: MermaidMdx,
|
|
1211
|
+
...customComponents
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
export {
|
|
1215
|
+
AccordionMdx,
|
|
1216
|
+
AccordionsMdx,
|
|
1217
|
+
ButtonMdx,
|
|
1218
|
+
CardMdx,
|
|
1219
|
+
CardsMdx,
|
|
1220
|
+
ChangesMdx,
|
|
1221
|
+
CodeBlock,
|
|
1222
|
+
FileMdx,
|
|
1223
|
+
FilesMdx,
|
|
1224
|
+
FolderMdx,
|
|
1225
|
+
ImageMdx,
|
|
1226
|
+
KbdMdx,
|
|
1227
|
+
LinkMdx,
|
|
1228
|
+
MermaidMdx,
|
|
1229
|
+
NoteMdx,
|
|
1230
|
+
ReleaseMdx,
|
|
1231
|
+
StepMdx,
|
|
1232
|
+
StepsMdx,
|
|
1233
|
+
TabMdx,
|
|
1234
|
+
TableBodyMdx,
|
|
1235
|
+
TableCellMdx,
|
|
1236
|
+
TableFooterMdx,
|
|
1237
|
+
TableHeadMdx,
|
|
1238
|
+
TableHeaderMdx,
|
|
1239
|
+
TableMdx,
|
|
1240
|
+
TableRowMdx,
|
|
1241
|
+
TabsMdx,
|
|
1242
|
+
TooltipMdx,
|
|
1243
|
+
YoutubeMdx,
|
|
1244
|
+
createMdxComponents
|
|
1245
|
+
};
|
|
20
1246
|
//# sourceMappingURL=index.js.map
|