react-docs-ui 0.6.13 → 0.6.15

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.
Files changed (70) hide show
  1. package/README.md +13 -0
  2. package/dist/AIChatDialog-W60DtiEW.js +418 -0
  3. package/dist/AIProvider-C1_b1iKH.js +1066 -0
  4. package/dist/AISelectionTrigger-MaBGhxTE.js +86 -0
  5. package/dist/AISettingsPanel-aiMnncnQ.js +524 -0
  6. package/dist/DocsApp-BBNDiw8A.js +23556 -0
  7. package/dist/GlobalContextMenu-DG6x5Y5w.js +278 -0
  8. package/dist/MdxContent-CMB8ZbXo.js +850 -0
  9. package/dist/MdxContent.lazy-C4rcCv4v.js +1768 -0
  10. package/dist/SearchDialog-tUSKKsxW.js +403 -0
  11. package/dist/SearchRuntime-5fXpxDsi.js +23 -0
  12. package/dist/context-menu-CB7erSoV.js +73 -0
  13. package/dist/dialog-DQ6nkP0y.js +97 -0
  14. package/dist/docs-app.es.d.ts +1 -0
  15. package/dist/docs-app.es.js +7 -9
  16. package/dist/react-docs-ui.css +2 -1
  17. package/dist/react-docs-ui.es.js +66 -195
  18. package/dist/shiki-highlighter-BmQSSJpS.js +7194 -0
  19. package/dist/theme-provider-fNhx9xK0.js +37 -0
  20. package/dist/types/components/DocsLayout.d.ts +1 -31
  21. package/dist/types/components/DocsLayout.d.ts.map +1 -1
  22. package/dist/types/components/Footer.d.ts +3 -28
  23. package/dist/types/components/Footer.d.ts.map +1 -1
  24. package/dist/types/components/HeaderNav.d.ts.map +1 -1
  25. package/dist/types/components/MdxContent.d.ts.map +1 -1
  26. package/dist/types/components/MobileSidebar.d.ts +1 -1
  27. package/dist/types/components/MobileSidebar.d.ts.map +1 -1
  28. package/dist/types/components/PageNavigation.d.ts +1 -1
  29. package/dist/types/components/PageNavigation.d.ts.map +1 -1
  30. package/dist/types/components/SidebarNav.d.ts +1 -1
  31. package/dist/types/components/SidebarNav.d.ts.map +1 -1
  32. package/dist/types/components/TableOfContents.d.ts +1 -1
  33. package/dist/types/components/TableOfContents.d.ts.map +1 -1
  34. package/dist/types/components/ai/AIChatDialog.d.ts +1 -1
  35. package/dist/types/components/ai/AIChatDialog.d.ts.map +1 -1
  36. package/dist/types/components/ai/AISelectionTrigger.d.ts +1 -1
  37. package/dist/types/components/ai/AISelectionTrigger.d.ts.map +1 -1
  38. package/dist/types/components/ai/AISettingsPanel.d.ts +1 -1
  39. package/dist/types/components/ai/AISettingsPanel.d.ts.map +1 -1
  40. package/dist/types/components/search/SearchItem.d.ts +1 -2
  41. package/dist/types/components/search/SearchItem.d.ts.map +1 -1
  42. package/dist/types/components/ui/button.d.ts +4 -4
  43. package/dist/types/components/ui/button.d.ts.map +1 -1
  44. package/dist/types/components/ui/toast.d.ts +3 -3
  45. package/dist/types/components/ui/toast.d.ts.map +1 -1
  46. package/dist/types/external-modules.d.ts +38 -0
  47. package/dist/types/generated/shiki-bundle.d.ts +1 -0
  48. package/dist/types/generated/shiki-bundle.d.ts.map +1 -1
  49. package/dist/types/lib/ai/crypto.d.ts.map +1 -1
  50. package/dist/types/lib/config.d.ts +0 -4
  51. package/dist/types/lib/config.d.ts.map +1 -1
  52. package/dist/types/lib/export-utils.d.ts.map +1 -1
  53. package/dist/types/lib/frontmatter.d.ts +6 -0
  54. package/dist/types/lib/frontmatter.d.ts.map +1 -0
  55. package/dist/types/lib/rehype-toc.d.ts.map +1 -1
  56. package/dist/types/lib/search/search-index-plugin.d.ts.map +1 -1
  57. package/dist/types/lib/shiki-highlighter.d.ts.map +1 -1
  58. package/dist/types/mdast.d.ts +53 -0
  59. package/dist/use-toast-d9VPBjMn.js +98 -0
  60. package/dist/utils-Ct96Mtjw.js +8 -0
  61. package/package.json +23 -24
  62. package/dist/AISettingsPanel-KzfonkeY.js +0 -1171
  63. package/dist/DocsApp-DTFpyBOl.js +0 -35170
  64. package/dist/GlobalContextMenu-hGNTKw3S.js +0 -210
  65. package/dist/MdxContent-B664V_Hk.js +0 -812
  66. package/dist/MdxContent.lazy-DsQt7MZQ.js +0 -1512
  67. package/dist/SearchDialog-Cfam5kUW.js +0 -406
  68. package/dist/SearchRuntime-Dk265vam.js +0 -31
  69. package/dist/context-menu-CBGG4zJl.js +0 -140
  70. package/dist/index-ByXnCzVt.js +0 -12
@@ -0,0 +1,403 @@
1
+ import { t as e } from "./utils-Ct96Mtjw.js";
2
+ import { l as t, r as n, t as r, u as i } from "./dialog-DQ6nkP0y.js";
3
+ import { createContext as a, forwardRef as o, useCallback as s, useContext as c, useEffect as l, useRef as u, useState as d } from "react";
4
+ import { FileText as f, Loader2 as p, Search as m, X as h } from "lucide-react";
5
+ import { useNavigate as g } from "react-router-dom";
6
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
7
+ import y from "flexsearch";
8
+ //#region src/lib/search/runtime/search-engine.ts
9
+ var b = 20, x = class {
10
+ index;
11
+ sections = /* @__PURE__ */ new Map();
12
+ initialized = !1;
13
+ constructor() {
14
+ this.index = new y.Index({
15
+ tokenize: "full",
16
+ resolution: 9,
17
+ cache: 100
18
+ });
19
+ }
20
+ init(e) {
21
+ this.clear();
22
+ for (let t of e.sections) this.sections.set(t.id, t), this.index.add(t.id, t.tokens.join(" "));
23
+ this.initialized = !0;
24
+ }
25
+ clear() {
26
+ this.sections.clear(), this.index = new y.Index({
27
+ tokenize: "full",
28
+ resolution: 9,
29
+ cache: 100
30
+ }), this.initialized = !1;
31
+ }
32
+ search(e) {
33
+ if (!this.initialized) return [];
34
+ let { query: t, limit: n = b } = e, r = t.toLowerCase().trim();
35
+ return r ? this.index.search(r, { limit: n }).map((e) => {
36
+ let t = this.sections.get(e);
37
+ return t ? {
38
+ id: t.id,
39
+ pageTitle: t.pageTitle,
40
+ sectionTitle: t.sectionTitle,
41
+ snippet: this.generateSnippet(t.content, r),
42
+ url: t.url,
43
+ score: 1
44
+ } : null;
45
+ }).filter((e) => e !== null) : [];
46
+ }
47
+ generateSnippet(e, t) {
48
+ if (!e) return "";
49
+ let n = e.toLowerCase(), r = t.split(/\s+/).filter(Boolean), i = 0;
50
+ for (let e of r) {
51
+ let t = n.indexOf(e);
52
+ if (t !== -1) {
53
+ i = t;
54
+ break;
55
+ }
56
+ }
57
+ let a = Math.max(0, i - 30), o = Math.min(e.length, a + 150), s = e.slice(a, o);
58
+ return a > 0 && (s = "..." + s), o < e.length && (s += "..."), s;
59
+ }
60
+ isInitialized() {
61
+ return this.initialized;
62
+ }
63
+ getSectionCount() {
64
+ return this.sections.size;
65
+ }
66
+ }, S = new x();
67
+ //#endregion
68
+ //#region src/lib/search/runtime/highlighter.ts
69
+ function C(e, t, n = "mark") {
70
+ if (!e || t.length === 0) return e;
71
+ let r = e.toLowerCase(), i = [];
72
+ for (let e of t) {
73
+ let t = e.toLowerCase(), n = 0;
74
+ for (;;) {
75
+ let a = r.indexOf(t, n);
76
+ if (a === -1) break;
77
+ i.push({
78
+ start: a,
79
+ end: a + e.length
80
+ }), n = a + 1;
81
+ }
82
+ }
83
+ if (i.length === 0) return e;
84
+ let a = w(i), o = "", s = 0;
85
+ for (let t of a) o += e.slice(s, t.start), o += `<${n}>`, o += e.slice(t.start, t.end), o += `</${n}>`, s = t.end;
86
+ return o += e.slice(s), o;
87
+ }
88
+ function w(e) {
89
+ if (e.length === 0) return [];
90
+ let t = [...e].sort((e, t) => e.start - t.start), n = [t[0]];
91
+ for (let e = 1; e < t.length; e++) {
92
+ let r = t[e], i = n[n.length - 1];
93
+ r.start <= i.end ? i.end = Math.max(i.end, r.end) : n.push(r);
94
+ }
95
+ return n;
96
+ }
97
+ function T(e, t, n = {}) {
98
+ let { maxLength: r = 120, contextBefore: i = 30, contextAfter: a = 80 } = n;
99
+ if (!e) return "";
100
+ if (t.length === 0) return e.slice(0, r) + (e.length > r ? "..." : "");
101
+ let o = e.toLowerCase(), s = -1, c = "";
102
+ for (let e of t) {
103
+ let t = o.indexOf(e.toLowerCase());
104
+ t !== -1 && (s === -1 || t < s) && (s = t, c = e);
105
+ }
106
+ if (s === -1) return e.slice(0, r) + (e.length > r ? "..." : "");
107
+ let l = Math.max(0, s - i), u = Math.min(e.length, s + c.length + a), d = e.slice(l, u);
108
+ return l > 0 && (d = "..." + d), u < e.length && (d += "..."), d;
109
+ }
110
+ function E(e, t, n = {}) {
111
+ return C(T(e, t, n), t, n.tag || "mark");
112
+ }
113
+ function D(e) {
114
+ return e.toLowerCase().split(/[\s\-_]+/).filter((e) => e.length > 0);
115
+ }
116
+ //#endregion
117
+ //#region src/components/search/SearchProvider.tsx
118
+ var O = a(null);
119
+ function k() {
120
+ let e = c(O);
121
+ if (!e) throw Error("useSearch must be used within a SearchProvider");
122
+ return e;
123
+ }
124
+ function A({ children: e, lang: t = "zh-cn", enabled: n = !0, maxResults: r = 20, enableHotkeys: i = !0 }) {
125
+ let [a, o] = d(!1), [c, f] = d(!1), [p, m] = d(null), [h, g] = d([]), [v, y] = d(""), [b, S] = d(!1), C = u(null), w = u(null), T = u(null), E = u(!1);
126
+ l(() => (C.current = new x(), () => {
127
+ C.current &&= (C.current.clear(), null);
128
+ }), []), l(() => {
129
+ T.current && T.current !== t && (o(!1), T.current = null, g([]), y(""), C.current && C.current.clear());
130
+ }, [t]);
131
+ let D = s(async () => {
132
+ if (!(a && T.current === t || E.current || !n)) {
133
+ E.current = !0, f(!0), m(null);
134
+ try {
135
+ let e = await fetch(`/search-index-${t}.json`);
136
+ if (!e.ok) throw Error(`Failed to load search index: ${e.status}`);
137
+ let n = await e.json();
138
+ C.current && C.current.init(n), T.current = t, o(!0);
139
+ } catch (e) {
140
+ m(e instanceof Error ? e.message : "Failed to load search index");
141
+ } finally {
142
+ f(!1), E.current = !1;
143
+ }
144
+ }
145
+ }, [
146
+ t,
147
+ a,
148
+ n
149
+ ]), k = s(async (e) => {
150
+ if (!e.trim()) return g([]), [];
151
+ C.current?.isInitialized() || await D();
152
+ let n = {
153
+ query: e,
154
+ lang: t,
155
+ limit: r
156
+ };
157
+ if (C.current) {
158
+ let e = C.current.search(n);
159
+ return g(e), e;
160
+ }
161
+ return [];
162
+ }, [
163
+ t,
164
+ D,
165
+ r
166
+ ]);
167
+ l(() => {
168
+ if (!v.trim()) {
169
+ g([]);
170
+ return;
171
+ }
172
+ return w.current && clearTimeout(w.current), w.current = setTimeout(() => {
173
+ k(v);
174
+ }, 150), () => {
175
+ w.current && clearTimeout(w.current);
176
+ };
177
+ }, [v, k]), l(() => {
178
+ b && !a && !E.current && D();
179
+ }, [
180
+ b,
181
+ a,
182
+ D
183
+ ]), l(() => {
184
+ if (!i) return;
185
+ let e = (e) => {
186
+ (e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" && (e.preventDefault(), S((e) => !e)), e.key === "Escape" && b && S(!1);
187
+ };
188
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
189
+ }, [i, b]);
190
+ let A = {
191
+ isLoaded: a,
192
+ isLoading: c,
193
+ error: p,
194
+ search: k,
195
+ results: h,
196
+ query: v,
197
+ setQuery: y,
198
+ open: b,
199
+ setOpen: S,
200
+ loadIndex: D
201
+ };
202
+ return /* @__PURE__ */ _(O.Provider, {
203
+ value: A,
204
+ children: e
205
+ });
206
+ }
207
+ //#endregion
208
+ //#region src/components/search/SearchInput.tsx
209
+ var j = o(({ value: t, onChange: n, onClear: r, className: i, placeholder: a, ...o }, s) => /* @__PURE__ */ v("div", {
210
+ className: "flex items-center gap-3 px-4 py-3 border-b",
211
+ children: [
212
+ /* @__PURE__ */ _(m, { className: "h-5 w-5 shrink-0 text-muted-foreground" }),
213
+ /* @__PURE__ */ _("input", {
214
+ ref: s,
215
+ type: "text",
216
+ value: t,
217
+ onChange: (e) => n(e.target.value),
218
+ placeholder: a || "搜索文档...",
219
+ className: e("flex-1 bg-transparent text-base outline-none placeholder:text-muted-foreground", i),
220
+ ...o
221
+ }),
222
+ t && r && /* @__PURE__ */ _("button", {
223
+ type: "button",
224
+ onClick: r,
225
+ className: "p-1 rounded hover:bg-muted transition-colors",
226
+ children: /* @__PURE__ */ _(h, { className: "h-4 w-4 text-muted-foreground" })
227
+ })
228
+ ]
229
+ }));
230
+ j.displayName = "SearchInput";
231
+ //#endregion
232
+ //#region src/components/search/SearchItem.tsx
233
+ var M = o(({ result: t, query: n, isSelected: r, onClick: i, onMouseEnter: a }, o) => {
234
+ let s = D(n), c = E(t.sectionTitle, s, {
235
+ maxLength: 100,
236
+ contextBefore: 0,
237
+ contextAfter: 0
238
+ }), l = E(t.snippet, s, { maxLength: 150 });
239
+ return /* @__PURE__ */ v("div", {
240
+ ref: o,
241
+ onClick: i,
242
+ onMouseEnter: a,
243
+ className: e("flex items-start gap-3 px-4 py-3 cursor-pointer transition-all duration-200 border-l-2 rounded-r-md mx-2", "hover:shadow-sm hover:translate-x-0.5", r ? "bg-accent/80 border-l-primary shadow-md scale-[1.02] translate-x-1" : "hover:bg-muted/50 border-l-transparent"),
244
+ children: [/* @__PURE__ */ _(f, { className: "h-4 w-4 mt-0.5 shrink-0 text-muted-foreground" }), /* @__PURE__ */ v("div", {
245
+ className: "flex-1 min-w-0",
246
+ children: [
247
+ /* @__PURE__ */ _("div", {
248
+ className: "flex items-center gap-2",
249
+ children: /* @__PURE__ */ _("span", {
250
+ className: "font-medium text-sm truncate",
251
+ dangerouslySetInnerHTML: { __html: c }
252
+ })
253
+ }),
254
+ t.pageTitle !== t.sectionTitle && /* @__PURE__ */ _("div", {
255
+ className: "text-xs text-muted-foreground truncate mt-0.5",
256
+ children: t.pageTitle
257
+ }),
258
+ l && /* @__PURE__ */ _("div", {
259
+ className: "text-xs text-muted-foreground mt-1 line-clamp-2",
260
+ dangerouslySetInnerHTML: { __html: l }
261
+ })
262
+ ]
263
+ })]
264
+ });
265
+ });
266
+ M.displayName = "SearchItem";
267
+ //#endregion
268
+ //#region src/components/search/SearchResults.tsx
269
+ function N({ results: e, query: t, onSelect: n }) {
270
+ let [r, i] = d(0), a = u(null), o = u(null);
271
+ l(() => {
272
+ i(0);
273
+ }, [e]), l(() => {
274
+ if (o.current && a.current) {
275
+ let e = a.current, t = o.current, n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
276
+ (r.bottom > n.bottom || r.top < n.top) && t.scrollIntoView({ block: "nearest" });
277
+ }
278
+ }, [r]), l(() => {
279
+ let t = (t) => {
280
+ if (t.key === "ArrowDown") t.preventDefault(), i((t) => Math.min(t + 1, e.length - 1));
281
+ else if (t.key === "ArrowUp") t.preventDefault(), i((e) => Math.max(e - 1, 0));
282
+ else if (t.key === "Enter") {
283
+ t.preventDefault();
284
+ let i = e[r];
285
+ i && n(i.url);
286
+ }
287
+ };
288
+ return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
289
+ }, [
290
+ e,
291
+ r,
292
+ n
293
+ ]);
294
+ let s = (e) => {
295
+ n(e.url);
296
+ };
297
+ return /* @__PURE__ */ _("div", {
298
+ ref: a,
299
+ className: "py-2",
300
+ children: e.map((e, n) => /* @__PURE__ */ _(M, {
301
+ result: e,
302
+ query: t,
303
+ isSelected: n === r,
304
+ ref: n === r ? o : null,
305
+ onClick: () => s(e),
306
+ onMouseEnter: () => i(n)
307
+ }, e.id))
308
+ });
309
+ }
310
+ //#endregion
311
+ //#region src/components/search/SearchDialog.tsx
312
+ function P({ placeholder: e }) {
313
+ let { open: a, setOpen: o, query: s, setQuery: c, results: d, isLoading: f, error: m, isLoaded: h } = k(), y = g(), b = u(null);
314
+ return l(() => {
315
+ a && b.current && setTimeout(() => b.current?.focus(), 0);
316
+ }, [a]), l(() => {
317
+ a || c("");
318
+ }, [a, c]), /* @__PURE__ */ _(r, {
319
+ open: a,
320
+ onOpenChange: (e) => {
321
+ o(e);
322
+ },
323
+ children: /* @__PURE__ */ v(n, {
324
+ className: "overflow-hidden p-0 shadow-lg max-w-xl top-[15%] translate-y-0",
325
+ showCloseButton: !1,
326
+ children: [
327
+ /* @__PURE__ */ _(i, { children: "搜索文档" }),
328
+ /* @__PURE__ */ _(t, { children: "搜索文档内容" }),
329
+ /* @__PURE__ */ v("div", {
330
+ className: "flex flex-col",
331
+ children: [
332
+ /* @__PURE__ */ _(j, {
333
+ ref: b,
334
+ value: s,
335
+ onChange: c,
336
+ placeholder: e,
337
+ onClear: () => c("")
338
+ }),
339
+ /* @__PURE__ */ v("div", {
340
+ className: "max-h-[60vh] overflow-y-auto border-t",
341
+ children: [
342
+ f && !h && /* @__PURE__ */ _("div", {
343
+ className: "flex items-center justify-center py-12",
344
+ children: /* @__PURE__ */ _(p, { className: "h-6 w-6 animate-spin text-muted-foreground" })
345
+ }),
346
+ m && /* @__PURE__ */ _("div", {
347
+ className: "px-4 py-8 text-center text-sm text-muted-foreground",
348
+ children: m
349
+ }),
350
+ h && !f && !s && /* @__PURE__ */ _("div", {
351
+ className: "px-4 py-8 text-center text-sm text-muted-foreground",
352
+ children: "输入关键词搜索文档"
353
+ }),
354
+ h && s && d.length === 0 && !f && /* @__PURE__ */ v("div", {
355
+ className: "px-4 py-8 text-center text-sm text-muted-foreground",
356
+ children: [
357
+ "未找到 \"",
358
+ s,
359
+ "\" 相关结果"
360
+ ]
361
+ }),
362
+ d.length > 0 && /* @__PURE__ */ _(N, {
363
+ results: d,
364
+ query: s,
365
+ onSelect: (e) => {
366
+ y(e), o(!1);
367
+ }
368
+ })
369
+ ]
370
+ }),
371
+ /* @__PURE__ */ v("div", {
372
+ className: "flex items-center justify-between border-t px-4 py-2 text-xs text-muted-foreground bg-muted/30",
373
+ children: [/* @__PURE__ */ v("div", {
374
+ className: "flex items-center gap-4",
375
+ children: [/* @__PURE__ */ v("span", {
376
+ className: "flex items-center gap-1",
377
+ children: [/* @__PURE__ */ _("kbd", {
378
+ className: "px-1.5 py-0.5 rounded bg-muted border text-[10px]",
379
+ children: "↵"
380
+ }), "选择"]
381
+ }), /* @__PURE__ */ v("span", {
382
+ className: "flex items-center gap-1",
383
+ children: [/* @__PURE__ */ _("kbd", {
384
+ className: "px-1.5 py-0.5 rounded bg-muted border text-[10px]",
385
+ children: "↑↓"
386
+ }), "导航"]
387
+ })]
388
+ }), /* @__PURE__ */ v("span", {
389
+ className: "flex items-center gap-1",
390
+ children: [/* @__PURE__ */ _("kbd", {
391
+ className: "px-1.5 py-0.5 rounded bg-muted border text-[10px]",
392
+ children: "esc"
393
+ }), "关闭"]
394
+ })]
395
+ })
396
+ ]
397
+ })
398
+ ]
399
+ })
400
+ });
401
+ }
402
+ //#endregion
403
+ export { A as a, E as c, x as d, S as f, j as i, C as l, N as n, k as o, M as r, T as s, P as t, D as u };
@@ -0,0 +1,23 @@
1
+ import { a as e, o as t, t as n } from "./SearchDialog-tUSKKsxW.js";
2
+ import { useEffect as r } from "react";
3
+ import { jsx as i } from "react/jsx-runtime";
4
+ //#region src/components/search/SearchRuntime.tsx
5
+ function a({ openSignal: e, placeholder: a }) {
6
+ let { setOpen: o } = t();
7
+ return r(() => {
8
+ e > 0 && o(!0);
9
+ }, [e, o]), /* @__PURE__ */ i(n, { placeholder: a });
10
+ }
11
+ function o({ lang: t, maxResults: n, placeholder: r, openSignal: o }) {
12
+ return /* @__PURE__ */ i(e, {
13
+ lang: t,
14
+ maxResults: n,
15
+ enableHotkeys: !1,
16
+ children: /* @__PURE__ */ i(a, {
17
+ openSignal: o,
18
+ placeholder: r
19
+ })
20
+ });
21
+ }
22
+ //#endregion
23
+ export { o as default };
@@ -0,0 +1,73 @@
1
+ import { t as e } from "./utils-Ct96Mtjw.js";
2
+ import * as t from "react";
3
+ import { CheckIcon as n, ChevronRightIcon as r, CircleIcon as i } from "lucide-react";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import * as s from "@radix-ui/react-context-menu";
6
+ //#region src/components/ui/context-menu.tsx
7
+ var c = s.Root, l = s.Trigger, u = s.Group;
8
+ s.Portal;
9
+ var d = s.Sub, f = s.RadioGroup, p = t.forwardRef(({ className: t, inset: n, children: i, ...c }, l) => /* @__PURE__ */ o(s.SubTrigger, {
10
+ ref: l,
11
+ className: e("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", n && "pl-8", t),
12
+ ...c,
13
+ children: [i, /* @__PURE__ */ a(r, { className: "ml-auto h-4 w-4" })]
14
+ }));
15
+ p.displayName = s.SubTrigger.displayName;
16
+ var m = t.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ a(s.SubContent, {
17
+ ref: r,
18
+ className: e("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", t),
19
+ ...n
20
+ }));
21
+ m.displayName = s.SubContent.displayName;
22
+ var h = t.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ a(s.Portal, { children: /* @__PURE__ */ a(s.Content, {
23
+ ref: r,
24
+ className: e("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", t),
25
+ ...n
26
+ }) }));
27
+ h.displayName = s.Content.displayName;
28
+ var g = t.forwardRef(({ className: t, inset: n, ...r }, i) => /* @__PURE__ */ a(s.Item, {
29
+ ref: i,
30
+ className: e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", n && "pl-8", t),
31
+ ...r
32
+ }));
33
+ g.displayName = s.Item.displayName;
34
+ var _ = t.forwardRef(({ className: t, children: r, checked: i, ...c }, l) => /* @__PURE__ */ o(s.CheckboxItem, {
35
+ ref: l,
36
+ className: e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", t),
37
+ checked: i,
38
+ ...c,
39
+ children: [/* @__PURE__ */ a("span", {
40
+ className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
41
+ children: /* @__PURE__ */ a(s.ItemIndicator, { children: /* @__PURE__ */ a(n, { className: "h-4 w-4" }) })
42
+ }), r]
43
+ }));
44
+ _.displayName = s.CheckboxItem.displayName;
45
+ var v = t.forwardRef(({ className: t, children: n, ...r }, c) => /* @__PURE__ */ o(s.RadioItem, {
46
+ ref: c,
47
+ className: e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", t),
48
+ ...r,
49
+ children: [/* @__PURE__ */ a("span", {
50
+ className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
51
+ children: /* @__PURE__ */ a(s.ItemIndicator, { children: /* @__PURE__ */ a(i, { className: "h-2 w-2 fill-current" }) })
52
+ }), n]
53
+ }));
54
+ v.displayName = s.RadioItem.displayName;
55
+ var y = t.forwardRef(({ className: t, inset: n, ...r }, i) => /* @__PURE__ */ a(s.Label, {
56
+ ref: i,
57
+ className: e("px-2 py-1.5 text-xs font-semibold text-muted-foreground", n && "pl-8", t),
58
+ ...r
59
+ }));
60
+ y.displayName = s.Label.displayName;
61
+ var b = t.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ a(s.Separator, {
62
+ ref: r,
63
+ className: e("-mx-1 my-1 h-px bg-muted", t),
64
+ ...n
65
+ }));
66
+ b.displayName = s.Separator.displayName;
67
+ var x = ({ className: t, ...n }) => /* @__PURE__ */ a("span", {
68
+ className: e("ml-auto text-xs tracking-widest opacity-60", t),
69
+ ...n
70
+ });
71
+ x.displayName = "ContextMenuShortcut";
72
+ //#endregion
73
+ export { g as a, v as c, d, m as f, u as i, b as l, l as m, _ as n, y as o, p, h as r, f as s, c as t, x as u };
@@ -0,0 +1,97 @@
1
+ import { t as e } from "./utils-Ct96Mtjw.js";
2
+ import "react";
3
+ import { XIcon as t } from "lucide-react";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ import * as i from "@radix-ui/react-dialog";
6
+ //#region src/components/ui/dialog.tsx
7
+ function a({ ...e }) {
8
+ return /* @__PURE__ */ n(i.Root, {
9
+ "data-slot": "dialog",
10
+ ...e
11
+ });
12
+ }
13
+ function o({ ...e }) {
14
+ return /* @__PURE__ */ n(i.Trigger, {
15
+ "data-slot": "dialog-trigger",
16
+ ...e
17
+ });
18
+ }
19
+ function s({ ...e }) {
20
+ return /* @__PURE__ */ n(i.Portal, {
21
+ "data-slot": "dialog-portal",
22
+ ...e
23
+ });
24
+ }
25
+ function c({ ...e }) {
26
+ return /* @__PURE__ */ n(i.Close, {
27
+ "data-slot": "dialog-close",
28
+ ...e
29
+ });
30
+ }
31
+ function l({ className: t, ...r }) {
32
+ return /* @__PURE__ */ n(i.Overlay, {
33
+ "data-slot": "dialog-overlay",
34
+ className: e("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", t),
35
+ ...r
36
+ });
37
+ }
38
+ function u({ className: a, children: o, showCloseButton: c = !0, ...u }) {
39
+ return /* @__PURE__ */ r(s, {
40
+ "data-slot": "dialog-portal",
41
+ children: [/* @__PURE__ */ n(l, {}), /* @__PURE__ */ r(i.Content, {
42
+ "data-slot": "dialog-content",
43
+ className: e("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", a),
44
+ ...u,
45
+ children: [o, c && /* @__PURE__ */ r(i.Close, {
46
+ "data-slot": "dialog-close",
47
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
48
+ children: [/* @__PURE__ */ n(t, {}), /* @__PURE__ */ n("span", {
49
+ className: "sr-only",
50
+ children: "Close"
51
+ })]
52
+ })]
53
+ })]
54
+ });
55
+ }
56
+ function d({ className: t, ...r }) {
57
+ return /* @__PURE__ */ n("div", {
58
+ "data-slot": "dialog-header",
59
+ className: e("flex flex-col gap-2 text-center sm:text-left", t),
60
+ ...r
61
+ });
62
+ }
63
+ function f({ className: t, ...r }) {
64
+ return /* @__PURE__ */ n("div", {
65
+ "data-slot": "dialog-footer",
66
+ className: e("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", t),
67
+ ...r
68
+ });
69
+ }
70
+ function p({ className: t, ...r }) {
71
+ return /* @__PURE__ */ n(i.Title, {
72
+ "data-slot": "dialog-title",
73
+ className: e("text-lg leading-none font-semibold", t),
74
+ ...r
75
+ });
76
+ }
77
+ function m({ className: t, ...r }) {
78
+ return /* @__PURE__ */ n(i.Description, {
79
+ "data-slot": "dialog-description",
80
+ className: e("text-muted-foreground text-sm", t),
81
+ ...r
82
+ });
83
+ }
84
+ function h({ children: e = "Dialog" }) {
85
+ return /* @__PURE__ */ n(i.Title, {
86
+ className: "sr-only",
87
+ children: e
88
+ });
89
+ }
90
+ function g({ children: e = "Dialog content" }) {
91
+ return /* @__PURE__ */ n(i.Description, {
92
+ className: "sr-only",
93
+ children: e
94
+ });
95
+ }
96
+ //#endregion
97
+ export { f as a, o as c, m as i, g as l, c as n, d as o, u as r, p as s, a as t, h as u };
@@ -0,0 +1 @@
1
+ export * from "./types/docs-app"
@@ -1,10 +1,8 @@
1
- import { p as t, a as o } from "./DocsApp-DTFpyBOl.js";
2
- import { D as s } from "./DocsApp-DTFpyBOl.js";
3
- let e = !1;
4
- function p() {
5
- e || (e = !0, t(), o());
1
+ import { c as e, n as t, t as n } from "./DocsApp-BBNDiw8A.js";
2
+ //#region src/docs-app.ts
3
+ var r = !1;
4
+ function i() {
5
+ r || (r = !0, t(), e());
6
6
  }
7
- export {
8
- s as DocsApp,
9
- p as preloadDocsRuntime
10
- };
7
+ //#endregion
8
+ export { n as DocsApp, i as preloadDocsRuntime };