@stainless-api/docs-ui 0.1.0-beta.48 → 0.1.0-beta.49

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 (160) hide show
  1. package/dist/{breadcrumbs-TNRag6Vy.d.ts → breadcrumbs-DEyC9k79.d.ts} +2 -2
  2. package/dist/breadcrumbs-nSFZO5Gf.js +63 -0
  3. package/dist/component-DRO8kQSp.js +23 -0
  4. package/dist/{component-generics-F0_Dx7UT.js → component-generics-B6Fn47Mz.js} +1 -1
  5. package/dist/{component-generics-Cs7jFHLq.d.ts → component-generics-COP53CRn.d.ts} +2 -2
  6. package/dist/component-generics-fyFHB6qA.d.ts +30 -0
  7. package/dist/components/MaskedInput.d.ts +1 -1
  8. package/dist/components/MaskedInput.js +1 -1
  9. package/dist/components/breadcrumbs.d.ts +1 -1
  10. package/dist/components/breadcrumbs.js +7 -9
  11. package/dist/components/icons.d.ts +11 -11
  12. package/dist/components/icons.js +1 -1
  13. package/dist/components/index.d.ts +9 -9
  14. package/dist/components/index.js +16 -9
  15. package/dist/components/method.d.ts +1 -1
  16. package/dist/components/method.js +8 -9
  17. package/dist/components/overview.d.ts +1 -1
  18. package/dist/components/overview.js +9 -9
  19. package/dist/components/primitives.d.ts +1 -1
  20. package/dist/components/primitives.js +6 -9
  21. package/dist/components/properties.d.ts +1 -1
  22. package/dist/components/properties.js +7 -9
  23. package/dist/components/sdk.d.ts +1 -1
  24. package/dist/components/sdk.js +8 -9
  25. package/dist/components/sidebar.d.ts +1 -1
  26. package/dist/components/sidebar.js +9 -9
  27. package/dist/components/snippets.d.ts +2 -2
  28. package/dist/components/snippets.js +7 -9
  29. package/dist/components-D7M-BwNI.js +71 -0
  30. package/dist/contexts/component-generics.d.ts +1 -1
  31. package/dist/contexts/component-generics.js +1 -1
  32. package/dist/contexts/component-types.d.ts +10 -10
  33. package/dist/contexts/component.d.ts +13 -13
  34. package/dist/contexts/component.js +25 -9
  35. package/dist/contexts/docs.d.ts +1 -1
  36. package/dist/contexts/docs.js +1 -1
  37. package/dist/contexts/index.d.ts +16 -17
  38. package/dist/contexts/index.js +6 -10
  39. package/dist/contexts/markdown.d.ts +1 -1
  40. package/dist/contexts/markdown.js +2 -2
  41. package/dist/contexts/navigation.d.ts +1 -1
  42. package/dist/contexts/navigation.js +1 -1
  43. package/dist/contexts/use-components.d.ts +9 -9
  44. package/dist/contexts/use-components.js +2 -2
  45. package/dist/contexts-p3rRZDlM.js +39 -0
  46. package/dist/csharp-CDSxfCZE.js +283 -0
  47. package/dist/docs-yYrp-uzs.d.ts +47 -0
  48. package/dist/go-1c3S5ETL.js +303 -0
  49. package/dist/http-2QNWXH9t.js +330 -0
  50. package/dist/{index-Dt1TxDPe.d.ts → index-BQpRynot.d.ts} +8 -8
  51. package/dist/{index-BPQVqZ6-.d.ts → index-CnilsjrJ.d.ts} +30 -30
  52. package/dist/index-Ct0NcQUK.d.ts +274 -0
  53. package/dist/{index-D_zoydBM.d.ts → index-D6NhcxHd.d.ts} +6 -7
  54. package/dist/index-LboM0f0c.d.ts +15 -0
  55. package/dist/index-avtZIGmX.d.ts +13 -0
  56. package/dist/index.d.ts +18 -19
  57. package/dist/index.js +27 -12
  58. package/dist/java-BbjF_oUI.js +403 -0
  59. package/dist/languages/csharp.d.ts +10 -10
  60. package/dist/languages/csharp.js +7 -9
  61. package/dist/languages/go.d.ts +10 -10
  62. package/dist/languages/go.js +7 -9
  63. package/dist/languages/http.d.ts +10 -10
  64. package/dist/languages/http.js +17 -9
  65. package/dist/languages/index.d.ts +10 -10
  66. package/dist/languages/index.js +24 -9
  67. package/dist/languages/java.d.ts +10 -10
  68. package/dist/languages/java.js +7 -9
  69. package/dist/languages/python.d.ts +10 -10
  70. package/dist/languages/python.js +7 -9
  71. package/dist/languages/ruby.d.ts +10 -10
  72. package/dist/languages/ruby.js +7 -9
  73. package/dist/languages/typescript.d.ts +10 -10
  74. package/dist/languages/typescript.js +7 -9
  75. package/dist/languages-BCYZjzuS.js +26 -0
  76. package/dist/markdown/index.d.ts +4 -3
  77. package/dist/markdown/index.js +103 -10
  78. package/dist/markdown/md.js +1 -1
  79. package/dist/markdown/printer.d.ts +2 -0
  80. package/dist/markdown/printer.js +28 -0
  81. package/dist/markdown/utils.d.ts +2 -2
  82. package/dist/markdown/utils.js +1 -1
  83. package/dist/{markdown-J4fsbXbi.d.ts → markdown-C8o8WrwG.d.ts} +2 -2
  84. package/dist/{markdown-Bx-mQFEj.js → markdown-CxdeWgjV.js} +1 -1
  85. package/dist/markdown-DA2cRtlr.d.ts +22 -0
  86. package/dist/{method-uqti5jIi.d.ts → method-B6eAtYl2.d.ts} +7 -7
  87. package/dist/method-CE08mUME.js +115 -0
  88. package/dist/{navigation-DztmhdsO.d.ts → navigation-BfAVGPgw.d.ts} +3 -3
  89. package/dist/navigation-CjBnMcop.d.ts +29 -0
  90. package/dist/{overview-CXiAiRu3.d.ts → overview-CswoJHww.d.ts} +6 -6
  91. package/dist/overview-DeZSiqFa.d.ts +39 -0
  92. package/dist/overview-S2hUqPXA.js +139 -0
  93. package/dist/primitives-BIWfwN5L.js +258 -0
  94. package/dist/{primitives-CS8fdjfv.d.ts → primitives-Caj5rKBc.d.ts} +9 -9
  95. package/dist/primitives-CbqXZ-5f.d.ts +97 -0
  96. package/dist/printer-DBw4S_Jn.d.ts +13 -0
  97. package/dist/printer-DVZVkqAr.d.ts +13 -0
  98. package/dist/printer-bNxiG6UB.js +74 -0
  99. package/dist/{properties-Bf600pp5.d.ts → properties-BkUlpvU4.d.ts} +5 -5
  100. package/dist/properties-jlGW3USi.js +131 -0
  101. package/dist/python-USOwFDv_.js +279 -0
  102. package/dist/{routing-BcGPNh2R.d.ts → routing-CMqh1cTZ.d.ts} +1 -1
  103. package/dist/routing-Dhmv52Fd.d.ts +54 -0
  104. package/dist/{routing-BGBmkDBL.js → routing-Wbb7YECB.js} +1 -1
  105. package/dist/routing.d.ts +1 -1
  106. package/dist/routing.js +1 -1
  107. package/dist/ruby-CSvGbSLe.js +387 -0
  108. package/dist/{sdk-CuOpWo9I.d.ts → sdk-BOwYR0k6.d.ts} +14 -14
  109. package/dist/sdk-CSCbbn3O.js +336 -0
  110. package/dist/sdk-CdhDsvo3.d.ts +118 -0
  111. package/dist/{sidebar-CqfIoVcr.d.ts → sidebar-BXz93vSy.d.ts} +5 -5
  112. package/dist/sidebar-CWyvCrJ0.js +81 -0
  113. package/dist/snippets-BQLXEIf6.js +161 -0
  114. package/dist/{snippets-BwifQYD4.d.ts → snippets-CbVFNmfq.d.ts} +8 -8
  115. package/dist/snippets-Wjo2dJNw.d.ts +51 -0
  116. package/dist/spec.d.ts +3 -3
  117. package/dist/spec.js +2 -2
  118. package/dist/style.d.ts +1 -1
  119. package/dist/style.js +1 -1
  120. package/dist/styles/resets.css +2 -1
  121. package/dist/styles.css +7 -3
  122. package/dist/typescript-DXG9psK3.js +449 -0
  123. package/dist/{use-components-BAHidYIO.js → use-components-RWQbviGq.js} +1 -1
  124. package/dist/{utils-DAOeBdRL.d.ts → utils-CTGH5e8c.d.ts} +2 -2
  125. package/dist/utils-DNKOwa7D.d.ts +21 -0
  126. package/dist/{utils-0z34vxY4.js → utils-D_1AWSRX.js} +2 -2
  127. package/dist/utils.d.ts +1 -1
  128. package/dist/utils.js +1 -1
  129. package/package.json +6 -20
  130. package/dist/contexts/search.d.ts +0 -2
  131. package/dist/contexts/search.js +0 -11
  132. package/dist/contexts-D3ClFTt3.js +0 -4117
  133. package/dist/pagefind-BHm6c3fb.js +0 -15
  134. package/dist/search/index.d.ts +0 -25
  135. package/dist/search/index.js +0 -332
  136. package/dist/search/mcp.d.ts +0 -13
  137. package/dist/search/mcp.js +0 -43
  138. package/dist/search/providers/algolia.d.ts +0 -24
  139. package/dist/search/providers/algolia.js +0 -11
  140. package/dist/search/providers/fuse.d.ts +0 -18
  141. package/dist/search/providers/fuse.js +0 -27
  142. package/dist/search/providers/pagefind.d.ts +0 -6
  143. package/dist/search/providers/pagefind.js +0 -3
  144. package/dist/search/providers/walker.d.ts +0 -9
  145. package/dist/search/providers/walker.js +0 -31
  146. package/dist/search/types.d.ts +0 -2
  147. package/dist/search/types.js +0 -3
  148. package/dist/search-DvzBAFUW.d.ts +0 -21
  149. package/dist/types-9YHj_ZeX.d.ts +0 -91
  150. package/dist/types-mRzd9aqe.js +0 -35
  151. /package/dist/{chunk-BWfJHHBp.js → chunk-DRcLgZ1e.js} +0 -0
  152. /package/dist/{docs-DGpIHBGY.d.ts → docs-B8-nCRaa.d.ts} +0 -0
  153. /package/dist/{docs-CNvEp0VL.js → docs-CXqi26jB.js} +0 -0
  154. /package/dist/{icons-DzBceOQw.js → icons-Ckod9aod.js} +0 -0
  155. /package/dist/{md-D5AxFoS4.js → md-oM2tUaCA.js} +0 -0
  156. /package/dist/{navigation-bydkHNUW.js → navigation-C5TN0SgC.js} +0 -0
  157. /package/dist/{style-D8hwSwrv.d.ts → style-D7RO5ymE.d.ts} +0 -0
  158. /package/dist/{style-0miv2y38.js → style-gnVEeXFj.js} +0 -0
  159. /package/dist/{utils-CiZXDoFR.js → utils-CqnL9Fc3.js} +0 -0
  160. /package/dist/{utils-BcWczffA.d.ts → utils-d8paVwKN.d.ts} +0 -0
@@ -0,0 +1,336 @@
1
+ import { a as useLanguage, l as useSpec, n as useContentPanelLayout, r as useDeclaration, s as useSettings } from "./docs-CXqi26jB.js";
2
+ import { n as useNavigation } from "./navigation-C5TN0SgC.js";
3
+ import { n as useLanguageComponents } from "./contexts-p3rRZDlM.js";
4
+ import { t as useComponents } from "./use-components-RWQbviGq.js";
5
+ import { t as style_default } from "./style-gnVEeXFj.js";
6
+ import { c as getLanguageSnippet, t as LanguageNames } from "./routing-Wbb7YECB.js";
7
+ import { a as KotlinIcon, c as RubyIcon, i as JavaIcon, l as TerraformIcon, n as CurlIcon, o as PowershellIcon, r as GoIcon, s as PythonIcon, t as CSharpIcon, u as TypescriptIcon } from "./icons-Ckod9aod.js";
8
+ import * as React$1 from "react";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
+ import { BookOpen, Copy, Github } from "lucide-react";
11
+ import clsx from "clsx";
12
+ import { Button, Callout } from "@stainless-api/ui-primitives";
13
+
14
+ //#region src/components/sdk.tsx
15
+ const PropertyModelContext = React$1.createContext({});
16
+ function usePropertyModel() {
17
+ return React$1.useContext(PropertyModelContext);
18
+ }
19
+ const ReferenceNestingContext = React$1.createContext([]);
20
+ function useReferenceNesting() {
21
+ return React$1.useContext(ReferenceNestingContext);
22
+ }
23
+ const SDKSnippetLanguages = {
24
+ "node.default": { name: "TypeScript" },
25
+ "typescript.default": { name: "TypeScript" },
26
+ "python.default": { name: "Python" },
27
+ "go.default": { name: "Go" },
28
+ "java.default": { name: "Java" },
29
+ "kotlin.default": { name: "Kotlin" },
30
+ "http.curl": { name: "cURL" },
31
+ "http.powershell": { name: "Powershell" },
32
+ "terraform.default": { name: "Terraform" },
33
+ "ruby.default": { name: "Ruby" },
34
+ "csharp.default": { name: "C#" },
35
+ "php.default": { name: "PHP" }
36
+ };
37
+ function SDKChildren({ paths, expand, depth }) {
38
+ const Docs = useComponents();
39
+ return /* @__PURE__ */ jsx("div", {
40
+ className: style_default.Properties,
41
+ children: paths.map((path, i) => /* @__PURE__ */ jsx(Docs.SDKDeclaration, {
42
+ path,
43
+ expand,
44
+ depth
45
+ }, i))
46
+ });
47
+ }
48
+ function SDKDeclaration({ path, expand, depth = 0 }) {
49
+ const Lang = useLanguageComponents();
50
+ const Docs = useComponents();
51
+ const decl = useDeclaration(path, true);
52
+ const settings = useSettings();
53
+ const model = usePropertyModel();
54
+ const nesting = useReferenceNesting();
55
+ const { selectedPath } = useNavigation();
56
+ if (decl.kind.endsWith("Reference")) {
57
+ const refId = "type" in decl && typeof decl.type !== "string" && "$ref" in decl.type ? decl.type["$ref"] : void 0;
58
+ if (refId && refId !== path && !nesting.includes(refId)) return /* @__PURE__ */ jsx(ReferenceNestingContext.Provider, {
59
+ value: [...nesting, refId],
60
+ children: /* @__PURE__ */ jsx(SDKDeclaration, {
61
+ path: refId,
62
+ expand,
63
+ depth
64
+ })
65
+ });
66
+ }
67
+ const isUnion = "childrenParentSchema" in decl && decl.childrenParentSchema && ["enum", "union"].includes(decl.childrenParentSchema);
68
+ const id = model?.propertyPath ? `${model.propertyPath} + ${path}` : path;
69
+ const shouldExpand = selectedPath?.startsWith(path) && nesting.length < 1 || settings?.properties?.expandDepth && depth <= settings?.properties?.expandDepth && !isUnion || expand;
70
+ const hasChildren = "children" in decl && (decl.children?.length ?? 0) > 0 && !decl.children?.includes(path) && !(isUnion && decl.childrenParentSchema === "enum" && decl.children?.length === 1) && (settings?.properties?.includeModelProperties !== false || !("modelPath" in decl));
71
+ const content = /* @__PURE__ */ jsx(Lang.Property, {
72
+ decl,
73
+ children: ({ ...props }) => /* @__PURE__ */ jsx(Docs.Property, {
74
+ id,
75
+ expand: shouldExpand,
76
+ constraints: "constraints" in decl && /* @__PURE__ */ jsx(Docs.SDKConstraints, { constraints: decl["constraints"] }),
77
+ declaration: /* @__PURE__ */ jsx(Lang.Declaration, { decl }),
78
+ title: "title" in decl ? decl.title : void 0,
79
+ description: "docstring" in decl ? decl["docstring"] : void 0,
80
+ deprecated: decl.deprecated,
81
+ ...props,
82
+ children: hasChildren && /* @__PURE__ */ jsxs(Fragment$1, { children: [isUnion && /* @__PURE__ */ jsx("div", {
83
+ className: style_default.PropertyAnnotation,
84
+ children: "Accepts one of the following:"
85
+ }), /* @__PURE__ */ jsx(Docs.SDKChildren, {
86
+ paths: decl.children ?? [],
87
+ depth: depth + 1
88
+ })] })
89
+ })
90
+ });
91
+ if ("modelPath" in decl) {
92
+ const value = {
93
+ modelPath: decl.modelPath,
94
+ propertyPath: decl.stainlessPath
95
+ };
96
+ return /* @__PURE__ */ jsx(PropertyModelContext.Provider, {
97
+ value,
98
+ children: content
99
+ });
100
+ }
101
+ return content;
102
+ }
103
+ function SDKConstraints({ constraints }) {
104
+ if (constraints) return /* @__PURE__ */ jsx("div", {
105
+ className: style_default.PropertyConstraints,
106
+ children: Object.entries(constraints).map(([name, value]) => /* @__PURE__ */ jsxs("div", {
107
+ className: style_default.PropertyConstraint,
108
+ children: [/* @__PURE__ */ jsx("span", {
109
+ className: style_default.PropertyConstraintName,
110
+ children: name
111
+ }), /* @__PURE__ */ jsx("span", {
112
+ className: style_default.PropertyConstraintValue,
113
+ children: value
114
+ })]
115
+ }, name))
116
+ });
117
+ }
118
+ const snippetIcons = {
119
+ "node.default": TypescriptIcon,
120
+ "typescript.default": TypescriptIcon,
121
+ "go.default": GoIcon,
122
+ "python.default": PythonIcon,
123
+ "terraform.default": TerraformIcon,
124
+ "http.curl": CurlIcon,
125
+ "http.powershell": PowershellIcon,
126
+ "ruby.default": RubyIcon,
127
+ "java.default": JavaIcon,
128
+ "kotlin.default": KotlinIcon,
129
+ "csharp.default": CSharpIcon,
130
+ "php.default": CSharpIcon
131
+ };
132
+ function SDKIcon({ language }) {
133
+ const LangIcon = snippetIcons[language];
134
+ if (!LangIcon) return null;
135
+ return /* @__PURE__ */ jsx(LangIcon, { className: clsx(style_default.Icon, language.split(".").shift()) });
136
+ }
137
+ function SDKRequestTitle({ snippetLanguage }) {
138
+ const languageName = SDKSnippetLanguages[snippetLanguage]?.name;
139
+ return /* @__PURE__ */ jsxs("span", {
140
+ className: style_default.SnippetRequestTitleLanguage,
141
+ children: [
142
+ /* @__PURE__ */ jsx(SDKIcon, { language: snippetLanguage }),
143
+ " ",
144
+ languageName
145
+ ]
146
+ });
147
+ }
148
+ function SDKExample({ method, transformRequestSnippet }) {
149
+ const Docs = useComponents();
150
+ const snippetLanguage = getLanguageSnippet(useLanguage());
151
+ return /* @__PURE__ */ jsx(Docs.Snippet, {
152
+ requestTitle: /* @__PURE__ */ jsx(Docs.SDKRequestTitle, { snippetLanguage }),
153
+ method,
154
+ transformRequestSnippet
155
+ });
156
+ }
157
+ function SDKMethodHeader({ method }) {
158
+ const Docs = useComponents();
159
+ const Lang = useLanguageComponents();
160
+ const decl = useDeclaration(method.stainlessPath, true);
161
+ return /* @__PURE__ */ jsx(Docs.MethodHeader, {
162
+ level: "h1",
163
+ title: method.summary ?? method.title,
164
+ signature: /* @__PURE__ */ jsx(Lang.MethodSignature, { decl }),
165
+ badges: method.deprecated && /* @__PURE__ */ jsx(Docs.Badge, {
166
+ id: "deprecated",
167
+ children: "Deprecated"
168
+ }),
169
+ children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
170
+ httpMethod: method.httpMethod,
171
+ endpoint: method.endpoint.split(" ", 2).at(-1)
172
+ })
173
+ });
174
+ }
175
+ function SDKMethodInfo({ method }) {
176
+ const Docs = useComponents();
177
+ const Lang = useLanguageComponents();
178
+ const decl = useDeclaration(method.stainlessPath, true);
179
+ const spec = useSpec();
180
+ const language = useLanguage();
181
+ if (Lang.MethodInfo) return /* @__PURE__ */ jsx(Lang.MethodInfo, { decl });
182
+ function shouldExpand(items) {
183
+ if (items.length > 1) return false;
184
+ const item = items[0];
185
+ if (!item) return false;
186
+ const decl$1 = spec?.decls?.[language]?.[item];
187
+ return decl$1 && "children" in decl$1 && decl$1.children && decl$1.children.length > 0;
188
+ }
189
+ return /* @__PURE__ */ jsx(Docs.MethodInfo, {
190
+ parameters: "paramsChildren" in decl && Array.isArray(decl.paramsChildren) && decl.paramsChildren.length > 0 && /* @__PURE__ */ jsx(Docs.SDKChildren, {
191
+ expand: shouldExpand(decl.paramsChildren),
192
+ paths: decl.paramsChildren
193
+ }),
194
+ returns: "responseChildren" in decl && decl.responseChildren && decl.responseChildren.length > 0 && /* @__PURE__ */ jsx(Docs.SDKChildren, {
195
+ expand: shouldExpand(decl.responseChildren),
196
+ paths: decl.responseChildren
197
+ })
198
+ });
199
+ }
200
+ function SDKMethod({ method, transformRequestSnippet }) {
201
+ const Docs = useComponents();
202
+ const decl = useDeclaration(method?.stainlessPath, false);
203
+ const layout = useContentPanelLayout();
204
+ const language = useLanguage();
205
+ if (!decl) return /* @__PURE__ */ jsxs("div", {
206
+ className: style_default.Method,
207
+ children: [/* @__PURE__ */ jsx(Docs.MethodHeader, {
208
+ level: "h1",
209
+ title: method.summary ?? method.title,
210
+ children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
211
+ httpMethod: method.httpMethod,
212
+ endpoint: method.endpoint.split(" ", 2).at(-1)
213
+ })
214
+ }), /* @__PURE__ */ jsxs(Callout, {
215
+ variant: "warning",
216
+ children: [
217
+ "The method ",
218
+ /* @__PURE__ */ jsx("code", { children: method.name }),
219
+ " is not implemented in ",
220
+ LanguageNames[language] ?? language,
221
+ "."
222
+ ]
223
+ })]
224
+ });
225
+ return /* @__PURE__ */ jsxs(Docs.Method, {
226
+ id: method.stainlessPath,
227
+ header: /* @__PURE__ */ jsx(Docs.SDKMethodHeader, { method }),
228
+ className: clsx({
229
+ [style_default.MethodSinglePane]: layout === "single-pane",
230
+ [style_default.MethodDoublePane]: layout === "double-pane"
231
+ }),
232
+ children: [
233
+ /* @__PURE__ */ jsxs("div", {
234
+ className: style_default.MethodContentColumn,
235
+ children: [/* @__PURE__ */ jsx(Docs.MethodDescription, { description: method.description }), /* @__PURE__ */ jsx(Docs.SDKMethodInfo, { method })]
236
+ }),
237
+ /* @__PURE__ */ jsx("div", {
238
+ className: clsx(style_default.MethodExample, "not-content", "stl-ui-not-prose"),
239
+ children: /* @__PURE__ */ jsx(Docs.SDKExample, {
240
+ method,
241
+ transformRequestSnippet
242
+ })
243
+ }),
244
+ /* @__PURE__ */ jsxs("div", {
245
+ className: style_default.MethodResponseColumn,
246
+ children: [/* @__PURE__ */ jsx("h5", { children: "Returns Examples" }), /* @__PURE__ */ jsx(Docs.SnippetResponse, { responses: method.exampleResponses })]
247
+ })
248
+ ]
249
+ });
250
+ }
251
+ function SDKModel({ model }) {
252
+ const Docs = useComponents();
253
+ if (!useDeclaration(`${model.stainlessPath} > (schema)`, true)) return null;
254
+ return /* @__PURE__ */ jsx("div", {
255
+ className: style_default.Model,
256
+ tabIndex: 0,
257
+ children: /* @__PURE__ */ jsx("div", {
258
+ className: style_default.ResourceContentProperties,
259
+ children: /* @__PURE__ */ jsx(Docs.SDKDeclaration, { path: `${model.stainlessPath} > (schema)` })
260
+ })
261
+ });
262
+ }
263
+ function SDKReference({ stainlessPath, children }) {
264
+ const Docs = useComponents();
265
+ if (!stainlessPath || !stainlessPath.endsWith("(schema)")) return children;
266
+ return /* @__PURE__ */ jsx("span", {
267
+ className: style_default.TypeReference,
268
+ children: /* @__PURE__ */ jsx(Docs.Link, {
269
+ stainlessPath,
270
+ children
271
+ })
272
+ });
273
+ }
274
+ function SDKLanguageBlock({ language, version, install, links }) {
275
+ const Docs = useComponents();
276
+ const lang = `${language}.default`;
277
+ return /* @__PURE__ */ jsxs("div", {
278
+ className: style_default.LanguageBlock,
279
+ children: [
280
+ /* @__PURE__ */ jsxs("div", {
281
+ className: style_default.LanguageBlockContent,
282
+ children: [/* @__PURE__ */ jsx("div", {
283
+ className: style_default.LanguageBlockContentIcon,
284
+ children: /* @__PURE__ */ jsx(Docs.SDKIcon, {
285
+ language: lang,
286
+ size: 24
287
+ })
288
+ }), /* @__PURE__ */ jsxs("div", {
289
+ className: style_default.LanguageBlockContentInfo,
290
+ children: [/* @__PURE__ */ jsx("div", {
291
+ className: style_default.LanguageBlockContentInfoLanguage,
292
+ children: Docs.SDKSnippetLanguages[lang].name
293
+ }), /* @__PURE__ */ jsx("div", {
294
+ className: style_default.LanguageBlockContentInfoVersion,
295
+ children: version
296
+ })]
297
+ })]
298
+ }),
299
+ /* @__PURE__ */ jsxs("div", {
300
+ className: style_default.LanguageBlockInstall,
301
+ "data-stldocs-copy-parent": true,
302
+ children: [
303
+ /* @__PURE__ */ jsx("pre", {
304
+ "data-stldocs-copy-content": true,
305
+ children: install
306
+ }),
307
+ " ",
308
+ /* @__PURE__ */ jsx(Button, {
309
+ variant: "ghost",
310
+ size: "sm",
311
+ "data-stldocs-snippet-copy": true,
312
+ children: /* @__PURE__ */ jsx(Copy, {
313
+ size: 16,
314
+ className: style_default.Icon
315
+ })
316
+ })
317
+ ]
318
+ }),
319
+ /* @__PURE__ */ jsxs("div", {
320
+ className: style_default.LanguageBlockLinks,
321
+ children: [/* @__PURE__ */ jsx(Button, {
322
+ href: links.repo,
323
+ variant: "outline",
324
+ children: /* @__PURE__ */ jsx(Button.Icon, { icon: Github })
325
+ }), /* @__PURE__ */ jsxs(Button, {
326
+ href: links.docs,
327
+ variant: "outline",
328
+ children: [/* @__PURE__ */ jsx(Button.Icon, { icon: BookOpen }), /* @__PURE__ */ jsx(Button.Label, { children: "Read Docs" })]
329
+ })]
330
+ })
331
+ ]
332
+ });
333
+ }
334
+
335
+ //#endregion
336
+ export { useReferenceNesting as _, SDKDeclaration as a, SDKLanguageBlock as c, SDKMethodInfo as d, SDKModel as f, usePropertyModel as g, SDKSnippetLanguages as h, SDKConstraints as i, SDKMethod as l, SDKRequestTitle as m, ReferenceNestingContext as n, SDKExample as o, SDKReference as p, SDKChildren as r, SDKIcon as s, PropertyModelContext as t, SDKMethodHeader as u };
@@ -0,0 +1,118 @@
1
+ import { t as DocsLanguage } from "./routing-Dhmv52Fd.js";
2
+ import * as React$1 from "react";
3
+ import * as react_jsx_runtime35 from "react/jsx-runtime";
4
+ import * as SDKJSON from "@stainless/sdk-json";
5
+
6
+ //#region src/components/sdk.d.ts
7
+ type PropertyModelContextType = {
8
+ modelPath?: string;
9
+ propertyPath?: string;
10
+ };
11
+ declare const PropertyModelContext: React$1.Context<PropertyModelContextType>;
12
+ declare function usePropertyModel(): PropertyModelContextType;
13
+ type ReferenceNestingContextType = string[];
14
+ declare const ReferenceNestingContext: React$1.Context<ReferenceNestingContextType>;
15
+ declare function useReferenceNesting(): ReferenceNestingContextType;
16
+ type SDKSnippetLanguagesType = Record<SDKJSON.SnippetLanguage, {
17
+ name: string;
18
+ }>;
19
+ declare const SDKSnippetLanguages: SDKSnippetLanguagesType;
20
+ type TransformRequestSnippetFn = ({
21
+ snippet,
22
+ language
23
+ }: {
24
+ snippet: string;
25
+ language: DocsLanguage;
26
+ }) => string;
27
+ type SDKChildrenProps = {
28
+ paths: SDKJSON.ID[];
29
+ expand?: boolean;
30
+ depth?: number;
31
+ };
32
+ declare function SDKChildren({
33
+ paths,
34
+ expand,
35
+ depth
36
+ }: SDKChildrenProps): react_jsx_runtime35.JSX.Element;
37
+ type SDKDeclarationProps = {
38
+ path: string;
39
+ expand?: boolean;
40
+ depth?: number;
41
+ };
42
+ declare function SDKDeclaration({
43
+ path,
44
+ expand,
45
+ depth
46
+ }: SDKDeclarationProps): react_jsx_runtime35.JSX.Element;
47
+ type SDKConstraintsProps = {
48
+ constraints?: Record<string, any>;
49
+ };
50
+ declare function SDKConstraints({
51
+ constraints
52
+ }: SDKConstraintsProps): react_jsx_runtime35.JSX.Element | undefined;
53
+ type SDKIconProps = {
54
+ language: SDKJSON.SnippetLanguage;
55
+ size?: number;
56
+ };
57
+ declare function SDKIcon({
58
+ language
59
+ }: SDKIconProps): react_jsx_runtime35.JSX.Element | null;
60
+ type SDKRequestTitleProps = {
61
+ snippetLanguage: SDKJSON.SnippetLanguage;
62
+ };
63
+ declare function SDKRequestTitle({
64
+ snippetLanguage
65
+ }: SDKRequestTitleProps): react_jsx_runtime35.JSX.Element;
66
+ type SDKExampleProps = {
67
+ method: SDKJSON.Method;
68
+ transformRequestSnippet?: TransformRequestSnippetFn;
69
+ };
70
+ declare function SDKExample({
71
+ method,
72
+ transformRequestSnippet
73
+ }: SDKExampleProps): react_jsx_runtime35.JSX.Element;
74
+ type SDKMethodProps = {
75
+ method: SDKJSON.Method;
76
+ transformRequestSnippet?: TransformRequestSnippetFn;
77
+ };
78
+ declare function SDKMethodHeader({
79
+ method
80
+ }: SDKMethodProps): react_jsx_runtime35.JSX.Element;
81
+ declare function SDKMethodInfo({
82
+ method
83
+ }: SDKMethodProps): react_jsx_runtime35.JSX.Element;
84
+ declare function SDKMethod({
85
+ method,
86
+ transformRequestSnippet
87
+ }: SDKMethodProps): react_jsx_runtime35.JSX.Element;
88
+ type SDKModelProps = {
89
+ model: SDKJSON.Model;
90
+ };
91
+ declare function SDKModel({
92
+ model
93
+ }: SDKModelProps): react_jsx_runtime35.JSX.Element | null;
94
+ type SDKReferenceProps = {
95
+ stainlessPath: string;
96
+ children?: React$1.ReactNode;
97
+ };
98
+ declare function SDKReference({
99
+ stainlessPath,
100
+ children
101
+ }: SDKReferenceProps): string | number | bigint | boolean | react_jsx_runtime35.JSX.Element | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | null | undefined;
102
+ type SDKLanguageBlockProps = {
103
+ language: DocsLanguage;
104
+ version: string;
105
+ install: string;
106
+ links: {
107
+ repo: string;
108
+ docs: string;
109
+ };
110
+ };
111
+ declare function SDKLanguageBlock({
112
+ language,
113
+ version,
114
+ install,
115
+ links
116
+ }: SDKLanguageBlockProps): react_jsx_runtime35.JSX.Element;
117
+ //#endregion
118
+ export { TransformRequestSnippetFn as C, SDKSnippetLanguagesType as S, useReferenceNesting as T, SDKModelProps as _, SDKChildren as a, SDKRequestTitleProps as b, SDKDeclaration as c, SDKLanguageBlock as d, SDKMethod as f, SDKModel as g, SDKMethodProps as h, ReferenceNestingContextType as i, SDKExample as l, SDKMethodInfo as m, PropertyModelContextType as n, SDKConstraints as o, SDKMethodHeader as p, ReferenceNestingContext as r, SDKConstraintsProps as s, PropertyModelContext as t, SDKIcon as u, SDKReference as v, usePropertyModel as w, SDKSnippetLanguages as x, SDKRequestTitle as y };
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from "react";
2
- import * as react_jsx_runtime31 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime47 from "react/jsx-runtime";
3
3
  import * as SDKJSON from "@stainless/sdk-json";
4
4
 
5
5
  //#region src/components/sidebar.d.ts
@@ -12,25 +12,25 @@ declare function SidebarExpander({
12
12
  open,
13
13
  summary,
14
14
  children
15
- }: SidebarExpanderProps): react_jsx_runtime31.JSX.Element;
15
+ }: SidebarExpanderProps): react_jsx_runtime47.JSX.Element;
16
16
  type SidebarMethodProps = {
17
17
  method: SDKJSON.Method;
18
18
  };
19
19
  declare function SidebarMethod({
20
20
  method
21
- }: SidebarMethodProps): react_jsx_runtime31.JSX.Element;
21
+ }: SidebarMethodProps): react_jsx_runtime47.JSX.Element;
22
22
  type SidebarResourceProps = {
23
23
  resource: SDKJSON.Resource;
24
24
  };
25
25
  declare function SidebarResource({
26
26
  resource
27
- }: SidebarResourceProps): react_jsx_runtime31.JSX.Element;
27
+ }: SidebarResourceProps): react_jsx_runtime47.JSX.Element;
28
28
  type SidebarProps = {
29
29
  resources: SDKJSON.Resource[];
30
30
  selectedPath?: string;
31
31
  };
32
32
  declare function Sidebar({
33
33
  resources
34
- }: SidebarProps): react_jsx_runtime31.JSX.Element;
34
+ }: SidebarProps): react_jsx_runtime47.JSX.Element;
35
35
  //#endregion
36
36
  export { SidebarProps as a, SidebarMethodProps as i, SidebarExpander as n, SidebarResource as o, SidebarMethod as r, SidebarResourceProps as s, Sidebar as t };
@@ -0,0 +1,81 @@
1
+ import { n as useNavigation } from "./navigation-C5TN0SgC.js";
2
+ import { t as useComponents } from "./use-components-RWQbviGq.js";
3
+ import { t as style_default } from "./style-gnVEeXFj.js";
4
+ import { o as MethodIconBadge } from "./method-CE08mUME.js";
5
+ import { r as isResourceEmpty } from "./utils-D_1AWSRX.js";
6
+ import "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { ChevronDown, ChevronRight } from "lucide-react";
9
+
10
+ //#region src/components/sidebar.tsx
11
+ function SidebarExpander({ open, summary, children }) {
12
+ return /* @__PURE__ */ jsxs("details", {
13
+ className: style_default.SidebarExpander,
14
+ open,
15
+ children: [/* @__PURE__ */ jsxs("summary", {
16
+ className: style_default.ExpanderSummary,
17
+ children: [/* @__PURE__ */ jsx("div", {
18
+ className: style_default.ExpanderSummaryContent,
19
+ children: summary
20
+ }), /* @__PURE__ */ jsxs("div", {
21
+ className: style_default.ExpanderSummaryIcon,
22
+ children: [/* @__PURE__ */ jsx(ChevronRight, {
23
+ size: 16,
24
+ strokeWidth: 1,
25
+ className: style_default.Icon
26
+ }), /* @__PURE__ */ jsx(ChevronDown, {
27
+ size: 16,
28
+ strokeWidth: 1,
29
+ className: style_default.Icon
30
+ })]
31
+ })]
32
+ }), /* @__PURE__ */ jsx("div", {
33
+ className: style_default.ExpanderContent,
34
+ children
35
+ })]
36
+ });
37
+ }
38
+ function SidebarMethod({ method }) {
39
+ const Docs = useComponents();
40
+ const { selectedPath } = useNavigation();
41
+ return /* @__PURE__ */ jsxs("div", {
42
+ className: style_default.SidebarMethod,
43
+ "data-selected": method.stainlessPath === selectedPath,
44
+ children: [/* @__PURE__ */ jsx(MethodIconBadge, { httpMethod: method.httpMethod }), /* @__PURE__ */ jsx(Docs.Link, {
45
+ stainlessPath: method.stainlessPath,
46
+ children: method.summary
47
+ })]
48
+ });
49
+ }
50
+ function SidebarResource({ resource }) {
51
+ const Docs = useComponents();
52
+ const { selectedPath } = useNavigation();
53
+ const subresources = Object.values(resource.subresources ?? {}).map((sub) => /* @__PURE__ */ jsx(SidebarResource, { resource: sub }, sub.stainlessPath));
54
+ const methods = Object.values(resource.methods).map((method) => /* @__PURE__ */ jsx(SidebarMethod, { method }, method.stainlessPath));
55
+ const hasChildren = subresources.length > 0 || methods.length > 0;
56
+ const title = /* @__PURE__ */ jsx("div", {
57
+ className: style_default.SidebarResourceTitle,
58
+ children: /* @__PURE__ */ jsx(Docs.Link, {
59
+ stainlessPath: resource.stainlessPath,
60
+ children: resource.title
61
+ })
62
+ });
63
+ return /* @__PURE__ */ jsx("div", {
64
+ className: style_default.SidebarResource,
65
+ "data-selected": resource.stainlessPath === selectedPath,
66
+ children: hasChildren ? /* @__PURE__ */ jsxs(SidebarExpander, {
67
+ summary: title,
68
+ open: true,
69
+ children: [methods, subresources]
70
+ }) : title
71
+ });
72
+ }
73
+ function Sidebar({ resources }) {
74
+ return /* @__PURE__ */ jsx("div", {
75
+ className: `${style_default.Root} ${style_default.Sidebar}`,
76
+ children: resources.filter((resource) => !isResourceEmpty(resource)).map((resource) => /* @__PURE__ */ jsx(SidebarResource, { resource }, resource.stainlessPath))
77
+ });
78
+ }
79
+
80
+ //#endregion
81
+ export { SidebarResource as i, SidebarExpander as n, SidebarMethod as r, Sidebar as t };