@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/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("dbk-card__icon", "w-5 h-5 text-primary shrink-0", horizontal && "mt-0.5"), "data-docubook": "card-icon" }),
83
- /* @__PURE__ */ jsxs2("div", { className: "dbk-card__body flex-1 min-w-0", "data-docubook": "card-body", children: [
84
- /* @__PURE__ */ jsx2("div", { className: "dbk-card__title text-base font-semibold text-foreground leading-6", "data-docubook": "card-title", children: title }),
85
- /* @__PURE__ */ jsx2("div", { className: "dbk-card__content text-sm text-muted-foreground -mt-3", "data-docubook": "card-content", children })
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: "dbk-card__link no-underline block", "data-docubook": "card-link", children: content });
90
+ return /* @__PURE__ */ jsx2(LinkComponent, { href, className: "no-underline block", children: content });
93
91
  }
94
- return /* @__PURE__ */ jsx2("a", { className: "dbk-card__link no-underline block", href, "data-docubook": "card-link", children: content });
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: "dbk-kbd 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",
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
- const noteRole = type === "danger" ? "alert" : "status";
263
- return /* @__PURE__ */ jsxs3(
264
- "div",
265
- {
266
- className: cn("dbk-note", noteVariants({ variant: type }), className),
267
- "data-docubook": "note",
268
- "data-variant": type,
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: "dbk-release mb-16 group", "data-docubook": "release", children: [
294
- /* @__PURE__ */ jsxs4("div", { className: "dbk-release__header flex items-center gap-3 mt-6 mb-2", "data-docubook": "release-header", children: [
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: "dbk-release__version 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",
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: "dbk-release__date-wrapper flex items-center gap-3 text-sm font-medium text-muted-foreground", "data-docubook": "release-date-wrapper", children: [
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", { className: "dbk-release__date", "data-docubook": "release-date", dateTime: date, children: new Date(date).toLocaleDateString("en-US", {
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: "dbk-release__title text-2xl font-bold text-foreground/90 mb-6 mt-0!", "data-docubook": "release-title", children: title }),
317
- /* @__PURE__ */ jsx7("div", { className: "dbk-release__content space-y-8", "data-docubook": "release-content", children })
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: "dbk-release-changes space-y-3 mb-8", "data-docubook": "release-changes", "data-type": type, children: [
350
- /* @__PURE__ */ jsx7("div", { className: "dbk-release-changes__header flex items-center gap-2", "data-docubook": "release-changes-header", children: /* @__PURE__ */ jsxs4(
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: "dbk-release-changes__icon h-3.5 w-3.5", "data-docubook": "release-changes-icon" }),
361
- /* @__PURE__ */ jsx7("span", { className: "dbk-release-changes__label", "data-docubook": "release-changes-label", children: config.label })
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: "dbk-release-changes__list list-none pl-0 space-y-2 text-foreground/80", "data-docubook": "release-changes-list", children: Children.map(children, (child, index) => {
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: "dbk-release-changes__item leading-relaxed", "data-docubook": "release-changes-item", children: processedChild }, index);
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("ol", { className: cn("dbk-stepper", stepperDefaultClasses.root), "data-docubook": "stepper", children: Children2.map(children, (child, index) => {
363
+ return /* @__PURE__ */ jsx8("div", { className: "flex flex-col", children: Children2.map(children, (child, index) => {
392
364
  return /* @__PURE__ */ jsxs5(
393
- "li",
365
+ "div",
394
366
  {
395
367
  className: cn(
396
- "dbk-stepper__item",
397
- stepperDefaultClasses.item,
368
+ "border-l border-muted pl-9 ml-3 relative",
398
369
  clsx4({
399
- [stepperDefaultClasses.itemWithConnector]: index < length - 1
370
+ "pb-5 ": index < length - 1
400
371
  })
401
372
  ),
402
- "data-docubook": "stepper-item",
403
373
  children: [
404
- /* @__PURE__ */ jsx8("div", { className: cn("dbk-stepper__number", stepperDefaultClasses.number), "data-docubook": "stepper-number", "aria-hidden": "true", children: index + 1 }),
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: cn("dbk-stepper-item", stepperItemDefaultClasses.root), "data-docubook": "stepper-item-content", children: [
416
- /* @__PURE__ */ jsx8("h4", { className: cn("dbk-stepper-item__title", stepperItemDefaultClasses.title), "data-docubook": "stepper-item-title", children: title }),
417
- /* @__PURE__ */ jsx8("div", { className: cn("dbk-stepper-item__content", stepperItemDefaultClasses.content), "data-docubook": "stepper-item-body", children })
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docubook/mdx",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Framework-agnostic MDX components for React with adapters.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",