@stainless-api/docs-ui 0.1.0-beta.5 → 0.1.0-beta.50

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 (212) hide show
  1. package/dist/breadcrumbs-C6pTTw_o.d.ts +20 -0
  2. package/dist/breadcrumbs-DEyC9k79.d.ts +20 -0
  3. package/dist/breadcrumbs-nSFZO5Gf.js +63 -0
  4. package/dist/chunk-DRcLgZ1e.js +18 -0
  5. package/dist/component-DRO8kQSp.js +23 -0
  6. package/dist/component-generics-B6Fn47Mz.js +45 -0
  7. package/dist/component-generics-D_yxZT6v.d.ts +30 -0
  8. package/dist/component-generics-DxN-MaP2.d.ts +30 -0
  9. package/dist/components/MaskedInput.d.ts +14 -0
  10. package/dist/components/MaskedInput.js +76 -0
  11. package/dist/components/breadcrumbs.d.ts +2 -0
  12. package/dist/components/breadcrumbs.js +9 -0
  13. package/dist/components/icons.d.ts +55 -0
  14. package/dist/components/icons.js +3 -0
  15. package/dist/components/index.d.ts +10 -0
  16. package/dist/components/index.js +18 -0
  17. package/dist/components/method.d.ts +2 -0
  18. package/dist/components/method.js +10 -0
  19. package/dist/components/overview.d.ts +2 -0
  20. package/dist/components/overview.js +11 -0
  21. package/dist/components/primitives.d.ts +2 -0
  22. package/dist/components/primitives.js +8 -0
  23. package/dist/components/properties.d.ts +2 -0
  24. package/dist/components/properties.js +9 -0
  25. package/dist/components/sdk.d.ts +2 -0
  26. package/dist/components/sdk.js +10 -0
  27. package/dist/components/sidebar.d.ts +2 -0
  28. package/dist/components/sidebar.js +11 -0
  29. package/dist/components/snippets.d.ts +3 -0
  30. package/dist/components/snippets.js +9 -0
  31. package/dist/components-D7M-BwNI.js +71 -0
  32. package/dist/contexts/component-generics.d.ts +2 -0
  33. package/dist/contexts/component-generics.js +3 -0
  34. package/dist/contexts/component-types.d.ts +16 -0
  35. package/dist/contexts/component-types.js +0 -0
  36. package/dist/contexts/component.d.ts +29 -0
  37. package/dist/contexts/component.js +27 -0
  38. package/dist/contexts/docs.d.ts +2 -0
  39. package/dist/contexts/docs.js +3 -0
  40. package/dist/contexts/index.d.ts +16 -0
  41. package/dist/contexts/index.js +7 -0
  42. package/dist/contexts/markdown.d.ts +2 -0
  43. package/dist/contexts/markdown.js +4 -0
  44. package/dist/contexts/navigation.d.ts +2 -0
  45. package/dist/contexts/navigation.js +3 -0
  46. package/dist/contexts/use-components.d.ts +14 -0
  47. package/dist/contexts/use-components.js +4 -0
  48. package/dist/contexts-p3rRZDlM.js +39 -0
  49. package/dist/csharp-CDSxfCZE.js +283 -0
  50. package/dist/docs-CXqi26jB.js +54 -0
  51. package/dist/docs-dNFWvk6w.d.ts +47 -0
  52. package/dist/docs-mMDqYdkf.d.ts +47 -0
  53. package/dist/go-1c3S5ETL.js +303 -0
  54. package/dist/http-2QNWXH9t.js +330 -0
  55. package/dist/icons-Ckod9aod.js +869 -0
  56. package/dist/index-0imEqwWy.d.ts +15 -0
  57. package/dist/index-BJR7MT73.d.ts +13 -0
  58. package/dist/index-DGWbX2x8.d.ts +13 -0
  59. package/dist/index-DJO7hQAU.d.ts +274 -0
  60. package/dist/index-DMFZJxNb.d.ts +15 -0
  61. package/dist/index-tw6MEWKp.d.ts +274 -0
  62. package/dist/index.d.ts +19 -0
  63. package/dist/index.js +29 -7542
  64. package/dist/java-BbjF_oUI.js +403 -0
  65. package/dist/languages/csharp.d.ts +11 -0
  66. package/dist/languages/csharp.js +9 -0
  67. package/dist/languages/go.d.ts +11 -0
  68. package/dist/languages/go.js +9 -0
  69. package/dist/languages/http.d.ts +11 -0
  70. package/dist/languages/http.js +19 -0
  71. package/dist/languages/index.d.ts +11 -0
  72. package/dist/languages/index.js +26 -0
  73. package/dist/languages/java.d.ts +11 -0
  74. package/dist/languages/java.js +9 -0
  75. package/dist/languages/python.d.ts +11 -0
  76. package/dist/languages/python.js +9 -0
  77. package/dist/languages/ruby.d.ts +11 -0
  78. package/dist/languages/ruby.js +9 -0
  79. package/dist/languages/typescript.d.ts +11 -0
  80. package/dist/languages/typescript.js +9 -0
  81. package/dist/languages-BCYZjzuS.js +26 -0
  82. package/dist/markdown/index.d.ts +12 -0
  83. package/dist/markdown/index.js +104 -0
  84. package/dist/markdown/md.d.ts +15 -0
  85. package/dist/markdown/md.js +3 -0
  86. package/dist/markdown/printer.d.ts +2 -0
  87. package/dist/markdown/printer.js +28 -0
  88. package/dist/markdown/utils.d.ts +3 -0
  89. package/dist/markdown/utils.js +3 -0
  90. package/dist/markdown-CxdeWgjV.js +48 -0
  91. package/dist/markdown-DeSSIANr.d.ts +22 -0
  92. package/dist/markdown-OuUthjwK.d.ts +22 -0
  93. package/dist/md-oM2tUaCA.js +41 -0
  94. package/dist/method-BiXJltKa.d.ts +71 -0
  95. package/dist/method-CE08mUME.js +115 -0
  96. package/dist/method-DQ3lDoTM.d.ts +71 -0
  97. package/dist/navigation-BX8nuda9.d.ts +29 -0
  98. package/dist/navigation-C5TN0SgC.js +24 -0
  99. package/dist/navigation-CWDfzVoR.d.ts +29 -0
  100. package/dist/overview-B43BuZbK.d.ts +39 -0
  101. package/dist/overview-MTDgZ7Xr.d.ts +39 -0
  102. package/dist/overview-S2hUqPXA.js +139 -0
  103. package/dist/primitives-1lB1L0is.d.ts +97 -0
  104. package/dist/primitives-BIWfwN5L.js +258 -0
  105. package/dist/primitives-DLv4uMoz.d.ts +97 -0
  106. package/dist/printer-DBw4S_Jn.d.ts +13 -0
  107. package/dist/printer-bNxiG6UB.js +74 -0
  108. package/dist/properties-B-giMW4K.d.ts +54 -0
  109. package/dist/properties-BvP2WAjP.d.ts +54 -0
  110. package/dist/properties-jlGW3USi.js +131 -0
  111. package/dist/python-USOwFDv_.js +279 -0
  112. package/dist/routing-CMqh1cTZ.d.ts +54 -0
  113. package/dist/routing-Wbb7YECB.js +194 -0
  114. package/dist/routing.d.ts +2 -0
  115. package/dist/routing.js +3 -180
  116. package/dist/ruby-CSvGbSLe.js +387 -0
  117. package/dist/sdk-BwXeHS3_.d.ts +118 -0
  118. package/dist/sdk-CSCbbn3O.js +336 -0
  119. package/dist/sdk-DXdNszcC.d.ts +118 -0
  120. package/dist/sidebar-CWyvCrJ0.js +81 -0
  121. package/dist/sidebar-DGGt5gik.d.ts +36 -0
  122. package/dist/sidebar-DfS6SWQz.d.ts +36 -0
  123. package/dist/snippets-BQLXEIf6.js +161 -0
  124. package/dist/snippets-BRs_4F1I.d.ts +51 -0
  125. package/dist/snippets-DxSMK50g.d.ts +51 -0
  126. package/dist/spec.d.ts +65 -0
  127. package/dist/spec.js +167 -0
  128. package/dist/style-D7RO5ymE.d.ts +168 -0
  129. package/dist/style-gnVEeXFj.js +169 -0
  130. package/dist/style.d.ts +2 -0
  131. package/dist/style.js +3 -0
  132. package/dist/styles/main.css +727 -754
  133. package/dist/styles/main.js +0 -0
  134. package/dist/styles/primitives.css +317 -461
  135. package/dist/styles/primitives.js +0 -0
  136. package/dist/styles/resets.css +32 -41
  137. package/dist/styles/resets.js +0 -0
  138. package/dist/styles/search.css +175 -274
  139. package/dist/styles/search.js +0 -0
  140. package/dist/styles/sidebar.css +59 -60
  141. package/dist/styles/sidebar.js +0 -0
  142. package/dist/styles/variables.css +26 -89
  143. package/dist/styles/variables.js +0 -0
  144. package/dist/styles.css +2910 -0
  145. package/dist/styles.mjs +1 -0
  146. package/dist/typescript-DXG9psK3.js +449 -0
  147. package/dist/use-components-RWQbviGq.js +7 -0
  148. package/dist/utils-BaLi5Bed.d.ts +21 -0
  149. package/dist/utils-CqnL9Fc3.js +31 -0
  150. package/dist/utils-D_1AWSRX.js +32 -0
  151. package/dist/utils-_AEBNJhG.d.ts +21 -0
  152. package/dist/utils-d8paVwKN.d.ts +14 -0
  153. package/dist/utils.d.ts +2 -0
  154. package/dist/utils.js +3 -0
  155. package/package.json +73 -21
  156. package/dist/mcp.js +0 -16003
  157. package/dist/styles/snippets.css +0 -132
  158. package/src/components/breadcrumbs.tsx +0 -94
  159. package/src/components/chat.tsx +0 -154
  160. package/src/components/dropdown.tsx +0 -91
  161. package/src/components/icons.tsx +0 -584
  162. package/src/components/index.ts +0 -9
  163. package/src/components/method.tsx +0 -144
  164. package/src/components/overview.tsx +0 -159
  165. package/src/components/primitives.tsx +0 -284
  166. package/src/components/properties.tsx +0 -130
  167. package/src/components/scripts/dropdown.ts +0 -78
  168. package/src/components/sdk.tsx +0 -402
  169. package/src/components/sidebar.tsx +0 -99
  170. package/src/components/snippets.tsx +0 -179
  171. package/src/contexts/component-generics.tsx +0 -48
  172. package/src/contexts/component-types.tsx +0 -5
  173. package/src/contexts/component.tsx +0 -32
  174. package/src/contexts/docs.tsx +0 -75
  175. package/src/contexts/index.tsx +0 -17
  176. package/src/contexts/markdown.tsx +0 -43
  177. package/src/contexts/navigation.tsx +0 -44
  178. package/src/contexts/search.tsx +0 -28
  179. package/src/contexts/use-components.tsx +0 -4
  180. package/src/index.ts +0 -6
  181. package/src/languages/go.tsx +0 -281
  182. package/src/languages/http.tsx +0 -321
  183. package/src/languages/index.ts +0 -26
  184. package/src/languages/java.tsx +0 -358
  185. package/src/languages/python.tsx +0 -255
  186. package/src/languages/ruby.tsx +0 -320
  187. package/src/languages/typescript.tsx +0 -393
  188. package/src/markdown/index.ts +0 -107
  189. package/src/markdown/md.ts +0 -45
  190. package/src/markdown/utils.ts +0 -49
  191. package/src/routing.ts +0 -238
  192. package/src/search/form.tsx +0 -127
  193. package/src/search/index.tsx +0 -1
  194. package/src/search/indexer.ts +0 -246
  195. package/src/search/mcp.ts +0 -61
  196. package/src/search/printer.tsx +0 -86
  197. package/src/search/providers/algolia.ts +0 -88
  198. package/src/search/providers/fuse.ts +0 -19
  199. package/src/search/providers/pagefind.ts +0 -17
  200. package/src/search/providers/walker.ts +0 -30
  201. package/src/search/results.tsx +0 -181
  202. package/src/search/state.ts +0 -64
  203. package/src/search/types.ts +0 -116
  204. package/src/style.ts +0 -197
  205. package/src/styles/main.css +0 -993
  206. package/src/styles/primitives.css +0 -573
  207. package/src/styles/resets.css +0 -47
  208. package/src/styles/search.css +0 -342
  209. package/src/styles/sidebar.css +0 -87
  210. package/src/styles/snippets.css +0 -132
  211. package/src/styles/variables.css +0 -90
  212. package/src/utils.ts +0 -41
@@ -0,0 +1,104 @@
1
+ import "../docs-CXqi26jB.js";
2
+ import "../component-generics-B6Fn47Mz.js";
3
+ import "../navigation-C5TN0SgC.js";
4
+ import "../markdown-CxdeWgjV.js";
5
+ import "../contexts-p3rRZDlM.js";
6
+ import "../use-components-RWQbviGq.js";
7
+ import "../properties-jlGW3USi.js";
8
+ import "../method-CE08mUME.js";
9
+ import "../primitives-BIWfwN5L.js";
10
+ import "../icons-Ckod9aod.js";
11
+ import "../sdk-CSCbbn3O.js";
12
+ import "../snippets-BQLXEIf6.js";
13
+ import "../overview-S2hUqPXA.js";
14
+ import "../breadcrumbs-nSFZO5Gf.js";
15
+ import "../sidebar-CWyvCrJ0.js";
16
+ import "../components-D7M-BwNI.js";
17
+ import "../typescript-DXG9psK3.js";
18
+ import "../java-BbjF_oUI.js";
19
+ import "../go-1c3S5ETL.js";
20
+ import "../python-USOwFDv_.js";
21
+ import "../ruby-CSvGbSLe.js";
22
+ import "../http-2QNWXH9t.js";
23
+ import "../csharp-CDSxfCZE.js";
24
+ import "../languages-BCYZjzuS.js";
25
+ import "../component-DRO8kQSp.js";
26
+ import { a as item, c as parse, l as strong, n as fence, o as list, r as heading, s as paragraph, t as code, u as text } from "../md-oM2tUaCA.js";
27
+ import { n as getSnippet, r as stripMarkup, t as getDecl } from "../utils-CqnL9Fc3.js";
28
+ import { n as methodSignature, r as printer_exports, t as declaration$1 } from "../printer-bNxiG6UB.js";
29
+ import Markdoc from "@markdoc/markdoc";
30
+
31
+ //#region src/markdown/index.ts
32
+ function declaration(env, decl) {
33
+ const content = declaration$1(env.language, decl);
34
+ return paragraph(code(stripMarkup(content)));
35
+ }
36
+ function renderChildren(env, children, nesting = []) {
37
+ return list(...children.map((child) => renderDecl(env, child, nesting)));
38
+ }
39
+ function renderDecl(env, path, nesting = []) {
40
+ const decl = getDecl(env, path);
41
+ const item$1 = item(declaration(env, decl));
42
+ const hasChildren = "children" in decl && decl.children && decl.children.length > 0;
43
+ const showModelProps = !("modelPath" in decl && decl["modelPath"]) || env.options.includeModelProperties;
44
+ if ("docstring" in decl && decl.docstring) item$1.children.push(...parse(decl.docstring));
45
+ if (hasChildren && showModelProps && !nesting.includes(path)) item$1.push(renderChildren(env, decl.children ?? [], [...nesting, path]));
46
+ return item$1;
47
+ }
48
+ function renderMethod(env, method) {
49
+ const decl = getDecl(env, method.stainlessPath);
50
+ if (!decl) return [paragraph(text("The method "), code(method.name), text(" is not available in this language."))];
51
+ const signature = methodSignature(env.language, decl);
52
+ const [httpMethod, endpoint] = method.endpoint.split(" ");
53
+ const output = [
54
+ heading(2, method.title),
55
+ ...env.language === "http" ? [] : [paragraph(code(stripMarkup(signature)))],
56
+ paragraph(strong(text(httpMethod)), text(" "), code(endpoint))
57
+ ];
58
+ if (method.description) output.push(...parse(method.description));
59
+ if (env.language === "http") {
60
+ const p = "paramsChildren" in decl && typeof decl.paramsChildren === "object" ? decl.paramsChildren : {};
61
+ for (const [location, value] of Object.entries(p)) {
62
+ if (value.length < 1) continue;
63
+ output.push(heading(3, [
64
+ text(location.at(0)?.toUpperCase() ?? ""),
65
+ text(location.slice(1)),
66
+ text(" Parameters")
67
+ ]), renderChildren(env, value));
68
+ }
69
+ const bp = "bodyParamsChildren" in decl ? decl.bodyParamsChildren?.["application/json"] : [];
70
+ if (bp && bp.length > 0) output.push(heading(3, "Body Parameters"), renderChildren(env, bp));
71
+ }
72
+ if ("paramsChildren" in decl && Array.isArray(decl.paramsChildren) && decl.paramsChildren.length > 0) output.push(heading(3, "Parameters"), renderChildren(env, decl.paramsChildren));
73
+ if ("responseChildren" in decl && decl.responseChildren && decl.responseChildren.length > 0) output.push(heading(3, "Returns"), renderChildren(env, decl.responseChildren));
74
+ const snippet = getSnippet(env, method.stainlessPath);
75
+ if (snippet) output.push(heading(3, "Example"), fence(env.language, snippet));
76
+ return output;
77
+ }
78
+ function renderModel(env, model) {
79
+ return [heading(3, model.title), list(renderDecl(env, `${model.stainlessPath} > (schema)`))];
80
+ }
81
+ function renderResource(env, resource) {
82
+ const methods = Object.values(resource.methods).filter((method) => getDecl(env, method.stainlessPath)).flatMap((method) => renderMethod(env, method));
83
+ const models = Object.values(resource.models).filter((model) => getDecl(env, `${model.stainlessPath} > (schema)`)).flatMap((model) => renderModel(env, model));
84
+ const doc = [heading(1, resource.title), ...methods];
85
+ if (models.length > 0) doc.push(heading(2, "Domain Types"), ...models);
86
+ if (!env.options.renderNestedResources) return doc;
87
+ const children = Object.values(resource.subresources ?? {}).flatMap((resource$1) => renderResource(env, resource$1));
88
+ return [...doc, ...children];
89
+ }
90
+ function render(env, node) {
91
+ switch (node.kind) {
92
+ case "resource": return renderResource(env, node);
93
+ case "http_method": return renderMethod(env, node);
94
+ case "model": return renderModel(env, node);
95
+ }
96
+ }
97
+ function renderMarkdown(env, node) {
98
+ const content = render(env, node);
99
+ const doc = new Markdoc.Ast.Node("document", {}, content);
100
+ return Markdoc.format(doc);
101
+ }
102
+
103
+ //#endregion
104
+ export { declaration, printer_exports as printer, render, renderMarkdown };
@@ -0,0 +1,15 @@
1
+ import { Node } from "@markdoc/markdoc";
2
+
3
+ //#region src/markdown/md.d.ts
4
+ declare function heading(level: number, children: string | Node[]): Node;
5
+ declare function text(content: string): Node;
6
+ declare function code(content: string): Node;
7
+ declare function paragraph(...children: Node[]): Node;
8
+ declare function list(...children: Node[]): Node;
9
+ declare function item(...children: Node[]): Node;
10
+ declare function strong(...children: Node[]): Node;
11
+ declare function inline(...children: Node[]): Node;
12
+ declare function fence(language: string, content: string): Node;
13
+ declare function parse(content: string): Node[];
14
+ //#endregion
15
+ export { code, fence, heading, inline, item, list, paragraph, parse, strong, text };
@@ -0,0 +1,3 @@
1
+ import { a as item, c as parse, i as inline, l as strong, n as fence, o as list, r as heading, s as paragraph, t as code, u as text } from "../md-oM2tUaCA.js";
2
+
3
+ export { code, fence, heading, inline, item, list, paragraph, parse, strong, text };
@@ -0,0 +1,2 @@
1
+ import { a as typeName, i as type, n as methodSignature, t as declaration } from "../printer-DBw4S_Jn.js";
2
+ export { declaration, methodSignature, type, typeName };
@@ -0,0 +1,28 @@
1
+ import "../docs-CXqi26jB.js";
2
+ import "../component-generics-B6Fn47Mz.js";
3
+ import "../navigation-C5TN0SgC.js";
4
+ import "../markdown-CxdeWgjV.js";
5
+ import "../contexts-p3rRZDlM.js";
6
+ import "../use-components-RWQbviGq.js";
7
+ import "../properties-jlGW3USi.js";
8
+ import "../method-CE08mUME.js";
9
+ import "../primitives-BIWfwN5L.js";
10
+ import "../icons-Ckod9aod.js";
11
+ import "../sdk-CSCbbn3O.js";
12
+ import "../snippets-BQLXEIf6.js";
13
+ import "../overview-S2hUqPXA.js";
14
+ import "../breadcrumbs-nSFZO5Gf.js";
15
+ import "../sidebar-CWyvCrJ0.js";
16
+ import "../components-D7M-BwNI.js";
17
+ import "../typescript-DXG9psK3.js";
18
+ import "../java-BbjF_oUI.js";
19
+ import "../go-1c3S5ETL.js";
20
+ import "../python-USOwFDv_.js";
21
+ import "../ruby-CSvGbSLe.js";
22
+ import "../http-2QNWXH9t.js";
23
+ import "../csharp-CDSxfCZE.js";
24
+ import "../languages-BCYZjzuS.js";
25
+ import "../component-DRO8kQSp.js";
26
+ import { a as typeName, i as type, n as methodSignature, t as declaration } from "../printer-bNxiG6UB.js";
27
+
28
+ export { declaration, methodSignature, type, typeName };
@@ -0,0 +1,3 @@
1
+ import "../sdk-BwXeHS3_.js";
2
+ import { i as stripMarkup, n as getDecl, r as getSnippet, t as EnvironmentType } from "../utils-_AEBNJhG.js";
3
+ export { EnvironmentType, getDecl, getSnippet, stripMarkup };
@@ -0,0 +1,3 @@
1
+ import { n as getSnippet, r as stripMarkup, t as getDecl } from "../utils-CqnL9Fc3.js";
2
+
3
+ export { getDecl, getSnippet, stripMarkup };
@@ -0,0 +1,48 @@
1
+ import { a as useLanguage } from "./docs-CXqi26jB.js";
2
+ import * as React$1 from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ //#region src/contexts/markdown.tsx
6
+ const HighlightLanguageMappings = {
7
+ node: "typescript",
8
+ http: "bash"
9
+ };
10
+ const MarkdownContext = React$1.createContext({
11
+ highlight: (content) => content,
12
+ render: (content) => content
13
+ });
14
+ const useMarkdownContext = () => React$1.useContext(MarkdownContext);
15
+ function useRenderMarkdown(content) {
16
+ const { render } = React$1.useContext(MarkdownContext);
17
+ return React$1.useMemo(() => {
18
+ if (!content) return void 0;
19
+ const rendered = render(content);
20
+ return typeof rendered === "string" ? rendered : React$1.use(rendered);
21
+ }, [content, render]);
22
+ }
23
+ function useHighlight(content, language) {
24
+ const { highlight } = React$1.useContext(MarkdownContext);
25
+ const defaultLanguage = useLanguage();
26
+ const lang = language ?? defaultLanguage;
27
+ return React$1.useMemo(() => {
28
+ if (lang === "none") return content;
29
+ const rendered = highlight(content, HighlightLanguageMappings[lang] ?? lang);
30
+ return typeof rendered === "string" ? rendered : React$1.use(rendered);
31
+ }, [
32
+ content,
33
+ highlight,
34
+ lang
35
+ ]);
36
+ }
37
+ function MarkdownProvider({ render, highlight, children }) {
38
+ return /* @__PURE__ */ jsx(MarkdownContext.Provider, {
39
+ value: {
40
+ render,
41
+ highlight
42
+ },
43
+ children
44
+ });
45
+ }
46
+
47
+ //#endregion
48
+ export { useRenderMarkdown as a, useMarkdownContext as i, MarkdownProvider as n, useHighlight as r, MarkdownContext as t };
@@ -0,0 +1,22 @@
1
+ import * as React$1 from "react";
2
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
3
+
4
+ //#region src/contexts/markdown.d.ts
5
+ type MarkdownContext = {
6
+ highlight: (content: string, language: string) => string | Promise<string>;
7
+ render: (content: string) => string | Promise<string>;
8
+ };
9
+ declare const MarkdownContext: React$1.Context<MarkdownContext>;
10
+ declare const useMarkdownContext: () => MarkdownContext;
11
+ declare function useRenderMarkdown(content?: string): string | undefined;
12
+ declare function useHighlight(content: string, language?: string): string;
13
+ type MarkdownProviderProps = MarkdownContext & {
14
+ children: React$1.ReactNode;
15
+ };
16
+ declare function MarkdownProvider({
17
+ render,
18
+ highlight,
19
+ children
20
+ }: MarkdownProviderProps): react_jsx_runtime12.JSX.Element;
21
+ //#endregion
22
+ export { useMarkdownContext as a, useHighlight as i, MarkdownProvider as n, useRenderMarkdown as o, MarkdownProviderProps as r, MarkdownContext as t };
@@ -0,0 +1,22 @@
1
+ import * as React$1 from "react";
2
+ import * as react_jsx_runtime66 from "react/jsx-runtime";
3
+
4
+ //#region src/contexts/markdown.d.ts
5
+ type MarkdownContext = {
6
+ highlight: (content: string, language: string) => string | Promise<string>;
7
+ render: (content: string) => string | Promise<string>;
8
+ };
9
+ declare const MarkdownContext: React$1.Context<MarkdownContext>;
10
+ declare const useMarkdownContext: () => MarkdownContext;
11
+ declare function useRenderMarkdown(content?: string): string | undefined;
12
+ declare function useHighlight(content: string, language?: string): string;
13
+ type MarkdownProviderProps = MarkdownContext & {
14
+ children: React$1.ReactNode;
15
+ };
16
+ declare function MarkdownProvider({
17
+ render,
18
+ highlight,
19
+ children
20
+ }: MarkdownProviderProps): react_jsx_runtime66.JSX.Element;
21
+ //#endregion
22
+ export { useMarkdownContext as a, useHighlight as i, MarkdownProvider as n, useRenderMarkdown as o, MarkdownProviderProps as r, MarkdownContext as t };
@@ -0,0 +1,41 @@
1
+ import Markdoc from "@markdoc/markdoc";
2
+
3
+ //#region src/markdown/md.ts
4
+ function heading(level, children) {
5
+ const content = inline(...typeof children === "string" ? [text(children)] : children);
6
+ return new Markdoc.Ast.Node("heading", { level }, [content]);
7
+ }
8
+ function text(content) {
9
+ return new Markdoc.Ast.Node("text", { content });
10
+ }
11
+ function code(content) {
12
+ return new Markdoc.Ast.Node("code", { content });
13
+ }
14
+ function paragraph(...children) {
15
+ const inline$1 = new Markdoc.Ast.Node("inline", {}, children);
16
+ return new Markdoc.Ast.Node("paragraph", {}, [inline$1]);
17
+ }
18
+ function list(...children) {
19
+ return new Markdoc.Ast.Node("list", { ordered: false }, children);
20
+ }
21
+ function item(...children) {
22
+ return new Markdoc.Ast.Node("item", {}, children);
23
+ }
24
+ function strong(...children) {
25
+ return new Markdoc.Ast.Node("strong", {}, children);
26
+ }
27
+ function inline(...children) {
28
+ return new Markdoc.Ast.Node("inline", {}, children);
29
+ }
30
+ function fence(language, content) {
31
+ return new Markdoc.Ast.Node("fence", {
32
+ language,
33
+ content
34
+ });
35
+ }
36
+ function parse(content) {
37
+ return Markdoc.parse(content).children;
38
+ }
39
+
40
+ //#endregion
41
+ export { item as a, parse as c, inline as i, strong as l, fence as n, list as o, heading as r, paragraph as s, code as t, text as u };
@@ -0,0 +1,71 @@
1
+ import * as React$1 from "react";
2
+ import { ReactNode } from "react";
3
+ import * as react_jsx_runtime78 from "react/jsx-runtime";
4
+ import { LucideIcon } from "lucide-react";
5
+
6
+ //#region src/components/method.d.ts
7
+ declare const HttpMethods: string[];
8
+ type HTTPMethod = (typeof HttpMethods)[number];
9
+ declare const HttpMethodIcons: Record<HTTPMethod, LucideIcon>;
10
+ type MethodIconProps = {
11
+ httpMethod?: string;
12
+ showName?: boolean;
13
+ };
14
+ declare function MethodIconBadge({
15
+ httpMethod,
16
+ showName
17
+ }: MethodIconProps): react_jsx_runtime78.JSX.Element | null;
18
+ type MethodHeaderProps = {
19
+ title: ReactNode;
20
+ level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
21
+ signature?: ReactNode;
22
+ badges?: ReactNode;
23
+ children?: ReactNode;
24
+ };
25
+ declare function MethodHeader({
26
+ title,
27
+ badges,
28
+ signature,
29
+ children,
30
+ level
31
+ }: MethodHeaderProps): react_jsx_runtime78.JSX.Element;
32
+ type MethodRouteProps = {
33
+ httpMethod?: string;
34
+ endpoint?: string | ReactNode;
35
+ iconOnly?: boolean;
36
+ };
37
+ declare function MethodRoute({
38
+ httpMethod,
39
+ endpoint,
40
+ iconOnly
41
+ }: MethodRouteProps): react_jsx_runtime78.JSX.Element;
42
+ type MethodDescriptionProps = {
43
+ description?: string;
44
+ };
45
+ declare function MethodDescription({
46
+ description
47
+ }: MethodDescriptionProps): react_jsx_runtime78.JSX.Element | undefined;
48
+ type MethodInfoProps = {
49
+ children?: ReactNode;
50
+ parameters?: ReactNode;
51
+ returns?: ReactNode;
52
+ };
53
+ declare function MethodInfo({
54
+ children,
55
+ parameters,
56
+ returns
57
+ }: MethodInfoProps): react_jsx_runtime78.JSX.Element;
58
+ type MethodProps = {
59
+ id?: string;
60
+ header?: ReactNode;
61
+ children?: ReactNode;
62
+ } & React$1.HTMLProps<HTMLDivElement>;
63
+ declare function Method({
64
+ id,
65
+ header,
66
+ children,
67
+ className,
68
+ ...props
69
+ }: MethodProps): react_jsx_runtime78.JSX.Element;
70
+ //#endregion
71
+ export { MethodDescription as a, MethodHeaderProps as c, MethodInfo as d, MethodInfoProps as f, MethodRouteProps as h, Method as i, MethodIconBadge as l, MethodRoute as m, HttpMethodIcons as n, MethodDescriptionProps as o, MethodProps as p, HttpMethods as r, MethodHeader as s, HTTPMethod as t, MethodIconProps as u };
@@ -0,0 +1,115 @@
1
+ import { t as useComponents } from "./use-components-RWQbviGq.js";
2
+ import { t as style_default } from "./style-gnVEeXFj.js";
3
+ import { i as PropertyToggle } from "./properties-jlGW3USi.js";
4
+ import * as React$1 from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { ArrowDownLeft, ArrowUpRight, X } from "lucide-react";
7
+ import clsx from "clsx";
8
+
9
+ //#region src/components/method.tsx
10
+ const HttpMethods = [
11
+ "get",
12
+ "head",
13
+ "put",
14
+ "delete",
15
+ "post",
16
+ "patch"
17
+ ];
18
+ const HttpMethodIcons = {
19
+ get: ArrowDownLeft,
20
+ put: ArrowUpRight,
21
+ post: ArrowUpRight,
22
+ patch: ArrowUpRight,
23
+ delete: X
24
+ };
25
+ function MethodIconBadge({ httpMethod, showName }) {
26
+ if (!httpMethod || !HttpMethods.includes(httpMethod)) return null;
27
+ return /* @__PURE__ */ jsxs("span", {
28
+ className: clsx(style_default.MethodRouteHttpMethod, style_default.MethodRouteHttpMethodIconOnly),
29
+ "data-method": httpMethod,
30
+ children: [HttpMethodIcons[httpMethod] && React$1.createElement(HttpMethodIcons[httpMethod], {
31
+ size: 14,
32
+ strokeWidth: 3,
33
+ className: style_default.Icon
34
+ }), showName && httpMethod]
35
+ });
36
+ }
37
+ function MethodHeader({ title, badges, signature, children, level }) {
38
+ const Heading = level ?? "h5";
39
+ return /* @__PURE__ */ jsxs("div", {
40
+ className: style_default.MethodHeader,
41
+ children: [
42
+ /* @__PURE__ */ jsx(Heading, {
43
+ className: style_default.MethodTitle,
44
+ children: title
45
+ }),
46
+ badges && /* @__PURE__ */ jsx("div", {
47
+ className: style_default.MethodBadges,
48
+ children: badges
49
+ }),
50
+ signature,
51
+ children
52
+ ]
53
+ });
54
+ }
55
+ function MethodRoute({ httpMethod, endpoint, iconOnly }) {
56
+ return /* @__PURE__ */ jsxs("div", {
57
+ className: style_default.MethodRoute,
58
+ children: [/* @__PURE__ */ jsx(MethodIconBadge, {
59
+ httpMethod,
60
+ showName: !iconOnly
61
+ }), endpoint && /* @__PURE__ */ jsx("span", {
62
+ className: style_default.MethodRouteEndpoint,
63
+ children: endpoint
64
+ })]
65
+ });
66
+ }
67
+ function MethodDescription({ description }) {
68
+ const { Markdown } = useComponents();
69
+ if (description) return /* @__PURE__ */ jsx("div", {
70
+ className: style_default.MethodDescription,
71
+ children: /* @__PURE__ */ jsx(Markdown, { content: description })
72
+ });
73
+ }
74
+ function MethodInfo({ children, parameters, returns }) {
75
+ return /* @__PURE__ */ jsxs("div", {
76
+ className: style_default.MethodInfo,
77
+ children: [
78
+ children && /* @__PURE__ */ jsx("div", {
79
+ className: style_default.MethodContent,
80
+ children
81
+ }),
82
+ parameters && /* @__PURE__ */ jsxs("div", {
83
+ className: style_default.MethodInfoSection,
84
+ children: [/* @__PURE__ */ jsxs("h5", { children: ["Parameters", /* @__PURE__ */ jsx(PropertyToggle, { target: "parameters" })] }), /* @__PURE__ */ jsx("div", {
85
+ className: style_default.MethodParameters,
86
+ "data-stldocs-property-group": "parameters",
87
+ children: parameters
88
+ })]
89
+ }),
90
+ returns && /* @__PURE__ */ jsxs("div", {
91
+ className: style_default.MethodInfoSection,
92
+ children: [/* @__PURE__ */ jsxs("h5", { children: ["Returns", /* @__PURE__ */ jsx(PropertyToggle, { target: "returns" })] }), /* @__PURE__ */ jsx("div", {
93
+ className: style_default.MethodReturns,
94
+ "data-stldocs-property-group": "returns",
95
+ children: returns
96
+ })]
97
+ })
98
+ ]
99
+ });
100
+ }
101
+ function Method({ id, header, children, className, ...props }) {
102
+ return /* @__PURE__ */ jsxs("div", {
103
+ id,
104
+ className: clsx(style_default.Method, className),
105
+ tabIndex: 0,
106
+ ...props,
107
+ children: [header, /* @__PURE__ */ jsx("div", {
108
+ className: style_default.MethodBody,
109
+ children
110
+ })]
111
+ });
112
+ }
113
+
114
+ //#endregion
115
+ export { MethodHeader as a, MethodRoute as c, MethodDescription as i, HttpMethods as n, MethodIconBadge as o, Method as r, MethodInfo as s, HttpMethodIcons as t };
@@ -0,0 +1,71 @@
1
+ import * as React$1 from "react";
2
+ import { ReactNode } from "react";
3
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
4
+ import { LucideIcon } from "lucide-react";
5
+
6
+ //#region src/components/method.d.ts
7
+ declare const HttpMethods: string[];
8
+ type HTTPMethod = (typeof HttpMethods)[number];
9
+ declare const HttpMethodIcons: Record<HTTPMethod, LucideIcon>;
10
+ type MethodIconProps = {
11
+ httpMethod?: string;
12
+ showName?: boolean;
13
+ };
14
+ declare function MethodIconBadge({
15
+ httpMethod,
16
+ showName
17
+ }: MethodIconProps): react_jsx_runtime14.JSX.Element | null;
18
+ type MethodHeaderProps = {
19
+ title: ReactNode;
20
+ level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
21
+ signature?: ReactNode;
22
+ badges?: ReactNode;
23
+ children?: ReactNode;
24
+ };
25
+ declare function MethodHeader({
26
+ title,
27
+ badges,
28
+ signature,
29
+ children,
30
+ level
31
+ }: MethodHeaderProps): react_jsx_runtime14.JSX.Element;
32
+ type MethodRouteProps = {
33
+ httpMethod?: string;
34
+ endpoint?: string | ReactNode;
35
+ iconOnly?: boolean;
36
+ };
37
+ declare function MethodRoute({
38
+ httpMethod,
39
+ endpoint,
40
+ iconOnly
41
+ }: MethodRouteProps): react_jsx_runtime14.JSX.Element;
42
+ type MethodDescriptionProps = {
43
+ description?: string;
44
+ };
45
+ declare function MethodDescription({
46
+ description
47
+ }: MethodDescriptionProps): react_jsx_runtime14.JSX.Element | undefined;
48
+ type MethodInfoProps = {
49
+ children?: ReactNode;
50
+ parameters?: ReactNode;
51
+ returns?: ReactNode;
52
+ };
53
+ declare function MethodInfo({
54
+ children,
55
+ parameters,
56
+ returns
57
+ }: MethodInfoProps): react_jsx_runtime14.JSX.Element;
58
+ type MethodProps = {
59
+ id?: string;
60
+ header?: ReactNode;
61
+ children?: ReactNode;
62
+ } & React$1.HTMLProps<HTMLDivElement>;
63
+ declare function Method({
64
+ id,
65
+ header,
66
+ children,
67
+ className,
68
+ ...props
69
+ }: MethodProps): react_jsx_runtime14.JSX.Element;
70
+ //#endregion
71
+ export { MethodDescription as a, MethodHeaderProps as c, MethodInfo as d, MethodInfoProps as f, MethodRouteProps as h, Method as i, MethodIconBadge as l, MethodRoute as m, HttpMethodIcons as n, MethodDescriptionProps as o, MethodProps as p, HttpMethods as r, MethodHeader as s, HTTPMethod as t, MethodIconProps as u };
@@ -0,0 +1,29 @@
1
+ import { t as DocsLanguage } from "./routing-CMqh1cTZ.js";
2
+ import * as React$1 from "react";
3
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
4
+
5
+ //#region src/contexts/navigation.d.ts
6
+ type NavigationHandler = (ev: React$1.MouseEvent | null, opts: {
7
+ href: string;
8
+ language: DocsLanguage;
9
+ stainlessPath: string;
10
+ scroll: boolean;
11
+ }) => void;
12
+ type NavigationContextType = {
13
+ basePath?: string;
14
+ selectedPath?: string;
15
+ navigationPath?: string[];
16
+ onNavigate?: NavigationHandler;
17
+ };
18
+ declare function useNavigation(): NavigationContextType;
19
+ type NavigationProviderProps = NavigationContextType & {
20
+ children: React$1.ReactNode;
21
+ };
22
+ declare function NavigationProvider({
23
+ basePath,
24
+ selectedPath,
25
+ onNavigate,
26
+ children
27
+ }: NavigationProviderProps): react_jsx_runtime13.JSX.Element;
28
+ //#endregion
29
+ export { useNavigation as a, NavigationProviderProps as i, NavigationHandler as n, NavigationProvider as r, NavigationContextType as t };
@@ -0,0 +1,24 @@
1
+ import * as React$1 from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+
4
+ //#region src/contexts/navigation.tsx
5
+ const Defaults = { basePath: "/" };
6
+ const NavigationContext = React$1.createContext(Defaults);
7
+ function useNavigation() {
8
+ return React$1.useContext(NavigationContext);
9
+ }
10
+ function NavigationProvider({ basePath, selectedPath, onNavigate, children }) {
11
+ const value = {
12
+ ...Defaults,
13
+ onNavigate,
14
+ basePath,
15
+ selectedPath
16
+ };
17
+ return /* @__PURE__ */ jsx(NavigationContext.Provider, {
18
+ value,
19
+ children
20
+ });
21
+ }
22
+
23
+ //#endregion
24
+ export { useNavigation as n, NavigationProvider as t };
@@ -0,0 +1,29 @@
1
+ import { t as DocsLanguage } from "./routing-CMqh1cTZ.js";
2
+ import * as React$1 from "react";
3
+ import * as react_jsx_runtime27 from "react/jsx-runtime";
4
+
5
+ //#region src/contexts/navigation.d.ts
6
+ type NavigationHandler = (ev: React$1.MouseEvent | null, opts: {
7
+ href: string;
8
+ language: DocsLanguage;
9
+ stainlessPath: string;
10
+ scroll: boolean;
11
+ }) => void;
12
+ type NavigationContextType = {
13
+ basePath?: string;
14
+ selectedPath?: string;
15
+ navigationPath?: string[];
16
+ onNavigate?: NavigationHandler;
17
+ };
18
+ declare function useNavigation(): NavigationContextType;
19
+ type NavigationProviderProps = NavigationContextType & {
20
+ children: React$1.ReactNode;
21
+ };
22
+ declare function NavigationProvider({
23
+ basePath,
24
+ selectedPath,
25
+ onNavigate,
26
+ children
27
+ }: NavigationProviderProps): react_jsx_runtime27.JSX.Element;
28
+ //#endregion
29
+ export { useNavigation as a, NavigationProviderProps as i, NavigationHandler as n, NavigationProvider as r, NavigationContextType as t };