@clarify-labs/renderer 0.2.0 → 0.5.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 (97) hide show
  1. package/output/AppShell-D3FsVHQK.js +390 -0
  2. package/output/AppShell-D3FsVHQK.js.map +1 -0
  3. package/output/AppShell-DeaJ-rgo.cjs +409 -0
  4. package/output/AppShell-DeaJ-rgo.cjs.map +1 -0
  5. package/output/OpenApiOperation-DYXG-6Rw.js +1772 -0
  6. package/output/OpenApiOperation-DYXG-6Rw.js.map +1 -0
  7. package/output/OpenApiOperation-mhoi-s4N.cjs +1840 -0
  8. package/output/OpenApiOperation-mhoi-s4N.cjs.map +1 -0
  9. package/output/app/PageNavigation.d.ts +7 -0
  10. package/output/app/PageSkeleton.d.ts +1 -0
  11. package/output/{components → app}/SectionProvider.d.ts +3 -2
  12. package/output/chunk-DakpK96I.cjs +43 -0
  13. package/output/client.cjs +1 -1
  14. package/output/client.js +1 -1
  15. package/output/components/Button.d.ts +18 -0
  16. package/output/components/Code.d.ts +11 -7
  17. package/output/components/Collapse.d.ts +9 -0
  18. package/output/components/Heading.d.ts +10 -0
  19. package/output/components/Logo.d.ts +2 -0
  20. package/output/components/Prose.d.ts +7 -0
  21. package/output/components/Tag.d.ts +34 -0
  22. package/output/components/index.d.ts +9 -79
  23. package/output/components/patterns.d.ts +4 -2
  24. package/output/context.d.ts +1 -6
  25. package/output/core/context.d.ts +8 -0
  26. package/output/core/i18n.d.ts +5 -0
  27. package/output/core/index.d.ts +3 -0
  28. package/output/core/types.d.ts +174 -0
  29. package/output/i18n.d.ts +1 -0
  30. package/output/index.cjs +135 -766
  31. package/output/index.cjs.map +1 -1
  32. package/output/index.d.ts +15 -4
  33. package/output/index.js +108 -751
  34. package/output/index.js.map +1 -1
  35. package/output/markdown.cjs +3 -0
  36. package/output/markdown.d.ts +1 -0
  37. package/output/markdown.js +2 -0
  38. package/output/mdx/DocShell.d.ts +7 -0
  39. package/output/mdx/Markdown.d.ts +7 -0
  40. package/output/mdx/components.d.ts +7 -7
  41. package/output/mdx/primitives.d.ts +18 -12
  42. package/output/mdx/remark.d.ts +2 -0
  43. package/output/openapi/components/ExamplePanels.d.ts +36 -0
  44. package/output/openapi/components/OpenApiOperation.d.ts +33 -0
  45. package/output/openapi/components/SchemaProperties.d.ts +20 -0
  46. package/output/openapi/entry.d.ts +13 -0
  47. package/output/openapi/index.d.ts +3 -20
  48. package/output/openapi/lib/helpers.d.ts +25 -0
  49. package/output/openapi/lib/request-code.d.ts +18 -0
  50. package/output/openapi/lib/spec-path.d.ts +2 -0
  51. package/output/openapi/types.d.ts +70 -0
  52. package/output/preview/openapi.d.ts +28 -0
  53. package/output/preview.cjs +734 -0
  54. package/output/preview.cjs.map +1 -0
  55. package/output/preview.d.ts +19 -0
  56. package/output/preview.js +731 -0
  57. package/output/preview.js.map +1 -0
  58. package/output/remark-DNOdJz5i.cjs +14 -0
  59. package/output/remark-DNOdJz5i.cjs.map +1 -0
  60. package/output/remark-o5sg9Ilv.js +7 -0
  61. package/output/remark-o5sg9Ilv.js.map +1 -0
  62. package/output/{render-bPMMBoDH.js → render-BpavVnAe.js} +3 -2
  63. package/output/render-BpavVnAe.js.map +1 -0
  64. package/output/{render-z9rSQ00n.cjs → render-CjZt3edL.cjs} +6 -5
  65. package/output/render-CjZt3edL.cjs.map +1 -0
  66. package/output/renderer.css +1702 -591
  67. package/output/server.cjs +7 -5
  68. package/output/server.cjs.map +1 -1
  69. package/output/server.js +4 -2
  70. package/output/server.js.map +1 -1
  71. package/output/shell/ContentActions.d.ts +1 -0
  72. package/output/shell/Header.d.ts +4 -3
  73. package/output/shell/Navigation.d.ts +3 -2
  74. package/output/shell/Search.d.ts +6 -4
  75. package/output/{components → shell}/SiteLogo.d.ts +1 -1
  76. package/output/shell/icons.d.ts +5 -0
  77. package/output/shell/mobile.d.ts +5 -3
  78. package/output/{AppShell-Ci894P_0.js → shell-BlMMdTpZ.js} +1228 -867
  79. package/output/shell-BlMMdTpZ.js.map +1 -0
  80. package/output/{AppShell-4KB3lU-n.cjs → shell-_MyLsMUI.cjs} +1403 -1036
  81. package/output/shell-_MyLsMUI.cjs.map +1 -0
  82. package/output/{components → theme}/ThemeProvider.d.ts +3 -2
  83. package/output/types.d.ts +1 -121
  84. package/output/utils/clipboard.d.ts +1 -0
  85. package/output/utils/hash.d.ts +1 -0
  86. package/output/utils/href.d.ts +5 -0
  87. package/output/utils/lucide.d.ts +17 -0
  88. package/output/utils/path.d.ts +2 -0
  89. package/package.json +24 -10
  90. package/output/AppShell-4KB3lU-n.cjs.map +0 -1
  91. package/output/AppShell-Ci894P_0.js.map +0 -1
  92. package/output/render-bPMMBoDH.js.map +0 -1
  93. package/output/render-z9rSQ00n.cjs.map +0 -1
  94. /package/output/{components → app}/BuiltWithClarify.d.ts +0 -0
  95. /package/output/{components → app}/PageFooter.d.ts +0 -0
  96. /package/output/openapi/{utils.d.ts → lib/utils.d.ts} +0 -0
  97. /package/output/{components → theme}/ThemeToggle.d.ts +0 -0
@@ -0,0 +1,734 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_shell = require("./shell-_MyLsMUI.cjs");
3
+ const require_OpenApiOperation = require("./OpenApiOperation-mhoi-s4N.cjs");
4
+ let react = require("react");
5
+ let react_router_dom = require("react-router-dom");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ //#region source/preview/openapi.tsx
8
+ function schemaFromType(type) {
9
+ if (type.endsWith("[]")) return {
10
+ type: "array",
11
+ items: schemaFromType(type.slice(0, -2))
12
+ };
13
+ if (type === "number" || type === "integer" || type === "boolean" || type === "object") return { type };
14
+ return { type: "string" };
15
+ }
16
+ function parseResponseExample(endpoint) {
17
+ if (typeof endpoint.responseExample !== "undefined") return endpoint.responseExample;
18
+ if (!endpoint.response) return void 0;
19
+ try {
20
+ return JSON.parse(endpoint.response);
21
+ } catch {
22
+ return endpoint.response;
23
+ }
24
+ }
25
+ function inferSchemaFromExample(example) {
26
+ if (Array.isArray(example)) return {
27
+ type: "array",
28
+ items: inferSchemaFromExample(example[0]) ?? { type: "object" }
29
+ };
30
+ if (typeof example === "object" && example !== null) return {
31
+ type: "object",
32
+ properties: Object.fromEntries(Object.entries(example).map(([key, value]) => [key, inferSchemaFromExample(value)]))
33
+ };
34
+ if (typeof example === "number") return { type: Number.isInteger(example) ? "integer" : "number" };
35
+ if (typeof example === "boolean") return { type: "boolean" };
36
+ return typeof example === "undefined" ? void 0 : { type: "string" };
37
+ }
38
+ function normalizeParameterLocation(location) {
39
+ return location === "route" ? "path" : location;
40
+ }
41
+ function toOpenApiParameter(parameter) {
42
+ return {
43
+ name: parameter.name,
44
+ in: normalizeParameterLocation(parameter.in),
45
+ required: parameter.required,
46
+ description: parameter.description,
47
+ schema: parameter.schema ?? schemaFromType(parameter.type)
48
+ };
49
+ }
50
+ function createPreviewOpenApi(endpoint) {
51
+ const method = endpoint.method.toLowerCase();
52
+ const parameters = (endpoint.parameters ?? []).map(toOpenApiParameter);
53
+ const responseExample = parseResponseExample(endpoint);
54
+ const responseSchema = endpoint.responseSchema ?? inferSchemaFromExample(responseExample);
55
+ const requestSchema = endpoint.requestSchema ?? inferSchemaFromExample(endpoint.requestExample);
56
+ const operation = {
57
+ summary: endpoint.summary,
58
+ description: endpoint.description,
59
+ parameters,
60
+ requestBody: requestSchema ? {
61
+ description: endpoint.requestDescription,
62
+ required: true,
63
+ content: { "application/json": {
64
+ schema: requestSchema,
65
+ example: endpoint.requestExample
66
+ } }
67
+ } : void 0,
68
+ responses: { [endpoint.responseStatus ?? "200"]: {
69
+ description: endpoint.responseDescription ?? "OK",
70
+ content: { "application/json": {
71
+ schema: responseSchema,
72
+ example: responseExample
73
+ } }
74
+ } }
75
+ };
76
+ return {
77
+ operation,
78
+ spec: {
79
+ openapi: "3.1.0",
80
+ info: {
81
+ title: "Clarify Build API",
82
+ version: "2026-06-20",
83
+ description: "API reference generated from OpenAPI and rendered as static documentation."
84
+ },
85
+ servers: [{
86
+ url: "https://server",
87
+ description: "Production"
88
+ }, {
89
+ url: "https://test-server",
90
+ description: "Test"
91
+ }],
92
+ components: { securitySchemes: { bearerAuth: {
93
+ type: "http",
94
+ scheme: "bearer",
95
+ bearerFormat: "JWT"
96
+ } } },
97
+ security: [{ bearerAuth: [] }],
98
+ paths: { [endpoint.path]: { [method]: operation } }
99
+ },
100
+ parameters
101
+ };
102
+ }
103
+ function OpenApiExamplesPreview(arg0) {
104
+ const { endpoint } = arg0;
105
+ const { operation, spec, parameters } = createPreviewOpenApi(endpoint);
106
+ const method = endpoint.method.toUpperCase();
107
+ const requestContents = require_OpenApiOperation.getMediaTypeEntries(require_OpenApiOperation.getRequestBody(spec, operation)?.content, spec);
108
+ const [selectedRequestMediaType, setSelectedRequestMediaType] = (0, react.useState)(requestContents[0]?.mediaType ?? "");
109
+ const selectedRequestContent = requestContents.find((content) => content.mediaType === selectedRequestMediaType) ?? requestContents[0];
110
+ const servers = require_OpenApiOperation.getServers(spec, operation, endpoint.path);
111
+ const [selectedServerKey, setSelectedServerKey] = (0, react.useState)(require_OpenApiOperation.getServerKey(servers[0], 0));
112
+ const selectedServer = servers.find((server, index) => require_OpenApiOperation.getServerKey(server, index) === selectedServerKey) ?? servers[0];
113
+ const [serverVariables, setServerVariables] = (0, react.useState)(require_OpenApiOperation.defaultServerVariables(selectedServer));
114
+ const [serverOpen, setServerOpen] = (0, react.useState)(false);
115
+ const authOptions = require_OpenApiOperation.getAuthOptions(spec, operation);
116
+ const [selectedAuthName, setSelectedAuthName] = (0, react.useState)(authOptions[0]?.name ?? "");
117
+ const selectedAuth = authOptions.find((option) => option.name === selectedAuthName);
118
+ const [authValues, setAuthValues] = (0, react.useState)({});
119
+ const [authOpen, setAuthOpen] = (0, react.useState)(false);
120
+ const authInput = selectedAuth ? {
121
+ name: selectedAuth.name,
122
+ scheme: selectedAuth.scheme,
123
+ value: authValues[selectedAuth.name] ?? require_OpenApiOperation.authPlaceholder(selectedAuth)
124
+ } : void 0;
125
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
126
+ className: "space-y-4",
127
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OpenApiOperation.EndpointIdentity, {
128
+ method,
129
+ path: endpoint.path,
130
+ servers,
131
+ selectedServerKey,
132
+ selectedServer,
133
+ serverVariables,
134
+ serverOpen,
135
+ authOptions,
136
+ selectedAuthName,
137
+ selectedAuth,
138
+ authValues,
139
+ authOpen,
140
+ onSelectServer: (value) => {
141
+ const nextServer = servers.find((server, index) => require_OpenApiOperation.getServerKey(server, index) === value) ?? servers[0];
142
+ setSelectedServerKey(value);
143
+ setServerVariables(require_OpenApiOperation.defaultServerVariables(nextServer));
144
+ },
145
+ onChangeServerVariable: (name, value) => setServerVariables((current) => ({
146
+ ...current,
147
+ [name]: value
148
+ })),
149
+ onToggleServer: () => {
150
+ setServerOpen((current) => !current);
151
+ setAuthOpen(false);
152
+ },
153
+ onToggleAuth: () => {
154
+ setAuthOpen((current) => !current);
155
+ setServerOpen(false);
156
+ },
157
+ onSelectAuth: setSelectedAuthName,
158
+ onChangeAuthValue: (name, value) => setAuthValues((current) => ({
159
+ ...current,
160
+ [name]: value
161
+ }))
162
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
163
+ className: "grid min-w-0 gap-4 lg:grid-cols-2",
164
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OpenApiOperation.RequestExamplesPanel, {
165
+ spec,
166
+ path: endpoint.path,
167
+ method,
168
+ parameters,
169
+ requestContents,
170
+ selectedMediaType: selectedRequestContent?.mediaType ?? "",
171
+ onSelectMediaType: setSelectedRequestMediaType,
172
+ selectedServer,
173
+ serverVariables,
174
+ auth: authInput
175
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OpenApiOperation.ResponseExamplesPanel, {
176
+ operation,
177
+ spec
178
+ })]
179
+ })]
180
+ });
181
+ }
182
+ //#endregion
183
+ //#region source/preview.tsx
184
+ var embeddedEndpoint = {
185
+ method: "GET",
186
+ path: "/examples/basic-request",
187
+ summary: "Basic request",
188
+ description: "Rendered from api.openapi.json inside the MDX guide.",
189
+ parameters: [
190
+ {
191
+ name: "cursor",
192
+ in: "query",
193
+ type: "string",
194
+ description: "Start after this cursor."
195
+ },
196
+ {
197
+ name: "limit",
198
+ in: "query",
199
+ type: "integer",
200
+ description: "Max items to return."
201
+ },
202
+ {
203
+ name: "X-Trace-Id",
204
+ in: "header",
205
+ type: "string",
206
+ description: "Optional request trace."
207
+ }
208
+ ],
209
+ responseDescription: "A page of example records.",
210
+ responseSchema: {
211
+ type: "object",
212
+ required: ["items"],
213
+ properties: {
214
+ items: {
215
+ type: "array",
216
+ items: { type: "object" }
217
+ },
218
+ next: { type: "string" }
219
+ }
220
+ },
221
+ responseExample: {
222
+ items: [],
223
+ next: "cursor_2"
224
+ }
225
+ };
226
+ var embeddedGuide = {
227
+ label: "source/en-US/openapi/embedding.mdx",
228
+ title: "Embed OpenAPI in MDX",
229
+ body: "Use MDX for workflow context, then render the exact operation from the spec.",
230
+ embed: "<OpenApiOperation specPath=\"/api\" path=\"/examples/basic-request\" method=\"get\" />",
231
+ outputs: [
232
+ "/openapi/embedding",
233
+ "/api",
234
+ "/api.openapi.json",
235
+ "/llms.txt"
236
+ ]
237
+ };
238
+ var staticOutputEndpoint = {
239
+ method: "POST",
240
+ path: "/api/{id}/path",
241
+ summary: "Create static build",
242
+ description: "Build static docs from MDX and OpenAPI sources.",
243
+ parameters: [{
244
+ name: "id",
245
+ in: "path",
246
+ type: "string",
247
+ required: true,
248
+ description: "Project ID."
249
+ }],
250
+ responseDescription: "Build metadata and static outputs.",
251
+ responseSchema: {
252
+ type: "object",
253
+ required: [
254
+ "id",
255
+ "status",
256
+ "outputs"
257
+ ],
258
+ properties: {
259
+ id: {
260
+ type: "string",
261
+ description: "Build identifier."
262
+ },
263
+ status: {
264
+ type: "string",
265
+ enum: [
266
+ "queued",
267
+ "running",
268
+ "ready"
269
+ ],
270
+ description: "Current build state."
271
+ },
272
+ outputs: {
273
+ type: "array",
274
+ description: "Generated static artifacts.",
275
+ items: {
276
+ type: "object",
277
+ required: ["path", "kind"],
278
+ properties: {
279
+ path: { type: "string" },
280
+ kind: {
281
+ type: "string",
282
+ enum: [
283
+ "html",
284
+ "asset",
285
+ "openapi",
286
+ "llms"
287
+ ]
288
+ }
289
+ }
290
+ }
291
+ }
292
+ }
293
+ },
294
+ requestDescription: "Static build options.",
295
+ requestSchema: {
296
+ type: "object",
297
+ required: ["source", "output"],
298
+ properties: {
299
+ source: {
300
+ type: "string",
301
+ description: "MDX source root."
302
+ },
303
+ output: {
304
+ type: "string",
305
+ description: "Static output root."
306
+ },
307
+ includeSearchIndex: {
308
+ type: "boolean",
309
+ description: "Generate search data."
310
+ }
311
+ }
312
+ },
313
+ requestExample: {
314
+ source: "source",
315
+ output: "output",
316
+ includeSearchIndex: true
317
+ },
318
+ responseExample: {
319
+ id: "build_01HY",
320
+ status: "ready",
321
+ outputs: [
322
+ {
323
+ path: "/openapi/index.html",
324
+ kind: "html"
325
+ },
326
+ {
327
+ path: "/api.openapi.json",
328
+ kind: "openapi"
329
+ },
330
+ {
331
+ path: "/llms.txt",
332
+ kind: "llms"
333
+ }
334
+ ]
335
+ }
336
+ };
337
+ var previewConfig = {
338
+ title: "Clarify preview",
339
+ description: "Renderer preview environment",
340
+ rootDirectory: "source",
341
+ routePrefix: "/",
342
+ outputDirectory: "output",
343
+ theme: {
344
+ preset: "default",
345
+ tokens: {
346
+ colors: {
347
+ primary: "#2563eb",
348
+ accent: "#60a5fa",
349
+ background: "#ffffff",
350
+ foreground: "#18181b",
351
+ surface: "#ffffff",
352
+ muted: "#71717a",
353
+ border: "rgb(24 24 27 / 0.1)",
354
+ codeBackground: "#f4f4f5"
355
+ },
356
+ radius: {
357
+ sm: "0.375rem",
358
+ md: "0.5rem",
359
+ lg: "0.75rem",
360
+ xl: "1rem"
361
+ }
362
+ },
363
+ layout: { maxWidth: "88rem" }
364
+ },
365
+ i18n: {
366
+ defaultLocale: "en",
367
+ missing: "fallback",
368
+ locales: [{
369
+ code: "en",
370
+ label: "English"
371
+ }]
372
+ }
373
+ };
374
+ var methodStyles = {
375
+ GET: "bg-emerald-400/15 text-emerald-600 dark:bg-emerald-400/20 dark:text-emerald-300",
376
+ POST: "bg-sky-400/15 text-sky-600 dark:bg-sky-400/20 dark:text-sky-300",
377
+ PUT: "bg-amber-400/15 text-amber-600 dark:bg-amber-400/20 dark:text-amber-300",
378
+ PATCH: "bg-amber-400/15 text-amber-600 dark:bg-amber-400/20 dark:text-amber-300",
379
+ DELETE: "bg-rose-400/15 text-rose-600 dark:bg-rose-400/20 dark:text-rose-300"
380
+ };
381
+ var mainPreviewPath = "/openapi/embedding";
382
+ var mainPreviewSections = [{
383
+ id: "overview",
384
+ title: "Overview"
385
+ }, {
386
+ id: "request-example",
387
+ title: "Request example"
388
+ }];
389
+ function PreviewEnvironment(arg0) {
390
+ const { children, initialEntry = "/preview", sections = [] } = arg0;
391
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.MemoryRouter, {
392
+ initialEntries: [initialEntry],
393
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_shell.ClarifyConfigContext.Provider, {
394
+ value: previewConfig,
395
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_shell.ClarifyLocaleContext.Provider, {
396
+ value: previewConfig.i18n.defaultLocale,
397
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_shell.OpenApisContext.Provider, {
398
+ value: {},
399
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_shell.SectionProvider, {
400
+ sections,
401
+ children
402
+ })
403
+ })
404
+ })
405
+ })
406
+ });
407
+ }
408
+ function Chrome(arg0) {
409
+ const { title, status, children } = arg0;
410
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
411
+ className: "clarify-app clarify-preview h-full overflow-hidden bg-(--clarify-theme-tokens-colors-background) text-(--clarify-ui-text) shadow-2xl ring-1 ring-(--clarify-theme-tokens-colors-border) dark:bg-zinc-950 dark:text-white dark:ring-white/10",
412
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
413
+ className: "flex items-center gap-3 border-b border-(--clarify-theme-tokens-colors-border) px-4 py-3 text-xs/6 text-(--clarify-ui-text-faint) dark:border-white/10",
414
+ children: [
415
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "size-2 rounded-full bg-rose-400" }),
416
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "size-2 rounded-full bg-amber-400" }),
417
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "size-2 rounded-full bg-emerald-400" }),
418
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
419
+ className: "ml-2 truncate font-medium text-(--clarify-ui-text-soft)",
420
+ children: title
421
+ }),
422
+ status ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
423
+ className: "ml-auto hidden rounded-full bg-emerald-400/15 px-2 py-0.5 font-medium text-emerald-700 sm:inline dark:text-emerald-300",
424
+ children: status
425
+ }) : null
426
+ ]
427
+ }), children]
428
+ });
429
+ }
430
+ function MethodBadge(arg0) {
431
+ const method = arg0.method.toUpperCase();
432
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
433
+ className: `rounded-md px-2.5 py-0.5 text-xs/6 font-black tracking-wide ${methodStyles[method] ?? "bg-(--clarify-ui-subtle-background) text-(--clarify-ui-text-soft)"}`,
434
+ children: method
435
+ });
436
+ }
437
+ function createPreviewNavigation(arg0) {
438
+ const { endpoint, guide, outputs } = arg0;
439
+ return [
440
+ {
441
+ title: "Guides",
442
+ path: "/guides",
443
+ icon: "BookOpenText",
444
+ children: [{
445
+ title: guide?.title ?? "MDX guide",
446
+ path: mainPreviewPath,
447
+ icon: "FileText"
448
+ }, {
449
+ title: "Getting started",
450
+ path: "/getting-started",
451
+ icon: "Rocket"
452
+ }]
453
+ },
454
+ {
455
+ title: "API Reference",
456
+ path: "/api",
457
+ icon: "Braces",
458
+ children: [{
459
+ title: endpoint.summary,
460
+ path: endpoint.path,
461
+ icon: "Cable"
462
+ }, {
463
+ title: "Generate static output",
464
+ path: staticOutputEndpoint.path,
465
+ icon: "UploadCloud"
466
+ }]
467
+ },
468
+ {
469
+ title: "Build Output",
470
+ path: "/output",
471
+ icon: "PackageCheck",
472
+ children: [{
473
+ title: `Routes (${outputs.length})`,
474
+ path: "/output/routes",
475
+ icon: "ListTree"
476
+ }]
477
+ }
478
+ ];
479
+ }
480
+ function PreviewNavigation(arg0) {
481
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_shell.Navigation, {
482
+ navigation: createPreviewNavigation(arg0),
483
+ className: "px-2"
484
+ });
485
+ }
486
+ function PreviewMetricGrid(arg0) {
487
+ const { metrics } = arg0;
488
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
489
+ className: "grid grid-cols-3 gap-2",
490
+ children: metrics.map((metric) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
491
+ className: "rounded-xl border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-2.5 shadow-sm dark:border-white/10 dark:bg-zinc-900/50",
492
+ children: [
493
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
494
+ className: "text-xs/5 text-(--clarify-ui-text-faint)",
495
+ children: metric.label
496
+ }),
497
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
498
+ className: "text-base/6 font-semibold text-(--clarify-ui-text-strong)",
499
+ children: metric.value
500
+ }),
501
+ metric.hint ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
502
+ className: "text-xs/5 text-(--clarify-ui-text-faint)",
503
+ children: metric.hint
504
+ }) : null
505
+ ]
506
+ }, metric.label))
507
+ });
508
+ }
509
+ function PreviewLabel(arg0) {
510
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
511
+ className: "text-xs/5 font-semibold uppercase tracking-wider text-(--clarify-ui-text-faint)",
512
+ children: arg0.children
513
+ });
514
+ }
515
+ function GuideSummaryPreview(arg0) {
516
+ const { guide } = arg0;
517
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
518
+ className: "border-b border-(--clarify-theme-tokens-colors-border) pb-4 dark:border-white/10",
519
+ children: [
520
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewLabel, { children: guide.label }),
521
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
522
+ className: "mt-1 text-xl/7 font-semibold tracking-tight text-(--clarify-ui-text-strong)",
523
+ children: guide.title
524
+ }),
525
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
526
+ className: "mt-2 max-w-2xl text-sm/6 text-(--clarify-ui-text-soft)",
527
+ children: guide.body
528
+ }),
529
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
530
+ className: "mt-3 overflow-hidden rounded-xl bg-zinc-950 px-3 py-2 text-xs/5 whitespace-pre-wrap text-zinc-300",
531
+ children: guide.embed
532
+ })
533
+ ]
534
+ });
535
+ }
536
+ function EndpointSummaryPreview(arg0) {
537
+ const { endpoint } = arg0;
538
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
539
+ className: "min-w-0",
540
+ children: [
541
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
542
+ className: "flex flex-wrap items-center gap-3",
543
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MethodBadge, { method: endpoint.method }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
544
+ className: "text-sm font-medium text-(--clarify-ui-text)",
545
+ children: endpoint.path
546
+ })]
547
+ }),
548
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
549
+ className: "mt-3 text-lg/7 font-semibold tracking-tight text-(--clarify-ui-text-strong)",
550
+ children: endpoint.summary
551
+ }),
552
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
553
+ className: "mt-1 text-sm/6 text-(--clarify-ui-text-soft)",
554
+ children: endpoint.description
555
+ })
556
+ ]
557
+ });
558
+ }
559
+ function EmbeddedApiPreview(arg0) {
560
+ const { endpoint } = arg0;
561
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
562
+ className: "clarify-preview-api-frame min-w-0 overflow-hidden border-t border-(--clarify-theme-tokens-colors-border) pt-4 dark:border-white/10",
563
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
564
+ className: "clarify-preview-api-content clarify-preview-api-content-embedded",
565
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiExamplesPreview, { endpoint })
566
+ })
567
+ });
568
+ }
569
+ function OutputListPreview(arg0) {
570
+ const { outputs } = arg0;
571
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
572
+ className: "border-t border-(--clarify-theme-tokens-colors-border) pt-4 dark:border-white/10",
573
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewLabel, { children: "Static output" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
574
+ className: "mt-3 grid gap-2 sm:grid-cols-2 xl:grid-cols-4",
575
+ children: outputs.map((output) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
576
+ className: "flex items-center gap-2 rounded-lg bg-(--clarify-ui-subtle-background) px-3 py-2 text-xs/5 text-(--clarify-ui-text-soft) dark:bg-white/5",
577
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "size-1.5 rounded-full bg-emerald-400" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
578
+ className: "truncate font-mono",
579
+ children: output
580
+ })]
581
+ }, output))
582
+ })]
583
+ });
584
+ }
585
+ function MainContentPreview() {
586
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
587
+ className: "min-w-0 bg-(--clarify-theme-tokens-colors-background) px-5 py-4 dark:bg-zinc-950",
588
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
589
+ className: "clarify-preview-content-window overflow-hidden",
590
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
591
+ className: "space-y-4",
592
+ children: [
593
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GuideSummaryPreview, { guide: embeddedGuide }),
594
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewMetricGrid, { metrics: [
595
+ {
596
+ label: "MDX",
597
+ value: "Guide",
598
+ hint: "context"
599
+ },
600
+ {
601
+ label: "Spec",
602
+ value: "OpenAPI",
603
+ hint: "source"
604
+ },
605
+ {
606
+ label: "Out",
607
+ value: "Static",
608
+ hint: "CDN"
609
+ }
610
+ ] }),
611
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
612
+ className: "clarify-preview-endpoint-grid grid gap-4",
613
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(EndpointSummaryPreview, { endpoint: embeddedEndpoint }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EmbeddedApiPreview, { endpoint: embeddedEndpoint })]
614
+ }),
615
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OutputListPreview, { outputs: embeddedGuide.outputs ?? [] })
616
+ ]
617
+ })
618
+ })
619
+ });
620
+ }
621
+ function MainPreview() {
622
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewEnvironment, {
623
+ initialEntry: mainPreviewPath,
624
+ sections: mainPreviewSections,
625
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chrome, {
626
+ title: "source/en-US/openapi/embedding.mdx",
627
+ status: "Rendered from OpenAPI + MDX",
628
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
629
+ className: "clarify-preview-shell grid",
630
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
631
+ className: "border-r border-(--clarify-theme-tokens-colors-border) px-1 py-4 text-sm/7 dark:border-white/10 dark:bg-white/5",
632
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewNavigation, {
633
+ endpoint: embeddedEndpoint,
634
+ guide: embeddedGuide,
635
+ outputs: embeddedGuide.outputs ?? []
636
+ })
637
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MainContentPreview, {})]
638
+ })
639
+ })
640
+ });
641
+ }
642
+ function MdxPreview() {
643
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewEnvironment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chrome, {
644
+ title: "source/started/index.mdx",
645
+ status: "Rendered by renderer",
646
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
647
+ className: "clarify-preview-body overflow-hidden bg-(--clarify-theme-tokens-colors-background) p-5 dark:bg-zinc-950",
648
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
649
+ className: "max-w-3xl text-sm/7 text-(--clarify-ui-text-soft)",
650
+ children: [
651
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
652
+ className: "inline-flex rounded-full bg-(--clarify-ui-accent-background) px-3 py-1 text-xs/5 font-semibold text-(--clarify-ui-accent-text)",
653
+ children: "MDX page"
654
+ }),
655
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
656
+ className: "mt-3 text-2xl/8 font-semibold tracking-tight text-(--clarify-ui-text-strong)",
657
+ children: "Get Started"
658
+ }),
659
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
660
+ className: "mt-3",
661
+ children: "Write pages in source/. Clarify turns MDX, config, and OpenAPI files into routes."
662
+ }),
663
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
664
+ className: "mt-5 rounded-2xl border border-(--clarify-ui-accent-border) bg-(--clarify-ui-accent-background) p-4 text-sm/6 text-(--clarify-ui-text-strong)",
665
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
666
+ className: "font-semibold text-(--clarify-ui-text-strong)",
667
+ children: "Static output ready"
668
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
669
+ className: "mt-1",
670
+ children: "output/ is plain static files."
671
+ })]
672
+ }),
673
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
674
+ className: "mt-5 grid gap-4 sm:grid-cols-2",
675
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
676
+ className: "rounded-2xl border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-5 shadow-sm dark:border-white/10 dark:bg-zinc-900/50",
677
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
678
+ className: "text-base/6 font-semibold text-(--clarify-ui-text-strong)",
679
+ children: "MDX pages"
680
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
681
+ className: "mt-2 text-sm/6",
682
+ children: "Guides live beside code."
683
+ })]
684
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
685
+ className: "rounded-2xl border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-5 shadow-sm dark:border-white/10 dark:bg-zinc-900/50",
686
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
687
+ className: "text-base/6 font-semibold text-(--clarify-ui-text-strong)",
688
+ children: "API embeds"
689
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
690
+ className: "mt-2 text-sm/6",
691
+ children: "Specs render inline."
692
+ })]
693
+ })]
694
+ }),
695
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
696
+ className: "mt-5 rounded-2xl border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-5 shadow-sm dark:border-white/10 dark:bg-zinc-900/50",
697
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
698
+ className: "flex items-center gap-3",
699
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MethodBadge, { method: embeddedEndpoint.method }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
700
+ className: "text-sm font-medium text-(--clarify-ui-text)",
701
+ children: embeddedEndpoint.path
702
+ })]
703
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
704
+ className: "mt-3 text-sm/6",
705
+ children: embeddedEndpoint.description
706
+ })]
707
+ })
708
+ ]
709
+ })
710
+ })
711
+ }) });
712
+ }
713
+ function OpenApiPreview() {
714
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewEnvironment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chrome, {
715
+ title: "source/api.openapi.json",
716
+ status: "Endpoint + examples",
717
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
718
+ className: "clarify-preview-openapi-window overflow-hidden bg-(--clarify-theme-tokens-colors-background) px-4 py-4 dark:bg-zinc-950",
719
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
720
+ className: "clarify-preview-openapi-mask h-full overflow-hidden",
721
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
722
+ className: "clarify-preview-api-content clarify-preview-api-content-openapi origin-top pb-10",
723
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpenApiExamplesPreview, { endpoint: staticOutputEndpoint })
724
+ })
725
+ })
726
+ })
727
+ }) });
728
+ }
729
+ //#endregion
730
+ exports.MainPreview = MainPreview;
731
+ exports.MdxPreview = MdxPreview;
732
+ exports.OpenApiPreview = OpenApiPreview;
733
+
734
+ //# sourceMappingURL=preview.cjs.map