@suzumiyaaoba/mdxr 0.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.
Files changed (236) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/dist/cli.d.mts +1 -0
  4. package/dist/cli.mjs +2902 -0
  5. package/dist/components.d.mts +791 -0
  6. package/dist/components.mjs +2 -0
  7. package/dist/config-SI9IyFiC.mjs +184 -0
  8. package/dist/doc-context-CEqzMYKv.d.mts +568 -0
  9. package/dist/index.d.mts +20 -0
  10. package/dist/index.mjs +4 -0
  11. package/dist/ui-GKFD0mx5.mjs +15986 -0
  12. package/package.json +131 -0
  13. package/skill/SKILL.md +49 -0
  14. package/skill/references/components/charts.md +172 -0
  15. package/skill/references/components/document.md +98 -0
  16. package/skill/references/components/forms.md +35 -0
  17. package/skill/references/components/investigation.md +198 -0
  18. package/skill/references/components/layout.md +68 -0
  19. package/skill/references/components/output.md +158 -0
  20. package/skill/references/components/planning.md +155 -0
  21. package/skill/references/components/reports.md +252 -0
  22. package/skill/references/components/shadcn.md +19 -0
  23. package/skill/references/components.md +186 -0
  24. package/skill/references/extending.md +48 -0
  25. package/src/ask-sheet.ts +40 -0
  26. package/src/assets/css.ts +392 -0
  27. package/src/assets/scripts.ts +78 -0
  28. package/src/catalog.ts +287 -0
  29. package/src/cli.ts +178 -0
  30. package/src/client/doc-events.ts +1108 -0
  31. package/src/client/entry.ts +27 -0
  32. package/src/client-js.ts +47 -0
  33. package/src/component-map.ts +47 -0
  34. package/src/components/ui/accordion.tsx +77 -0
  35. package/src/components/ui/alert-dialog.tsx +185 -0
  36. package/src/components/ui/alert.tsx +76 -0
  37. package/src/components/ui/aspect-ratio.tsx +22 -0
  38. package/src/components/ui/attachment.tsx +208 -0
  39. package/src/components/ui/avatar.tsx +106 -0
  40. package/src/components/ui/badge.tsx +52 -0
  41. package/src/components/ui/breadcrumb.tsx +121 -0
  42. package/src/components/ui/bubble.tsx +128 -0
  43. package/src/components/ui/button-group.tsx +88 -0
  44. package/src/components/ui/button.tsx +58 -0
  45. package/src/components/ui/calendar.tsx +226 -0
  46. package/src/components/ui/card.tsx +102 -0
  47. package/src/components/ui/carousel.tsx +246 -0
  48. package/src/components/ui/chart.tsx +379 -0
  49. package/src/components/ui/checkbox.tsx +27 -0
  50. package/src/components/ui/collapsible.tsx +19 -0
  51. package/src/components/ui/combobox.tsx +298 -0
  52. package/src/components/ui/command.tsx +193 -0
  53. package/src/components/ui/context-menu.tsx +271 -0
  54. package/src/components/ui/dialog.tsx +159 -0
  55. package/src/components/ui/direction.tsx +4 -0
  56. package/src/components/ui/drawer.tsx +227 -0
  57. package/src/components/ui/dropdown-menu.tsx +269 -0
  58. package/src/components/ui/empty.tsx +104 -0
  59. package/src/components/ui/field.tsx +237 -0
  60. package/src/components/ui/fieldset.tsx +32 -0
  61. package/src/components/ui/frame.tsx +87 -0
  62. package/src/components/ui/hover-card.tsx +50 -0
  63. package/src/components/ui/input-group.tsx +159 -0
  64. package/src/components/ui/input-otp.tsx +83 -0
  65. package/src/components/ui/input.tsx +19 -0
  66. package/src/components/ui/item.tsx +202 -0
  67. package/src/components/ui/kbd.tsx +26 -0
  68. package/src/components/ui/label.tsx +19 -0
  69. package/src/components/ui/marker.tsx +71 -0
  70. package/src/components/ui/menubar.tsx +284 -0
  71. package/src/components/ui/message-scroller.tsx +128 -0
  72. package/src/components/ui/message.tsx +91 -0
  73. package/src/components/ui/meter.tsx +80 -0
  74. package/src/components/ui/native-select.tsx +64 -0
  75. package/src/components/ui/navigation-menu.tsx +170 -0
  76. package/src/components/ui/pagination.tsx +133 -0
  77. package/src/components/ui/popover.tsx +87 -0
  78. package/src/components/ui/progress.tsx +82 -0
  79. package/src/components/ui/questionnaire.tsx +328 -0
  80. package/src/components/ui/radio-group.tsx +35 -0
  81. package/src/components/ui/resizable.tsx +49 -0
  82. package/src/components/ui/scroll-area.tsx +50 -0
  83. package/src/components/ui/select.tsx +201 -0
  84. package/src/components/ui/separator.tsx +22 -0
  85. package/src/components/ui/sheet.tsx +135 -0
  86. package/src/components/ui/sidebar.tsx +730 -0
  87. package/src/components/ui/skeleton.tsx +13 -0
  88. package/src/components/ui/slider.tsx +51 -0
  89. package/src/components/ui/spinner.tsx +16 -0
  90. package/src/components/ui/switch.tsx +31 -0
  91. package/src/components/ui/table.tsx +113 -0
  92. package/src/components/ui/tabs.tsx +82 -0
  93. package/src/components/ui/textarea.tsx +17 -0
  94. package/src/components/ui/toast.tsx +229 -0
  95. package/src/components/ui/toggle-group.tsx +87 -0
  96. package/src/components/ui/toggle.tsx +43 -0
  97. package/src/components/ui/tooltip.tsx +65 -0
  98. package/src/components.ts +78 -0
  99. package/src/config.ts +56 -0
  100. package/src/define.ts +122 -0
  101. package/src/doc-context.ts +20 -0
  102. package/src/editor.ts +94 -0
  103. package/src/format-error.ts +78 -0
  104. package/src/guards.ts +84 -0
  105. package/src/hooks/use-mobile.ts +21 -0
  106. package/src/html.ts +91 -0
  107. package/src/hydrate/export-index.ts +232 -0
  108. package/src/hydrate/import-scan.ts +169 -0
  109. package/src/hydrate/plugins.ts +118 -0
  110. package/src/hydrate/runtime-module.ts +145 -0
  111. package/src/hydrate-runtime.ts +67 -0
  112. package/src/hydrate.ts +147 -0
  113. package/src/index.ts +16 -0
  114. package/src/init.ts +57 -0
  115. package/src/langs.ts +148 -0
  116. package/src/lines.ts +53 -0
  117. package/src/load-user-module.ts +191 -0
  118. package/src/mdx.ts +248 -0
  119. package/src/paths.ts +36 -0
  120. package/src/rehype/shiki.ts +533 -0
  121. package/src/remark/alerts.ts +53 -0
  122. package/src/remark/ast.ts +96 -0
  123. package/src/remark/callouts.ts +25 -0
  124. package/src/remark/code-file.ts +85 -0
  125. package/src/remark/code-meta.ts +21 -0
  126. package/src/remark/directives.ts +170 -0
  127. package/src/remark/file-paths.ts +64 -0
  128. package/src/remark/headings.ts +131 -0
  129. package/src/remark/no-js.ts +40 -0
  130. package/src/render.ts +337 -0
  131. package/src/serve.ts +322 -0
  132. package/src/styles/globals.css +134 -0
  133. package/src/styles/shadcn.css +641 -0
  134. package/src/tailwind.ts +119 -0
  135. package/src/ui/approvals.tsx +76 -0
  136. package/src/ui/ask-question.tsx +386 -0
  137. package/src/ui/ask.tsx +206 -0
  138. package/src/ui/attrs.ts +51 -0
  139. package/src/ui/audit.tsx +139 -0
  140. package/src/ui/bar-chart.tsx +334 -0
  141. package/src/ui/benchmarks.tsx +143 -0
  142. package/src/ui/bits.tsx +537 -0
  143. package/src/ui/board.tsx +173 -0
  144. package/src/ui/bridge.tsx +207 -0
  145. package/src/ui/bumps.tsx +178 -0
  146. package/src/ui/callout.tsx +106 -0
  147. package/src/ui/changes.tsx +89 -0
  148. package/src/ui/chart-bits.tsx +52 -0
  149. package/src/ui/chart.ts +577 -0
  150. package/src/ui/checks.tsx +203 -0
  151. package/src/ui/child-index.tsx +44 -0
  152. package/src/ui/children.ts +43 -0
  153. package/src/ui/chips.tsx +49 -0
  154. package/src/ui/cmd.tsx +27 -0
  155. package/src/ui/columns.tsx +31 -0
  156. package/src/ui/comments.tsx +544 -0
  157. package/src/ui/compare.tsx +67 -0
  158. package/src/ui/decision.tsx +79 -0
  159. package/src/ui/deps.tsx +78 -0
  160. package/src/ui/details.tsx +43 -0
  161. package/src/ui/diff-parse.ts +307 -0
  162. package/src/ui/diff.tsx +458 -0
  163. package/src/ui/diffstat.tsx +58 -0
  164. package/src/ui/due.tsx +65 -0
  165. package/src/ui/effort.tsx +29 -0
  166. package/src/ui/endpoints.tsx +118 -0
  167. package/src/ui/envvars.tsx +96 -0
  168. package/src/ui/figure.tsx +37 -0
  169. package/src/ui/file-icon.ts +1020 -0
  170. package/src/ui/file-link.ts +32 -0
  171. package/src/ui/file-ref.tsx +39 -0
  172. package/src/ui/files.tsx +112 -0
  173. package/src/ui/findings.tsx +85 -0
  174. package/src/ui/flow.tsx +73 -0
  175. package/src/ui/funnel.tsx +121 -0
  176. package/src/ui/gantt.tsx +443 -0
  177. package/src/ui/gauges.tsx +135 -0
  178. package/src/ui/glossary.tsx +29 -0
  179. package/src/ui/graph-layout.ts +149 -0
  180. package/src/ui/graph-specs.tsx +102 -0
  181. package/src/ui/graph.tsx +278 -0
  182. package/src/ui/grid.tsx +119 -0
  183. package/src/ui/hypothesis.tsx +94 -0
  184. package/src/ui/icon.tsx +80 -0
  185. package/src/ui/incident.tsx +130 -0
  186. package/src/ui/index.ts +342 -0
  187. package/src/ui/ins-del.tsx +41 -0
  188. package/src/ui/json.tsx +190 -0
  189. package/src/ui/layout.ts +9 -0
  190. package/src/ui/line-chart.tsx +251 -0
  191. package/src/ui/matrix.tsx +208 -0
  192. package/src/ui/meta.tsx +73 -0
  193. package/src/ui/option.tsx +64 -0
  194. package/src/ui/owner.tsx +40 -0
  195. package/src/ui/packages.tsx +104 -0
  196. package/src/ui/pathway.tsx +96 -0
  197. package/src/ui/phase.tsx +41 -0
  198. package/src/ui/pie-chart.tsx +170 -0
  199. package/src/ui/plan.tsx +77 -0
  200. package/src/ui/pre.tsx +175 -0
  201. package/src/ui/priority.tsx +51 -0
  202. package/src/ui/props.tsx +77 -0
  203. package/src/ui/quadrant.tsx +172 -0
  204. package/src/ui/radar.tsx +200 -0
  205. package/src/ui/ref.tsx +160 -0
  206. package/src/ui/release.tsx +178 -0
  207. package/src/ui/req.tsx +42 -0
  208. package/src/ui/review.tsx +133 -0
  209. package/src/ui/risk.tsx +67 -0
  210. package/src/ui/sankey.tsx +287 -0
  211. package/src/ui/scatter.tsx +237 -0
  212. package/src/ui/schema.tsx +113 -0
  213. package/src/ui/score.tsx +105 -0
  214. package/src/ui/search.tsx +120 -0
  215. package/src/ui/series.tsx +38 -0
  216. package/src/ui/severity.tsx +69 -0
  217. package/src/ui/shadcn.tsx +216 -0
  218. package/src/ui/spark.tsx +86 -0
  219. package/src/ui/stack.tsx +57 -0
  220. package/src/ui/stats.tsx +63 -0
  221. package/src/ui/status-badge.tsx +66 -0
  222. package/src/ui/statuspage.tsx +238 -0
  223. package/src/ui/steps.tsx +74 -0
  224. package/src/ui/summary.tsx +41 -0
  225. package/src/ui/symbol-ref.tsx +73 -0
  226. package/src/ui/terminal.tsx +117 -0
  227. package/src/ui/tests.tsx +218 -0
  228. package/src/ui/timeline.tsx +63 -0
  229. package/src/ui/toc.tsx +56 -0
  230. package/src/ui/tones.ts +187 -0
  231. package/src/ui/trace.tsx +69 -0
  232. package/src/ui/tree.tsx +281 -0
  233. package/src/ui/treemap.tsx +128 -0
  234. package/src/ui/venn.tsx +258 -0
  235. package/src/ui/verdict.tsx +78 -0
  236. package/src/ui/waterfall.tsx +142 -0
@@ -0,0 +1,568 @@
1
+ import { GenericSchema, InferOutput } from "valibot";
2
+ import { ReactElement, ReactNode } from "react";
3
+ //#region src/define.d.ts
4
+ /** Metadata attached to a component for `mdxr catalog` and prop validation. */
5
+ interface ComponentMeta {
6
+ description?: string;
7
+ /** Valibot schema for props (MDX attributes arrive as strings; `children` is passed through). */
8
+ schema?: GenericSchema;
9
+ }
10
+ /** Props as received from a document: arbitrary attributes plus children. */
11
+ interface DocProps extends Record<string, unknown> {
12
+ children?: ReactNode;
13
+ }
14
+ /**
15
+ * A component usable in an mdxr document. Props are intentionally loose —
16
+ * documents are data, and prop validation happens via `defineComponent`
17
+ * schemas at render time. Only ever invoked by MDX/React.
18
+ */
19
+ type AnyComponent = ((props: DocProps) => ReactNode) & {
20
+ __mdxr?: ComponentMeta;
21
+ };
22
+ /** Name → component map passed to MDX's `components` prop. */
23
+ type ComponentMap = Record<string, AnyComponent>;
24
+ type MdxrComponent = AnyComponent;
25
+ type PropsOf<S> = S extends GenericSchema ? InferOutput<S> : Record<string, unknown>;
26
+ /**
27
+ * Wrap a render function with prop validation + catalog metadata.
28
+ * Prop types are inferred from the valibot schema, so the render callback
29
+ * is fully typed. Validation failures surface as document errors so the
30
+ * agent can self-correct.
31
+ */
32
+ declare const defineComponent: <S extends GenericSchema | undefined = undefined>(meta: {
33
+ description?: string;
34
+ schema?: S;
35
+ }, render: (props: PropsOf<S> & {
36
+ children?: ReactNode;
37
+ }) => ReactElement | null) => MdxrComponent;
38
+ /** Extract all text from a React node tree (used for copy-to-clipboard payloads). */
39
+ declare const textOf: (node: unknown) => string;
40
+ //#endregion
41
+ //#region src/ui/approvals.d.ts
42
+ declare const Approvals: AnyComponent;
43
+ declare const Approval: AnyComponent;
44
+ //#endregion
45
+ //#region src/ui/ask-question.d.ts
46
+ /**
47
+ * `<Ask>` question internals: the `Choice`/`Question` components plus the
48
+ * field chrome (ChoiceField/ToggleField/FieldFrame/SelectControl/
49
+ * FieldControl) each question type renders through. All native controls —
50
+ * every type stays interactive in static HTML.
51
+ */
52
+ declare const QUESTION_TYPES: readonly ["choice", "multi", "select", "text", "textarea", "toggle"];
53
+ /**
54
+ * A single option inside a `<Question type="choice|multi|select">`. Renders
55
+ * as a radio card, a checkbox card, or an `<option>` depending on the
56
+ * question's type — all native controls, so they work in static HTML.
57
+ */
58
+ declare const Choice: AnyComponent;
59
+ /**
60
+ * One question inside `<Ask>`. `name` is the answer key; the Markdown answer
61
+ * sheet shows `label` (falling back to `name`). Types: `choice` (radio
62
+ * cards), `multi` (checkbox cards), `select` (dropdown), `text`, `textarea`,
63
+ * `toggle` (switch). Defaults to `choice` when it has <Choice> children,
64
+ * otherwise `text`.
65
+ */
66
+ declare const Question: AnyComponent;
67
+ //#endregion
68
+ //#region src/ui/ask.d.ts
69
+ /**
70
+ * A block of questions asking the reader for input — e.g. open decisions in
71
+ * a plan. Built on native form controls so it is interactive in static HTML.
72
+ * Answers are rendered live as a Markdown sheet (`- **label**: answer` lines
73
+ * under `# title`) in the output pane; "Copy answers" copies it to the
74
+ * clipboard and "Save .md" downloads it (nothing is submitted anywhere).
75
+ * `Choice`/`Question` and the per-type field chrome live in
76
+ * `ask-question.tsx`.
77
+ */
78
+ declare const Ask: AnyComponent;
79
+ //#endregion
80
+ //#region src/ui/audit.d.ts
81
+ declare const Vuln: AnyComponent;
82
+ declare const Audit: AnyComponent;
83
+ //#endregion
84
+ //#region src/ui/bar-chart.d.ts
85
+ declare const Bar: AnyComponent;
86
+ declare const BarChart: AnyComponent;
87
+ //#endregion
88
+ //#region src/ui/benchmarks.d.ts
89
+ declare const BENCH_BETTER: readonly ["higher", "lower"];
90
+ declare const Bench: AnyComponent;
91
+ declare const Benchmarks: AnyComponent;
92
+ //#endregion
93
+ //#region src/ui/bridge.d.ts
94
+ declare const Delta: AnyComponent;
95
+ declare const Bridge: AnyComponent;
96
+ //#endregion
97
+ //#region src/ui/bumps.d.ts
98
+ declare const BUMP_KINDS: readonly ["major", "minor", "patch"];
99
+ declare const Bump: AnyComponent;
100
+ declare const Bumps: AnyComponent;
101
+ //#endregion
102
+ //#region src/ui/callout.d.ts
103
+ declare const CALLOUT_KINDS: readonly ["note", "tip", "important", "warning", "caution", "danger", "decision", "goal", "nongoal", "question", "answer"];
104
+ declare const Callout: AnyComponent;
105
+ //#endregion
106
+ //#region src/ui/changes.d.ts
107
+ declare const CHANGE_KINDS: readonly ["add", "modify", "delete", "rename"];
108
+ declare const Changes: AnyComponent;
109
+ declare const Change: AnyComponent;
110
+ //#endregion
111
+ //#region src/ui/checks.d.ts
112
+ declare const CHECK_STATUSES: readonly ["pass", "fail", "running", "pending", "skip"];
113
+ declare const Check: AnyComponent;
114
+ declare const Checks: AnyComponent;
115
+ //#endregion
116
+ //#region src/ui/cmd.d.ts
117
+ declare const Cmd: AnyComponent;
118
+ //#endregion
119
+ //#region src/ui/columns.d.ts
120
+ declare const Columns: AnyComponent;
121
+ declare const Column: AnyComponent;
122
+ //#endregion
123
+ //#region src/ui/comments.d.ts
124
+ declare const Comments: AnyComponent;
125
+ //#endregion
126
+ //#region src/ui/board.d.ts
127
+ declare const BoardCard: AnyComponent;
128
+ declare const Lane: AnyComponent;
129
+ declare const Board: AnyComponent;
130
+ //#endregion
131
+ //#region src/ui/compare.d.ts
132
+ /**
133
+ * Before/After panels — wrap in `<Columns>` for side-by-side layout.
134
+ * `title` overrides the label (e.g. "Current" / "Proposed").
135
+ */
136
+ declare const Before: AnyComponent;
137
+ declare const After: AnyComponent;
138
+ //#endregion
139
+ //#region src/ui/decision.d.ts
140
+ declare const DECISION_STATUSES: readonly ["accepted", "deprecated", "proposed", "rejected", "superseded"];
141
+ declare const Decision: AnyComponent;
142
+ //#endregion
143
+ //#region src/ui/deps.d.ts
144
+ declare const DEP_KINDS: readonly ["calls", "extends", "implements", "imports", "reads", "writes"];
145
+ declare const Deps: AnyComponent;
146
+ declare const Dep: AnyComponent;
147
+ //#endregion
148
+ //#region src/ui/details.d.ts
149
+ /**
150
+ * Collapsible section on native `<details>` — opens/closes without client
151
+ * JS, unlike the shadcn Collapsible (which renders its initial state only).
152
+ */
153
+ declare const Details: AnyComponent;
154
+ //#endregion
155
+ //#region src/ui/diff-parse.d.ts
156
+ /**
157
+ * Unified-diff parsing. `parseDiff` turns patch text into per-file
158
+ * structures; `DiffView` (diff.tsx) renders them. Bare `+`/`-` line
159
+ * streams (no `diff --git`/`@@` headers) parse as a single anonymous file.
160
+ */
161
+ interface DiffRow {
162
+ kind: "add" | "ctx" | "del" | "note";
163
+ newLine?: number;
164
+ oldLine?: number;
165
+ text: string;
166
+ }
167
+ interface DiffHunk {
168
+ header?: string;
169
+ rows: DiffRow[];
170
+ }
171
+ interface FileDiff {
172
+ adds: number;
173
+ dels: number;
174
+ hunks: DiffHunk[];
175
+ meta: string[];
176
+ newPath?: string;
177
+ oldPath?: string;
178
+ raw: string[];
179
+ }
180
+ /** One highlighted token inside a rendered diff row. */
181
+ interface DiffHlToken {
182
+ /** Shiki style string — `--shiki-light`/`--shiki-dark` vars. */
183
+ s?: string;
184
+ /** Token text. */
185
+ t: string;
186
+ }
187
+ /**
188
+ * Per-file highlight payload parked on `<code data-diffhl>` by rehypeShiki:
189
+ * `[file][hunk][row]` → token list. `null` means "render the row's plain
190
+ * text" — note rows, or files whose language could not be resolved.
191
+ */
192
+ type DiffHl = (DiffHlToken[] | null)[][][];
193
+ /**
194
+ * Parse unified-diff text into per-file structures. `--- `/`+++ ` count as
195
+ * file headers only outside hunks (or when they form a `---`/`+++` pair —
196
+ * inside a hunk a lone `-`-prefixed line is content). Lines with no diff
197
+ * structure at all land in `meta`/`raw`; bare `+`/`-` streams without `@@`
198
+ * headers collect into an implicit hunk.
199
+ */
200
+ declare const parseDiff: (text: string) => FileDiff[];
201
+ //#endregion
202
+ //#region src/ui/diff.d.ts
203
+ /**
204
+ * A comment thread anchored to a rendered diff row (`<Comments>`). `range`
205
+ * selects rows by line number on `side` — the thread lands after the last
206
+ * matching row, like a GitHub review comment; a range matching no row (and
207
+ * a `range`-less, file-level comment) drops into the file card's tail.
208
+ */
209
+ interface DiffCommentSpec {
210
+ /** Path selecting the file card; absent targets the first file. */
211
+ file?: string;
212
+ /** Raw `lines` spec — thread anchors and markdown copy reuse it. */
213
+ lines?: string;
214
+ /** Rendered comment card(s) injected at the anchor. */
215
+ node: ReactNode;
216
+ /** Inclusive line range on `side`; `end` undefined reads "to EOF". */
217
+ range?: {
218
+ end?: number;
219
+ start: number;
220
+ };
221
+ /** Side whose line numbers anchor the comment — `new` (default) or `old`. */
222
+ side: "new" | "old";
223
+ }
224
+ /** Rendered by `Pre` for ```diff / ```patch fences. `hl` is the per-row
225
+ * language highlighting parsed from the fence's `data-diffhl` (absent when
226
+ * no grammar was resolved at compile time). */
227
+ declare const DiffView: ({ comments, filename, hl, text }: {
228
+ comments?: readonly DiffCommentSpec[];
229
+ filename?: string;
230
+ hl?: DiffHl;
231
+ text: string;
232
+ }) => ReactElement | null;
233
+ //#endregion
234
+ //#region src/ui/diffstat.d.ts
235
+ declare const DiffStat: AnyComponent;
236
+ //#endregion
237
+ //#region src/ui/due.d.ts
238
+ declare const Due: AnyComponent;
239
+ //#endregion
240
+ //#region src/ui/effort.d.ts
241
+ declare const EFFORT_SIZES: readonly ["xs", "s", "m", "l", "xl"];
242
+ declare const Effort: AnyComponent;
243
+ //#endregion
244
+ //#region src/ui/endpoints.d.ts
245
+ declare const HTTP_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"];
246
+ declare const Endpoint: AnyComponent;
247
+ declare const Endpoints: AnyComponent;
248
+ //#endregion
249
+ //#region src/ui/envvars.d.ts
250
+ declare const EnvVar: AnyComponent;
251
+ declare const EnvVars: AnyComponent;
252
+ //#endregion
253
+ //#region src/ui/figure.d.ts
254
+ declare const Figure: AnyComponent;
255
+ //#endregion
256
+ //#region src/ui/file-ref.d.ts
257
+ declare const FileRef: AnyComponent;
258
+ //#endregion
259
+ //#region src/ui/files.d.ts
260
+ declare const FILE_KINDS: readonly ["config", "core", "docs", "entry", "generated", "test", "types"];
261
+ declare const Files: AnyComponent;
262
+ declare const File: AnyComponent;
263
+ //#endregion
264
+ //#region src/ui/findings.d.ts
265
+ declare const CONFIDENCES: readonly ["confirmed", "inferred", "unverified"];
266
+ declare const Finding: AnyComponent;
267
+ declare const Findings: AnyComponent;
268
+ //#endregion
269
+ //#region src/ui/flow.d.ts
270
+ declare const Flow: AnyComponent;
271
+ declare const FlowStep: AnyComponent;
272
+ //#endregion
273
+ //#region src/ui/funnel.d.ts
274
+ declare const Stage: AnyComponent;
275
+ declare const Funnel: AnyComponent;
276
+ //#endregion
277
+ //#region src/ui/gantt.d.ts
278
+ declare const Task: AnyComponent;
279
+ declare const Milestone: AnyComponent;
280
+ declare const Gantt: AnyComponent;
281
+ //#endregion
282
+ //#region src/ui/gauges.d.ts
283
+ declare const GAUGE_TONES: readonly ["emerald", "amber", "red", "sky", "violet", "neutral"];
284
+ declare const Gauge: AnyComponent;
285
+ declare const Gauges: AnyComponent;
286
+ //#endregion
287
+ //#region src/ui/glossary.d.ts
288
+ declare const Glossary: AnyComponent;
289
+ declare const Term: AnyComponent;
290
+ //#endregion
291
+ //#region src/ui/graph-specs.d.ts
292
+ declare const Node: AnyComponent;
293
+ declare const Edge: AnyComponent;
294
+ //#endregion
295
+ //#region src/ui/graph.d.ts
296
+ declare const Graph: AnyComponent;
297
+ //#endregion
298
+ //#region src/ui/grid.d.ts
299
+ declare const Grid: AnyComponent;
300
+ declare const Cell: AnyComponent;
301
+ //#endregion
302
+ //#region src/ui/hypothesis.d.ts
303
+ declare const HYPOTHESIS_STATUSES: readonly ["supported", "refuted", "untested"];
304
+ declare const Hypothesis: AnyComponent;
305
+ declare const Hypotheses: AnyComponent;
306
+ //#endregion
307
+ //#region src/ui/icon.d.ts
308
+ /** Normalize `name` to `prefix:name`; bare names use the lucide set. */
309
+ declare const normalizeIconName: (name: string) => string;
310
+ /** True when `name` resolves to a registered icon. */
311
+ declare const hasIcon: (name: unknown) => name is string;
312
+ declare const Icon: AnyComponent;
313
+ //#endregion
314
+ //#region src/ui/incident.d.ts
315
+ declare const INCIDENT_STATUSES: readonly ["investigating", "identified", "monitoring", "resolved"];
316
+ declare const Incident: AnyComponent;
317
+ //#endregion
318
+ //#region src/ui/ins-del.d.ts
319
+ /**
320
+ * Inline word-level edits for prose/config changes — the inline counterpart
321
+ * of Before/After blocks and ```diff fences. Renders semantic <ins>/<del>.
322
+ */
323
+ declare const Ins: AnyComponent;
324
+ declare const Del: AnyComponent;
325
+ //#endregion
326
+ //#region src/ui/json.d.ts
327
+ declare const Json: AnyComponent;
328
+ //#endregion
329
+ //#region src/ui/line-chart.d.ts
330
+ declare const LineChart: AnyComponent;
331
+ //#endregion
332
+ //#region src/ui/matrix.d.ts
333
+ declare const Matrix: AnyComponent;
334
+ //#endregion
335
+ //#region src/ui/meta.d.ts
336
+ declare const MetaItem: AnyComponent;
337
+ declare const Meta: AnyComponent;
338
+ //#endregion
339
+ //#region src/ui/option.d.ts
340
+ declare const OPTION_STATUSES: readonly ["considered", "recommended", "rejected"];
341
+ declare const Option: AnyComponent;
342
+ //#endregion
343
+ //#region src/ui/owner.d.ts
344
+ declare const Owner: AnyComponent;
345
+ //#endregion
346
+ //#region src/ui/packages.d.ts
347
+ declare const PACKAGE_KINDS: readonly ["dep", "dev", "peer", "optional"];
348
+ declare const Package: AnyComponent;
349
+ declare const Packages: AnyComponent;
350
+ //#endregion
351
+ //#region src/ui/pathway.d.ts
352
+ declare const Stop: AnyComponent;
353
+ declare const Pathway: AnyComponent;
354
+ //#endregion
355
+ //#region src/ui/phase.d.ts
356
+ declare const Phase: AnyComponent;
357
+ //#endregion
358
+ //#region src/ui/pie-chart.d.ts
359
+ declare const Slice: AnyComponent;
360
+ declare const PieChart: AnyComponent;
361
+ //#endregion
362
+ //#region src/ui/quadrant.d.ts
363
+ declare const Pin: AnyComponent;
364
+ declare const Quadrant: AnyComponent;
365
+ //#endregion
366
+ //#region src/ui/plan.d.ts
367
+ interface PlanHeaderProps {
368
+ date?: string | undefined;
369
+ owner?: string | undefined;
370
+ status?: string | undefined;
371
+ title?: string | undefined;
372
+ updated?: string | undefined;
373
+ version?: string | undefined;
374
+ }
375
+ /**
376
+ * The document header row shared by `<Plan>` and the frontmatter-generated
377
+ * header in render.ts. `status` is validated by StatusBadge's own schema.
378
+ */
379
+ declare const PlanHeader: (p: PlanHeaderProps) => ReactElement;
380
+ declare const Plan: AnyComponent;
381
+ //#endregion
382
+ //#region src/ui/pre.d.ts
383
+ /**
384
+ * Overrides the `pre` element: fenced code blocks become framed blocks with a
385
+ * filename/language header and a copy button. ```mermaid fences render as
386
+ * diagrams (mermaid is loaded from CDN only when present).
387
+ */
388
+ declare const Pre: (props: DocProps) => ReactElement;
389
+ //#endregion
390
+ //#region src/ui/priority.d.ts
391
+ declare const PRIORITY_LEVELS: readonly ["p0", "p1", "p2", "p3"];
392
+ declare const Priority: AnyComponent;
393
+ //#endregion
394
+ //#region src/ui/props.d.ts
395
+ declare const Props: AnyComponent;
396
+ declare const Prop: AnyComponent;
397
+ //#endregion
398
+ //#region src/ui/radar.d.ts
399
+ declare const Radar: AnyComponent;
400
+ //#endregion
401
+ //#region src/ui/ref.d.ts
402
+ declare const Ref: AnyComponent;
403
+ declare const Issue: AnyComponent;
404
+ declare const PR: AnyComponent;
405
+ declare const Commit: AnyComponent;
406
+ //#endregion
407
+ //#region src/ui/release.d.ts
408
+ declare const ENTRY_KINDS: readonly ["breaking", "added", "changed", "deprecated", "removed", "fixed", "security"];
409
+ declare const Entry: AnyComponent;
410
+ declare const Release: AnyComponent;
411
+ //#endregion
412
+ //#region src/ui/req.d.ts
413
+ declare const Reqs: AnyComponent;
414
+ declare const Req: AnyComponent;
415
+ //#endregion
416
+ //#region src/ui/review.d.ts
417
+ declare const REVIEW_VERDICTS: readonly ["approve", "comment", "changes"];
418
+ declare const Comment: AnyComponent;
419
+ declare const Review: AnyComponent;
420
+ //#endregion
421
+ //#region src/ui/risk.d.ts
422
+ declare const RISK_LEVELS: readonly ["low", "medium", "high"];
423
+ declare const Risk: AnyComponent;
424
+ //#endregion
425
+ //#region src/ui/sankey.d.ts
426
+ declare const Link: AnyComponent;
427
+ declare const Sankey: AnyComponent;
428
+ //#endregion
429
+ //#region src/ui/scatter.d.ts
430
+ declare const Point: AnyComponent;
431
+ declare const Scatter: AnyComponent;
432
+ //#endregion
433
+ //#region src/ui/schema.d.ts
434
+ declare const DbField: AnyComponent;
435
+ declare const DbTable: AnyComponent;
436
+ declare const Schema: AnyComponent;
437
+ //#endregion
438
+ //#region src/ui/score.d.ts
439
+ declare const Score: AnyComponent;
440
+ //#endregion
441
+ //#region src/ui/search.d.ts
442
+ declare const Search: AnyComponent;
443
+ declare const Searches: AnyComponent;
444
+ //#endregion
445
+ //#region src/ui/series.d.ts
446
+ declare const Series: AnyComponent;
447
+ //#endregion
448
+ //#region src/ui/severity.d.ts
449
+ declare const SEVERITY_LEVELS: readonly ["critical", "high", "medium", "low", "info"];
450
+ declare const isSeverity: (x: unknown) => x is "critical" | "high" | "medium" | "low" | "info";
451
+ declare const Severity: AnyComponent;
452
+ //#endregion
453
+ //#region src/ui/stack.d.ts
454
+ declare const Stack: AnyComponent;
455
+ declare const Row: AnyComponent;
456
+ //#endregion
457
+ //#region src/ui/spark.d.ts
458
+ declare const SPARK_TONES: readonly ["neutral", "emerald", "amber", "red", "sky", "violet"];
459
+ declare const Spark: AnyComponent;
460
+ //#endregion
461
+ //#region src/ui/stats.d.ts
462
+ declare const Stats: AnyComponent;
463
+ declare const Stat: AnyComponent;
464
+ //#endregion
465
+ //#region src/ui/status-badge.d.ts
466
+ declare const STATUSES: readonly ["todo", "doing", "done", "blocked"];
467
+ declare const StatusBadge: AnyComponent;
468
+ //#endregion
469
+ //#region src/ui/statuspage.d.ts
470
+ declare const SERVICE_STATUSES: readonly ["operational", "degraded", "outage", "maintenance"];
471
+ declare const Service: AnyComponent;
472
+ declare const StatusPage: AnyComponent;
473
+ declare const DAY_STATUSES: readonly ["up", "degraded", "down", "maint", "none"];
474
+ declare const Day: AnyComponent;
475
+ declare const Uptime: AnyComponent;
476
+ //#endregion
477
+ //#region src/ui/steps.d.ts
478
+ declare const Step: AnyComponent;
479
+ declare const Steps: AnyComponent;
480
+ //#endregion
481
+ //#region src/ui/summary.d.ts
482
+ declare const Summary: AnyComponent;
483
+ //#endregion
484
+ //#region src/ui/symbol-ref.d.ts
485
+ declare const SYMBOL_KINDS: readonly ["class", "component", "const", "enum", "fn", "interface", "prop", "type"];
486
+ declare const SymbolRef: AnyComponent;
487
+ //#endregion
488
+ //#region src/ui/terminal.d.ts
489
+ declare const Terminal: AnyComponent;
490
+ //#endregion
491
+ //#region src/ui/tests.d.ts
492
+ declare const TEST_STATUSES: readonly ["pass", "fail", "skip", "todo"];
493
+ /** `"120ms"`/`"1.2s"`/`"2m"` → milliseconds; unparseable → undefined. */
494
+ declare const parseDuration: (x: unknown) => number | undefined;
495
+ declare const formatDuration: (ms: number) => string;
496
+ declare const Test: AnyComponent;
497
+ declare const Tests: AnyComponent;
498
+ //#endregion
499
+ //#region src/ui/timeline.d.ts
500
+ declare const Timeline: AnyComponent;
501
+ declare const Event: AnyComponent;
502
+ //#endregion
503
+ //#region src/ui/toc.d.ts
504
+ /**
505
+ * Table of contents. The `:::toc` directive / `<Toc>` element is a marker —
506
+ * the remark plugin collects the document's headings, gives them `id`s, and
507
+ * injects the link list as this component's children. `depth`/`min` are read
508
+ * by the plugin at that point; the component itself frames the list as a
509
+ * collapsible outline (native <details> — works without client JS).
510
+ */
511
+ declare const Toc: AnyComponent;
512
+ //#endregion
513
+ //#region src/ui/trace.d.ts
514
+ declare const FRAME_KINDS: readonly ["app", "lib"];
515
+ declare const Trace: AnyComponent;
516
+ declare const TraceFrame: AnyComponent;
517
+ //#endregion
518
+ //#region src/ui/tree.d.ts
519
+ declare const Tree: AnyComponent;
520
+ //#endregion
521
+ //#region src/ui/treemap.d.ts
522
+ declare const Tile: AnyComponent;
523
+ declare const Treemap: AnyComponent;
524
+ //#endregion
525
+ //#region src/ui/venn.d.ts
526
+ declare const Set: AnyComponent;
527
+ declare const Overlap: AnyComponent;
528
+ declare const Venn: AnyComponent;
529
+ //#endregion
530
+ //#region src/ui/verdict.d.ts
531
+ declare const VERDICTS: readonly ["approve", "pass", "warn", "fail", "info"];
532
+ declare const Verdict: AnyComponent;
533
+ //#endregion
534
+ //#region src/ui/waterfall.d.ts
535
+ declare const Span: AnyComponent;
536
+ declare const Waterfall: AnyComponent;
537
+ //#endregion
538
+ //#region src/ui/index.d.ts
539
+ /**
540
+ * The built-in component catalog available inside mdxr documents.
541
+ * `pre` overrides fenced code blocks; the rest are usable as MDX JSX elements.
542
+ * shadcn/ui (Base UI) primitives are included — rendered documents carry a
543
+ * hydration bundle, so interactive parts work in the browser.
544
+ * `Toc` and `CodeFile` are remark-level features (injected/expanded before
545
+ * render); `Toc` still needs this entry so MDX accepts the element.
546
+ */
547
+ declare const builtinComponents: ComponentMap;
548
+ //#endregion
549
+ //#region src/doc-context.d.ts
550
+ interface DocContextValue {
551
+ /**
552
+ * Build an editor URL (`vscode://file/…`, per the resolved `editor` setting)
553
+ * for a document-relative path, or undefined when file links are disabled or
554
+ * the file does not exist on disk.
555
+ */
556
+ fileLink?: (relPath: string, line?: string) => string | undefined;
557
+ /**
558
+ * The document's render timestamp. Relative-time components (`<Due>`) must
559
+ * read "now" from here: the value is serialized into the hydration payload,
560
+ * so client rendering sees the same instant SSR did — a render crossing
561
+ * midnight can't produce a hydration mismatch.
562
+ */
563
+ now?: Date;
564
+ }
565
+ /** Render-time document info shared with components. */
566
+ declare const DocContext: import("react").Context<DocContextValue>;
567
+ //#endregion
568
+ export { Schema as $, CHECK_STATUSES as $n, Hypothesis as $t, DAY_STATUSES as A, EFFORT_SIZES as An, Phase as At, SPARK_TONES as B, Dep as Bn, MetaItem as Bt, parseDuration as C, FileRef as Cn, Approval as Cr, Pre as Ct, Summary as D, Endpoint as Dn, defineComponent as Dr, Quadrant as Dt, SymbolRef as E, EnvVars as En, MdxrComponent as Er, Pin as Et, Uptime as F, DiffView as Fn, Packages as Ft, Severity as G, Before as Gn, Ins as Gt, Row as H, DECISION_STATUSES as Hn, LineChart as Ht, STATUSES as I, FileDiff as In, Owner as It, Search as J, Lane as Jn, Icon as Jt, isSeverity as K, Board as Kn, INCIDENT_STATUSES as Kt, StatusBadge as L, parseDiff as Ln, OPTION_STATUSES as Lt, SERVICE_STATUSES as M, Due as Mn, Stop as Mt, Service as N, DiffStat as Nn, PACKAGE_KINDS as Nt, Step as O, Endpoints as On, textOf as Or, PieChart as Ot, StatusPage as P, DiffCommentSpec as Pn, Package as Pt, DbTable as Q, Cmd as Qn, Hypotheses as Qt, Stat as R, Details as Rn, Option as Rt, formatDuration as S, Files as Sn, Question as Sr, Priority as St, SYMBOL_KINDS as T, EnvVar as Tn, ComponentMeta as Tr, PlanHeader as Tt, Stack as U, Decision as Un, Json as Ut, Spark as V, Deps as Vn, Matrix as Vt, SEVERITY_LEVELS as W, After as Wn, Del as Wt, Score as X, Column as Xn, normalizeIconName as Xt, Searches as Y, Comments as Yn, hasIcon as Yt, DbField as Z, Columns as Zn, HYPOTHESIS_STATUSES as Zt, Event as _, CONFIDENCES as _n, Audit as _r, Ref as _t, VERDICTS as a, Glossary as an, CALLOUT_KINDS as ar, Risk as at, Test as b, FILE_KINDS as bn, Choice as br, Props as bt, Set as c, Gauge as cn, Bump as cr, Review as ct, Treemap as d, Milestone as dn, Delta as dr, ENTRY_KINDS as dt, Cell as en, Check as er, Point as et, Tree as f, Task as fn, BENCH_BETTER as fr, Entry as ft, Toc as g, FlowStep as gn, BarChart as gr, PR as gt, TraceFrame as h, Flow as hn, Bar as hr, Issue as ht, Waterfall as i, Node as in, Changes as ir, RISK_LEVELS as it, Day as j, Effort as jn, Pathway as jt, Steps as k, HTTP_METHODS as kn, Slice as kt, Venn as l, Gauges as ln, Bumps as lr, Req as lt, Trace as m, Stage as mn, Benchmarks as mr, Commit as mt, builtinComponents as n, Graph as nn, CHANGE_KINDS as nr, Link as nt, Verdict as o, Term as on, Callout as or, Comment as ot, FRAME_KINDS as p, Funnel as pn, Bench as pr, Release as pt, Series as q, BoardCard as qn, Incident as qt, Span as r, Edge as rn, Change as rr, Sankey as rt, Overlap as s, GAUGE_TONES as sn, BUMP_KINDS as sr, REVIEW_VERDICTS as st, DocContext as t, Grid as tn, Checks as tr, Scatter as tt, Tile as u, Gantt as un, Bridge as ur, Reqs as ut, Timeline as v, Finding as vn, Vuln as vr, Radar as vt, Terminal as w, Figure as wn, Approvals as wr, Plan as wt, Tests as x, File as xn, QUESTION_TYPES as xr, PRIORITY_LEVELS as xt, TEST_STATUSES as y, Findings as yn, Ask as yr, Prop as yt, Stats as z, DEP_KINDS as zn, Meta as zt };
@@ -0,0 +1,20 @@
1
+ import { Dr as defineComponent, Er as MdxrComponent, Or as textOf, Tr as ComponentMeta, n as builtinComponents, t as DocContext } from "./doc-context-CEqzMYKv.mjs";
2
+ import * as v from "valibot";
3
+ //#region src/config.d.ts
4
+ /** Shape of `mdxr.config.ts` in a project that uses mdxr. */
5
+ interface MdxrConfig {
6
+ /** Path to a TS/TSX module whose named exports are extra MDX components. */
7
+ components?: string;
8
+ /**
9
+ * Editor used for file links (`vscode` default). A known name (`cursor`,
10
+ * `zed`, `vscode-insiders`, `windsurf`, `sublime`, `textmate`, `idea`), a
11
+ * `{path}`/`{line}` URL template, or `"none"` to disable. Frontmatter
12
+ * `editor:` overrides per document.
13
+ */
14
+ editor?: string;
15
+ /** Path to a CSS file with `@theme` overrides / extra utilities. */
16
+ theme?: string;
17
+ }
18
+ export declare const defineConfig: (config: MdxrConfig) => MdxrConfig;
19
+ //#endregion
20
+ export { type ComponentMeta, DocContext, type MdxrComponent, type MdxrConfig, builtinComponents, defineComponent, textOf, v };
package/dist/index.mjs ADDED
@@ -0,0 +1,4 @@
1
+ import { Bu as defineComponent, Vu as textOf, t as builtinComponents, zu as DocContext } from "./ui-GKFD0mx5.mjs";
2
+ import { t as defineConfig } from "./config-SI9IyFiC.mjs";
3
+ import * as v from "valibot";
4
+ export { DocContext, builtinComponents, defineComponent, defineConfig, textOf, v };