@docubook/mdx 1.0.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.
@@ -0,0 +1,909 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // src/core/index.ts
32
+ var core_exports = {};
33
+ __export(core_exports, {
34
+ Accordion: () => Accordion,
35
+ AccordionGroup: () => AccordionGroup,
36
+ Button: () => Button,
37
+ Card: () => Card,
38
+ CardGroup: () => CardGroup,
39
+ Changes: () => Changes,
40
+ Copy: () => Copy,
41
+ File: () => File,
42
+ Files: () => Files,
43
+ Folder: () => Folder,
44
+ Image: () => Image,
45
+ Kbd: () => Kbd,
46
+ Link: () => Link,
47
+ Note: () => Note,
48
+ Pre: () => Pre,
49
+ Release: () => Release,
50
+ Stepper: () => Stepper,
51
+ StepperItem: () => StepperItem,
52
+ Tooltip: () => Tooltip,
53
+ Youtube: () => Youtube,
54
+ createCoreMdxComponents: () => createCoreMdxComponents
55
+ });
56
+ module.exports = __toCommonJS(core_exports);
57
+
58
+ // src/core/components/Accordion.tsx
59
+ var import_react2 = require("react");
60
+ var import_lucide_react = require("lucide-react");
61
+ var Icons = __toESM(require("lucide-react"), 1);
62
+
63
+ // src/core/utils/cn.ts
64
+ var import_clsx = require("clsx");
65
+ var import_tailwind_merge = require("tailwind-merge");
66
+ function cn(...inputs) {
67
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
68
+ }
69
+
70
+ // src/core/components/AccordionContext.tsx
71
+ var import_react = require("react");
72
+ var import_jsx_runtime = require("react/jsx-runtime");
73
+ var AccordionGroupContext = (0, import_react.createContext)(null);
74
+ function AccordionGroupProvider({ children }) {
75
+ const [openTitle, setOpenTitle] = (0, import_react.useState)(null);
76
+ const groupId = (0, import_react.useId)();
77
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
78
+ AccordionGroupContext.Provider,
79
+ {
80
+ value: { inGroup: true, groupId, openTitle, setOpenTitle },
81
+ children
82
+ }
83
+ );
84
+ }
85
+
86
+ // src/core/components/Accordion.tsx
87
+ var import_jsx_runtime2 = require("react/jsx-runtime");
88
+ function Accordion({ title, children, icon }) {
89
+ const groupContext = (0, import_react2.useContext)(AccordionGroupContext);
90
+ const isInGroup = groupContext?.inGroup === true;
91
+ const groupOpen = groupContext?.openTitle === title;
92
+ const setGroupOpen = groupContext?.setOpenTitle;
93
+ const [localOpen, setLocalOpen] = (0, import_react2.useState)(false);
94
+ const isOpen = isInGroup ? groupOpen : localOpen;
95
+ const handleToggle = () => {
96
+ if (isInGroup && setGroupOpen) {
97
+ setGroupOpen(groupOpen ? null : title);
98
+ } else {
99
+ setLocalOpen(!localOpen);
100
+ }
101
+ };
102
+ const Icon = icon ? Icons[icon] : null;
103
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
104
+ "div",
105
+ {
106
+ className: cn(
107
+ !isInGroup && "rounded-lg border shadow-sm",
108
+ isInGroup && "border-border border-b last:border-b-0"
109
+ ),
110
+ children: [
111
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
112
+ "button",
113
+ {
114
+ type: "button",
115
+ onClick: handleToggle,
116
+ 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",
117
+ children: [
118
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
119
+ import_lucide_react.ChevronRight,
120
+ {
121
+ className: cn(
122
+ "text-muted-foreground h-4 w-4 shrink-0 transition-transform duration-200",
123
+ isOpen && "rotate-90"
124
+ )
125
+ }
126
+ ),
127
+ Icon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { className: "text-foreground h-4 w-4 shrink-0" }),
128
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { className: "text-foreground m-0! text-base font-medium", children: title })
129
+ ]
130
+ }
131
+ ),
132
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
133
+ "div",
134
+ {
135
+ className: cn(
136
+ "grid transition-[grid-template-rows] duration-200 ease-out",
137
+ isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
138
+ ),
139
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dark:bg-muted/10 bg-muted/15 px-4 py-3", children }) })
140
+ }
141
+ )
142
+ ]
143
+ }
144
+ );
145
+ }
146
+
147
+ // src/core/components/AccordionGroup.tsx
148
+ var import_clsx2 = __toESM(require("clsx"), 1);
149
+ var import_jsx_runtime3 = require("react/jsx-runtime");
150
+ function AccordionGroup({ children, className }) {
151
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AccordionGroupProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_clsx2.default)("overflow-hidden rounded-lg border", className), children }) });
152
+ }
153
+
154
+ // src/core/components/Button.tsx
155
+ var Icons2 = __toESM(require("lucide-react"), 1);
156
+ var import_jsx_runtime4 = require("react/jsx-runtime");
157
+ function Button({
158
+ icon,
159
+ text,
160
+ href,
161
+ target,
162
+ size = "md",
163
+ variation = "primary",
164
+ LinkComponent
165
+ }) {
166
+ const baseStyles = "inline-flex items-center justify-center rounded font-medium focus:outline-none transition no-underline";
167
+ const sizeStyles = {
168
+ sm: "px-3 py-1 my-6 text-sm",
169
+ md: "px-4 py-2 my-6 text-base",
170
+ lg: "px-5 py-3 my-6 text-lg"
171
+ };
172
+ const variationStyles = {
173
+ primary: "bg-primary text-white hover:bg-primary/90",
174
+ accent: "bg-accent text-white hover:bg-accent/90",
175
+ outline: "border border-accent text-accent hover:bg-accent/10"
176
+ };
177
+ const Icon = icon ? Icons2[icon] : null;
178
+ const className = `${baseStyles} ${sizeStyles[size]} ${variationStyles[variation]}`;
179
+ const inner = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
180
+ text && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: text }),
181
+ Icon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { className: "mr-2 h-5 w-5" })
182
+ ] });
183
+ if (LinkComponent) {
184
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
185
+ LinkComponent,
186
+ {
187
+ href,
188
+ target,
189
+ rel: target === "_blank" ? "noopener noreferrer" : void 0,
190
+ className,
191
+ children: inner
192
+ }
193
+ );
194
+ }
195
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
196
+ "a",
197
+ {
198
+ href,
199
+ target,
200
+ rel: target === "_blank" ? "noopener noreferrer" : void 0,
201
+ className,
202
+ children: inner
203
+ }
204
+ );
205
+ }
206
+
207
+ // src/core/components/Card.tsx
208
+ var Icons3 = __toESM(require("lucide-react"), 1);
209
+ var import_clsx3 = __toESM(require("clsx"), 1);
210
+ var import_jsx_runtime5 = require("react/jsx-runtime");
211
+ function Card({
212
+ title,
213
+ icon,
214
+ href,
215
+ horizontal,
216
+ children,
217
+ className,
218
+ LinkComponent
219
+ }) {
220
+ const Icon = icon ? Icons3[icon] : null;
221
+ const content = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
222
+ "div",
223
+ {
224
+ className: (0, import_clsx3.default)(
225
+ "border rounded-lg shadow-sm p-4 transition-all duration-200",
226
+ "bg-card text-card-foreground border-border",
227
+ "hover:bg-accent/5 hover:border-accent/30",
228
+ "flex gap-2",
229
+ horizontal ? "flex-row items-start gap-1" : "flex-col space-y-1",
230
+ className
231
+ ),
232
+ children: [
233
+ Icon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { className: (0, import_clsx3.default)("w-5 h-5 text-primary shrink-0", horizontal && "mt-0.5") }),
234
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex-1 min-w-0", children: [
235
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "text-base font-semibold text-foreground leading-6", children: title }),
236
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "text-sm text-muted-foreground -mt-3", children })
237
+ ] })
238
+ ]
239
+ }
240
+ );
241
+ if (!href) return content;
242
+ if (LinkComponent) {
243
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LinkComponent, { href, className: "no-underline block", children: content });
244
+ }
245
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { className: "no-underline block", href, children: content });
246
+ }
247
+
248
+ // src/core/components/CardGroup.tsx
249
+ var import_react3 = __toESM(require("react"), 1);
250
+ var import_clsx4 = __toESM(require("clsx"), 1);
251
+ var import_jsx_runtime6 = require("react/jsx-runtime");
252
+ function CardGroup({ children, cols = 2, className }) {
253
+ const cardsArray = import_react3.default.Children.toArray(children);
254
+ const gridColsClass = {
255
+ 1: "grid-cols-1",
256
+ 2: "grid-cols-1 sm:grid-cols-2",
257
+ 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
258
+ 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
259
+ }[cols] || "grid-cols-1 sm:grid-cols-2";
260
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_clsx4.default)("grid gap-4 text-foreground", gridColsClass, className), children: cardsArray.map((card, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: card }, index)) });
261
+ }
262
+
263
+ // src/core/components/FileTree.tsx
264
+ var import_react4 = require("react");
265
+ var import_lucide_react2 = require("lucide-react");
266
+ var import_jsx_runtime7 = require("react/jsx-runtime");
267
+ function FileComponent({ name }) {
268
+ const [isHovered, setIsHovered] = (0, import_react4.useState)(false);
269
+ const fileExtension = name.split(".").pop()?.toUpperCase();
270
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
271
+ "div",
272
+ {
273
+ className: `
274
+ flex items-center gap-2 py-1.5 pl-7 pr-3 text-sm rounded-md
275
+ transition-colors duration-150 cursor-default select-none
276
+ ${isHovered ? "bg-accent/10" : "hover:bg-muted/50"}
277
+ `,
278
+ onMouseEnter: () => setIsHovered(true),
279
+ onMouseLeave: () => setIsHovered(false),
280
+ tabIndex: -1,
281
+ children: [
282
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
283
+ import_lucide_react2.File,
284
+ {
285
+ className: `
286
+ h-3.5 w-3.5 shrink-0 transition-colors
287
+ ${isHovered ? "text-accent" : "text-muted-foreground"}
288
+ `
289
+ }
290
+ ),
291
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "font-mono text-sm text-foreground truncate", children: name }),
292
+ isHovered && fileExtension && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ml-auto text-xs text-muted-foreground/80", children: fileExtension })
293
+ ]
294
+ }
295
+ );
296
+ }
297
+ function FolderComponent({ name, children }) {
298
+ const [isOpen, setIsOpen] = (0, import_react4.useState)(true);
299
+ const [isHovered, setIsHovered] = (0, import_react4.useState)(false);
300
+ const hasChildren = import_react4.Children.count(children) > 0;
301
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative", children: [
302
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
303
+ "div",
304
+ {
305
+ className: `
306
+ flex items-center gap-2 py-1.5 pl-4 pr-3 rounded-md
307
+ transition-colors duration-150 select-none
308
+ ${isHovered ? "bg-muted/60" : ""}
309
+ ${isOpen ? "text-foreground" : "text-foreground/80"}
310
+ ${hasChildren ? "cursor-pointer" : "cursor-default"}
311
+ `,
312
+ onClick: () => hasChildren && setIsOpen(!isOpen),
313
+ onMouseEnter: () => setIsHovered(true),
314
+ onMouseLeave: () => setIsHovered(false),
315
+ tabIndex: -1,
316
+ children: [
317
+ hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
318
+ import_lucide_react2.ChevronRight,
319
+ {
320
+ className: `
321
+ h-3.5 w-3.5 shrink-0 transition-transform duration-200
322
+ ${isOpen ? "rotate-90" : ""}
323
+ ${isHovered ? "text-foreground/70" : "text-muted-foreground"}
324
+ `
325
+ }
326
+ ) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w-3.5" }),
327
+ isOpen ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
328
+ import_lucide_react2.FolderOpen,
329
+ {
330
+ className: `
331
+ h-4 w-4 shrink-0 transition-colors
332
+ ${isHovered ? "text-accent" : "text-muted-foreground"}
333
+ `
334
+ }
335
+ ) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
336
+ import_lucide_react2.Folder,
337
+ {
338
+ className: `
339
+ h-4 w-4 shrink-0 transition-colors
340
+ ${isHovered ? "text-accent/80" : "text-muted-foreground/80"}
341
+ `
342
+ }
343
+ ),
344
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: `font-medium transition-colors duration-150 ${isHovered ? "text-accent" : ""}`, children: name })
345
+ ]
346
+ }
347
+ ),
348
+ isOpen && hasChildren && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "ml-5 border-l-2 border-muted/50 pl-2", children })
349
+ ] });
350
+ }
351
+ function Files({ children }) {
352
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
353
+ "div",
354
+ {
355
+ 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 ",
356
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "p-2", children: import_react4.Children.map(children, (child, index) => {
357
+ if ((0, import_react4.isValidElement)(child)) {
358
+ return (0, import_react4.cloneElement)(child, { key: index });
359
+ }
360
+ return null;
361
+ }) })
362
+ }
363
+ );
364
+ }
365
+ function Folder({ name, children }) {
366
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FolderComponent, { name, children });
367
+ }
368
+ function File({ name }) {
369
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FileComponent, { name });
370
+ }
371
+
372
+ // src/core/components/Image.tsx
373
+ var import_react_dom = require("react-dom");
374
+ var import_lucide_react3 = require("lucide-react");
375
+ var import_react5 = require("react");
376
+ var import_jsx_runtime8 = require("react/jsx-runtime");
377
+ function Image({
378
+ src,
379
+ alt = "alt",
380
+ width = 800,
381
+ height = 350,
382
+ ...props
383
+ }) {
384
+ const [isOpen, setIsOpen] = (0, import_react5.useState)(false);
385
+ const scrollYRef = (0, import_react5.useRef)(0);
386
+ (0, import_react5.useEffect)(() => {
387
+ if (!isOpen) return;
388
+ scrollYRef.current = window.scrollY;
389
+ document.body.style.position = "fixed";
390
+ document.body.style.top = `-${scrollYRef.current}px`;
391
+ document.body.style.width = "100%";
392
+ const handleEsc = (e) => {
393
+ if (e.key === "Escape") setIsOpen(false);
394
+ };
395
+ window.addEventListener("keydown", handleEsc);
396
+ return () => {
397
+ document.body.style.position = "";
398
+ document.body.style.top = "";
399
+ document.body.style.width = "";
400
+ window.scrollTo(0, scrollYRef.current);
401
+ window.removeEventListener("keydown", handleEsc);
402
+ };
403
+ }, [isOpen]);
404
+ if (!src) return null;
405
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
406
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
407
+ "button",
408
+ {
409
+ type: "button",
410
+ className: "relative group cursor-zoom-in my-6 w-full flex justify-center rounded-lg",
411
+ onClick: () => setIsOpen(true),
412
+ "aria-label": "Zoom image",
413
+ children: [
414
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/5 transition-colors z-10 flex items-center justify-center opacity-0 group-hover:opacity-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ZoomIn, { className: "w-8 h-8 text-white drop-shadow-md" }) }),
415
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
416
+ "img",
417
+ {
418
+ src: typeof src === "string" ? src : "",
419
+ alt,
420
+ width,
421
+ height,
422
+ className: "w-full h-auto rounded-lg transition-transform duration-300 group-hover:scale-[1.01]",
423
+ ...props
424
+ }
425
+ )
426
+ ]
427
+ }
428
+ ),
429
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
430
+ "div",
431
+ {
432
+ className: "fixed inset-0 z-99999 flex items-center justify-center bg-black/90 backdrop-blur-md p-4 md:p-10 cursor-zoom-out",
433
+ onClick: () => setIsOpen(false),
434
+ children: [
435
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
436
+ "button",
437
+ {
438
+ className: "absolute top-4 right-4 z-50 p-2 text-white/70 hover:text-white bg-black/20 hover:bg-white/10 rounded-full transition-colors",
439
+ onClick: (e) => {
440
+ e.stopPropagation();
441
+ setIsOpen(false);
442
+ },
443
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.X, { className: "w-6 h-6" })
444
+ }
445
+ ),
446
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
447
+ "div",
448
+ {
449
+ className: "relative max-w-7xl w-full h-full flex items-center justify-center",
450
+ onClick: (e) => e.stopPropagation(),
451
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
452
+ "div",
453
+ {
454
+ className: "relative w-full h-full flex items-center justify-center",
455
+ onClick: () => setIsOpen(false),
456
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
457
+ "img",
458
+ {
459
+ src: typeof src === "string" ? src : "",
460
+ alt,
461
+ width: 1920,
462
+ height: 1080,
463
+ className: "object-contain max-h-[90vh] w-auto h-auto rounded-md shadow-2xl"
464
+ }
465
+ )
466
+ }
467
+ )
468
+ }
469
+ ),
470
+ alt && alt !== "alt" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 text-white px-4 py-2 rounded-full text-sm font-medium backdrop-blur-md border border-white/10", children: alt })
471
+ ]
472
+ }
473
+ ) })
474
+ ] });
475
+ }
476
+ function Portal({ children }) {
477
+ if (typeof window === "undefined") return null;
478
+ return (0, import_react_dom.createPortal)(children, document.body);
479
+ }
480
+
481
+ // src/core/components/Keyboard.tsx
482
+ var import_jsx_runtime9 = require("react/jsx-runtime");
483
+ var macKeyMap = {
484
+ command: "\u2318",
485
+ cmd: "\u2318",
486
+ option: "\u2325",
487
+ alt: "\u2325",
488
+ shift: "\u21E7",
489
+ ctrl: "\u2303",
490
+ control: "\u2303",
491
+ tab: "\u21E5",
492
+ caps: "\u21EA",
493
+ enter: "\u23CE",
494
+ return: "\u23CE",
495
+ delete: "\u232B",
496
+ escape: "\u238B",
497
+ esc: "\u238B",
498
+ up: "\u2191",
499
+ down: "\u2193",
500
+ left: "\u2190",
501
+ right: "\u2192",
502
+ space: "\u2423"
503
+ };
504
+ var windowsKeyMap = {
505
+ command: "Win",
506
+ cmd: "Win",
507
+ option: "Alt",
508
+ alt: "Alt",
509
+ ctrl: "Ctrl",
510
+ control: "Ctrl",
511
+ delete: "Del",
512
+ escape: "Esc",
513
+ esc: "Esc",
514
+ enter: "Enter",
515
+ return: "Enter",
516
+ tab: "Tab",
517
+ caps: "Caps",
518
+ shift: "Shift",
519
+ space: "Space",
520
+ up: "\u2191",
521
+ down: "\u2193",
522
+ left: "\u2190",
523
+ right: "\u2192"
524
+ };
525
+ function Kbd({
526
+ show: keyProp,
527
+ type = "window",
528
+ children,
529
+ ...props
530
+ }) {
531
+ const getKeyDisplay = () => {
532
+ if (!keyProp || typeof keyProp !== "string") return null;
533
+ const lowerKey = keyProp.toLowerCase();
534
+ if (type === "mac") {
535
+ return macKeyMap[lowerKey] || keyProp;
536
+ }
537
+ return windowsKeyMap[lowerKey] || keyProp.charAt(0).toUpperCase() + keyProp.slice(1);
538
+ };
539
+ const renderContent = () => {
540
+ if (children !== void 0 && children !== null && children !== "") {
541
+ return children;
542
+ }
543
+ return getKeyDisplay() || keyProp || "";
544
+ };
545
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
546
+ "kbd",
547
+ {
548
+ 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",
549
+ ...props,
550
+ children: renderContent()
551
+ }
552
+ );
553
+ }
554
+
555
+ // src/core/components/Link.tsx
556
+ var import_jsx_runtime10 = require("react/jsx-runtime");
557
+ function isUnsafeHref(href) {
558
+ const normalized = href.trim().toLowerCase();
559
+ return normalized.startsWith("javascript:") || normalized.startsWith("data:") || normalized.startsWith("vbscript:");
560
+ }
561
+ function Link({ href, target, rel, ...props }) {
562
+ if (!href) return null;
563
+ if (isUnsafeHref(href)) return null;
564
+ const isExternal = /^https?:\/\//.test(href);
565
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
566
+ "a",
567
+ {
568
+ href,
569
+ ...props,
570
+ target: target ?? (isExternal ? "_blank" : void 0),
571
+ rel: rel ?? (isExternal ? "noopener noreferrer" : void 0)
572
+ }
573
+ );
574
+ }
575
+
576
+ // src/core/components/Note.tsx
577
+ var import_class_variance_authority = require("class-variance-authority");
578
+ var import_lucide_react4 = require("lucide-react");
579
+ var import_jsx_runtime11 = require("react/jsx-runtime");
580
+ var noteVariants = (0, import_class_variance_authority.cva)(
581
+ "relative w-full rounded-lg border border-l-4 p-4 mb-4 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
582
+ {
583
+ variants: {
584
+ variant: {
585
+ note: "bg-muted/30 border-border border-l-primary/50 text-foreground [&>svg]:text-primary",
586
+ danger: "border-destructive/20 border-l-destructive/60 bg-destructive/5 text-destructive [&>svg]:text-destructive dark:border-destructive/30",
587
+ warning: "border-orange-500/20 border-l-orange-500/60 bg-orange-500/5 text-orange-600 dark:text-orange-400 [&>svg]:text-orange-600 dark:[&>svg]:text-orange-400",
588
+ success: "border-emerald-500/20 border-l-emerald-500/60 bg-emerald-500/5 text-emerald-600 dark:text-emerald-400 [&>svg]:text-emerald-600 dark:[&>svg]:text-emerald-400"
589
+ }
590
+ },
591
+ defaultVariants: {
592
+ variant: "note"
593
+ }
594
+ }
595
+ );
596
+ var iconMap = {
597
+ note: import_lucide_react4.Info,
598
+ danger: import_lucide_react4.ShieldAlert,
599
+ warning: import_lucide_react4.AlertTriangle,
600
+ success: import_lucide_react4.CheckCircle2
601
+ };
602
+ function Note({
603
+ className,
604
+ title = "Note",
605
+ type = "note",
606
+ children,
607
+ ...props
608
+ }) {
609
+ const Icon = iconMap[type] || import_lucide_react4.Info;
610
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn(noteVariants({ variant: type }), className), ...props, children: [
611
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { className: "h-5 w-5" }),
612
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "pl-8", children: [
613
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h5", { className: "mb-1 font-medium leading-none tracking-tight", children: title }),
614
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "text-sm [&_p]:leading-relaxed opacity-90", children })
615
+ ] })
616
+ ] });
617
+ }
618
+
619
+ // src/core/components/Copy.tsx
620
+ var import_lucide_react5 = require("lucide-react");
621
+ var import_react6 = require("react");
622
+ var import_jsx_runtime12 = require("react/jsx-runtime");
623
+ function Copy({ content }) {
624
+ const [isCopied, setIsCopied] = (0, import_react6.useState)(false);
625
+ async function handleCopy() {
626
+ await navigator.clipboard.writeText(content);
627
+ setIsCopied(true);
628
+ setTimeout(() => {
629
+ setIsCopied(false);
630
+ }, 2e3);
631
+ }
632
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
633
+ "button",
634
+ {
635
+ type: "button",
636
+ className: "border cursor-copy inline-flex h-6 w-6 items-center justify-center rounded-md",
637
+ onClick: handleCopy,
638
+ "aria-label": isCopied ? "Copied" : "Copy code",
639
+ children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.ClipboardCheckIcon, { className: "w-3 h-3" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.ClipboardIcon, { className: "w-3 h-3" })
640
+ }
641
+ );
642
+ }
643
+
644
+ // src/core/components/Pre.tsx
645
+ var import_si = require("react-icons/si");
646
+ var import_fa = require("react-icons/fa");
647
+ var import_tb = require("react-icons/tb");
648
+ var import_jsx_runtime13 = require("react/jsx-runtime");
649
+ function LanguageIcon({ lang }) {
650
+ const iconProps = { size: 16, className: "w-4 h-4" };
651
+ const languageToIconMap = {
652
+ gitignore: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiGit, { ...iconProps }),
653
+ docker: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiDocker, { ...iconProps }),
654
+ dockerfile: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiDocker, { ...iconProps }),
655
+ nginx: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiNginx, { ...iconProps }),
656
+ sql: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiPostgresql, { ...iconProps }),
657
+ graphql: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiGraphql, { ...iconProps }),
658
+ yaml: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiYaml, { ...iconProps }),
659
+ yml: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiYaml, { ...iconProps }),
660
+ toml: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiToml, { ...iconProps }),
661
+ json: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_tb.TbJson, { ...iconProps }),
662
+ md: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiMarkdown, { ...iconProps }),
663
+ markdown: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiMarkdown, { ...iconProps }),
664
+ bash: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiGnubash, { ...iconProps }),
665
+ sh: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiGnubash, { ...iconProps }),
666
+ shell: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiGnubash, { ...iconProps }),
667
+ swift: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiSwift, { ...iconProps }),
668
+ kotlin: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiKotlin, { ...iconProps }),
669
+ kt: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiKotlin, { ...iconProps }),
670
+ kts: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiKotlin, { ...iconProps }),
671
+ rb: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiRuby, { ...iconProps }),
672
+ ruby: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiRuby, { ...iconProps }),
673
+ php: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiPhp, { ...iconProps }),
674
+ go: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiGo, { ...iconProps }),
675
+ py: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiPython, { ...iconProps }),
676
+ python: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiPython, { ...iconProps }),
677
+ java: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_fa.FaJava, { ...iconProps }),
678
+ tsx: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiReact, { ...iconProps }),
679
+ typescript: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiTypescript, { ...iconProps }),
680
+ ts: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiTypescript, { ...iconProps }),
681
+ jsx: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiReact, { ...iconProps }),
682
+ js: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiJavascript, { ...iconProps }),
683
+ javascript: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiJavascript, { ...iconProps }),
684
+ html: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiHtml5, { ...iconProps }),
685
+ css: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiCss, { ...iconProps }),
686
+ scss: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiSass, { ...iconProps }),
687
+ sass: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_si.SiSass, { ...iconProps })
688
+ };
689
+ return languageToIconMap[lang] || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_fa.FaCode, { ...iconProps });
690
+ }
691
+ function getLanguage(className = "") {
692
+ const match = className.match(/language-(\w+)/);
693
+ return match ? match[1] : "default";
694
+ }
695
+ function Pre({ children, raw, ...rest }) {
696
+ const { "data-title": title, className, ...restProps } = rest;
697
+ const language = getLanguage(className);
698
+ const hasTitle = !!title;
699
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "code-block-container", children: [
700
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "code-block-actions", children: raw && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Copy, { content: raw }) }),
701
+ hasTitle && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "code-block-header", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-2", children: [
702
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LanguageIcon, { lang: language }),
703
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: title })
704
+ ] }) }),
705
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "code-block-body", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("pre", { className, ...restProps, children }) })
706
+ ] });
707
+ }
708
+
709
+ // src/core/components/Release.tsx
710
+ var import_react7 = require("react");
711
+ var import_lucide_react6 = require("lucide-react");
712
+ var import_jsx_runtime14 = require("react/jsx-runtime");
713
+ function Release({ version, title, date, children }) {
714
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "mb-16 group", children: [
715
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-3 mt-6 mb-2", children: [
716
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
717
+ "div",
718
+ {
719
+ id: version,
720
+ 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",
721
+ children: [
722
+ "v",
723
+ version
724
+ ]
725
+ }
726
+ ),
727
+ date && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-3 text-sm font-medium text-muted-foreground", children: [
728
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "h-1 w-1 rounded-full bg-muted-foreground/30" }),
729
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("time", { dateTime: date, children: new Date(date).toLocaleDateString("en-US", {
730
+ year: "numeric",
731
+ month: "long",
732
+ day: "numeric"
733
+ }) })
734
+ ] })
735
+ ] }),
736
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { className: "text-2xl font-bold text-foreground/90 mb-6 mt-0!", children: title }),
737
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "space-y-8", children })
738
+ ] });
739
+ }
740
+ var typeConfig = {
741
+ added: {
742
+ label: "Added",
743
+ className: "bg-green-100 dark:bg-green-900/50 text-green-700 dark:text-green-300",
744
+ icon: import_lucide_react6.PlusCircle
745
+ },
746
+ fixed: {
747
+ label: "Fixed",
748
+ className: "bg-yellow-100 dark:bg-yellow-900/50 text-yellow-700 dark:text-yellow-300",
749
+ icon: import_lucide_react6.Wrench
750
+ },
751
+ improved: {
752
+ label: "Improved",
753
+ className: "bg-cyan-100 dark:bg-cyan-900/50 text-cyan-700 dark:text-cyan-300",
754
+ icon: import_lucide_react6.Zap
755
+ },
756
+ deprecated: {
757
+ label: "Deprecated",
758
+ className: "bg-orange-100 dark:bg-orange-900/50 text-orange-700 dark:text-orange-300",
759
+ icon: import_lucide_react6.AlertTriangle
760
+ },
761
+ removed: {
762
+ label: "Removed",
763
+ className: "bg-pink-100 dark:bg-pink-900/50 text-pink-700 dark:text-pink-300",
764
+ icon: import_lucide_react6.XCircle
765
+ }
766
+ };
767
+ function Changes({ type, children }) {
768
+ const config = typeConfig[type] || typeConfig.added;
769
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-3 mb-8", children: [
770
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
771
+ "div",
772
+ {
773
+ className: cn(
774
+ "px-3 py-1 rounded-full text-sm font-medium flex items-center gap-1.5",
775
+ config.className
776
+ ),
777
+ children: [
778
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(config.icon, { className: "h-3.5 w-3.5" }),
779
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: config.label })
780
+ ]
781
+ }
782
+ ) }),
783
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "list-none pl-0 space-y-2 text-foreground/80", children: import_react7.Children.map(children, (child, index) => {
784
+ const processedChild = typeof child === "string" ? child.trim().replace(/^[-*]\s+/, "") : child;
785
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: "leading-relaxed", children: processedChild }, index);
786
+ }) })
787
+ ] });
788
+ }
789
+
790
+ // src/core/components/Stepper.tsx
791
+ var import_clsx5 = __toESM(require("clsx"), 1);
792
+ var import_react8 = require("react");
793
+ var import_jsx_runtime15 = require("react/jsx-runtime");
794
+ function Stepper({ children }) {
795
+ const length = import_react8.Children.count(children);
796
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col", children: import_react8.Children.map(children, (child, index) => {
797
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
798
+ "div",
799
+ {
800
+ className: cn(
801
+ "border-l border-muted pl-9 ml-3 relative",
802
+ (0, import_clsx5.default)({
803
+ "pb-5 ": index < length - 1
804
+ })
805
+ ),
806
+ children: [
807
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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 }),
808
+ child
809
+ ]
810
+ }
811
+ );
812
+ }) });
813
+ }
814
+ function StepperItem({
815
+ children,
816
+ title
817
+ }) {
818
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "pt-0.5", children: [
819
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h4", { className: "mt-0", children: title }),
820
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children })
821
+ ] });
822
+ }
823
+
824
+ // src/core/components/Tooltip.tsx
825
+ var import_react9 = require("react");
826
+ var import_jsx_runtime16 = require("react/jsx-runtime");
827
+ var Tooltip = ({ text, tip }) => {
828
+ const [visible, setVisible] = (0, import_react9.useState)(false);
829
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
830
+ "span",
831
+ {
832
+ className: "relative inline-flex items-center cursor-help text-primary hover:text-primary/80 transition-colors",
833
+ onMouseEnter: () => setVisible(true),
834
+ onMouseLeave: () => setVisible(false),
835
+ children: [
836
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "border-b border-dashed border-primary/60 pb-0.5", children: text }),
837
+ visible && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("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: [
838
+ tip,
839
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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" })
840
+ ] })
841
+ ]
842
+ }
843
+ );
844
+ };
845
+
846
+ // src/core/components/Youtube.tsx
847
+ var import_jsx_runtime17 = require("react/jsx-runtime");
848
+ var Youtube = ({ videoId, className }) => {
849
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: `youtube ${className || ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
850
+ "iframe",
851
+ {
852
+ src: `https://www.youtube.com/embed/${videoId}?rel=0&modestbranding=1&showinfo=0&autohide=1&controls=1`,
853
+ title: "YouTube video player",
854
+ frameBorder: "0",
855
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
856
+ allowFullScreen: true
857
+ }
858
+ ) });
859
+ };
860
+
861
+ // src/core/index.ts
862
+ function createCoreMdxComponents() {
863
+ return {
864
+ Accordion,
865
+ AccordionGroup,
866
+ Button,
867
+ Card,
868
+ CardGroup,
869
+ Kbd,
870
+ kbd: Kbd,
871
+ pre: Pre,
872
+ Note,
873
+ Stepper,
874
+ StepperItem,
875
+ Youtube,
876
+ Tooltip,
877
+ Release,
878
+ Changes,
879
+ File,
880
+ Files,
881
+ Folder,
882
+ img: Image,
883
+ a: Link
884
+ };
885
+ }
886
+ // Annotate the CommonJS export names for ESM import in node:
887
+ 0 && (module.exports = {
888
+ Accordion,
889
+ AccordionGroup,
890
+ Button,
891
+ Card,
892
+ CardGroup,
893
+ Changes,
894
+ Copy,
895
+ File,
896
+ Files,
897
+ Folder,
898
+ Image,
899
+ Kbd,
900
+ Link,
901
+ Note,
902
+ Pre,
903
+ Release,
904
+ Stepper,
905
+ StepperItem,
906
+ Tooltip,
907
+ Youtube,
908
+ createCoreMdxComponents
909
+ });