@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/index.js
CHANGED
|
@@ -69,7 +69,6 @@ function Card({
|
|
|
69
69
|
"div",
|
|
70
70
|
{
|
|
71
71
|
className: clsx(
|
|
72
|
-
"dbk-card",
|
|
73
72
|
"border rounded-lg shadow-sm p-4 transition-all duration-200",
|
|
74
73
|
"bg-card text-card-foreground border-border",
|
|
75
74
|
"hover:bg-accent/5 hover:border-accent/30",
|
|
@@ -77,21 +76,20 @@ function Card({
|
|
|
77
76
|
horizontal ? "flex-row items-start gap-1" : "flex-col space-y-1",
|
|
78
77
|
className
|
|
79
78
|
),
|
|
80
|
-
"data-docubook": "card",
|
|
81
79
|
children: [
|
|
82
|
-
Icon && /* @__PURE__ */ jsx2(Icon, { className: clsx("
|
|
83
|
-
/* @__PURE__ */ jsxs2("div", { className: "
|
|
84
|
-
/* @__PURE__ */ jsx2("div", { className: "
|
|
85
|
-
/* @__PURE__ */ jsx2("div", { className: "
|
|
80
|
+
Icon && /* @__PURE__ */ jsx2(Icon, { className: clsx("w-5 h-5 text-primary shrink-0", horizontal && "mt-0.5") }),
|
|
81
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex-1 min-w-0", children: [
|
|
82
|
+
/* @__PURE__ */ jsx2("div", { className: "text-base font-semibold text-foreground leading-6", children: title }),
|
|
83
|
+
/* @__PURE__ */ jsx2("div", { className: "text-sm text-muted-foreground -mt-3", children })
|
|
86
84
|
] })
|
|
87
85
|
]
|
|
88
86
|
}
|
|
89
87
|
);
|
|
90
88
|
if (!href) return content;
|
|
91
89
|
if (LinkComponent) {
|
|
92
|
-
return /* @__PURE__ */ jsx2(LinkComponent, { href, className: "
|
|
90
|
+
return /* @__PURE__ */ jsx2(LinkComponent, { href, className: "no-underline block", children: content });
|
|
93
91
|
}
|
|
94
|
-
return /* @__PURE__ */ jsx2("a", { className: "
|
|
92
|
+
return /* @__PURE__ */ jsx2("a", { className: "no-underline block", href, children: content });
|
|
95
93
|
}
|
|
96
94
|
|
|
97
95
|
// src/core/components/CardGroup.tsx
|
|
@@ -176,8 +174,7 @@ function Kbd({
|
|
|
176
174
|
return /* @__PURE__ */ jsx4(
|
|
177
175
|
"kbd",
|
|
178
176
|
{
|
|
179
|
-
className: "
|
|
180
|
-
"data-docubook": "kbd",
|
|
177
|
+
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",
|
|
181
178
|
...props,
|
|
182
179
|
children: renderContent()
|
|
183
180
|
}
|
|
@@ -259,24 +256,13 @@ function Note({
|
|
|
259
256
|
...props
|
|
260
257
|
}) {
|
|
261
258
|
const Icon = iconMap[type] || Info;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
"div",
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
role: noteRole,
|
|
270
|
-
...props,
|
|
271
|
-
children: [
|
|
272
|
-
/* @__PURE__ */ jsx6(Icon, { className: cn("dbk-note__icon", noteDefaultClasses.icon), "data-docubook": "note-icon" }),
|
|
273
|
-
/* @__PURE__ */ jsxs3("div", { className: cn("dbk-note__content-wrapper", noteDefaultClasses.contentWrapper), "data-docubook": "note-content-wrapper", children: [
|
|
274
|
-
/* @__PURE__ */ jsx6("h5", { className: cn("dbk-note__title", noteDefaultClasses.title), "data-docubook": "note-title", children: title }),
|
|
275
|
-
/* @__PURE__ */ jsx6("div", { className: cn("dbk-note__content", noteDefaultClasses.content), "data-docubook": "note-content", children })
|
|
276
|
-
] })
|
|
277
|
-
]
|
|
278
|
-
}
|
|
279
|
-
);
|
|
259
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn(noteVariants({ variant: type }), className), ...props, children: [
|
|
260
|
+
/* @__PURE__ */ jsx6(Icon, { className: noteDefaultClasses.icon }),
|
|
261
|
+
/* @__PURE__ */ jsxs3("div", { className: noteDefaultClasses.contentWrapper, children: [
|
|
262
|
+
/* @__PURE__ */ jsx6("h5", { className: noteDefaultClasses.title, children: title }),
|
|
263
|
+
/* @__PURE__ */ jsx6("div", { className: noteDefaultClasses.content, children })
|
|
264
|
+
] })
|
|
265
|
+
] });
|
|
280
266
|
}
|
|
281
267
|
|
|
282
268
|
// src/core/components/Release.tsx
|
|
@@ -290,31 +276,30 @@ import {
|
|
|
290
276
|
} from "lucide-react";
|
|
291
277
|
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
292
278
|
function Release({ version, title, date, children }) {
|
|
293
|
-
return /* @__PURE__ */ jsxs4("div", { className: "
|
|
294
|
-
/* @__PURE__ */ jsxs4("div", { className: "
|
|
279
|
+
return /* @__PURE__ */ jsxs4("div", { className: "mb-16 group", children: [
|
|
280
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-3 mt-6 mb-2", children: [
|
|
295
281
|
/* @__PURE__ */ jsxs4(
|
|
296
282
|
"div",
|
|
297
283
|
{
|
|
298
284
|
id: version,
|
|
299
|
-
className: "
|
|
300
|
-
"data-docubook": "release-version",
|
|
285
|
+
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",
|
|
301
286
|
children: [
|
|
302
287
|
"v",
|
|
303
288
|
version
|
|
304
289
|
]
|
|
305
290
|
}
|
|
306
291
|
),
|
|
307
|
-
date && /* @__PURE__ */ jsxs4("div", { className: "
|
|
292
|
+
date && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-3 text-sm font-medium text-muted-foreground", children: [
|
|
308
293
|
/* @__PURE__ */ jsx7("span", { className: "h-1 w-1 rounded-full bg-muted-foreground/30" }),
|
|
309
|
-
/* @__PURE__ */ jsx7("time", {
|
|
294
|
+
/* @__PURE__ */ jsx7("time", { dateTime: date, children: new Date(date).toLocaleDateString("en-US", {
|
|
310
295
|
year: "numeric",
|
|
311
296
|
month: "long",
|
|
312
297
|
day: "numeric"
|
|
313
298
|
}) })
|
|
314
299
|
] })
|
|
315
300
|
] }),
|
|
316
|
-
/* @__PURE__ */ jsx7("h3", { className: "
|
|
317
|
-
/* @__PURE__ */ jsx7("div", { className: "
|
|
301
|
+
/* @__PURE__ */ jsx7("h3", { className: "text-2xl font-bold text-foreground/90 mb-6 mt-0!", children: title }),
|
|
302
|
+
/* @__PURE__ */ jsx7("div", { className: "space-y-8", children })
|
|
318
303
|
] });
|
|
319
304
|
}
|
|
320
305
|
var typeConfig = {
|
|
@@ -346,25 +331,23 @@ var typeConfig = {
|
|
|
346
331
|
};
|
|
347
332
|
function Changes({ type, children }) {
|
|
348
333
|
const config = typeConfig[type] || typeConfig.added;
|
|
349
|
-
return /* @__PURE__ */ jsxs4("div", { className: "
|
|
350
|
-
/* @__PURE__ */ jsx7("div", { className: "
|
|
334
|
+
return /* @__PURE__ */ jsxs4("div", { className: "space-y-3 mb-8", children: [
|
|
335
|
+
/* @__PURE__ */ jsx7("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs4(
|
|
351
336
|
"div",
|
|
352
337
|
{
|
|
353
338
|
className: cn(
|
|
354
|
-
"dbk-release-changes__badge",
|
|
355
339
|
"px-3 py-1 rounded-full text-sm font-medium flex items-center gap-1.5",
|
|
356
340
|
config.className
|
|
357
341
|
),
|
|
358
|
-
"data-docubook": "release-changes-badge",
|
|
359
342
|
children: [
|
|
360
|
-
/* @__PURE__ */ jsx7(config.icon, { className: "
|
|
361
|
-
/* @__PURE__ */ jsx7("span", {
|
|
343
|
+
/* @__PURE__ */ jsx7(config.icon, { className: "h-3.5 w-3.5" }),
|
|
344
|
+
/* @__PURE__ */ jsx7("span", { children: config.label })
|
|
362
345
|
]
|
|
363
346
|
}
|
|
364
347
|
) }),
|
|
365
|
-
/* @__PURE__ */ jsx7("ul", { className: "
|
|
348
|
+
/* @__PURE__ */ jsx7("ul", { className: "list-none pl-0 space-y-2 text-foreground/80", children: Children.map(children, (child, index) => {
|
|
366
349
|
const processedChild = typeof child === "string" ? child.trim().replace(/^[-*]\s+/, "") : child;
|
|
367
|
-
return /* @__PURE__ */ jsx7("li", { className: "
|
|
350
|
+
return /* @__PURE__ */ jsx7("li", { className: "leading-relaxed", children: processedChild }, index);
|
|
368
351
|
}) })
|
|
369
352
|
] });
|
|
370
353
|
}
|
|
@@ -373,35 +356,22 @@ function Changes({ type, children }) {
|
|
|
373
356
|
import clsx4 from "clsx";
|
|
374
357
|
import { Children as Children2 } from "react";
|
|
375
358
|
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
376
|
-
var stepperDefaultClasses = {
|
|
377
|
-
root: "flex flex-col",
|
|
378
|
-
item: "border-l border-muted pl-9 ml-3 relative",
|
|
379
|
-
itemWithConnector: "pb-5 ",
|
|
380
|
-
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"
|
|
381
|
-
};
|
|
382
|
-
var stepperItemDefaultClasses = {
|
|
383
|
-
root: "pt-0.5",
|
|
384
|
-
title: "mt-0",
|
|
385
|
-
content: ""
|
|
386
|
-
};
|
|
387
359
|
function Stepper({
|
|
388
360
|
children
|
|
389
361
|
}) {
|
|
390
362
|
const length = Children2.count(children);
|
|
391
|
-
return /* @__PURE__ */ jsx8("
|
|
363
|
+
return /* @__PURE__ */ jsx8("div", { className: "flex flex-col", children: Children2.map(children, (child, index) => {
|
|
392
364
|
return /* @__PURE__ */ jsxs5(
|
|
393
|
-
"
|
|
365
|
+
"div",
|
|
394
366
|
{
|
|
395
367
|
className: cn(
|
|
396
|
-
"
|
|
397
|
-
stepperDefaultClasses.item,
|
|
368
|
+
"border-l border-muted pl-9 ml-3 relative",
|
|
398
369
|
clsx4({
|
|
399
|
-
|
|
370
|
+
"pb-5 ": index < length - 1
|
|
400
371
|
})
|
|
401
372
|
),
|
|
402
|
-
"data-docubook": "stepper-item",
|
|
403
373
|
children: [
|
|
404
|
-
/* @__PURE__ */ jsx8("div", { className:
|
|
374
|
+
/* @__PURE__ */ jsx8("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 }),
|
|
405
375
|
child
|
|
406
376
|
]
|
|
407
377
|
}
|
|
@@ -412,9 +382,9 @@ function StepperItem({
|
|
|
412
382
|
children,
|
|
413
383
|
title
|
|
414
384
|
}) {
|
|
415
|
-
return /* @__PURE__ */ jsxs5("div", { className:
|
|
416
|
-
/* @__PURE__ */ jsx8("h4", { className:
|
|
417
|
-
/* @__PURE__ */ jsx8("div", {
|
|
385
|
+
return /* @__PURE__ */ jsxs5("div", { className: "pt-0.5", children: [
|
|
386
|
+
/* @__PURE__ */ jsx8("h4", { className: "mt-0", children: title }),
|
|
387
|
+
/* @__PURE__ */ jsx8("div", { children })
|
|
418
388
|
] });
|
|
419
389
|
}
|
|
420
390
|
|