@docubook/mdx 1.0.0 → 1.1.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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  // src/core/components/Accordion.tsx
4
- import { useContext, useState as useState2 } from "react";
4
+ import { useContext, useId as useId2, useState as useState2 } from "react";
5
5
  import { ChevronRight } from "lucide-react";
6
6
  import * as Icons from "lucide-react";
7
7
 
@@ -30,7 +30,24 @@ 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
+ };
33
47
  function Accordion({ title, children, icon }) {
48
+ const baseId = useId2();
49
+ const triggerId = `${baseId}-trigger`;
50
+ const contentId = `${baseId}-content`;
34
51
  const groupContext = useContext(AccordionGroupContext);
35
52
  const isInGroup = groupContext?.inGroup === true;
36
53
  const groupOpen = groupContext?.openTitle === title;
@@ -48,9 +65,11 @@ function Accordion({ title, children, icon }) {
48
65
  return /* @__PURE__ */ jsxs(
49
66
  "div",
50
67
  {
68
+ "data-docubook": "accordion",
51
69
  className: cn(
52
- !isInGroup && "rounded-lg border shadow-sm",
53
- isInGroup && "border-border border-b last:border-b-0"
70
+ "dbk-accordion",
71
+ !isInGroup && accordionDefaultClasses.rootStandalone,
72
+ isInGroup && accordionDefaultClasses.rootInGroup
54
73
  ),
55
74
  children: [
56
75
  /* @__PURE__ */ jsxs(
@@ -58,19 +77,25 @@ function Accordion({ title, children, icon }) {
58
77
  {
59
78
  type: "button",
60
79
  onClick: handleToggle,
61
- 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",
80
+ className: cn("dbk-accordion__button", accordionDefaultClasses.button),
81
+ "aria-expanded": isOpen,
82
+ "aria-controls": contentId,
83
+ id: triggerId,
84
+ "data-docubook": "accordion-button",
62
85
  children: [
63
86
  /* @__PURE__ */ jsx2(
64
87
  ChevronRight,
65
88
  {
66
89
  className: cn(
67
- "text-muted-foreground h-4 w-4 shrink-0 transition-transform duration-200",
68
- isOpen && "rotate-90"
69
- )
90
+ "dbk-accordion__chevron",
91
+ accordionDefaultClasses.chevron,
92
+ isOpen && accordionDefaultClasses.chevronOpen
93
+ ),
94
+ "data-docubook": "accordion-chevron"
70
95
  }
71
96
  ),
72
- Icon && /* @__PURE__ */ jsx2(Icon, { className: "text-foreground h-4 w-4 shrink-0" }),
73
- /* @__PURE__ */ jsx2("h3", { className: "text-foreground m-0! text-base font-medium", children: title })
97
+ Icon && /* @__PURE__ */ jsx2(Icon, { className: cn("dbk-accordion__icon", accordionDefaultClasses.icon), "data-docubook": "accordion-icon" }),
98
+ /* @__PURE__ */ jsx2("h3", { className: cn("dbk-accordion__title", accordionDefaultClasses.title), "data-docubook": "accordion-title", children: title })
74
99
  ]
75
100
  }
76
101
  ),
@@ -78,10 +103,15 @@ function Accordion({ title, children, icon }) {
78
103
  "div",
79
104
  {
80
105
  className: cn(
81
- "grid transition-[grid-template-rows] duration-200 ease-out",
82
- isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
106
+ "dbk-accordion__content-grid",
107
+ accordionDefaultClasses.contentGrid,
108
+ isOpen ? accordionDefaultClasses.contentGridOpen : accordionDefaultClasses.contentGridClosed
83
109
  ),
84
- children: /* @__PURE__ */ jsx2("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx2("div", { className: "dark:bg-muted/10 bg-muted/15 px-4 py-3", children }) })
110
+ "data-docubook": "accordion-content-grid",
111
+ id: contentId,
112
+ role: "region",
113
+ "aria-labelledby": triggerId,
114
+ children: /* @__PURE__ */ jsx2("div", { className: cn("dbk-accordion__content-overflow", accordionDefaultClasses.contentOverflow), "data-docubook": "accordion-content-overflow", children: /* @__PURE__ */ jsx2("div", { className: cn("dbk-accordion__content-body", accordionDefaultClasses.contentBody), "data-docubook": "accordion-content-body", children }) })
85
115
  }
86
116
  )
87
117
  ]
@@ -92,8 +122,18 @@ function Accordion({ title, children, icon }) {
92
122
  // src/core/components/AccordionGroup.tsx
93
123
  import clsx2 from "clsx";
94
124
  import { jsx as jsx3 } from "react/jsx-runtime";
125
+ var accordionGroupDefaultClasses = {
126
+ root: "overflow-hidden rounded-lg border"
127
+ };
95
128
  function AccordionGroup({ children, className }) {
96
- return /* @__PURE__ */ jsx3(AccordionGroupProvider, { children: /* @__PURE__ */ jsx3("div", { className: clsx2("overflow-hidden rounded-lg border", className), children }) });
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
+ ) });
97
137
  }
98
138
 
99
139
  // src/core/components/Button.tsx
@@ -167,6 +207,7 @@ function Card({
167
207
  "div",
168
208
  {
169
209
  className: clsx3(
210
+ "dbk-card",
170
211
  "border rounded-lg shadow-sm p-4 transition-all duration-200",
171
212
  "bg-card text-card-foreground border-border",
172
213
  "hover:bg-accent/5 hover:border-accent/30",
@@ -174,20 +215,21 @@ function Card({
174
215
  horizontal ? "flex-row items-start gap-1" : "flex-col space-y-1",
175
216
  className
176
217
  ),
218
+ "data-docubook": "card",
177
219
  children: [
178
- Icon && /* @__PURE__ */ jsx5(Icon, { className: clsx3("w-5 h-5 text-primary shrink-0", horizontal && "mt-0.5") }),
179
- /* @__PURE__ */ jsxs3("div", { className: "flex-1 min-w-0", children: [
180
- /* @__PURE__ */ jsx5("div", { className: "text-base font-semibold text-foreground leading-6", children: title }),
181
- /* @__PURE__ */ jsx5("div", { className: "text-sm text-muted-foreground -mt-3", children })
220
+ Icon && /* @__PURE__ */ jsx5(Icon, { className: clsx3("dbk-card__icon", "w-5 h-5 text-primary shrink-0", horizontal && "mt-0.5"), "data-docubook": "card-icon" }),
221
+ /* @__PURE__ */ jsxs3("div", { className: "dbk-card__body flex-1 min-w-0", "data-docubook": "card-body", children: [
222
+ /* @__PURE__ */ jsx5("div", { className: "dbk-card__title text-base font-semibold text-foreground leading-6", "data-docubook": "card-title", children: title }),
223
+ /* @__PURE__ */ jsx5("div", { className: "dbk-card__content text-sm text-muted-foreground -mt-3", "data-docubook": "card-content", children })
182
224
  ] })
183
225
  ]
184
226
  }
185
227
  );
186
228
  if (!href) return content;
187
229
  if (LinkComponent) {
188
- return /* @__PURE__ */ jsx5(LinkComponent, { href, className: "no-underline block", children: content });
230
+ return /* @__PURE__ */ jsx5(LinkComponent, { href, className: "dbk-card__link no-underline block", "data-docubook": "card-link", children: content });
189
231
  }
190
- return /* @__PURE__ */ jsx5("a", { className: "no-underline block", href, children: content });
232
+ return /* @__PURE__ */ jsx5("a", { className: "dbk-card__link no-underline block", href, "data-docubook": "card-link", children: content });
191
233
  }
192
234
 
193
235
  // src/core/components/CardGroup.tsx
@@ -219,105 +261,144 @@ import {
219
261
  FolderOpen
220
262
  } from "lucide-react";
221
263
  import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
222
- function FileComponent({ name }) {
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
+ function FileComponent({
299
+ name
300
+ }) {
223
301
  const [isHovered, setIsHovered] = useState3(false);
224
302
  const fileExtension = name.split(".").pop()?.toUpperCase();
225
303
  return /* @__PURE__ */ jsxs4(
226
304
  "div",
227
305
  {
228
- className: `
229
- flex items-center gap-2 py-1.5 pl-7 pr-3 text-sm rounded-md
230
- transition-colors duration-150 cursor-default select-none
231
- ${isHovered ? "bg-accent/10" : "hover:bg-muted/50"}
232
- `,
306
+ className: cn(
307
+ "dbk-file-tree__file",
308
+ fileDefaultClasses.root,
309
+ isHovered && fileDefaultClasses.rootHover
310
+ ),
311
+ "data-docubook": "file-tree-file",
233
312
  onMouseEnter: () => setIsHovered(true),
234
313
  onMouseLeave: () => setIsHovered(false),
235
314
  tabIndex: -1,
236
315
  children: [
237
- /* @__PURE__ */ jsx7(
238
- FileIcon,
239
- {
240
- className: `
241
- h-3.5 w-3.5 shrink-0 transition-colors
242
- ${isHovered ? "text-accent" : "text-muted-foreground"}
243
- `
244
- }
245
- ),
246
- /* @__PURE__ */ jsx7("span", { className: "font-mono text-sm text-foreground truncate", children: name }),
247
- isHovered && fileExtension && /* @__PURE__ */ jsx7("span", { className: "ml-auto text-xs text-muted-foreground/80", children: fileExtension })
316
+ /* @__PURE__ */ jsx7(FileIcon, { className: cn("dbk-file-tree__file-icon", fileDefaultClasses.icon, isHovered && fileDefaultClasses.iconHover), "data-docubook": "file-tree-file-icon" }),
317
+ /* @__PURE__ */ jsx7("span", { className: cn("dbk-file-tree__file-text", fileDefaultClasses.text), "data-docubook": "file-tree-file-text", children: name }),
318
+ isHovered && fileExtension && /* @__PURE__ */ jsx7("span", { className: cn("dbk-file-tree__file-extension", fileDefaultClasses.extension), "data-docubook": "file-tree-file-extension", children: fileExtension })
248
319
  ]
249
320
  }
250
321
  );
251
322
  }
252
- function FolderComponent({ name, children }) {
323
+ function FolderComponent({
324
+ name,
325
+ children
326
+ }) {
253
327
  const [isOpen, setIsOpen] = useState3(true);
254
328
  const [isHovered, setIsHovered] = useState3(false);
255
329
  const hasChildren = Children.count(children) > 0;
256
- return /* @__PURE__ */ jsxs4("div", { className: "relative", children: [
330
+ return /* @__PURE__ */ jsxs4("div", { className: cn("dbk-file-tree__folder", folderDefaultClasses.root), "data-docubook": "file-tree-folder", children: [
257
331
  /* @__PURE__ */ jsxs4(
258
- "div",
332
+ "button",
259
333
  {
260
- className: `
261
- flex items-center gap-2 py-1.5 pl-4 pr-3 rounded-md
262
- transition-colors duration-150 select-none
263
- ${isHovered ? "bg-muted/60" : ""}
264
- ${isOpen ? "text-foreground" : "text-foreground/80"}
265
- ${hasChildren ? "cursor-pointer" : "cursor-default"}
266
- `,
334
+ type: "button",
335
+ className: cn(
336
+ "dbk-file-tree__folder-button",
337
+ folderDefaultClasses.header,
338
+ isHovered && folderDefaultClasses.headerHover,
339
+ isOpen ? folderDefaultClasses.headerOpen : folderDefaultClasses.headerClosed,
340
+ hasChildren ? folderDefaultClasses.headerPointer : folderDefaultClasses.headerDefault
341
+ ),
267
342
  onClick: () => hasChildren && setIsOpen(!isOpen),
268
343
  onMouseEnter: () => setIsHovered(true),
269
344
  onMouseLeave: () => setIsHovered(false),
270
- tabIndex: -1,
345
+ "aria-expanded": hasChildren ? isOpen : void 0,
346
+ "data-docubook": "file-tree-folder-button",
271
347
  children: [
272
348
  hasChildren ? /* @__PURE__ */ jsx7(
273
349
  ChevronRight2,
274
350
  {
275
- className: `
276
- h-3.5 w-3.5 shrink-0 transition-transform duration-200
277
- ${isOpen ? "rotate-90" : ""}
278
- ${isHovered ? "text-foreground/70" : "text-muted-foreground"}
279
- `
351
+ className: cn(
352
+ "dbk-file-tree__folder-chevron",
353
+ folderDefaultClasses.chevron,
354
+ isOpen && folderDefaultClasses.chevronOpen,
355
+ isHovered ? folderDefaultClasses.chevronHover : folderDefaultClasses.chevronDefault
356
+ ),
357
+ "data-docubook": "file-tree-folder-chevron"
280
358
  }
281
- ) : /* @__PURE__ */ jsx7("div", { className: "w-3.5" }),
359
+ ) : /* @__PURE__ */ jsx7("div", { className: cn("dbk-file-tree__folder-spacer", folderDefaultClasses.spacer), "data-docubook": "file-tree-folder-spacer" }),
282
360
  isOpen ? /* @__PURE__ */ jsx7(
283
361
  FolderOpen,
284
362
  {
285
- className: `
286
- h-4 w-4 shrink-0 transition-colors
287
- ${isHovered ? "text-accent" : "text-muted-foreground"}
288
- `
363
+ className: cn(
364
+ "dbk-file-tree__folder-icon",
365
+ folderDefaultClasses.icon,
366
+ isHovered ? folderDefaultClasses.iconOpenHover : folderDefaultClasses.iconOpenDefault
367
+ ),
368
+ "data-docubook": "file-tree-folder-icon"
289
369
  }
290
370
  ) : /* @__PURE__ */ jsx7(
291
371
  FolderIcon,
292
372
  {
293
- className: `
294
- h-4 w-4 shrink-0 transition-colors
295
- ${isHovered ? "text-accent/80" : "text-muted-foreground/80"}
296
- `
373
+ className: cn(
374
+ "dbk-file-tree__folder-icon",
375
+ folderDefaultClasses.icon,
376
+ isHovered ? folderDefaultClasses.iconClosedHover : folderDefaultClasses.iconClosedDefault
377
+ ),
378
+ "data-docubook": "file-tree-folder-icon"
297
379
  }
298
380
  ),
299
- /* @__PURE__ */ jsx7("span", { className: `font-medium transition-colors duration-150 ${isHovered ? "text-accent" : ""}`, children: name })
381
+ /* @__PURE__ */ jsx7("span", { className: cn("dbk-file-tree__folder-text", folderDefaultClasses.text, isHovered && folderDefaultClasses.textHover), "data-docubook": "file-tree-folder-text", children: name })
300
382
  ]
301
383
  }
302
384
  ),
303
- isOpen && hasChildren && /* @__PURE__ */ jsx7("div", { className: "ml-5 border-l-2 border-muted/50 pl-2", children })
385
+ isOpen && hasChildren && /* @__PURE__ */ jsx7("div", { className: cn("dbk-file-tree__folder-children", folderDefaultClasses.children), "data-docubook": "file-tree-folder-children", children })
304
386
  ] });
305
387
  }
306
- function Files({ children }) {
307
- return /* @__PURE__ */ jsx7(
308
- "div",
309
- {
310
- className: "\n rounded-xl border border-muted/20\n bg-card/20 backdrop-blur-sm\n shadow-sm overflow-hidden\n transition-all duration-200\n hover:shadow-md hover:border-muted/60\n ",
311
- children: /* @__PURE__ */ jsx7("div", { className: "p-2", children: Children.map(children, (child, index) => {
312
- if (isValidElement(child)) {
313
- return cloneElement(child, { key: index });
314
- }
315
- return null;
316
- }) })
388
+ function Files({
389
+ children
390
+ }) {
391
+ return /* @__PURE__ */ jsx7("div", { className: cn("dbk-file-tree", filesDefaultClasses.root), "data-docubook": "file-tree", children: /* @__PURE__ */ jsx7("div", { className: cn("dbk-file-tree__content", filesDefaultClasses.content), "data-docubook": "file-tree-content", children: Children.map(children, (child, index) => {
392
+ if (isValidElement(child)) {
393
+ return cloneElement(child, { key: index });
317
394
  }
318
- );
395
+ return null;
396
+ }) }) });
319
397
  }
320
- function Folder({ name, children }) {
398
+ function Folder({
399
+ name,
400
+ children
401
+ }) {
321
402
  return /* @__PURE__ */ jsx7(FolderComponent, { name, children });
322
403
  }
323
404
  function File({ name }) {
@@ -500,7 +581,8 @@ function Kbd({
500
581
  return /* @__PURE__ */ jsx9(
501
582
  "kbd",
502
583
  {
503
- 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",
584
+ 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",
585
+ "data-docubook": "kbd",
504
586
  ...props,
505
587
  children: renderContent()
506
588
  }
@@ -559,6 +641,12 @@ var iconMap = {
559
641
  warning: AlertTriangle,
560
642
  success: CheckCircle2
561
643
  };
644
+ var noteDefaultClasses = {
645
+ icon: "h-5 w-5",
646
+ contentWrapper: "pl-8",
647
+ title: "mb-1 font-medium leading-none tracking-tight",
648
+ content: "text-sm [&_p]:leading-relaxed opacity-90"
649
+ };
562
650
  function Note({
563
651
  className,
564
652
  title = "Note",
@@ -567,36 +655,55 @@ function Note({
567
655
  ...props
568
656
  }) {
569
657
  const Icon = iconMap[type] || Info;
570
- return /* @__PURE__ */ jsxs6("div", { className: cn(noteVariants({ variant: type }), className), ...props, children: [
571
- /* @__PURE__ */ jsx11(Icon, { className: "h-5 w-5" }),
572
- /* @__PURE__ */ jsxs6("div", { className: "pl-8", children: [
573
- /* @__PURE__ */ jsx11("h5", { className: "mb-1 font-medium leading-none tracking-tight", children: title }),
574
- /* @__PURE__ */ jsx11("div", { className: "text-sm [&_p]:leading-relaxed opacity-90", children })
575
- ] })
576
- ] });
658
+ const noteRole = type === "danger" ? "alert" : "status";
659
+ return /* @__PURE__ */ jsxs6(
660
+ "div",
661
+ {
662
+ className: cn("dbk-note", noteVariants({ variant: type }), className),
663
+ "data-docubook": "note",
664
+ "data-variant": type,
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
+ );
577
676
  }
578
677
 
579
678
  // src/core/components/Copy.tsx
580
679
  import { ClipboardCheckIcon, ClipboardIcon } from "lucide-react";
581
680
  import { useState as useState5 } from "react";
582
- import { jsx as jsx12 } from "react/jsx-runtime";
681
+ import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
583
682
  function Copy({ content }) {
584
683
  const [isCopied, setIsCopied] = useState5(false);
585
684
  async function handleCopy() {
586
- await navigator.clipboard.writeText(content);
587
- setIsCopied(true);
588
- setTimeout(() => {
685
+ try {
686
+ await navigator.clipboard.writeText(content);
687
+ setIsCopied(true);
688
+ setTimeout(() => {
689
+ setIsCopied(false);
690
+ }, 2e3);
691
+ } catch {
589
692
  setIsCopied(false);
590
- }, 2e3);
693
+ }
591
694
  }
592
- return /* @__PURE__ */ jsx12(
695
+ return /* @__PURE__ */ jsxs7(
593
696
  "button",
594
697
  {
595
698
  type: "button",
596
- className: "border cursor-copy inline-flex h-6 w-6 items-center justify-center rounded-md",
699
+ className: "dbk-copy inline-flex h-6 w-6 items-center justify-center rounded-md border bg-secondary text-secondary-foreground transition-colors hover:bg-secondary/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-copy",
597
700
  onClick: handleCopy,
598
701
  "aria-label": isCopied ? "Copied" : "Copy code",
599
- children: isCopied ? /* @__PURE__ */ jsx12(ClipboardCheckIcon, { className: "w-3 h-3" }) : /* @__PURE__ */ jsx12(ClipboardIcon, { className: "w-3 h-3" })
702
+ "data-docubook": "copy-button",
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
+ ]
600
707
  }
601
708
  );
602
709
  }
@@ -627,7 +734,7 @@ import {
627
734
  } from "react-icons/si";
628
735
  import { FaJava, FaCode } from "react-icons/fa";
629
736
  import { TbJson } from "react-icons/tb";
630
- import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
737
+ import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
631
738
  function LanguageIcon({ lang }) {
632
739
  const iconProps = { size: 16, className: "w-4 h-4" };
633
740
  const languageToIconMap = {
@@ -678,9 +785,9 @@ function Pre({ children, raw, ...rest }) {
678
785
  const { "data-title": title, className, ...restProps } = rest;
679
786
  const language = getLanguage(className);
680
787
  const hasTitle = !!title;
681
- return /* @__PURE__ */ jsxs7("div", { className: "code-block-container", children: [
788
+ return /* @__PURE__ */ jsxs8("div", { className: "code-block-container", children: [
682
789
  /* @__PURE__ */ jsx13("div", { className: "code-block-actions", children: raw && /* @__PURE__ */ jsx13(Copy, { content: raw }) }),
683
- hasTitle && /* @__PURE__ */ jsx13("div", { className: "code-block-header", children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
790
+ hasTitle && /* @__PURE__ */ jsx13("div", { className: "code-block-header", children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
684
791
  /* @__PURE__ */ jsx13(LanguageIcon, { lang: language }),
685
792
  /* @__PURE__ */ jsx13("span", { children: title })
686
793
  ] }) }),
@@ -697,32 +804,33 @@ import {
697
804
  XCircle,
698
805
  Zap
699
806
  } from "lucide-react";
700
- import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
807
+ import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
701
808
  function Release({ version, title, date, children }) {
702
- return /* @__PURE__ */ jsxs8("div", { className: "mb-16 group", children: [
703
- /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3 mt-6 mb-2", children: [
704
- /* @__PURE__ */ jsxs8(
809
+ return /* @__PURE__ */ jsxs9("div", { className: "dbk-release mb-16 group", "data-docubook": "release", children: [
810
+ /* @__PURE__ */ jsxs9("div", { className: "dbk-release__header flex items-center gap-3 mt-6 mb-2", "data-docubook": "release-header", children: [
811
+ /* @__PURE__ */ jsxs9(
705
812
  "div",
706
813
  {
707
814
  id: version,
708
- 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",
815
+ 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",
816
+ "data-docubook": "release-version",
709
817
  children: [
710
818
  "v",
711
819
  version
712
820
  ]
713
821
  }
714
822
  ),
715
- date && /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3 text-sm font-medium text-muted-foreground", children: [
823
+ date && /* @__PURE__ */ jsxs9("div", { className: "dbk-release__date-wrapper flex items-center gap-3 text-sm font-medium text-muted-foreground", "data-docubook": "release-date-wrapper", children: [
716
824
  /* @__PURE__ */ jsx14("span", { className: "h-1 w-1 rounded-full bg-muted-foreground/30" }),
717
- /* @__PURE__ */ jsx14("time", { dateTime: date, children: new Date(date).toLocaleDateString("en-US", {
825
+ /* @__PURE__ */ jsx14("time", { className: "dbk-release__date", "data-docubook": "release-date", dateTime: date, children: new Date(date).toLocaleDateString("en-US", {
718
826
  year: "numeric",
719
827
  month: "long",
720
828
  day: "numeric"
721
829
  }) })
722
830
  ] })
723
831
  ] }),
724
- /* @__PURE__ */ jsx14("h3", { className: "text-2xl font-bold text-foreground/90 mb-6 mt-0!", children: title }),
725
- /* @__PURE__ */ jsx14("div", { className: "space-y-8", children })
832
+ /* @__PURE__ */ jsx14("h3", { className: "dbk-release__title text-2xl font-bold text-foreground/90 mb-6 mt-0!", "data-docubook": "release-title", children: title }),
833
+ /* @__PURE__ */ jsx14("div", { className: "dbk-release__content space-y-8", "data-docubook": "release-content", children })
726
834
  ] });
727
835
  }
728
836
  var typeConfig = {
@@ -754,23 +862,25 @@ var typeConfig = {
754
862
  };
755
863
  function Changes({ type, children }) {
756
864
  const config = typeConfig[type] || typeConfig.added;
757
- return /* @__PURE__ */ jsxs8("div", { className: "space-y-3 mb-8", children: [
758
- /* @__PURE__ */ jsx14("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs8(
865
+ return /* @__PURE__ */ jsxs9("div", { className: "dbk-release-changes space-y-3 mb-8", "data-docubook": "release-changes", "data-type": type, children: [
866
+ /* @__PURE__ */ jsx14("div", { className: "dbk-release-changes__header flex items-center gap-2", "data-docubook": "release-changes-header", children: /* @__PURE__ */ jsxs9(
759
867
  "div",
760
868
  {
761
869
  className: cn(
870
+ "dbk-release-changes__badge",
762
871
  "px-3 py-1 rounded-full text-sm font-medium flex items-center gap-1.5",
763
872
  config.className
764
873
  ),
874
+ "data-docubook": "release-changes-badge",
765
875
  children: [
766
- /* @__PURE__ */ jsx14(config.icon, { className: "h-3.5 w-3.5" }),
767
- /* @__PURE__ */ jsx14("span", { children: config.label })
876
+ /* @__PURE__ */ jsx14(config.icon, { className: "dbk-release-changes__icon h-3.5 w-3.5", "data-docubook": "release-changes-icon" }),
877
+ /* @__PURE__ */ jsx14("span", { className: "dbk-release-changes__label", "data-docubook": "release-changes-label", children: config.label })
768
878
  ]
769
879
  }
770
880
  ) }),
771
- /* @__PURE__ */ jsx14("ul", { className: "list-none pl-0 space-y-2 text-foreground/80", children: Children2.map(children, (child, index) => {
881
+ /* @__PURE__ */ jsx14("ul", { className: "dbk-release-changes__list list-none pl-0 space-y-2 text-foreground/80", "data-docubook": "release-changes-list", children: Children2.map(children, (child, index) => {
772
882
  const processedChild = typeof child === "string" ? child.trim().replace(/^[-*]\s+/, "") : child;
773
- return /* @__PURE__ */ jsx14("li", { className: "leading-relaxed", children: processedChild }, index);
883
+ return /* @__PURE__ */ jsx14("li", { className: "dbk-release-changes__item leading-relaxed", "data-docubook": "release-changes-item", children: processedChild }, index);
774
884
  }) })
775
885
  ] });
776
886
  }
@@ -778,21 +888,36 @@ function Changes({ type, children }) {
778
888
  // src/core/components/Stepper.tsx
779
889
  import clsx5 from "clsx";
780
890
  import { Children as Children3 } from "react";
781
- import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
782
- function Stepper({ children }) {
891
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
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
+ };
903
+ function Stepper({
904
+ children
905
+ }) {
783
906
  const length = Children3.count(children);
784
- return /* @__PURE__ */ jsx15("div", { className: "flex flex-col", children: Children3.map(children, (child, index) => {
785
- return /* @__PURE__ */ jsxs9(
786
- "div",
907
+ return /* @__PURE__ */ jsx15("ol", { className: cn("dbk-stepper", stepperDefaultClasses.root), "data-docubook": "stepper", children: Children3.map(children, (child, index) => {
908
+ return /* @__PURE__ */ jsxs10(
909
+ "li",
787
910
  {
788
911
  className: cn(
789
- "border-l border-muted pl-9 ml-3 relative",
912
+ "dbk-stepper__item",
913
+ stepperDefaultClasses.item,
790
914
  clsx5({
791
- "pb-5 ": index < length - 1
915
+ [stepperDefaultClasses.itemWithConnector]: index < length - 1
792
916
  })
793
917
  ),
918
+ "data-docubook": "stepper-item",
794
919
  children: [
795
- /* @__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", children: index + 1 }),
920
+ /* @__PURE__ */ jsx15("div", { className: cn("dbk-stepper__number", stepperDefaultClasses.number), "data-docubook": "stepper-number", "aria-hidden": "true", children: index + 1 }),
796
921
  child
797
922
  ]
798
923
  }
@@ -803,28 +928,49 @@ function StepperItem({
803
928
  children,
804
929
  title
805
930
  }) {
806
- return /* @__PURE__ */ jsxs9("div", { className: "pt-0.5", children: [
807
- /* @__PURE__ */ jsx15("h4", { className: "mt-0", children: title }),
808
- /* @__PURE__ */ jsx15("div", { children })
931
+ return /* @__PURE__ */ jsxs10("div", { className: cn("dbk-stepper-item", stepperItemDefaultClasses.root), "data-docubook": "stepper-item-content", children: [
932
+ /* @__PURE__ */ jsx15("h4", { className: cn("dbk-stepper-item__title", stepperItemDefaultClasses.title), "data-docubook": "stepper-item-title", children: title }),
933
+ /* @__PURE__ */ jsx15("div", { className: cn("dbk-stepper-item__content", stepperItemDefaultClasses.content), "data-docubook": "stepper-item-body", children })
809
934
  ] });
810
935
  }
811
936
 
812
937
  // src/core/components/Tooltip.tsx
813
938
  import { useState as useState6 } from "react";
814
- import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
939
+ import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
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
+ };
815
946
  var Tooltip = ({ text, tip }) => {
816
947
  const [visible, setVisible] = useState6(false);
817
- return /* @__PURE__ */ jsxs10(
948
+ return /* @__PURE__ */ jsxs11(
818
949
  "span",
819
950
  {
820
- className: "relative inline-flex items-center cursor-help text-primary hover:text-primary/80 transition-colors",
951
+ className: cn("dbk-tooltip", tooltipDefaultClasses.root),
952
+ "data-docubook": "tooltip",
821
953
  onMouseEnter: () => setVisible(true),
822
954
  onMouseLeave: () => setVisible(false),
823
955
  children: [
824
- /* @__PURE__ */ jsx16("span", { className: "border-b border-dashed border-primary/60 pb-0.5", children: text }),
825
- 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", children: [
956
+ /* @__PURE__ */ jsx16(
957
+ "button",
958
+ {
959
+ type: "button",
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,
968
+ children: text
969
+ }
970
+ ),
971
+ visible && /* @__PURE__ */ jsxs11("span", { className: cn("dbk-tooltip__content", tooltipDefaultClasses.content), role: "tooltip", "data-docubook": "tooltip-content", children: [
826
972
  tip,
827
- /* @__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" })
973
+ /* @__PURE__ */ jsx16("span", { className: cn("dbk-tooltip__arrow", tooltipDefaultClasses.arrow), "data-docubook": "tooltip-arrow" })
828
974
  ] })
829
975
  ]
830
976
  }