@stainless-api/docs-ui 0.1.0-beta.6 → 0.1.0-beta.61

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 (206) hide show
  1. package/dist/breadcrumbs-BVskoBYz.d.ts +25 -0
  2. package/dist/breadcrumbs-C9LLJyuJ.d.ts +25 -0
  3. package/dist/breadcrumbs-CqA6kow2.js +63 -0
  4. package/dist/chunk-BN_g-Awi.js +18 -0
  5. package/dist/cli-0bJ66S1r.js +157 -0
  6. package/dist/component-CjJJYIxG.js +23 -0
  7. package/dist/component-generics-BC_P155r.d.ts +30 -0
  8. package/dist/component-generics-BkwbbxJF.d.ts +30 -0
  9. package/dist/component-generics-POFirVVb.js +45 -0
  10. package/dist/components/MaskedInput.d.ts +14 -0
  11. package/dist/components/MaskedInput.js +76 -0
  12. package/dist/components/breadcrumbs.d.ts +2 -0
  13. package/dist/components/breadcrumbs.js +9 -0
  14. package/dist/components/icons.d.ts +60 -0
  15. package/dist/components/icons.js +3 -0
  16. package/dist/components/index.d.ts +10 -0
  17. package/dist/components/index.js +18 -0
  18. package/dist/components/method.d.ts +2 -0
  19. package/dist/components/method.js +10 -0
  20. package/dist/components/overview.d.ts +2 -0
  21. package/dist/components/overview.js +11 -0
  22. package/dist/components/primitives.d.ts +2 -0
  23. package/dist/components/primitives.js +8 -0
  24. package/dist/components/properties.d.ts +2 -0
  25. package/dist/components/properties.js +9 -0
  26. package/dist/components/sdk.d.ts +2 -0
  27. package/dist/components/sdk.js +10 -0
  28. package/dist/components/sidebar.d.ts +2 -0
  29. package/dist/components/sidebar.js +9 -0
  30. package/dist/components/snippets.d.ts +3 -0
  31. package/dist/components/snippets.js +9 -0
  32. package/dist/components-FEHnQBJC.js +70 -0
  33. package/dist/contexts/component-generics.d.ts +2 -0
  34. package/dist/contexts/component-generics.js +3 -0
  35. package/dist/contexts/component-types.d.ts +16 -0
  36. package/dist/contexts/component-types.js +0 -0
  37. package/dist/contexts/component.d.ts +29 -0
  38. package/dist/contexts/component.js +28 -0
  39. package/dist/contexts/docs.d.ts +2 -0
  40. package/dist/contexts/docs.js +3 -0
  41. package/dist/contexts/index.d.ts +22 -0
  42. package/dist/contexts/index.js +7 -0
  43. package/dist/contexts/markdown.d.ts +2 -0
  44. package/dist/contexts/markdown.js +4 -0
  45. package/dist/contexts/navigation.d.ts +2 -0
  46. package/dist/contexts/navigation.js +3 -0
  47. package/dist/contexts/use-components.d.ts +14 -0
  48. package/dist/contexts/use-components.js +4 -0
  49. package/dist/contexts-CeV_L_Iy.js +39 -0
  50. package/dist/csharp-Dl2RIiYP.js +283 -0
  51. package/dist/docs--qWFuJCM.d.ts +46 -0
  52. package/dist/docs-DSFRsmbQ.d.ts +46 -0
  53. package/dist/docs-Di94viZV.js +54 -0
  54. package/dist/go-DuKdRGqU.js +303 -0
  55. package/dist/http-C7bu4oCl.js +331 -0
  56. package/dist/icons-BYKn5X8E.js +885 -0
  57. package/dist/index-C0qvL4yP.d.ts +15 -0
  58. package/dist/index-DE1vA8T2.d.ts +302 -0
  59. package/dist/index-DsFyACw9.d.ts +15 -0
  60. package/dist/index-FDM-j9s-.d.ts +302 -0
  61. package/dist/index-zNpvNvtN.d.ts +1691 -0
  62. package/dist/index.d.ts +19 -0
  63. package/dist/index.js +30 -7542
  64. package/dist/java-DSyzO-6F.js +403 -0
  65. package/dist/languages/cli.d.ts +11 -0
  66. package/dist/languages/cli.js +20 -0
  67. package/dist/languages/csharp.d.ts +11 -0
  68. package/dist/languages/csharp.js +9 -0
  69. package/dist/languages/go.d.ts +11 -0
  70. package/dist/languages/go.js +9 -0
  71. package/dist/languages/http.d.ts +11 -0
  72. package/dist/languages/http.js +19 -0
  73. package/dist/languages/index.d.ts +11 -0
  74. package/dist/languages/index.js +27 -0
  75. package/dist/languages/java.d.ts +11 -0
  76. package/dist/languages/java.js +9 -0
  77. package/dist/languages/python.d.ts +11 -0
  78. package/dist/languages/python.js +9 -0
  79. package/dist/languages/ruby.d.ts +11 -0
  80. package/dist/languages/ruby.js +9 -0
  81. package/dist/languages/typescript.d.ts +11 -0
  82. package/dist/languages/typescript.js +9 -0
  83. package/dist/languages-BO5YJ6cy.js +28 -0
  84. package/dist/markdown/index.d.ts +12 -0
  85. package/dist/markdown/index.js +105 -0
  86. package/dist/markdown/md.d.ts +15 -0
  87. package/dist/markdown/md.js +41 -0
  88. package/dist/markdown/printer.d.ts +13 -0
  89. package/dist/markdown/printer.js +98 -0
  90. package/dist/markdown/utils.d.ts +21 -0
  91. package/dist/markdown/utils.js +31 -0
  92. package/dist/markdown-B517MrZh.d.ts +22 -0
  93. package/dist/markdown-C7Tb41LZ.d.ts +22 -0
  94. package/dist/markdown-D2JWyRws.js +49 -0
  95. package/dist/method-BaQEZVlw.d.ts +59 -0
  96. package/dist/method-Dln4ZTIB.d.ts +59 -0
  97. package/dist/method-jTnA0G8m.js +90 -0
  98. package/dist/navigation-XhIgqXwM.d.ts +29 -0
  99. package/dist/navigation-aoYZ_tl4.js +24 -0
  100. package/dist/navigation-rKdts-BR.d.ts +29 -0
  101. package/dist/overview-B3kgyac2.d.ts +39 -0
  102. package/dist/overview-BnagZfH1.js +139 -0
  103. package/dist/overview-Dp-gGl3v.d.ts +39 -0
  104. package/dist/primitives-B6zu2rrx.d.ts +105 -0
  105. package/dist/primitives-DQLc9kN7.js +250 -0
  106. package/dist/primitives-VtUGoYwX.d.ts +105 -0
  107. package/dist/properties-Bun4nfUE.d.ts +54 -0
  108. package/dist/properties-DGL2J11L.js +131 -0
  109. package/dist/properties-ZOIqpkET.d.ts +54 -0
  110. package/dist/python-D8ABqtn1.js +269 -0
  111. package/dist/routing-Ce0_tBW6.js +197 -0
  112. package/dist/routing-CtbZJru_.d.ts +54 -0
  113. package/dist/routing.d.ts +2 -0
  114. package/dist/routing.js +3 -180
  115. package/dist/ruby-261jvCjl.js +387 -0
  116. package/dist/sdk-BebFnWYL.d.ts +118 -0
  117. package/dist/sdk-CIxaNoAs.d.ts +118 -0
  118. package/dist/sdk-GGpyGTao.js +338 -0
  119. package/dist/sidebar-BWno0E4w.js +85 -0
  120. package/dist/sidebar-CLsIJZZf.d.ts +36 -0
  121. package/dist/sidebar-D4m_pVpS.d.ts +36 -0
  122. package/dist/snippets-CwVjwsAo.d.ts +53 -0
  123. package/dist/snippets-Ym3mnHO3.d.ts +53 -0
  124. package/dist/snippets-kI8eNs1F.js +164 -0
  125. package/dist/spec.d.ts +65 -0
  126. package/dist/spec.js +167 -0
  127. package/dist/style-LwfvXElj.js +170 -0
  128. package/dist/style.d.ts +169 -0
  129. package/dist/style.js +3 -0
  130. package/dist/styles/main.css +722 -755
  131. package/dist/styles/main.js +0 -0
  132. package/dist/styles/primitives.css +322 -459
  133. package/dist/styles/primitives.js +0 -0
  134. package/dist/styles/resets.css +32 -41
  135. package/dist/styles/resets.js +0 -0
  136. package/dist/styles/search.css +192 -270
  137. package/dist/styles/search.js +0 -0
  138. package/dist/styles/sidebar.css +56 -61
  139. package/dist/styles/sidebar.js +0 -0
  140. package/dist/styles/variables.css +26 -89
  141. package/dist/styles/variables.js +0 -0
  142. package/dist/styles.css +3145 -0
  143. package/dist/styles.mjs +1 -0
  144. package/dist/typescript-D924WidI.js +449 -0
  145. package/dist/use-components-BUz3GbO4.js +7 -0
  146. package/dist/utils-D01mAUfQ.js +32 -0
  147. package/dist/utils.d.ts +14 -0
  148. package/dist/utils.js +3 -0
  149. package/package.json +73 -21
  150. package/dist/mcp.js +0 -16003
  151. package/dist/styles/snippets.css +0 -132
  152. package/src/components/breadcrumbs.tsx +0 -94
  153. package/src/components/chat.tsx +0 -154
  154. package/src/components/dropdown.tsx +0 -91
  155. package/src/components/icons.tsx +0 -584
  156. package/src/components/index.ts +0 -9
  157. package/src/components/method.tsx +0 -144
  158. package/src/components/overview.tsx +0 -159
  159. package/src/components/primitives.tsx +0 -284
  160. package/src/components/properties.tsx +0 -130
  161. package/src/components/scripts/dropdown.ts +0 -78
  162. package/src/components/sdk.tsx +0 -402
  163. package/src/components/sidebar.tsx +0 -99
  164. package/src/components/snippets.tsx +0 -179
  165. package/src/contexts/component-generics.tsx +0 -48
  166. package/src/contexts/component-types.tsx +0 -5
  167. package/src/contexts/component.tsx +0 -32
  168. package/src/contexts/docs.tsx +0 -75
  169. package/src/contexts/index.tsx +0 -17
  170. package/src/contexts/markdown.tsx +0 -43
  171. package/src/contexts/navigation.tsx +0 -44
  172. package/src/contexts/search.tsx +0 -28
  173. package/src/contexts/use-components.tsx +0 -4
  174. package/src/index.ts +0 -6
  175. package/src/languages/go.tsx +0 -281
  176. package/src/languages/http.tsx +0 -321
  177. package/src/languages/index.ts +0 -26
  178. package/src/languages/java.tsx +0 -358
  179. package/src/languages/python.tsx +0 -255
  180. package/src/languages/ruby.tsx +0 -320
  181. package/src/languages/typescript.tsx +0 -393
  182. package/src/markdown/index.ts +0 -107
  183. package/src/markdown/md.ts +0 -45
  184. package/src/markdown/utils.ts +0 -49
  185. package/src/routing.ts +0 -238
  186. package/src/search/form.tsx +0 -127
  187. package/src/search/index.tsx +0 -1
  188. package/src/search/indexer.ts +0 -246
  189. package/src/search/mcp.ts +0 -61
  190. package/src/search/printer.tsx +0 -86
  191. package/src/search/providers/algolia.ts +0 -88
  192. package/src/search/providers/fuse.ts +0 -19
  193. package/src/search/providers/pagefind.ts +0 -17
  194. package/src/search/providers/walker.ts +0 -30
  195. package/src/search/results.tsx +0 -181
  196. package/src/search/state.ts +0 -64
  197. package/src/search/types.ts +0 -116
  198. package/src/style.ts +0 -197
  199. package/src/styles/main.css +0 -993
  200. package/src/styles/primitives.css +0 -573
  201. package/src/styles/resets.css +0 -47
  202. package/src/styles/search.css +0 -342
  203. package/src/styles/sidebar.css +0 -87
  204. package/src/styles/snippets.css +0 -132
  205. package/src/styles/variables.css +0 -90
  206. package/src/utils.ts +0 -41
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,449 @@
1
+ import { t as __exportAll } from "./chunk-BN_g-Awi.js";
2
+ import { a as useLanguage, l as useSpec, r as useDeclaration } from "./docs-Di94viZV.js";
3
+ import { n as useLanguageComponents } from "./contexts-CeV_L_Iy.js";
4
+ import { t as useComponents } from "./use-components-BUz3GbO4.js";
5
+ import { t as style_default } from "./style-LwfvXElj.js";
6
+ import * as React$1 from "react";
7
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
+
9
+ //#region src/languages/typescript.tsx
10
+ var typescript_exports = /* @__PURE__ */ __exportAll({
11
+ Declaration: () => Declaration,
12
+ MethodSignature: () => MethodSignature,
13
+ Property: () => Property,
14
+ Type: () => Type,
15
+ TypeName: () => TypeName
16
+ });
17
+ const ComplexTypes = {
18
+ TSTypeObject: "object",
19
+ TSTypeUnion: "union",
20
+ TSTypeInterface: "interface",
21
+ TSTypeIntersection: "intersection",
22
+ TSTypeArray: "array"
23
+ };
24
+ const constStyle = {
25
+ string: style_default.LiteralString,
26
+ number: style_default.LiteralNumeric,
27
+ boolean: style_default.LiteralBoolean
28
+ };
29
+ function Identifier({ name, optional }) {
30
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
31
+ className: style_default.TextIdentifier,
32
+ children: /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(name) ? name : JSON.stringify(name)
33
+ }), optional && /* @__PURE__ */ jsx("span", {
34
+ className: style_default.TextPunctuation,
35
+ children: "?"
36
+ })] });
37
+ }
38
+ function TypeParams({ params }) {
39
+ const Lang = useLanguageComponents();
40
+ const { Join } = useComponents();
41
+ if (!params?.length) return null;
42
+ const typeParams = params?.map((param, key) => param.constraint ? /* @__PURE__ */ jsxs(React$1.Fragment, { children: [
43
+ /* @__PURE__ */ jsx("span", {
44
+ className: style_default.TypeReference,
45
+ children: param.name
46
+ }),
47
+ /* @__PURE__ */ jsx("span", {
48
+ className: style_default.TextKeyword,
49
+ children: "extends "
50
+ }),
51
+ /* @__PURE__ */ jsx(Lang.Type, { type: param.constraint })
52
+ ] }, key) : /* @__PURE__ */ jsx(React$1.Fragment, { children: "param.name" }, key));
53
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
54
+ /* @__PURE__ */ jsx("span", {
55
+ className: style_default.TypeBracket,
56
+ children: "<"
57
+ }),
58
+ /* @__PURE__ */ jsx(Join, {
59
+ items: typeParams,
60
+ limit: 3,
61
+ children: /* @__PURE__ */ jsx("span", {
62
+ className: style_default.TextOperator,
63
+ children: ", "
64
+ })
65
+ }),
66
+ /* @__PURE__ */ jsx("span", {
67
+ className: style_default.TypeBracket,
68
+ children: ">"
69
+ })
70
+ ] });
71
+ }
72
+ function TypePreview({ path }) {
73
+ const spec = useSpec();
74
+ const language = useLanguage();
75
+ const decl = useDeclaration(path, false);
76
+ const { Join } = useComponents();
77
+ if (!(decl && "children" in decl && decl.children && decl.children.length > 0) || decl && "type" in decl && decl.type !== void 0 && "kind" in decl["type"] && decl["type"]["kind"] === "TSTypeUnion") return;
78
+ const items = decl.children.map((prop, key) => {
79
+ const p = spec?.decls?.[language]?.[prop];
80
+ return /* @__PURE__ */ jsx("span", {
81
+ className: style_default.TypePropertyName,
82
+ children: /* @__PURE__ */ jsx("span", {
83
+ className: style_default.TextIdentifier,
84
+ children: p && "key" in p ? p["key"] : null
85
+ })
86
+ }, key);
87
+ });
88
+ return /* @__PURE__ */ jsxs("span", {
89
+ className: style_default.TypePreview,
90
+ "data-stldocs-type-preview": "properties",
91
+ children: [
92
+ /* @__PURE__ */ jsx("span", {
93
+ className: style_default.TypeBrace,
94
+ children: " {"
95
+ }),
96
+ /* @__PURE__ */ jsxs("span", {
97
+ className: style_default.TypePreviewContent,
98
+ children: [
99
+ " ",
100
+ /* @__PURE__ */ jsx(Join, {
101
+ items,
102
+ limit: 3,
103
+ children: /* @__PURE__ */ jsx("span", {
104
+ className: style_default.TextOperator,
105
+ children: ", "
106
+ })
107
+ }),
108
+ " "
109
+ ]
110
+ }),
111
+ /* @__PURE__ */ jsx("span", {
112
+ className: style_default.TypeBrace,
113
+ children: "} "
114
+ })
115
+ ]
116
+ });
117
+ }
118
+ function TypeName({ type }) {
119
+ const Lang = useLanguageComponents();
120
+ return ComplexTypes[type.kind] ?? /* @__PURE__ */ jsx(Lang.Type, { type });
121
+ }
122
+ function Type({ type }) {
123
+ const Lang = useLanguageComponents();
124
+ const { Join, SDKReference } = useComponents();
125
+ switch (type.kind) {
126
+ case "TSTypeUnknown":
127
+ case "TSTypeUndefined":
128
+ case "TSTypeNever":
129
+ case "TSTypeVoid":
130
+ case "TSTypeNull":
131
+ case "TSTypeAny":
132
+ case "TSTypeBoolean":
133
+ case "TSTypeNumber": return /* @__PURE__ */ jsx("span", {
134
+ className: style_default.Type,
135
+ children: /* @__PURE__ */ jsx("span", {
136
+ className: style_default.TypeKeyword,
137
+ children: type.kind.slice(6).toLowerCase()
138
+ })
139
+ });
140
+ case "TSTypeString": return /* @__PURE__ */ jsx("span", {
141
+ className: style_default.Type,
142
+ children: /* @__PURE__ */ jsx("span", {
143
+ className: style_default.TypeString,
144
+ children: "string"
145
+ })
146
+ });
147
+ case "TSTypeLiteral": return /* @__PURE__ */ jsx("span", {
148
+ className: style_default.Type,
149
+ children: /* @__PURE__ */ jsx("span", {
150
+ className: constStyle[typeof type.literal],
151
+ children: JSON.stringify(type.literal)
152
+ })
153
+ });
154
+ case "TSTypeArray": return /* @__PURE__ */ jsxs("span", {
155
+ className: style_default.Type,
156
+ children: [
157
+ /* @__PURE__ */ jsx("span", {
158
+ className: style_default.TypeArray,
159
+ children: "Array<"
160
+ }),
161
+ /* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
162
+ /* @__PURE__ */ jsx("span", {
163
+ className: style_default.TypeArray,
164
+ children: ">"
165
+ })
166
+ ]
167
+ });
168
+ case "TSTypeReference": {
169
+ const name = type.ident.split(".").at(-1);
170
+ const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
171
+ return /* @__PURE__ */ jsxs("span", {
172
+ className: style_default.Type,
173
+ children: [
174
+ /* @__PURE__ */ jsx(SDKReference, {
175
+ stainlessPath: type.$ref,
176
+ children: name
177
+ }),
178
+ params && params.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
179
+ /* @__PURE__ */ jsx("span", {
180
+ className: style_default.TypeBracket,
181
+ children: "<"
182
+ }),
183
+ /* @__PURE__ */ jsx(Join, {
184
+ items: params,
185
+ limit: 3,
186
+ children: /* @__PURE__ */ jsx("span", {
187
+ className: style_default.TextOperator,
188
+ children: ", "
189
+ })
190
+ }),
191
+ /* @__PURE__ */ jsx("span", {
192
+ className: style_default.TypeBracket,
193
+ children: ">"
194
+ })
195
+ ] }),
196
+ /* @__PURE__ */ jsx(TypePreview, { path: type.$ref })
197
+ ]
198
+ });
199
+ }
200
+ case "TSTypeIntersection":
201
+ case "TSTypeUnion": {
202
+ const items = type.types.map((t, key) => /* @__PURE__ */ jsx(Lang.Type, { type: t }, key));
203
+ const delimiter = type.kind === "TSTypeUnion" ? "|" : "&";
204
+ return /* @__PURE__ */ jsx("span", {
205
+ className: style_default.Type,
206
+ children: /* @__PURE__ */ jsx("span", {
207
+ className: style_default.TypePreview,
208
+ "data-stldocs-type-preview": "union",
209
+ children: /* @__PURE__ */ jsx("span", {
210
+ className: style_default.TypePreviewContent,
211
+ children: /* @__PURE__ */ jsx(Join, {
212
+ items,
213
+ limit: 3,
214
+ children: /* @__PURE__ */ jsxs("span", {
215
+ className: style_default.TextOperator,
216
+ children: [
217
+ " ",
218
+ delimiter,
219
+ " "
220
+ ]
221
+ })
222
+ })
223
+ })
224
+ })
225
+ });
226
+ }
227
+ case "TSTypeObject":
228
+ case "TSTypeInterface": {
229
+ const extend = type.kind === "TSTypeObject" ? null : type.extends?.map((ref, key) => /* @__PURE__ */ jsx(Lang.Type, { type: ref }, key));
230
+ const items = type.members.map((prop, key) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [
231
+ /* @__PURE__ */ jsx("span", {
232
+ className: style_default.TypePropertyName,
233
+ children: /* @__PURE__ */ jsx(Identifier, {
234
+ name: prop.ident,
235
+ optional: prop.optional
236
+ })
237
+ }),
238
+ /* @__PURE__ */ jsx("span", {
239
+ className: style_default.TextPunctuation,
240
+ children: ": "
241
+ }),
242
+ /* @__PURE__ */ jsx(Lang.Type, { type: prop.type })
243
+ ] }, key));
244
+ return /* @__PURE__ */ jsxs("span", {
245
+ className: style_default.Type,
246
+ children: [extend?.length && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
247
+ className: style_default.TypeKeyword,
248
+ children: " extends "
249
+ }), /* @__PURE__ */ jsx(Join, {
250
+ items: extend,
251
+ limit: 3,
252
+ children: /* @__PURE__ */ jsx("span", {
253
+ className: style_default.TextOperator,
254
+ children: ", "
255
+ })
256
+ })] }), /* @__PURE__ */ jsxs("span", {
257
+ className: style_default.TypePreview,
258
+ "data-stldocs-type-preview": "properties",
259
+ children: [
260
+ /* @__PURE__ */ jsx("span", {
261
+ className: style_default.TypeBrace,
262
+ children: "{ "
263
+ }),
264
+ /* @__PURE__ */ jsx("span", {
265
+ className: style_default.TypePreviewContent,
266
+ children: /* @__PURE__ */ jsx(Join, {
267
+ items,
268
+ limit: 3,
269
+ children: /* @__PURE__ */ jsx("span", {
270
+ className: style_default.TextOperator,
271
+ children: ", "
272
+ })
273
+ })
274
+ }),
275
+ /* @__PURE__ */ jsx("span", {
276
+ className: style_default.TypeBrace,
277
+ children: "} "
278
+ })
279
+ ]
280
+ })]
281
+ });
282
+ }
283
+ }
284
+ }
285
+ function MethodSignature({ decl }) {
286
+ const Lang = useLanguageComponents();
287
+ const { Join, Tooltip } = useComponents();
288
+ const params = decl.signature.parameters.map((param, i) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [/* @__PURE__ */ jsx(Tooltip, {
289
+ content: /* @__PURE__ */ jsx(Lang.Type, { type: param.type }),
290
+ children: /* @__PURE__ */ jsx("span", {
291
+ className: style_default.TextIdentifier,
292
+ children: param.ident
293
+ })
294
+ }), param.optional && /* @__PURE__ */ jsx("span", {
295
+ className: style_default.TextPunctuation,
296
+ children: "?"
297
+ })] }, i));
298
+ return /* @__PURE__ */ jsx("div", {
299
+ className: style_default.MethodSignature,
300
+ children: /* @__PURE__ */ jsxs("span", {
301
+ className: style_default.SignatureTitle,
302
+ children: [
303
+ decl.signature.async && /* @__PURE__ */ jsx("span", {
304
+ className: style_default.TextKeyword,
305
+ children: "async "
306
+ }),
307
+ /* @__PURE__ */ jsx("span", {
308
+ className: style_default.SignatureQualified,
309
+ children: /* @__PURE__ */ jsx("span", {
310
+ className: style_default.TextIdentifier,
311
+ children: decl.qualified?.slice(0, -decl.ident.length)
312
+ })
313
+ }),
314
+ /* @__PURE__ */ jsx("span", {
315
+ className: style_default.SignatureName,
316
+ children: /* @__PURE__ */ jsx("span", {
317
+ className: style_default.TextIdentifier,
318
+ children: decl.ident
319
+ })
320
+ }),
321
+ /* @__PURE__ */ jsxs("span", {
322
+ className: style_default.MethodSignature,
323
+ children: [
324
+ decl.signature.typeParameters && /* @__PURE__ */ jsx(TypeParams, { params: decl.signature.typeParameters }),
325
+ /* @__PURE__ */ jsx("span", {
326
+ className: style_default.SignatureParen,
327
+ children: "("
328
+ }),
329
+ /* @__PURE__ */ jsx("span", {
330
+ className: style_default.SignatureParams,
331
+ children: /* @__PURE__ */ jsx(Join, {
332
+ items: params,
333
+ children: /* @__PURE__ */ jsx("span", {
334
+ className: style_default.TextOperator,
335
+ children: ", "
336
+ })
337
+ })
338
+ }),
339
+ /* @__PURE__ */ jsx("span", {
340
+ className: style_default.SignatureParen,
341
+ children: ")"
342
+ }),
343
+ decl.signature.returns && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
344
+ className: style_default.TextPunctuation,
345
+ children: ": "
346
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: decl.signature.returns })] })
347
+ ]
348
+ })
349
+ ]
350
+ })
351
+ });
352
+ }
353
+ function Property({ decl, children }) {
354
+ const Lang = useLanguageComponents();
355
+ if (!decl) return;
356
+ switch (decl.kind) {
357
+ case "TSDeclProperty": return children({
358
+ name: decl.key,
359
+ typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
360
+ type: decl.type.kind in ComplexTypes && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
361
+ });
362
+ case "TSDeclTypeAlias": return children({
363
+ name: decl.ident,
364
+ typeName: "alias",
365
+ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
366
+ });
367
+ case "TSDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
368
+ case "TSDeclInterface": return children({ type: /* @__PURE__ */ jsxs(Fragment$1, { children: [
369
+ /* @__PURE__ */ jsx("span", {
370
+ className: style_default.TextIdentifier,
371
+ children: decl.ident
372
+ }),
373
+ decl.typeParameters && /* @__PURE__ */ jsx(TypeParams, { params: decl.typeParameters }),
374
+ decl.extends?.flatMap((t, key) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [/* @__PURE__ */ jsx("span", {
375
+ className: style_default.TextKeyword,
376
+ children: " extends "
377
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: t })] }, `extends:${key}`))
378
+ ] }) });
379
+ }
380
+ }
381
+ function Declaration({ decl }) {
382
+ const Lang = useLanguageComponents();
383
+ if (!decl) return;
384
+ switch (decl.kind) {
385
+ case "TSDeclProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
386
+ decl.declare && /* @__PURE__ */ jsx("span", {
387
+ className: style_default.TextKeyword,
388
+ children: "declare "
389
+ }),
390
+ /* @__PURE__ */ jsx("span", {
391
+ className: style_default.TypePropertyName,
392
+ children: /* @__PURE__ */ jsx(Identifier, {
393
+ name: decl.key,
394
+ optional: decl.optional
395
+ })
396
+ }),
397
+ /* @__PURE__ */ jsx("span", {
398
+ className: style_default.TextPunctuation,
399
+ children: ": "
400
+ }),
401
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
402
+ ] });
403
+ case "TSDeclFunction": return /* @__PURE__ */ jsx(Lang.MethodSignature, { decl });
404
+ case "TSDeclTypeAlias": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
405
+ /* @__PURE__ */ jsx(Identifier, { name: decl.ident }),
406
+ /* @__PURE__ */ jsx(TypeParams, { params: decl.typeParameters }),
407
+ /* @__PURE__ */ jsx("span", {
408
+ className: style_default.TextOperator,
409
+ children: " = "
410
+ }),
411
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
412
+ ] });
413
+ case "TSDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
414
+ case "TSDeclInterface": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
415
+ /* @__PURE__ */ jsx("span", {
416
+ className: style_default.TextIdentifier,
417
+ children: decl.ident
418
+ }),
419
+ /* @__PURE__ */ jsx(TypeParams, { params: decl.typeParameters }),
420
+ decl.extends?.map((t, index) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [/* @__PURE__ */ jsx("span", {
421
+ className: style_default.TextKeyword,
422
+ children: " extends "
423
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: t })] }, index)),
424
+ /* @__PURE__ */ jsx(TypePreview, { path: decl.stainlessPath })
425
+ ] });
426
+ case "TSDeclClass": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
427
+ /* @__PURE__ */ jsx("span", {
428
+ className: style_default.TextKeyword,
429
+ children: "class "
430
+ }),
431
+ /* @__PURE__ */ jsx("span", {
432
+ className: style_default.TextIdentifier,
433
+ children: decl.ident
434
+ }),
435
+ /* @__PURE__ */ jsx(TypeParams, { params: decl.typeParameters }),
436
+ decl.superClass ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
437
+ className: style_default.TextKeyword,
438
+ children: " extends "
439
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: decl.superClass })] }) : null,
440
+ decl.implements?.map((t, index) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [/* @__PURE__ */ jsx("span", {
441
+ className: style_default.TextKeyword,
442
+ children: " implements "
443
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: t })] }, index))
444
+ ] });
445
+ }
446
+ }
447
+
448
+ //#endregion
449
+ export { TypeName as a, Type as i, MethodSignature as n, typescript_exports as o, Property as r, Declaration as t };
@@ -0,0 +1,7 @@
1
+ import { i as useComponents$1 } from "./component-generics-POFirVVb.js";
2
+
3
+ //#region src/contexts/use-components.tsx
4
+ const useComponents = () => useComponents$1();
5
+
6
+ //#endregion
7
+ export { useComponents as t };
@@ -0,0 +1,32 @@
1
+ import { t as __exportAll } from "./chunk-BN_g-Awi.js";
2
+ import { f as parseStainlessPath } from "./routing-Ce0_tBW6.js";
3
+
4
+ //#region src/utils.ts
5
+ var utils_exports = /* @__PURE__ */ __exportAll({
6
+ flatResources: () => flatResources,
7
+ getResourceFromSpec: () => getResourceFromSpec,
8
+ isResourceEmpty: () => isResourceEmpty
9
+ });
10
+ function flatResources(resources, parents) {
11
+ return Object.keys(resources ?? {}).flatMap((key) => {
12
+ const resource = resources[key];
13
+ return [{
14
+ resource,
15
+ parents
16
+ }, ...resource.subresources ? flatResources(resource.subresources, [...parents, resource]) : []];
17
+ });
18
+ }
19
+ function getResourceFromSpec(stainlessPath, spec) {
20
+ if (typeof stainlessPath === "string") {
21
+ const parsed = parseStainlessPath(stainlessPath);
22
+ if (!parsed?.resource) return null;
23
+ stainlessPath = parsed.resource;
24
+ }
25
+ return stainlessPath.slice(1).reduce((acc, cur) => acc?.subresources?.[cur], spec.resources[stainlessPath[0]]) ?? null;
26
+ }
27
+ function isResourceEmpty(resource) {
28
+ return !(Object.values(resource.methods).length > 0 || Object.values(resource.models).length > 0 || Object.values(resource.subresources).length > 0);
29
+ }
30
+
31
+ //#endregion
32
+ export { utils_exports as i, getResourceFromSpec as n, isResourceEmpty as r, flatResources as t };
@@ -0,0 +1,14 @@
1
+ import { f as Resource, h as Spec } from "./index-zNpvNvtN.js";
2
+
3
+ //#region src/utils.d.ts
4
+ declare namespace utils_d_exports {
5
+ export { flatResources, getResourceFromSpec, isResourceEmpty };
6
+ }
7
+ declare function flatResources(resources: Record<string, Resource> | undefined, parents: Resource[]): {
8
+ resource: Resource;
9
+ parents: Resource[];
10
+ }[];
11
+ declare function getResourceFromSpec(stainlessPath: string | string[], spec: Spec): Resource | null;
12
+ declare function isResourceEmpty(resource: Resource): boolean;
13
+ //#endregion
14
+ export { flatResources, getResourceFromSpec, isResourceEmpty, utils_d_exports as t };
package/dist/utils.js ADDED
@@ -0,0 +1,3 @@
1
+ import { n as getResourceFromSpec, r as isResourceEmpty, t as flatResources } from "./utils-D01mAUfQ.js";
2
+
3
+ export { flatResources, getResourceFromSpec, isResourceEmpty };
package/package.json CHANGED
@@ -1,39 +1,91 @@
1
1
  {
2
2
  "name": "@stainless-api/docs-ui",
3
3
  "private": false,
4
- "version": "0.1.0-beta.6",
4
+ "version": "0.1.0-beta.61",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "type": "module",
9
9
  "files": [
10
- "dist",
11
- "src"
10
+ "dist"
12
11
  ],
12
+ "peerDependencies": {
13
+ "react": ">=19.0.0",
14
+ "react-dom": ">=19.0.0"
15
+ },
13
16
  "dependencies": {
14
- "@algolia/client-search": "^5.25.0",
15
- "@markdoc/markdoc": "^0.5.2",
16
- "ai": "4.3.19",
17
+ "@markdoc/markdoc": "^0.5.4",
17
18
  "clsx": "^2.1.1",
18
- "fuse.js": "^7.1.0",
19
19
  "htmlparser2": "^10.0.0",
20
- "lucide-react": "^0.544.0",
21
- "react": "^19.1.1",
22
- "react-dom": "^19.1.1",
23
- "@stainless-api/ui-primitives": "0.1.0-beta.7"
20
+ "lucide-react": "^0.562.0",
21
+ "@stainless-api/ui-primitives": "0.1.0-beta.45"
24
22
  },
25
23
  "devDependencies": {
26
- "@types/node": "^24.4.0",
27
- "@types/react": "^19.1.13",
28
- "@types/react-dom": "^19.1.9",
29
- "dotenv": "17.2.2",
30
- "esbuild": "^0.25.4",
31
- "tsx": "^4.20.3",
32
- "@stainless/eslint-config": "0.0.0"
24
+ "@types/node": "24.10.9",
25
+ "@types/react": "19.2.7",
26
+ "@types/react-dom": "^19.2.3",
27
+ "dotenv": "17.2.3",
28
+ "react": "^19.2.3",
29
+ "react-dom": "^19.2.3",
30
+ "tsdown": "^0.20.0",
31
+ "typescript": "5.9.3",
32
+ "@stainless/eslint-config": "0.1.0-beta.1",
33
+ "@stainless/sdk-json": "^0.1.0-beta.3"
34
+ },
35
+ "exports": {
36
+ ".": {
37
+ "default": "./dist/index.js"
38
+ },
39
+ "./routing": {
40
+ "default": "./dist/routing.js"
41
+ },
42
+ "./utils": {
43
+ "default": "./dist/utils.js"
44
+ },
45
+ "./components": {
46
+ "default": "./dist/components/index.js"
47
+ },
48
+ "./components/scripts/*": {
49
+ "default": "./dist/components/scripts/*.js"
50
+ },
51
+ "./components/*": {
52
+ "default": "./dist/components/*.js"
53
+ },
54
+ "./languages": {
55
+ "default": "./dist/languages/index.js"
56
+ },
57
+ "./languages/*": {
58
+ "default": "./dist/languages/*.js"
59
+ },
60
+ "./contexts": {
61
+ "default": "./dist/contexts/index.js"
62
+ },
63
+ "./contexts/*": {
64
+ "default": "./dist/contexts/*.js"
65
+ },
66
+ "./style": {
67
+ "default": "./dist/style.js"
68
+ },
69
+ "./styles/*": {
70
+ "default": "./dist/styles/*"
71
+ },
72
+ "./styles.css": {
73
+ "default": "./dist/styles.css"
74
+ },
75
+ "./markdown": {
76
+ "default": "./dist/markdown/index.js"
77
+ },
78
+ "./markdown/*": {
79
+ "default": "./dist/markdown/*.js"
80
+ },
81
+ "./spec": {
82
+ "default": "./dist/spec.js"
83
+ }
33
84
  },
34
85
  "scripts": {
35
- "symlink": "node make-symlink.js",
36
- "build": "node build.js",
37
- "lint": "eslint ."
86
+ "build": "tsdown",
87
+ "clean": "rm -rf dist",
88
+ "lint": "eslint .",
89
+ "check:types": "tsc --noEmit"
38
90
  }
39
91
  }