@docubook/mdx 1.1.0 → 1.2.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/README.md +0 -95
- package/dist/adapters/next/index.cjs +6 -8
- package/dist/adapters/next/index.js +6 -8
- package/dist/adapters/react-router/index.cjs +6 -8
- package/dist/adapters/react-router/index.js +6 -8
- package/dist/core/index.cjs +101 -209
- package/dist/core/index.js +111 -219
- package/dist/core/server.cjs +35 -65
- package/dist/core/server.js +35 -65
- package/dist/index.cjs +35 -65
- package/dist/index.js +35 -65
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -30,20 +30,6 @@ function AccordionGroupProvider({ children }) {
|
|
|
30
30
|
|
|
31
31
|
// src/core/components/Accordion.tsx
|
|
32
32
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
33
|
-
var accordionDefaultClasses = {
|
|
34
|
-
rootStandalone: "rounded-lg border shadow-sm",
|
|
35
|
-
rootInGroup: "border-border border-b last:border-b-0",
|
|
36
|
-
button: "bg-muted/40 dark:bg-muted/20 hover:bg-muted/70 dark:hover:bg-muted/70 flex w-full cursor-pointer items-center gap-2 px-4 py-3 text-start transition-colors",
|
|
37
|
-
chevron: "text-muted-foreground h-4 w-4 shrink-0 transition-transform duration-200",
|
|
38
|
-
chevronOpen: "rotate-90",
|
|
39
|
-
icon: "text-foreground h-4 w-4 shrink-0",
|
|
40
|
-
title: "text-foreground m-0! text-base font-medium",
|
|
41
|
-
contentGrid: "grid transition-[grid-template-rows] duration-200 ease-out",
|
|
42
|
-
contentGridOpen: "grid-rows-[1fr]",
|
|
43
|
-
contentGridClosed: "grid-rows-[0fr]",
|
|
44
|
-
contentOverflow: "overflow-hidden",
|
|
45
|
-
contentBody: "dark:bg-muted/10 bg-muted/15 px-4 py-3"
|
|
46
|
-
};
|
|
47
33
|
function Accordion({ title, children, icon }) {
|
|
48
34
|
const baseId = useId2();
|
|
49
35
|
const triggerId = `${baseId}-trigger`;
|
|
@@ -65,11 +51,9 @@ function Accordion({ title, children, icon }) {
|
|
|
65
51
|
return /* @__PURE__ */ jsxs(
|
|
66
52
|
"div",
|
|
67
53
|
{
|
|
68
|
-
"data-docubook": "accordion",
|
|
69
54
|
className: cn(
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
isInGroup && accordionDefaultClasses.rootInGroup
|
|
55
|
+
!isInGroup && "rounded-lg border shadow-sm",
|
|
56
|
+
isInGroup && "border-border border-b last:border-b-0"
|
|
73
57
|
),
|
|
74
58
|
children: [
|
|
75
59
|
/* @__PURE__ */ jsxs(
|
|
@@ -77,25 +61,22 @@ function Accordion({ title, children, icon }) {
|
|
|
77
61
|
{
|
|
78
62
|
type: "button",
|
|
79
63
|
onClick: handleToggle,
|
|
80
|
-
className:
|
|
64
|
+
className: "bg-muted/40 dark:bg-muted/20 hover:bg-muted/70 dark:hover:bg-muted/70 flex w-full cursor-pointer items-center gap-2 px-4 py-3 text-start transition-colors",
|
|
81
65
|
"aria-expanded": isOpen,
|
|
82
66
|
"aria-controls": contentId,
|
|
83
67
|
id: triggerId,
|
|
84
|
-
"data-docubook": "accordion-button",
|
|
85
68
|
children: [
|
|
86
69
|
/* @__PURE__ */ jsx2(
|
|
87
70
|
ChevronRight,
|
|
88
71
|
{
|
|
89
72
|
className: cn(
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
),
|
|
94
|
-
"data-docubook": "accordion-chevron"
|
|
73
|
+
"text-muted-foreground h-4 w-4 shrink-0 transition-transform duration-200",
|
|
74
|
+
isOpen && "rotate-90"
|
|
75
|
+
)
|
|
95
76
|
}
|
|
96
77
|
),
|
|
97
|
-
Icon && /* @__PURE__ */ jsx2(Icon, { className:
|
|
98
|
-
/* @__PURE__ */ jsx2("h3", { className:
|
|
78
|
+
Icon && /* @__PURE__ */ jsx2(Icon, { className: "text-foreground h-4 w-4 shrink-0" }),
|
|
79
|
+
/* @__PURE__ */ jsx2("h3", { className: "text-foreground m-0! text-base font-medium", children: title })
|
|
99
80
|
]
|
|
100
81
|
}
|
|
101
82
|
),
|
|
@@ -103,15 +84,13 @@ function Accordion({ title, children, icon }) {
|
|
|
103
84
|
"div",
|
|
104
85
|
{
|
|
105
86
|
className: cn(
|
|
106
|
-
"
|
|
107
|
-
|
|
108
|
-
isOpen ? accordionDefaultClasses.contentGridOpen : accordionDefaultClasses.contentGridClosed
|
|
87
|
+
"grid transition-[grid-template-rows] duration-200 ease-out",
|
|
88
|
+
isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
109
89
|
),
|
|
110
|
-
"data-docubook": "accordion-content-grid",
|
|
111
90
|
id: contentId,
|
|
112
91
|
role: "region",
|
|
113
92
|
"aria-labelledby": triggerId,
|
|
114
|
-
children: /* @__PURE__ */ jsx2("div", { className:
|
|
93
|
+
children: /* @__PURE__ */ jsx2("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx2("div", { className: "dark:bg-muted/10 bg-muted/15 px-4 py-3", children }) })
|
|
115
94
|
}
|
|
116
95
|
)
|
|
117
96
|
]
|
|
@@ -122,18 +101,8 @@ function Accordion({ title, children, icon }) {
|
|
|
122
101
|
// src/core/components/AccordionGroup.tsx
|
|
123
102
|
import clsx2 from "clsx";
|
|
124
103
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
125
|
-
var accordionGroupDefaultClasses = {
|
|
126
|
-
root: "overflow-hidden rounded-lg border"
|
|
127
|
-
};
|
|
128
104
|
function AccordionGroup({ children, className }) {
|
|
129
|
-
return /* @__PURE__ */ jsx3(AccordionGroupProvider, { children: /* @__PURE__ */ jsx3(
|
|
130
|
-
"div",
|
|
131
|
-
{
|
|
132
|
-
className: clsx2("dbk-accordion-group", accordionGroupDefaultClasses.root, className),
|
|
133
|
-
"data-docubook": "accordion-group",
|
|
134
|
-
children
|
|
135
|
-
}
|
|
136
|
-
) });
|
|
105
|
+
return /* @__PURE__ */ jsx3(AccordionGroupProvider, { children: /* @__PURE__ */ jsx3("div", { className: clsx2("overflow-hidden rounded-lg border", className), children }) });
|
|
137
106
|
}
|
|
138
107
|
|
|
139
108
|
// src/core/components/Button.tsx
|
|
@@ -207,7 +176,6 @@ function Card({
|
|
|
207
176
|
"div",
|
|
208
177
|
{
|
|
209
178
|
className: clsx3(
|
|
210
|
-
"dbk-card",
|
|
211
179
|
"border rounded-lg shadow-sm p-4 transition-all duration-200",
|
|
212
180
|
"bg-card text-card-foreground border-border",
|
|
213
181
|
"hover:bg-accent/5 hover:border-accent/30",
|
|
@@ -215,21 +183,20 @@ function Card({
|
|
|
215
183
|
horizontal ? "flex-row items-start gap-1" : "flex-col space-y-1",
|
|
216
184
|
className
|
|
217
185
|
),
|
|
218
|
-
"data-docubook": "card",
|
|
219
186
|
children: [
|
|
220
|
-
Icon && /* @__PURE__ */ jsx5(Icon, { className: clsx3("
|
|
221
|
-
/* @__PURE__ */ jsxs3("div", { className: "
|
|
222
|
-
/* @__PURE__ */ jsx5("div", { className: "
|
|
223
|
-
/* @__PURE__ */ jsx5("div", { className: "
|
|
187
|
+
Icon && /* @__PURE__ */ jsx5(Icon, { className: clsx3("w-5 h-5 text-primary shrink-0", horizontal && "mt-0.5") }),
|
|
188
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex-1 min-w-0", children: [
|
|
189
|
+
/* @__PURE__ */ jsx5("div", { className: "text-base font-semibold text-foreground leading-6", children: title }),
|
|
190
|
+
/* @__PURE__ */ jsx5("div", { className: "text-sm text-muted-foreground -mt-3", children })
|
|
224
191
|
] })
|
|
225
192
|
]
|
|
226
193
|
}
|
|
227
194
|
);
|
|
228
195
|
if (!href) return content;
|
|
229
196
|
if (LinkComponent) {
|
|
230
|
-
return /* @__PURE__ */ jsx5(LinkComponent, { href, className: "
|
|
197
|
+
return /* @__PURE__ */ jsx5(LinkComponent, { href, className: "no-underline block", children: content });
|
|
231
198
|
}
|
|
232
|
-
return /* @__PURE__ */ jsx5("a", { className: "
|
|
199
|
+
return /* @__PURE__ */ jsx5("a", { className: "no-underline block", href, children: content });
|
|
233
200
|
}
|
|
234
201
|
|
|
235
202
|
// src/core/components/CardGroup.tsx
|
|
@@ -261,40 +228,6 @@ import {
|
|
|
261
228
|
FolderOpen
|
|
262
229
|
} from "lucide-react";
|
|
263
230
|
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
264
|
-
var fileDefaultClasses = {
|
|
265
|
-
root: "flex items-center gap-2 py-1.5 pl-7 pr-3 text-sm rounded-md transition-colors duration-150 cursor-default select-none hover:bg-muted/50",
|
|
266
|
-
rootHover: "bg-accent/10",
|
|
267
|
-
icon: "h-3.5 w-3.5 shrink-0 transition-colors text-muted-foreground",
|
|
268
|
-
iconHover: "text-accent",
|
|
269
|
-
text: "font-mono text-sm text-foreground truncate",
|
|
270
|
-
extension: "ml-auto text-xs text-muted-foreground/80"
|
|
271
|
-
};
|
|
272
|
-
var folderDefaultClasses = {
|
|
273
|
-
root: "relative",
|
|
274
|
-
header: "flex items-center gap-2 py-1.5 pl-4 pr-3 rounded-md transition-colors duration-150 select-none",
|
|
275
|
-
headerHover: "bg-muted/60",
|
|
276
|
-
headerOpen: "text-foreground",
|
|
277
|
-
headerClosed: "text-foreground/80",
|
|
278
|
-
headerPointer: "cursor-pointer",
|
|
279
|
-
headerDefault: "cursor-default",
|
|
280
|
-
chevron: "h-3.5 w-3.5 shrink-0 transition-transform duration-200",
|
|
281
|
-
chevronOpen: "rotate-90",
|
|
282
|
-
chevronHover: "text-foreground/70",
|
|
283
|
-
chevronDefault: "text-muted-foreground",
|
|
284
|
-
spacer: "w-3.5",
|
|
285
|
-
icon: "h-4 w-4 shrink-0 transition-colors",
|
|
286
|
-
iconOpenHover: "text-accent",
|
|
287
|
-
iconOpenDefault: "text-muted-foreground",
|
|
288
|
-
iconClosedHover: "text-accent/80",
|
|
289
|
-
iconClosedDefault: "text-muted-foreground/80",
|
|
290
|
-
text: "font-medium transition-colors duration-150",
|
|
291
|
-
textHover: "text-accent",
|
|
292
|
-
children: "ml-5 border-l-2 border-muted/50 pl-2"
|
|
293
|
-
};
|
|
294
|
-
var filesDefaultClasses = {
|
|
295
|
-
root: "rounded-xl border border-muted/20 bg-card/20 backdrop-blur-sm shadow-sm overflow-hidden transition-all duration-200 hover:shadow-md hover:border-muted/60",
|
|
296
|
-
content: "p-2"
|
|
297
|
-
};
|
|
298
231
|
function FileComponent({
|
|
299
232
|
name
|
|
300
233
|
}) {
|
|
@@ -304,18 +237,24 @@ function FileComponent({
|
|
|
304
237
|
"div",
|
|
305
238
|
{
|
|
306
239
|
className: cn(
|
|
307
|
-
"
|
|
308
|
-
|
|
309
|
-
isHovered && fileDefaultClasses.rootHover
|
|
240
|
+
"flex items-center gap-2 py-1.5 pl-7 pr-3 text-sm rounded-md transition-colors duration-150 cursor-default select-none",
|
|
241
|
+
isHovered ? "bg-accent/10" : "hover:bg-muted/50"
|
|
310
242
|
),
|
|
311
|
-
"data-docubook": "file-tree-file",
|
|
312
243
|
onMouseEnter: () => setIsHovered(true),
|
|
313
244
|
onMouseLeave: () => setIsHovered(false),
|
|
314
245
|
tabIndex: -1,
|
|
315
246
|
children: [
|
|
316
|
-
/* @__PURE__ */ jsx7(
|
|
317
|
-
|
|
318
|
-
|
|
247
|
+
/* @__PURE__ */ jsx7(
|
|
248
|
+
FileIcon,
|
|
249
|
+
{
|
|
250
|
+
className: cn(
|
|
251
|
+
"h-3.5 w-3.5 shrink-0 transition-colors",
|
|
252
|
+
isHovered ? "text-accent" : "text-muted-foreground"
|
|
253
|
+
)
|
|
254
|
+
}
|
|
255
|
+
),
|
|
256
|
+
/* @__PURE__ */ jsx7("span", { className: "font-mono text-sm text-foreground truncate", children: name }),
|
|
257
|
+
isHovered && fileExtension && /* @__PURE__ */ jsx7("span", { className: "ml-auto text-xs text-muted-foreground/80", children: fileExtension })
|
|
319
258
|
]
|
|
320
259
|
}
|
|
321
260
|
);
|
|
@@ -327,73 +266,73 @@ function FolderComponent({
|
|
|
327
266
|
const [isOpen, setIsOpen] = useState3(true);
|
|
328
267
|
const [isHovered, setIsHovered] = useState3(false);
|
|
329
268
|
const hasChildren = Children.count(children) > 0;
|
|
330
|
-
return /* @__PURE__ */ jsxs4("div", { className:
|
|
269
|
+
return /* @__PURE__ */ jsxs4("div", { className: "relative", children: [
|
|
331
270
|
/* @__PURE__ */ jsxs4(
|
|
332
|
-
"
|
|
271
|
+
"div",
|
|
333
272
|
{
|
|
334
|
-
type: "button",
|
|
335
273
|
className: cn(
|
|
336
|
-
"
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
hasChildren ? folderDefaultClasses.headerPointer : folderDefaultClasses.headerDefault
|
|
274
|
+
"flex items-center gap-2 py-1.5 pl-4 pr-3 rounded-md transition-colors duration-150 select-none",
|
|
275
|
+
isHovered ? "bg-muted/60" : "",
|
|
276
|
+
isOpen ? "text-foreground" : "text-foreground/80",
|
|
277
|
+
hasChildren ? "cursor-pointer" : "cursor-default"
|
|
341
278
|
),
|
|
342
279
|
onClick: () => hasChildren && setIsOpen(!isOpen),
|
|
343
280
|
onMouseEnter: () => setIsHovered(true),
|
|
344
281
|
onMouseLeave: () => setIsHovered(false),
|
|
282
|
+
tabIndex: -1,
|
|
283
|
+
onKeyDown: (event) => event.preventDefault(),
|
|
345
284
|
"aria-expanded": hasChildren ? isOpen : void 0,
|
|
346
|
-
"data-docubook": "file-tree-folder-button",
|
|
347
285
|
children: [
|
|
348
286
|
hasChildren ? /* @__PURE__ */ jsx7(
|
|
349
287
|
ChevronRight2,
|
|
350
288
|
{
|
|
351
289
|
className: cn(
|
|
352
|
-
"
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
),
|
|
357
|
-
"data-docubook": "file-tree-folder-chevron"
|
|
290
|
+
"h-3.5 w-3.5 shrink-0 transition-transform duration-200",
|
|
291
|
+
isOpen ? "rotate-90" : "",
|
|
292
|
+
isHovered ? "text-foreground/70" : "text-muted-foreground"
|
|
293
|
+
)
|
|
358
294
|
}
|
|
359
|
-
) : /* @__PURE__ */ jsx7("div", { className:
|
|
295
|
+
) : /* @__PURE__ */ jsx7("div", { className: "w-3.5" }),
|
|
360
296
|
isOpen ? /* @__PURE__ */ jsx7(
|
|
361
297
|
FolderOpen,
|
|
362
298
|
{
|
|
363
299
|
className: cn(
|
|
364
|
-
"
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
),
|
|
368
|
-
"data-docubook": "file-tree-folder-icon"
|
|
300
|
+
"h-4 w-4 shrink-0 transition-colors",
|
|
301
|
+
isHovered ? "text-accent" : "text-muted-foreground"
|
|
302
|
+
)
|
|
369
303
|
}
|
|
370
304
|
) : /* @__PURE__ */ jsx7(
|
|
371
305
|
FolderIcon,
|
|
372
306
|
{
|
|
373
307
|
className: cn(
|
|
374
|
-
"
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
),
|
|
378
|
-
"data-docubook": "file-tree-folder-icon"
|
|
308
|
+
"h-4 w-4 shrink-0 transition-colors",
|
|
309
|
+
isHovered ? "text-accent/80" : "text-muted-foreground/80"
|
|
310
|
+
)
|
|
379
311
|
}
|
|
380
312
|
),
|
|
381
|
-
/* @__PURE__ */ jsx7("span", { className: cn("
|
|
313
|
+
/* @__PURE__ */ jsx7("span", { className: cn("font-medium transition-colors duration-150", isHovered ? "text-accent" : ""), children: name })
|
|
382
314
|
]
|
|
383
315
|
}
|
|
384
316
|
),
|
|
385
|
-
isOpen && hasChildren && /* @__PURE__ */ jsx7("div", { className:
|
|
317
|
+
isOpen && hasChildren && /* @__PURE__ */ jsx7("div", { className: "ml-5 border-l-2 border-muted/50 pl-2", children })
|
|
386
318
|
] });
|
|
387
319
|
}
|
|
388
320
|
function Files({
|
|
389
321
|
children
|
|
390
322
|
}) {
|
|
391
|
-
return /* @__PURE__ */ jsx7(
|
|
392
|
-
|
|
393
|
-
|
|
323
|
+
return /* @__PURE__ */ jsx7(
|
|
324
|
+
"div",
|
|
325
|
+
{
|
|
326
|
+
className: "rounded-xl border border-muted/20 bg-card/20 backdrop-blur-sm shadow-sm overflow-hidden transition-all duration-200 hover:shadow-md hover:border-muted/60",
|
|
327
|
+
onKeyDown: (event) => event.preventDefault(),
|
|
328
|
+
children: /* @__PURE__ */ jsx7("div", { className: "p-2", children: Children.map(children, (child, index) => {
|
|
329
|
+
if (isValidElement(child)) {
|
|
330
|
+
return cloneElement(child, { key: index });
|
|
331
|
+
}
|
|
332
|
+
return null;
|
|
333
|
+
}) })
|
|
394
334
|
}
|
|
395
|
-
|
|
396
|
-
}) }) });
|
|
335
|
+
);
|
|
397
336
|
}
|
|
398
337
|
function Folder({
|
|
399
338
|
name,
|
|
@@ -581,8 +520,7 @@ function Kbd({
|
|
|
581
520
|
return /* @__PURE__ */ jsx9(
|
|
582
521
|
"kbd",
|
|
583
522
|
{
|
|
584
|
-
className: "
|
|
585
|
-
"data-docubook": "kbd",
|
|
523
|
+
className: "inline-flex items-center justify-center px-2 py-1 mx-0.5 text-xs font-mono font-medium text-foreground bg-secondary/70 border rounded-md",
|
|
586
524
|
...props,
|
|
587
525
|
children: renderContent()
|
|
588
526
|
}
|
|
@@ -655,30 +593,19 @@ function Note({
|
|
|
655
593
|
...props
|
|
656
594
|
}) {
|
|
657
595
|
const Icon = iconMap[type] || Info;
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
"div",
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
role: noteRole,
|
|
666
|
-
...props,
|
|
667
|
-
children: [
|
|
668
|
-
/* @__PURE__ */ jsx11(Icon, { className: cn("dbk-note__icon", noteDefaultClasses.icon), "data-docubook": "note-icon" }),
|
|
669
|
-
/* @__PURE__ */ jsxs6("div", { className: cn("dbk-note__content-wrapper", noteDefaultClasses.contentWrapper), "data-docubook": "note-content-wrapper", children: [
|
|
670
|
-
/* @__PURE__ */ jsx11("h5", { className: cn("dbk-note__title", noteDefaultClasses.title), "data-docubook": "note-title", children: title }),
|
|
671
|
-
/* @__PURE__ */ jsx11("div", { className: cn("dbk-note__content", noteDefaultClasses.content), "data-docubook": "note-content", children })
|
|
672
|
-
] })
|
|
673
|
-
]
|
|
674
|
-
}
|
|
675
|
-
);
|
|
596
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn(noteVariants({ variant: type }), className), ...props, children: [
|
|
597
|
+
/* @__PURE__ */ jsx11(Icon, { className: noteDefaultClasses.icon }),
|
|
598
|
+
/* @__PURE__ */ jsxs6("div", { className: noteDefaultClasses.contentWrapper, children: [
|
|
599
|
+
/* @__PURE__ */ jsx11("h5", { className: noteDefaultClasses.title, children: title }),
|
|
600
|
+
/* @__PURE__ */ jsx11("div", { className: noteDefaultClasses.content, children })
|
|
601
|
+
] })
|
|
602
|
+
] });
|
|
676
603
|
}
|
|
677
604
|
|
|
678
605
|
// src/core/components/Copy.tsx
|
|
679
606
|
import { ClipboardCheckIcon, ClipboardIcon } from "lucide-react";
|
|
680
607
|
import { useState as useState5 } from "react";
|
|
681
|
-
import { jsx as jsx12
|
|
608
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
682
609
|
function Copy({ content }) {
|
|
683
610
|
const [isCopied, setIsCopied] = useState5(false);
|
|
684
611
|
async function handleCopy() {
|
|
@@ -692,18 +619,14 @@ function Copy({ content }) {
|
|
|
692
619
|
setIsCopied(false);
|
|
693
620
|
}
|
|
694
621
|
}
|
|
695
|
-
return /* @__PURE__ */
|
|
622
|
+
return /* @__PURE__ */ jsx12(
|
|
696
623
|
"button",
|
|
697
624
|
{
|
|
698
625
|
type: "button",
|
|
699
|
-
className: "
|
|
626
|
+
className: "border cursor-copy inline-flex h-6 w-6 items-center justify-center rounded-md",
|
|
700
627
|
onClick: handleCopy,
|
|
701
628
|
"aria-label": isCopied ? "Copied" : "Copy code",
|
|
702
|
-
"
|
|
703
|
-
children: [
|
|
704
|
-
isCopied ? /* @__PURE__ */ jsx12(ClipboardCheckIcon, { className: "dbk-copy__icon w-3 h-3", "data-docubook": "copy-icon" }) : /* @__PURE__ */ jsx12(ClipboardIcon, { className: "dbk-copy__icon w-3 h-3", "data-docubook": "copy-icon" }),
|
|
705
|
-
/* @__PURE__ */ jsx12("span", { className: "sr-only", "aria-live": "polite", children: isCopied ? "Copied" : "Copy" })
|
|
706
|
-
]
|
|
629
|
+
children: isCopied ? /* @__PURE__ */ jsx12(ClipboardCheckIcon, { className: "w-3 h-3" }) : /* @__PURE__ */ jsx12(ClipboardIcon, { className: "w-3 h-3" })
|
|
707
630
|
}
|
|
708
631
|
);
|
|
709
632
|
}
|
|
@@ -734,7 +657,7 @@ import {
|
|
|
734
657
|
} from "react-icons/si";
|
|
735
658
|
import { FaJava, FaCode } from "react-icons/fa";
|
|
736
659
|
import { TbJson } from "react-icons/tb";
|
|
737
|
-
import { jsx as jsx13, jsxs as
|
|
660
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
738
661
|
function LanguageIcon({ lang }) {
|
|
739
662
|
const iconProps = { size: 16, className: "w-4 h-4" };
|
|
740
663
|
const languageToIconMap = {
|
|
@@ -785,9 +708,9 @@ function Pre({ children, raw, ...rest }) {
|
|
|
785
708
|
const { "data-title": title, className, ...restProps } = rest;
|
|
786
709
|
const language = getLanguage(className);
|
|
787
710
|
const hasTitle = !!title;
|
|
788
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ jsxs7("div", { className: "code-block-container", children: [
|
|
789
712
|
/* @__PURE__ */ jsx13("div", { className: "code-block-actions", children: raw && /* @__PURE__ */ jsx13(Copy, { content: raw }) }),
|
|
790
|
-
hasTitle && /* @__PURE__ */ jsx13("div", { className: "code-block-header", children: /* @__PURE__ */
|
|
713
|
+
hasTitle && /* @__PURE__ */ jsx13("div", { className: "code-block-header", children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
|
|
791
714
|
/* @__PURE__ */ jsx13(LanguageIcon, { lang: language }),
|
|
792
715
|
/* @__PURE__ */ jsx13("span", { children: title })
|
|
793
716
|
] }) }),
|
|
@@ -804,33 +727,32 @@ import {
|
|
|
804
727
|
XCircle,
|
|
805
728
|
Zap
|
|
806
729
|
} from "lucide-react";
|
|
807
|
-
import { jsx as jsx14, jsxs as
|
|
730
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
808
731
|
function Release({ version, title, date, children }) {
|
|
809
|
-
return /* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
/* @__PURE__ */
|
|
732
|
+
return /* @__PURE__ */ jsxs8("div", { className: "mb-16 group", children: [
|
|
733
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3 mt-6 mb-2", children: [
|
|
734
|
+
/* @__PURE__ */ jsxs8(
|
|
812
735
|
"div",
|
|
813
736
|
{
|
|
814
737
|
id: version,
|
|
815
|
-
className: "
|
|
816
|
-
"data-docubook": "release-version",
|
|
738
|
+
className: "inline-flex items-center rounded-full border border-primary/20 bg-primary/10 px-3 py-1 text-sm font-semibold text-primary transition-colors hover:bg-primary/15 scroll-m-20 backdrop-blur-sm",
|
|
817
739
|
children: [
|
|
818
740
|
"v",
|
|
819
741
|
version
|
|
820
742
|
]
|
|
821
743
|
}
|
|
822
744
|
),
|
|
823
|
-
date && /* @__PURE__ */
|
|
745
|
+
date && /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3 text-sm font-medium text-muted-foreground", children: [
|
|
824
746
|
/* @__PURE__ */ jsx14("span", { className: "h-1 w-1 rounded-full bg-muted-foreground/30" }),
|
|
825
|
-
/* @__PURE__ */ jsx14("time", {
|
|
747
|
+
/* @__PURE__ */ jsx14("time", { dateTime: date, children: new Date(date).toLocaleDateString("en-US", {
|
|
826
748
|
year: "numeric",
|
|
827
749
|
month: "long",
|
|
828
750
|
day: "numeric"
|
|
829
751
|
}) })
|
|
830
752
|
] })
|
|
831
753
|
] }),
|
|
832
|
-
/* @__PURE__ */ jsx14("h3", { className: "
|
|
833
|
-
/* @__PURE__ */ jsx14("div", { className: "
|
|
754
|
+
/* @__PURE__ */ jsx14("h3", { className: "text-2xl font-bold text-foreground/90 mb-6 mt-0!", children: title }),
|
|
755
|
+
/* @__PURE__ */ jsx14("div", { className: "space-y-8", children })
|
|
834
756
|
] });
|
|
835
757
|
}
|
|
836
758
|
var typeConfig = {
|
|
@@ -862,25 +784,23 @@ var typeConfig = {
|
|
|
862
784
|
};
|
|
863
785
|
function Changes({ type, children }) {
|
|
864
786
|
const config = typeConfig[type] || typeConfig.added;
|
|
865
|
-
return /* @__PURE__ */
|
|
866
|
-
/* @__PURE__ */ jsx14("div", { className: "
|
|
787
|
+
return /* @__PURE__ */ jsxs8("div", { className: "space-y-3 mb-8", children: [
|
|
788
|
+
/* @__PURE__ */ jsx14("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs8(
|
|
867
789
|
"div",
|
|
868
790
|
{
|
|
869
791
|
className: cn(
|
|
870
|
-
"dbk-release-changes__badge",
|
|
871
792
|
"px-3 py-1 rounded-full text-sm font-medium flex items-center gap-1.5",
|
|
872
793
|
config.className
|
|
873
794
|
),
|
|
874
|
-
"data-docubook": "release-changes-badge",
|
|
875
795
|
children: [
|
|
876
|
-
/* @__PURE__ */ jsx14(config.icon, { className: "
|
|
877
|
-
/* @__PURE__ */ jsx14("span", {
|
|
796
|
+
/* @__PURE__ */ jsx14(config.icon, { className: "h-3.5 w-3.5" }),
|
|
797
|
+
/* @__PURE__ */ jsx14("span", { children: config.label })
|
|
878
798
|
]
|
|
879
799
|
}
|
|
880
800
|
) }),
|
|
881
|
-
/* @__PURE__ */ jsx14("ul", { className: "
|
|
801
|
+
/* @__PURE__ */ jsx14("ul", { className: "list-none pl-0 space-y-2 text-foreground/80", children: Children2.map(children, (child, index) => {
|
|
882
802
|
const processedChild = typeof child === "string" ? child.trim().replace(/^[-*]\s+/, "") : child;
|
|
883
|
-
return /* @__PURE__ */ jsx14("li", { className: "
|
|
803
|
+
return /* @__PURE__ */ jsx14("li", { className: "leading-relaxed", children: processedChild }, index);
|
|
884
804
|
}) })
|
|
885
805
|
] });
|
|
886
806
|
}
|
|
@@ -888,36 +808,23 @@ function Changes({ type, children }) {
|
|
|
888
808
|
// src/core/components/Stepper.tsx
|
|
889
809
|
import clsx5 from "clsx";
|
|
890
810
|
import { Children as Children3 } from "react";
|
|
891
|
-
import { jsx as jsx15, jsxs as
|
|
892
|
-
var stepperDefaultClasses = {
|
|
893
|
-
root: "flex flex-col",
|
|
894
|
-
item: "border-l border-muted pl-9 ml-3 relative",
|
|
895
|
-
itemWithConnector: "pb-5 ",
|
|
896
|
-
number: "bg-muted text-muted-foreground w-8 h-8 text-xs font-medium rounded-md border border-border/50 flex items-center justify-center absolute -left-4 font-code"
|
|
897
|
-
};
|
|
898
|
-
var stepperItemDefaultClasses = {
|
|
899
|
-
root: "pt-0.5",
|
|
900
|
-
title: "mt-0",
|
|
901
|
-
content: ""
|
|
902
|
-
};
|
|
811
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
903
812
|
function Stepper({
|
|
904
813
|
children
|
|
905
814
|
}) {
|
|
906
815
|
const length = Children3.count(children);
|
|
907
|
-
return /* @__PURE__ */ jsx15("
|
|
908
|
-
return /* @__PURE__ */
|
|
909
|
-
"
|
|
816
|
+
return /* @__PURE__ */ jsx15("div", { className: "flex flex-col", children: Children3.map(children, (child, index) => {
|
|
817
|
+
return /* @__PURE__ */ jsxs9(
|
|
818
|
+
"div",
|
|
910
819
|
{
|
|
911
820
|
className: cn(
|
|
912
|
-
"
|
|
913
|
-
stepperDefaultClasses.item,
|
|
821
|
+
"border-l border-muted pl-9 ml-3 relative",
|
|
914
822
|
clsx5({
|
|
915
|
-
|
|
823
|
+
"pb-5 ": index < length - 1
|
|
916
824
|
})
|
|
917
825
|
),
|
|
918
|
-
"data-docubook": "stepper-item",
|
|
919
826
|
children: [
|
|
920
|
-
/* @__PURE__ */ jsx15("div", { className:
|
|
827
|
+
/* @__PURE__ */ jsx15("div", { className: "bg-muted text-muted-foreground w-8 h-8 text-xs font-medium rounded-md border border-border/50 flex items-center justify-center absolute -left-4 font-code", "aria-hidden": "true", children: index + 1 }),
|
|
921
828
|
child
|
|
922
829
|
]
|
|
923
830
|
}
|
|
@@ -928,49 +835,34 @@ function StepperItem({
|
|
|
928
835
|
children,
|
|
929
836
|
title
|
|
930
837
|
}) {
|
|
931
|
-
return /* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */ jsx15("h4", { className:
|
|
933
|
-
/* @__PURE__ */ jsx15("div", {
|
|
838
|
+
return /* @__PURE__ */ jsxs9("div", { className: "pt-0.5", children: [
|
|
839
|
+
/* @__PURE__ */ jsx15("h4", { className: "mt-0", children: title }),
|
|
840
|
+
/* @__PURE__ */ jsx15("div", { children })
|
|
934
841
|
] });
|
|
935
842
|
}
|
|
936
843
|
|
|
937
844
|
// src/core/components/Tooltip.tsx
|
|
938
845
|
import { useState as useState6 } from "react";
|
|
939
|
-
import { jsx as jsx16, jsxs as
|
|
940
|
-
var tooltipDefaultClasses = {
|
|
941
|
-
root: "relative inline-flex items-center cursor-help text-primary hover:text-primary/80 transition-colors",
|
|
942
|
-
trigger: "border-b border-dashed border-primary/60 pb-0.5",
|
|
943
|
-
content: "absolute bottom-full left-1/2 -translate-x-1/2 mb-3 w-64 bg-popover text-popover-foreground text-sm p-3 rounded-md shadow-lg border border-border/50 wrap-break-word text-left z-50",
|
|
944
|
-
arrow: "absolute -bottom-1.5 left-1/2 -translate-x-1/2 w-3 h-3 bg-popover rotate-45 border-b border-r border-border/50 -z-10"
|
|
945
|
-
};
|
|
846
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
946
847
|
var Tooltip = ({ text, tip }) => {
|
|
947
848
|
const [visible, setVisible] = useState6(false);
|
|
948
|
-
return /* @__PURE__ */
|
|
849
|
+
return /* @__PURE__ */ jsxs10(
|
|
949
850
|
"span",
|
|
950
851
|
{
|
|
951
|
-
className:
|
|
952
|
-
"data-docubook": "tooltip",
|
|
852
|
+
className: "relative inline-flex items-center cursor-help text-primary hover:text-primary/80 transition-colors",
|
|
953
853
|
onMouseEnter: () => setVisible(true),
|
|
954
854
|
onMouseLeave: () => setVisible(false),
|
|
955
855
|
children: [
|
|
956
856
|
/* @__PURE__ */ jsx16(
|
|
957
|
-
"
|
|
857
|
+
"span",
|
|
958
858
|
{
|
|
959
|
-
|
|
960
|
-
className: cn("dbk-tooltip__trigger", tooltipDefaultClasses.trigger),
|
|
961
|
-
"data-docubook": "tooltip-trigger",
|
|
962
|
-
onFocus: () => setVisible(true),
|
|
963
|
-
onBlur: () => setVisible(false),
|
|
964
|
-
onKeyDown: (event) => {
|
|
965
|
-
if (event.key === "Escape") setVisible(false);
|
|
966
|
-
},
|
|
967
|
-
"aria-expanded": visible,
|
|
859
|
+
className: "border-b border-dashed border-primary/60 pb-0.5",
|
|
968
860
|
children: text
|
|
969
861
|
}
|
|
970
862
|
),
|
|
971
|
-
visible && /* @__PURE__ */
|
|
863
|
+
visible && /* @__PURE__ */ jsxs10("span", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-3 w-64 bg-popover text-popover-foreground text-sm p-3 rounded-md shadow-lg border border-border/50 wrap-break-word text-left z-50", role: "tooltip", children: [
|
|
972
864
|
tip,
|
|
973
|
-
/* @__PURE__ */ jsx16("span", { className:
|
|
865
|
+
/* @__PURE__ */ jsx16("span", { className: "absolute -bottom-1.5 left-1/2 -translate-x-1/2 w-3 h-3 bg-popover rotate-45 border-b border-r border-border/50 -z-10" })
|
|
974
866
|
] })
|
|
975
867
|
]
|
|
976
868
|
}
|