@stainless-api/docs-ui 0.1.0-beta.8 → 0.1.0-beta.80

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 (155) hide show
  1. package/dist/chunk-BYypO7fO.js +18 -0
  2. package/dist/components/MaskedInput.d.ts +14 -0
  3. package/dist/components/MaskedInput.js +76 -0
  4. package/dist/components/breadcrumbs.d.ts +25 -0
  5. package/dist/components/breadcrumbs.js +64 -0
  6. package/dist/components/icons.d.ts +65 -0
  7. package/dist/components/icons.js +941 -0
  8. package/dist/components/index.d.ts +16 -0
  9. package/dist/components/index.js +75 -0
  10. package/dist/components/method.d.ts +59 -0
  11. package/dist/components/method.js +97 -0
  12. package/dist/components/overview.d.ts +39 -0
  13. package/dist/components/overview.js +139 -0
  14. package/dist/components/primitives.d.ts +107 -0
  15. package/dist/components/primitives.js +253 -0
  16. package/dist/components/properties.d.ts +54 -0
  17. package/dist/components/properties.js +140 -0
  18. package/dist/components/sdk-sidebar.d.ts +15 -0
  19. package/dist/components/sdk-sidebar.js +52 -0
  20. package/dist/components/sdk.d.ts +128 -0
  21. package/dist/components/sdk.js +490 -0
  22. package/dist/components/snippets.d.ts +71 -0
  23. package/dist/components/snippets.js +184 -0
  24. package/dist/components/stl-sidebar.d.ts +58 -0
  25. package/dist/components/stl-sidebar.js +114 -0
  26. package/dist/contexts/component-generics.d.ts +30 -0
  27. package/dist/contexts/component-generics.js +33 -0
  28. package/dist/contexts/component-types.d.ts +8 -0
  29. package/dist/contexts/component-types.js +0 -0
  30. package/dist/contexts/component.d.ts +21 -0
  31. package/dist/contexts/component.js +24 -0
  32. package/dist/contexts/docs.d.ts +62 -0
  33. package/dist/contexts/docs.js +91 -0
  34. package/dist/contexts/index.d.ts +13 -0
  35. package/dist/contexts/index.js +45 -0
  36. package/dist/contexts/markdown.d.ts +22 -0
  37. package/dist/contexts/markdown.js +49 -0
  38. package/dist/contexts/navigation.d.ts +29 -0
  39. package/dist/contexts/navigation.js +24 -0
  40. package/dist/contexts/use-components.d.ts +6 -0
  41. package/dist/contexts/use-components.js +8 -0
  42. package/dist/index-pvh-w1xa.d.ts +1776 -0
  43. package/dist/index.d.ts +7 -0
  44. package/dist/index.js +9 -7542
  45. package/dist/languages/cli.d.ts +38 -0
  46. package/dist/languages/cli.js +167 -0
  47. package/dist/languages/csharp.d.ts +42 -0
  48. package/dist/languages/csharp.js +284 -0
  49. package/dist/languages/go.d.ts +40 -0
  50. package/dist/languages/go.js +304 -0
  51. package/dist/languages/http.d.ts +46 -0
  52. package/dist/languages/http.js +391 -0
  53. package/dist/languages/index.d.ts +51 -0
  54. package/dist/languages/index.js +33 -0
  55. package/dist/languages/java.d.ts +43 -0
  56. package/dist/languages/java.js +404 -0
  57. package/dist/languages/php.d.ts +40 -0
  58. package/dist/languages/php.js +313 -0
  59. package/dist/languages/python.d.ts +40 -0
  60. package/dist/languages/python.js +270 -0
  61. package/dist/languages/ruby.d.ts +40 -0
  62. package/dist/languages/ruby.js +388 -0
  63. package/dist/languages/terraform.d.ts +48 -0
  64. package/dist/languages/terraform.js +244 -0
  65. package/dist/languages/typescript.d.ts +40 -0
  66. package/dist/languages/typescript.js +450 -0
  67. package/dist/markdown/index.d.ts +11 -0
  68. package/dist/markdown/index.js +80 -0
  69. package/dist/markdown/md.d.ts +15 -0
  70. package/dist/markdown/md.js +41 -0
  71. package/dist/markdown/printer.d.ts +13 -0
  72. package/dist/markdown/printer.js +76 -0
  73. package/dist/markdown/utils.d.ts +21 -0
  74. package/dist/markdown/utils.js +31 -0
  75. package/dist/routing.d.ts +61 -0
  76. package/dist/routing.js +176 -150
  77. package/dist/spec.d.ts +65 -0
  78. package/dist/spec.js +167 -0
  79. package/dist/style.d.ts +177 -0
  80. package/dist/style.js +178 -0
  81. package/dist/styles/main.css +788 -752
  82. package/dist/styles/main.js +0 -0
  83. package/dist/styles/primitives.css +326 -458
  84. package/dist/styles/primitives.js +0 -0
  85. package/dist/styles/resets.css +32 -41
  86. package/dist/styles/resets.js +0 -0
  87. package/dist/styles/search.css +192 -270
  88. package/dist/styles/search.js +0 -0
  89. package/dist/styles/sidebar.css +182 -69
  90. package/dist/styles/sidebar.js +0 -0
  91. package/dist/styles/variables.css +28 -89
  92. package/dist/styles/variables.js +0 -0
  93. package/dist/styles.css +3333 -0
  94. package/dist/styles.mjs +1 -0
  95. package/dist/use-strict-context-L0c8JKg4.js +16 -0
  96. package/dist/utils.d.ts +20 -0
  97. package/dist/utils.js +54 -0
  98. package/package.json +74 -22
  99. package/dist/mcp.js +0 -16003
  100. package/dist/styles/snippets.css +0 -132
  101. package/src/components/breadcrumbs.tsx +0 -94
  102. package/src/components/chat.tsx +0 -154
  103. package/src/components/dropdown.tsx +0 -91
  104. package/src/components/icons.tsx +0 -584
  105. package/src/components/index.ts +0 -9
  106. package/src/components/method.tsx +0 -146
  107. package/src/components/overview.tsx +0 -160
  108. package/src/components/primitives.tsx +0 -284
  109. package/src/components/properties.tsx +0 -130
  110. package/src/components/scripts/dropdown.ts +0 -78
  111. package/src/components/sdk.tsx +0 -403
  112. package/src/components/sidebar.tsx +0 -99
  113. package/src/components/snippets.tsx +0 -180
  114. package/src/contexts/component-generics.tsx +0 -48
  115. package/src/contexts/component-types.tsx +0 -5
  116. package/src/contexts/component.tsx +0 -32
  117. package/src/contexts/docs.tsx +0 -75
  118. package/src/contexts/index.tsx +0 -17
  119. package/src/contexts/markdown.tsx +0 -43
  120. package/src/contexts/navigation.tsx +0 -44
  121. package/src/contexts/search.tsx +0 -28
  122. package/src/contexts/use-components.tsx +0 -4
  123. package/src/index.ts +0 -6
  124. package/src/languages/go.tsx +0 -281
  125. package/src/languages/http.tsx +0 -321
  126. package/src/languages/index.ts +0 -26
  127. package/src/languages/java.tsx +0 -358
  128. package/src/languages/python.tsx +0 -255
  129. package/src/languages/ruby.tsx +0 -320
  130. package/src/languages/typescript.tsx +0 -393
  131. package/src/markdown/index.ts +0 -107
  132. package/src/markdown/md.ts +0 -45
  133. package/src/markdown/utils.ts +0 -49
  134. package/src/routing.ts +0 -238
  135. package/src/search/form.tsx +0 -127
  136. package/src/search/index.tsx +0 -1
  137. package/src/search/indexer.ts +0 -246
  138. package/src/search/mcp.ts +0 -61
  139. package/src/search/printer.tsx +0 -86
  140. package/src/search/providers/algolia.ts +0 -88
  141. package/src/search/providers/fuse.ts +0 -19
  142. package/src/search/providers/pagefind.ts +0 -17
  143. package/src/search/providers/walker.ts +0 -30
  144. package/src/search/results.tsx +0 -182
  145. package/src/search/state.ts +0 -64
  146. package/src/search/types.ts +0 -116
  147. package/src/style.ts +0 -196
  148. package/src/styles/main.css +0 -986
  149. package/src/styles/primitives.css +0 -580
  150. package/src/styles/resets.css +0 -39
  151. package/src/styles/search.css +0 -341
  152. package/src/styles/sidebar.css +0 -85
  153. package/src/styles/snippets.css +0 -130
  154. package/src/styles/variables.css +0 -86
  155. package/src/utils.ts +0 -41
@@ -0,0 +1,304 @@
1
+ import { t as __exportAll } from "../chunk-BYypO7fO.js";
2
+ import "../use-strict-context-L0c8JKg4.js";
3
+ import { useLanguageComponents } from "../contexts/index.js";
4
+ import { useComponents } from "../contexts/use-components.js";
5
+ import style_default from "../style.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/go.tsx
10
+ var go_exports = /* @__PURE__ */ __exportAll({
11
+ Declaration: () => Declaration,
12
+ MethodSignature: () => MethodSignature,
13
+ Property: () => Property,
14
+ Type: () => Type,
15
+ TypeName: () => TypeName
16
+ });
17
+ const ComplexTypes = {
18
+ GoTypeMap: "map",
19
+ GoTypeArray: "array"
20
+ };
21
+ const Keywords = {
22
+ GoTypeAny: "any",
23
+ GoTypeUnknown: "unknown",
24
+ GoTypeInt: "int64",
25
+ GoTypeFloat: "float64",
26
+ GoTypeBool: "bool",
27
+ GoTypeError: "error"
28
+ };
29
+ function isField(type) {
30
+ return type.kind === "GoTypeReference" && type.typeName === "param.Field";
31
+ }
32
+ function TypeName({ type }) {
33
+ const Lang = useLanguageComponents();
34
+ return isField(type) ? "field" : ComplexTypes[type.kind] ?? /* @__PURE__ */ jsx(Lang.Type, { type });
35
+ }
36
+ function Type({ type }) {
37
+ const Lang = useLanguageComponents();
38
+ const { Join, SDKReference } = useComponents();
39
+ switch (type.kind) {
40
+ case "GoTypeReference": {
41
+ const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
42
+ return /* @__PURE__ */ jsxs("span", {
43
+ className: style_default.Type,
44
+ children: [type.$ref ? /* @__PURE__ */ jsx(SDKReference, {
45
+ stainlessPath: type.$ref,
46
+ children: type.typeName
47
+ }) : type.typeName, params && params.length > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
48
+ /* @__PURE__ */ jsx("span", {
49
+ className: style_default.TypeBracket,
50
+ children: "["
51
+ }),
52
+ /* @__PURE__ */ jsx(Join, {
53
+ items: params,
54
+ limit: 3,
55
+ children: /* @__PURE__ */ jsx("span", {
56
+ className: style_default.TextOperator,
57
+ children: ", "
58
+ })
59
+ }),
60
+ /* @__PURE__ */ jsx("span", {
61
+ className: style_default.TypeBracket,
62
+ children: "]"
63
+ })
64
+ ] }) : null]
65
+ });
66
+ }
67
+ case "GoTypeAny":
68
+ case "GoTypeUnknown":
69
+ case "GoTypeInt":
70
+ case "GoTypeFloat":
71
+ case "GoTypeBool":
72
+ case "GoTypeError": return /* @__PURE__ */ jsx("span", {
73
+ className: style_default.Type,
74
+ children: /* @__PURE__ */ jsx("span", {
75
+ className: style_default.TypeKeyword,
76
+ children: Keywords[type.kind]
77
+ })
78
+ });
79
+ case "GoTypeString": return /* @__PURE__ */ jsx("span", {
80
+ className: style_default.Type,
81
+ children: /* @__PURE__ */ jsx("span", {
82
+ className: style_default.TypeString,
83
+ children: "string"
84
+ })
85
+ });
86
+ case "GoTypeArray": return /* @__PURE__ */ jsxs("span", {
87
+ className: style_default.Type,
88
+ children: [/* @__PURE__ */ jsx("span", {
89
+ className: style_default.TextOperator,
90
+ children: "[]"
91
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: type.elementType })]
92
+ });
93
+ case "GoTypeStruct": return /* @__PURE__ */ jsx("span", {
94
+ className: style_default.Type,
95
+ children: /* @__PURE__ */ jsx("span", {
96
+ className: style_default.TypeKeyword,
97
+ children: "struct{…}"
98
+ })
99
+ });
100
+ case "GoTypeInterface": return /* @__PURE__ */ jsx("span", {
101
+ className: style_default.Type,
102
+ children: /* @__PURE__ */ jsx("span", {
103
+ className: style_default.TypeKeyword,
104
+ children: "interface{…}"
105
+ })
106
+ });
107
+ case "GoTypeMap": return /* @__PURE__ */ jsxs("span", {
108
+ className: style_default.Type,
109
+ children: [
110
+ /* @__PURE__ */ jsx("span", {
111
+ className: style_default.TypeKeyword,
112
+ children: "map"
113
+ }),
114
+ /* @__PURE__ */ jsx("span", {
115
+ className: style_default.TypeBracket,
116
+ children: "["
117
+ }),
118
+ /* @__PURE__ */ jsx(Lang.Type, { type: type.indexType }),
119
+ /* @__PURE__ */ jsx("span", {
120
+ className: style_default.TextPunctuation,
121
+ children: ","
122
+ }),
123
+ " ",
124
+ /* @__PURE__ */ jsx(Lang.Type, { type: type.itemType }),
125
+ /* @__PURE__ */ jsx("span", {
126
+ className: style_default.TypeBracket,
127
+ children: "]"
128
+ })
129
+ ]
130
+ });
131
+ case "GoTypePointer": return /* @__PURE__ */ jsxs("span", {
132
+ className: style_default.Type,
133
+ children: [/* @__PURE__ */ jsx("span", {
134
+ className: style_default.TextOperator,
135
+ children: "*"
136
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: type.inner })]
137
+ });
138
+ }
139
+ }
140
+ function MethodSignature({ decl }) {
141
+ const Lang = useLanguageComponents();
142
+ const { Join } = useComponents();
143
+ const params = decl.parameters.map((param, i) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [/* @__PURE__ */ jsx("span", {
144
+ className: style_default.TextIdentifier,
145
+ children: param.ident
146
+ }), param.optional && /* @__PURE__ */ jsx("span", {
147
+ className: style_default.TextPunctuation,
148
+ children: "?"
149
+ })] }, i));
150
+ const returns = decl.returnType.map((t, key) => /* @__PURE__ */ jsx(Lang.Type, { type: t }, key));
151
+ return /* @__PURE__ */ jsx("div", {
152
+ className: style_default.MethodSignature,
153
+ children: /* @__PURE__ */ jsxs("span", {
154
+ className: style_default.SignatureTitle,
155
+ children: [
156
+ decl.async && /* @__PURE__ */ jsx("span", {
157
+ className: style_default.TextKeyword,
158
+ children: "async "
159
+ }),
160
+ decl.qualified && /* @__PURE__ */ jsx("span", {
161
+ className: style_default.SignatureQualified,
162
+ children: /* @__PURE__ */ jsx("span", {
163
+ className: style_default.TextIdentifier,
164
+ children: decl.qualified?.slice(0, -decl.ident.length)
165
+ })
166
+ }),
167
+ decl.kind === "GoDeclFunction" && /* @__PURE__ */ jsx("span", {
168
+ className: style_default.SignatureName,
169
+ children: /* @__PURE__ */ jsx("span", {
170
+ className: style_default.TextIdentifier,
171
+ children: decl.ident
172
+ })
173
+ }),
174
+ /* @__PURE__ */ jsxs("span", {
175
+ className: style_default.MethodSignature,
176
+ children: [
177
+ /* @__PURE__ */ jsx("span", {
178
+ className: style_default.SignatureParen,
179
+ children: "("
180
+ }),
181
+ /* @__PURE__ */ jsx("span", {
182
+ className: style_default.SignatureParams,
183
+ children: /* @__PURE__ */ jsx(Join, {
184
+ items: params,
185
+ children: /* @__PURE__ */ jsx("span", {
186
+ className: style_default.TextOperator,
187
+ children: ", "
188
+ })
189
+ })
190
+ }),
191
+ /* @__PURE__ */ jsxs("span", {
192
+ className: style_default.SignatureParen,
193
+ children: [")", " "]
194
+ }),
195
+ decl.returnType.length === 1 ? returns : /* @__PURE__ */ jsxs(Fragment$1, { children: [
196
+ /* @__PURE__ */ jsx("span", {
197
+ className: style_default.SignatureParen,
198
+ children: "("
199
+ }),
200
+ /* @__PURE__ */ jsx(Join, {
201
+ items: returns,
202
+ children: /* @__PURE__ */ jsx("span", {
203
+ className: style_default.TextOperator,
204
+ children: ", "
205
+ })
206
+ }),
207
+ /* @__PURE__ */ jsx("span", {
208
+ className: style_default.SignatureParen,
209
+ children: ")"
210
+ })
211
+ ] })
212
+ ]
213
+ })
214
+ ]
215
+ })
216
+ });
217
+ }
218
+ function Property({ decl, children }) {
219
+ const Docs = useComponents();
220
+ const Lang = useLanguageComponents();
221
+ if (!decl) return null;
222
+ switch (decl.kind) {
223
+ case "GoDeclProperty": return children({
224
+ name: decl.ident,
225
+ typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
226
+ badges: decl.optional && /* @__PURE__ */ jsx(Docs.Badge, { id: "optional" }),
227
+ type: (isField(decl.type) || decl.type.kind in ComplexTypes) && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
228
+ });
229
+ case "GoDeclConst": return children({
230
+ name: decl.ident,
231
+ typeName: "const",
232
+ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
233
+ });
234
+ case "GoDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
235
+ case "GoDeclType":
236
+ case "GoDeclTypeAlias": {
237
+ const typeName = decl.type.kind === "GoTypeStruct" ? "struct" : decl.type.kind === "GoTypeInterface" ? "interface" : decl.kind === "GoDeclTypeAlias" ? "alias" : "type";
238
+ return children({
239
+ name: decl.ident,
240
+ typeName,
241
+ type: ["GoTypeStruct", "GoTypeInterface"].includes(decl.type.kind) || /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
242
+ });
243
+ }
244
+ }
245
+ }
246
+ function Declaration({ decl }) {
247
+ const Lang = useLanguageComponents();
248
+ if (!decl) return;
249
+ switch (decl.kind) {
250
+ case "GoDeclType": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
251
+ /* @__PURE__ */ jsx("span", {
252
+ className: style_default.TextKeyword,
253
+ children: "type "
254
+ }),
255
+ /* @__PURE__ */ jsxs("span", {
256
+ className: style_default.TextIdentifier,
257
+ children: [decl.ident, " "]
258
+ }),
259
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
260
+ ] });
261
+ case "GoDeclTypeAlias": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
262
+ /* @__PURE__ */ jsx("span", {
263
+ className: style_default.TextKeyword,
264
+ children: "type "
265
+ }),
266
+ /* @__PURE__ */ jsxs("span", {
267
+ className: style_default.TextIdentifier,
268
+ children: [decl.ident, " "]
269
+ }),
270
+ /* @__PURE__ */ jsx("span", {
271
+ className: style_default.TextOperator,
272
+ children: "= "
273
+ }),
274
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
275
+ ] });
276
+ case "GoDeclProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
277
+ className: style_default.TypePropertyName,
278
+ children: /* @__PURE__ */ jsxs("span", {
279
+ className: style_default.TextIdentifier,
280
+ children: [decl.ident, " "]
281
+ })
282
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })] });
283
+ case "GoDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
284
+ case "GoDeclConst": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
285
+ /* @__PURE__ */ jsx("span", {
286
+ className: style_default.TextKeyword,
287
+ children: "const "
288
+ }),
289
+ /* @__PURE__ */ jsxs("span", {
290
+ className: style_default.TextIdentifier,
291
+ children: [decl.ident, " "]
292
+ }),
293
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }),
294
+ /* @__PURE__ */ jsx("span", {
295
+ className: style_default.TextOperator,
296
+ children: " = "
297
+ }),
298
+ JSON.stringify(decl.value)
299
+ ] });
300
+ }
301
+ }
302
+
303
+ //#endregion
304
+ export { Declaration, MethodSignature, Property, Type, TypeName, go_exports as t };
@@ -0,0 +1,46 @@
1
+ import { s as HttpAST } from "../index-pvh-w1xa.js";
2
+ import { PropertyFn } from "./index.js";
3
+ import React from "react";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
5
+
6
+ //#region src/languages/http.d.ts
7
+ declare namespace http_d_exports {
8
+ export { Declaration, DeclarationProps, MethodInfo, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };
9
+ }
10
+ type TypeProps = {
11
+ type: HttpAST.HttpType;
12
+ };
13
+ declare function TypeName({
14
+ type
15
+ }: TypeProps): string | react_jsx_runtime0.JSX.Element;
16
+ declare function Type({
17
+ type
18
+ }: TypeProps): react_jsx_runtime0.JSX.Element;
19
+ type MethodSignatureProps = {
20
+ decl: HttpAST.HttpDeclFunction;
21
+ };
22
+ declare function MethodSignature({
23
+ decl
24
+ }: MethodSignatureProps): null;
25
+ declare function MethodInfo({
26
+ decl,
27
+ children
28
+ }: MethodSignatureProps & {
29
+ children: React.ReactNode;
30
+ }): react_jsx_runtime0.JSX.Element;
31
+ type PropertyProps = {
32
+ decl: HttpAST.HttpDeclaration;
33
+ children: PropertyFn;
34
+ };
35
+ declare function Property({
36
+ decl,
37
+ children
38
+ }: PropertyProps): React.ReactNode;
39
+ type DeclarationProps = {
40
+ decl: HttpAST.HttpDeclaration;
41
+ };
42
+ declare function Declaration({
43
+ decl
44
+ }: DeclarationProps): react_jsx_runtime0.JSX.Element | undefined;
45
+ //#endregion
46
+ export { Declaration, DeclarationProps, MethodInfo, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName, http_d_exports as t };