@stainless-api/docs-ui 0.1.0-beta.9 → 0.1.0-beta.91

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 (162) hide show
  1. package/dist/breadcrumbs-BaNU4WsC.d.ts +25 -0
  2. package/dist/chunk-pbuEa-1d.js +13 -0
  3. package/dist/component-generics-D9XaPlr8.d.ts +30 -0
  4. package/dist/component-generics-DYxBWv1v.js +42 -0
  5. package/dist/components/MaskedInput.d.ts +14 -0
  6. package/dist/components/MaskedInput.js +74 -0
  7. package/dist/components/breadcrumbs.d.ts +2 -0
  8. package/dist/components/breadcrumbs.js +61 -0
  9. package/dist/components/icons.d.ts +72 -0
  10. package/dist/components/icons.js +953 -0
  11. package/dist/components/index.d.ts +10 -0
  12. package/dist/components/index.js +72 -0
  13. package/dist/components/method.d.ts +2 -0
  14. package/dist/components/method.js +94 -0
  15. package/dist/components/overview.d.ts +2 -0
  16. package/dist/components/overview.js +139 -0
  17. package/dist/components/primitives.d.ts +2 -0
  18. package/dist/components/primitives.js +250 -0
  19. package/dist/components/properties.d.ts +2 -0
  20. package/dist/components/properties.js +143 -0
  21. package/dist/components/sdk-sidebar.d.ts +2 -0
  22. package/dist/components/sdk-sidebar.js +49 -0
  23. package/dist/components/sdk.d.ts +2 -0
  24. package/dist/components/sdk.js +487 -0
  25. package/dist/components/snippets.d.ts +2 -0
  26. package/dist/components/snippets.js +183 -0
  27. package/dist/components/stl-sidebar.d.ts +2 -0
  28. package/dist/components/stl-sidebar.js +111 -0
  29. package/dist/contexts/component-generics.d.ts +2 -0
  30. package/dist/contexts/component-generics.js +2 -0
  31. package/dist/contexts/component-types.d.ts +7 -0
  32. package/dist/contexts/component-types.js +0 -0
  33. package/dist/contexts/component.d.ts +20 -0
  34. package/dist/contexts/component.js +21 -0
  35. package/dist/contexts/docs.d.ts +2 -0
  36. package/dist/contexts/docs.js +89 -0
  37. package/dist/contexts/index.d.ts +6 -0
  38. package/dist/contexts/index.js +43 -0
  39. package/dist/contexts/markdown.d.ts +2 -0
  40. package/dist/contexts/markdown.js +62 -0
  41. package/dist/contexts/navigation.d.ts +2 -0
  42. package/dist/contexts/navigation.js +21 -0
  43. package/dist/contexts/use-components.d.ts +6 -0
  44. package/dist/contexts/use-components.js +5 -0
  45. package/dist/docs-D0qzNoXq.d.ts +62 -0
  46. package/dist/index-DFr9Mesr.d.ts +1776 -0
  47. package/dist/index-Dt9uPKZP.d.ts +464 -0
  48. package/dist/index.d.ts +5 -0
  49. package/dist/index.js +7 -7542
  50. package/dist/languages/cli.d.ts +2 -0
  51. package/dist/languages/cli.js +164 -0
  52. package/dist/languages/csharp.d.ts +2 -0
  53. package/dist/languages/csharp.js +281 -0
  54. package/dist/languages/go.d.ts +2 -0
  55. package/dist/languages/go.js +301 -0
  56. package/dist/languages/http.d.ts +2 -0
  57. package/dist/languages/http.js +381 -0
  58. package/dist/languages/index.d.ts +2 -0
  59. package/dist/languages/index.js +30 -0
  60. package/dist/languages/java.d.ts +2 -0
  61. package/dist/languages/java.js +401 -0
  62. package/dist/languages/php.d.ts +2 -0
  63. package/dist/languages/php.js +310 -0
  64. package/dist/languages/python.d.ts +2 -0
  65. package/dist/languages/python.js +267 -0
  66. package/dist/languages/ruby.d.ts +2 -0
  67. package/dist/languages/ruby.js +385 -0
  68. package/dist/languages/terraform.d.ts +2 -0
  69. package/dist/languages/terraform.js +258 -0
  70. package/dist/languages/typescript.d.ts +2 -0
  71. package/dist/languages/typescript.js +447 -0
  72. package/dist/markdown/index.d.ts +11 -0
  73. package/dist/markdown/index.js +86 -0
  74. package/dist/markdown/md.d.ts +15 -0
  75. package/dist/markdown/md.js +39 -0
  76. package/dist/markdown/printer.d.ts +13 -0
  77. package/dist/markdown/printer.js +73 -0
  78. package/dist/markdown/utils.d.ts +28 -0
  79. package/dist/markdown/utils.js +31 -0
  80. package/dist/markdown-B30HO-Vy.d.ts +33 -0
  81. package/dist/method-BKJnP-rW.d.ts +59 -0
  82. package/dist/navigation-DGl8lR6w.d.ts +29 -0
  83. package/dist/overview-iH1evPEF.d.ts +39 -0
  84. package/dist/primitives-BHt-BuLf.d.ts +107 -0
  85. package/dist/properties-CCbMRhSX.d.ts +54 -0
  86. package/dist/routing-yTSG7nWM.d.ts +61 -0
  87. package/dist/routing.d.ts +2 -0
  88. package/dist/routing.js +174 -150
  89. package/dist/sdk-BengV7mg.d.ts +128 -0
  90. package/dist/sdk-sidebar-CRqLm3YO.d.ts +15 -0
  91. package/dist/spec.d.ts +65 -0
  92. package/dist/spec.js +165 -0
  93. package/dist/stl-sidebar-Pra9uCYo.d.ts +58 -0
  94. package/dist/style.d.ts +178 -0
  95. package/dist/style.js +178 -0
  96. package/dist/styles/main.css +765 -755
  97. package/dist/styles/primitives.css +359 -442
  98. package/dist/styles/resets.css +25 -41
  99. package/dist/styles/search.css +187 -270
  100. package/dist/styles/sidebar.css +155 -69
  101. package/dist/styles/variables.css +23 -89
  102. package/dist/styles.css +3171 -0
  103. package/dist/utils.d.ts +20 -0
  104. package/dist/utils.js +52 -0
  105. package/package.json +75 -22
  106. package/dist/mcp.js +0 -16003
  107. package/dist/styles/snippets.css +0 -132
  108. package/src/components/breadcrumbs.tsx +0 -94
  109. package/src/components/chat.tsx +0 -154
  110. package/src/components/dropdown.tsx +0 -91
  111. package/src/components/icons.tsx +0 -584
  112. package/src/components/index.ts +0 -9
  113. package/src/components/method.tsx +0 -146
  114. package/src/components/overview.tsx +0 -160
  115. package/src/components/primitives.tsx +0 -284
  116. package/src/components/properties.tsx +0 -130
  117. package/src/components/scripts/dropdown.ts +0 -78
  118. package/src/components/sdk.tsx +0 -403
  119. package/src/components/sidebar.tsx +0 -99
  120. package/src/components/snippets.tsx +0 -180
  121. package/src/contexts/component-generics.tsx +0 -48
  122. package/src/contexts/component-types.tsx +0 -5
  123. package/src/contexts/component.tsx +0 -32
  124. package/src/contexts/docs.tsx +0 -75
  125. package/src/contexts/index.tsx +0 -17
  126. package/src/contexts/markdown.tsx +0 -43
  127. package/src/contexts/navigation.tsx +0 -44
  128. package/src/contexts/search.tsx +0 -28
  129. package/src/contexts/use-components.tsx +0 -4
  130. package/src/index.ts +0 -6
  131. package/src/languages/go.tsx +0 -281
  132. package/src/languages/http.tsx +0 -321
  133. package/src/languages/index.ts +0 -26
  134. package/src/languages/java.tsx +0 -358
  135. package/src/languages/python.tsx +0 -255
  136. package/src/languages/ruby.tsx +0 -320
  137. package/src/languages/typescript.tsx +0 -393
  138. package/src/markdown/index.ts +0 -107
  139. package/src/markdown/md.ts +0 -45
  140. package/src/markdown/utils.ts +0 -49
  141. package/src/routing.ts +0 -238
  142. package/src/search/form.tsx +0 -127
  143. package/src/search/index.tsx +0 -1
  144. package/src/search/indexer.ts +0 -246
  145. package/src/search/mcp.ts +0 -61
  146. package/src/search/printer.tsx +0 -86
  147. package/src/search/providers/algolia.ts +0 -88
  148. package/src/search/providers/fuse.ts +0 -19
  149. package/src/search/providers/pagefind.ts +0 -17
  150. package/src/search/providers/walker.ts +0 -30
  151. package/src/search/results.tsx +0 -182
  152. package/src/search/state.ts +0 -64
  153. package/src/search/types.ts +0 -116
  154. package/src/style.ts +0 -196
  155. package/src/styles/main.css +0 -986
  156. package/src/styles/primitives.css +0 -580
  157. package/src/styles/resets.css +0 -39
  158. package/src/styles/search.css +0 -341
  159. package/src/styles/sidebar.css +0 -85
  160. package/src/styles/snippets.css +0 -130
  161. package/src/styles/variables.css +0 -86
  162. package/src/utils.ts +0 -41
@@ -0,0 +1,385 @@
1
+ import { t as __exportAll } from "../chunk-pbuEa-1d.js";
2
+ import { useDeclaration, useLanguage, useSpec } from "../contexts/docs.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
+ //#region src/languages/ruby.tsx
9
+ var ruby_exports = /* @__PURE__ */ __exportAll({
10
+ Declaration: () => Declaration,
11
+ MethodSignature: () => MethodSignature,
12
+ Property: () => Property,
13
+ Type: () => Type,
14
+ TypeName: () => TypeName
15
+ });
16
+ const ComplexTypes = {
17
+ RubyTypeObject: "object",
18
+ RubyTypeUnion: "union",
19
+ RubyTypeIntersection: "intersection",
20
+ RubyTypeArray: "array",
21
+ RubyTypeMap: "hash"
22
+ };
23
+ const Keywords = {
24
+ RubyTypeBinary: "FileInput",
25
+ RubyTypeUnknown: "untyped",
26
+ RubyTypeNull: "nil",
27
+ RubyTypeInteger: "Integer",
28
+ RubyTypeFloat: "Float",
29
+ RubyTypeBoolean: "bool"
30
+ };
31
+ function TypeName({ type }) {
32
+ const Lang = useLanguageComponents();
33
+ return ComplexTypes[type.kind] ?? /* @__PURE__ */ jsx(Lang.Type, { type });
34
+ }
35
+ const VALID_IDENTIFIER = /^[_A-Za-z][_A-Za-z0-9]*$/;
36
+ function TypePreview({ path }) {
37
+ const spec = useSpec();
38
+ const language = useLanguage();
39
+ const decl = useDeclaration(path, false);
40
+ const { Join } = useComponents();
41
+ if (!(decl && "children" in decl && decl.children && decl.children.length > 0) || "type" in decl && decl["type"] && "kind" in decl["type"] && decl["type"]?.["kind"] === "RubyTypeUnion") return;
42
+ const items = decl.children.map((prop, key) => {
43
+ const p = spec?.decls?.[language]?.[prop];
44
+ return /* @__PURE__ */ jsx("span", {
45
+ className: style_default.TypePropertyName,
46
+ children: /* @__PURE__ */ jsx("span", {
47
+ className: style_default.TextIdentifier,
48
+ children: p && "ident" in p ? p["ident"] : null
49
+ })
50
+ }, key);
51
+ });
52
+ return /* @__PURE__ */ jsxs("span", {
53
+ className: style_default.TypePreview,
54
+ "data-stldocs-type-preview": "properties",
55
+ children: [
56
+ /* @__PURE__ */ jsx("span", {
57
+ className: style_default.TypeBrace,
58
+ children: " {"
59
+ }),
60
+ /* @__PURE__ */ jsxs("span", {
61
+ className: style_default.TypePreviewContent,
62
+ children: [
63
+ " ",
64
+ /* @__PURE__ */ jsx(Join, {
65
+ items,
66
+ limit: 3,
67
+ children: /* @__PURE__ */ jsx("span", {
68
+ className: style_default.TextOperator,
69
+ children: ", "
70
+ })
71
+ }),
72
+ " "
73
+ ]
74
+ }),
75
+ /* @__PURE__ */ jsx("span", {
76
+ className: style_default.TypeBrace,
77
+ children: "} "
78
+ })
79
+ ]
80
+ });
81
+ }
82
+ function Type({ type }) {
83
+ const Lang = useLanguageComponents();
84
+ const { SDKReference, Join } = useComponents();
85
+ switch (type.kind) {
86
+ case "RubyTypeBinary":
87
+ case "RubyTypeUnknown":
88
+ case "RubyTypeNull":
89
+ case "RubyTypeInteger":
90
+ case "RubyTypeFloat":
91
+ case "RubyTypeBoolean": return /* @__PURE__ */ jsx("span", {
92
+ className: style_default.Type,
93
+ children: /* @__PURE__ */ jsx("span", {
94
+ className: style_default.TypeKeyword,
95
+ children: Keywords[type.kind]
96
+ })
97
+ });
98
+ case "RubyTypeString": return /* @__PURE__ */ jsx("span", {
99
+ className: style_default.Type,
100
+ children: /* @__PURE__ */ jsx("span", {
101
+ className: style_default.TypeString,
102
+ children: "String"
103
+ })
104
+ });
105
+ case "RubyTypeLiteral":
106
+ switch (typeof type.literal) {
107
+ case "string": return /* @__PURE__ */ jsx("span", {
108
+ className: style_default.Type,
109
+ children: /* @__PURE__ */ jsxs("span", {
110
+ className: style_default.LiteralString,
111
+ children: [":", type.literal.match(VALID_IDENTIFIER) ? type.literal : JSON.stringify(type.literal)]
112
+ })
113
+ });
114
+ case "number": return /* @__PURE__ */ jsx("span", {
115
+ className: style_default.Type,
116
+ children: /* @__PURE__ */ jsx("span", {
117
+ className: style_default.LiteralNumeric,
118
+ children: JSON.stringify(type.literal)
119
+ })
120
+ });
121
+ case "boolean": return /* @__PURE__ */ jsx("span", {
122
+ className: style_default.Type,
123
+ children: /* @__PURE__ */ jsx("span", {
124
+ className: style_default.LiteralBoolean,
125
+ children: JSON.stringify(type.literal)
126
+ })
127
+ });
128
+ }
129
+ break;
130
+ case "RubyTypeArray": return /* @__PURE__ */ jsxs("span", {
131
+ className: style_default.Type,
132
+ children: [
133
+ /* @__PURE__ */ jsx("span", {
134
+ className: style_default.TypeArray,
135
+ children: "Array["
136
+ }),
137
+ /* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
138
+ /* @__PURE__ */ jsx("span", {
139
+ className: style_default.TypeArray,
140
+ children: "]"
141
+ })
142
+ ]
143
+ });
144
+ case "RubyTypeMap": return /* @__PURE__ */ jsxs("span", {
145
+ className: style_default.Type,
146
+ children: [
147
+ /* @__PURE__ */ jsx("span", {
148
+ className: style_default.TypeArray,
149
+ children: "Hash["
150
+ }),
151
+ type.indexType.kind === "RubyTypeString" ? /* @__PURE__ */ jsx("span", {
152
+ className: style_default.TypeString,
153
+ children: "Symbol"
154
+ }) : /* @__PURE__ */ jsx(Lang.Type, { type: type.indexType }),
155
+ ", ",
156
+ /* @__PURE__ */ jsx(Lang.Type, { type: type.itemType }),
157
+ /* @__PURE__ */ jsx("span", {
158
+ className: style_default.TypeArray,
159
+ children: "]"
160
+ })
161
+ ]
162
+ });
163
+ case "RubyTypeReference": {
164
+ const name = type.ident.split(".").at(-1);
165
+ if (!type.typeParameters || type.typeParameters.length === 0) return /* @__PURE__ */ jsxs("span", {
166
+ className: style_default.Type,
167
+ children: [/* @__PURE__ */ jsx(SDKReference, {
168
+ stainlessPath: type.$ref,
169
+ children: name
170
+ }), /* @__PURE__ */ jsx(TypePreview, { path: type.$ref })]
171
+ });
172
+ const typeParameters = type.typeParameters.map((t, i) => /* @__PURE__ */ jsx(Lang.Type, { type: t }, i));
173
+ return /* @__PURE__ */ jsxs("span", {
174
+ className: style_default.Type,
175
+ children: [
176
+ /* @__PURE__ */ jsx(SDKReference, {
177
+ stainlessPath: type.$ref,
178
+ children: name
179
+ }),
180
+ /* @__PURE__ */ jsx("span", {
181
+ className: style_default.TypeBracket,
182
+ children: "<"
183
+ }),
184
+ /* @__PURE__ */ jsx(Join, {
185
+ items: typeParameters,
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
+ /* @__PURE__ */ jsx(TypePreview, { path: type.$ref })
196
+ ]
197
+ });
198
+ }
199
+ case "RubyTypeIntersection":
200
+ case "RubyTypeUnion": {
201
+ const items = type.types.map((t, key) => /* @__PURE__ */ jsx(Lang.Type, { type: t }, key));
202
+ const delimiter = type.kind === "RubyTypeUnion" ? "|" : "&";
203
+ return /* @__PURE__ */ jsx("span", {
204
+ className: style_default.Type,
205
+ children: /* @__PURE__ */ jsx("span", {
206
+ className: style_default.TypePreview,
207
+ "data-stldocs-type-preview": "union",
208
+ children: /* @__PURE__ */ jsx("span", {
209
+ className: style_default.TypePreviewContent,
210
+ children: /* @__PURE__ */ jsx(Join, {
211
+ items,
212
+ limit: 3,
213
+ children: /* @__PURE__ */ jsxs("span", {
214
+ className: style_default.TextOperator,
215
+ children: [
216
+ " ",
217
+ delimiter,
218
+ " "
219
+ ]
220
+ })
221
+ })
222
+ })
223
+ })
224
+ });
225
+ }
226
+ case "RubyTypeBuiltinClass": return /* @__PURE__ */ jsx("span", {
227
+ className: style_default.TypeReference,
228
+ children: type.className
229
+ });
230
+ case "RubyTypeObject": {
231
+ const items = type.members.map((prop, key) => /* @__PURE__ */ jsx("span", {
232
+ className: style_default.TextIdentifier,
233
+ children: prop.ident
234
+ }, key));
235
+ return /* @__PURE__ */ jsx("span", {
236
+ className: style_default.Type,
237
+ children: /* @__PURE__ */ jsx("span", {
238
+ className: style_default.TypePreview,
239
+ "data-stldocs-type-preview": "properties",
240
+ children: /* @__PURE__ */ jsxs("span", {
241
+ className: style_default.TypePreviewContent,
242
+ children: [
243
+ /* @__PURE__ */ jsx("span", {
244
+ className: style_default.TypeBrace,
245
+ children: "{ "
246
+ }),
247
+ /* @__PURE__ */ jsx(Join, {
248
+ items,
249
+ limit: 3,
250
+ children: /* @__PURE__ */ jsx("span", {
251
+ className: style_default.TextOperator,
252
+ children: ", "
253
+ })
254
+ }),
255
+ /* @__PURE__ */ jsx("span", {
256
+ className: style_default.TypeBrace,
257
+ children: "}"
258
+ })
259
+ ]
260
+ })
261
+ })
262
+ });
263
+ }
264
+ }
265
+ }
266
+ function MethodSignature({ decl }) {
267
+ const Lang = useLanguageComponents();
268
+ const { Join } = useComponents();
269
+ const params = decl.args.map((param, i) => /* @__PURE__ */ jsx(React$1.Fragment, { children: /* @__PURE__ */ jsx("span", {
270
+ className: style_default.TextIdentifier,
271
+ children: param.ident
272
+ }) }, i));
273
+ return /* @__PURE__ */ jsx("div", {
274
+ className: style_default.MethodSignature,
275
+ children: /* @__PURE__ */ jsxs("span", {
276
+ className: style_default.SignatureTitle,
277
+ children: [
278
+ /* @__PURE__ */ jsx("span", {
279
+ className: style_default.SignatureQualified,
280
+ children: /* @__PURE__ */ jsx("span", {
281
+ className: style_default.TextIdentifier,
282
+ children: decl.qualified?.slice(0, -decl.ident.length)
283
+ })
284
+ }),
285
+ /* @__PURE__ */ jsx("span", {
286
+ className: style_default.SignatureName,
287
+ children: /* @__PURE__ */ jsx("span", {
288
+ className: style_default.TextIdentifier,
289
+ children: decl.ident
290
+ })
291
+ }),
292
+ /* @__PURE__ */ jsxs("span", {
293
+ className: style_default.MethodSignature,
294
+ children: [
295
+ /* @__PURE__ */ jsx("span", {
296
+ className: style_default.SignatureParen,
297
+ children: "("
298
+ }),
299
+ /* @__PURE__ */ jsx("span", {
300
+ className: style_default.SignatureParams,
301
+ children: /* @__PURE__ */ jsx(Join, {
302
+ items: params,
303
+ children: /* @__PURE__ */ jsx("span", {
304
+ className: style_default.TextOperator,
305
+ children: ", "
306
+ })
307
+ })
308
+ }),
309
+ /* @__PURE__ */ jsx("span", {
310
+ className: style_default.SignatureParen,
311
+ children: ")"
312
+ }),
313
+ " -> ",
314
+ decl.returns ? /* @__PURE__ */ jsx(Lang.Type, { type: decl.returns }) : "void"
315
+ ]
316
+ })
317
+ ]
318
+ })
319
+ });
320
+ }
321
+ function Property({ decl, children }) {
322
+ const Lang = useLanguageComponents();
323
+ switch (decl.kind) {
324
+ case "RubyDeclProperty": return children({
325
+ name: decl.ident,
326
+ typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
327
+ type: decl.type.kind in ComplexTypes && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
328
+ });
329
+ case "RubyDeclTypeAlias": return children({
330
+ name: decl.ident,
331
+ typeName: "alias",
332
+ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
333
+ });
334
+ case "RubyDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
335
+ case "RubyDeclClass": return children({
336
+ name: decl.ident,
337
+ typeName: "class"
338
+ });
339
+ }
340
+ }
341
+ function Declaration({ decl }) {
342
+ const Lang = useLanguageComponents();
343
+ if (!decl) return;
344
+ switch (decl.kind) {
345
+ case "RubyDeclProperty": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
346
+ /* @__PURE__ */ jsx("span", {
347
+ className: style_default.TypePropertyName,
348
+ children: /* @__PURE__ */ jsx("span", {
349
+ className: style_default.TextIdentifier,
350
+ children: decl.ident
351
+ })
352
+ }),
353
+ /* @__PURE__ */ jsx("span", {
354
+ className: style_default.TextPunctuation,
355
+ children: ": "
356
+ }),
357
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
358
+ ] });
359
+ case "RubyDeclTypeAlias": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
360
+ /* @__PURE__ */ jsx("span", {
361
+ className: style_default.TextIdentifier,
362
+ children: decl.ident
363
+ }),
364
+ /* @__PURE__ */ jsx("span", {
365
+ className: style_default.TextOperator,
366
+ children: " = "
367
+ }),
368
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
369
+ ] });
370
+ case "RubyDeclClass": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
371
+ /* @__PURE__ */ jsx("span", {
372
+ className: style_default.TextKeyword,
373
+ children: "class "
374
+ }),
375
+ /* @__PURE__ */ jsx("span", {
376
+ className: style_default.TextIdentifier,
377
+ children: decl.ident
378
+ }),
379
+ /* @__PURE__ */ jsx(TypePreview, { path: decl.stainlessPath })
380
+ ] });
381
+ case "RubyDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
382
+ }
383
+ }
384
+ //#endregion
385
+ export { Declaration, MethodSignature, Property, Type, TypeName, ruby_exports as t };
@@ -0,0 +1,2 @@
1
+ import { A as Type, C as DeclarationProps, D as Resource, E as PropertyProps, M as TypeProps, N as isResourceEntirelyUnsupported, O as ResourceProps, S as Declaration, T as Property, j as TypeName, k as TerraformSource, w as MethodSignature } from "../index-Dt9uPKZP.js";
2
+ export { Declaration, DeclarationProps, MethodSignature, Property, PropertyProps, Resource, ResourceProps, TerraformSource, Type, TypeName, TypeProps, isResourceEntirelyUnsupported };
@@ -0,0 +1,258 @@
1
+ import { t as __exportAll } from "../chunk-pbuEa-1d.js";
2
+ import { useDeclaration, useSpec } from "../contexts/docs.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 "react";
7
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
+ import clsx from "clsx";
9
+ import { Badge, Callout } from "@stainless-api/ui-primitives";
10
+ //#region src/languages/terraform.tsx
11
+ var terraform_exports = /* @__PURE__ */ __exportAll({
12
+ Declaration: () => Declaration,
13
+ MethodSignature: () => MethodSignature,
14
+ Property: () => Property,
15
+ Resource: () => Resource,
16
+ TerraformSource: () => TerraformSource,
17
+ Type: () => Type,
18
+ TypeName: () => TypeName,
19
+ isResourceEntirelyUnsupported: () => isResourceEntirelyUnsupported
20
+ });
21
+ function TypeName({ type }) {
22
+ return /* @__PURE__ */ jsx(useLanguageComponents().Type, { type });
23
+ }
24
+ function Type({ type }) {
25
+ const Lang = useLanguageComponents();
26
+ const { Join } = useComponents();
27
+ switch (type.category) {
28
+ case "nested": switch (type.type) {
29
+ case "ListNested":
30
+ case "MapNested":
31
+ case "SetNested": return /* @__PURE__ */ jsxs("span", {
32
+ className: style_default.Type,
33
+ children: [
34
+ /* @__PURE__ */ jsx("span", {
35
+ className: style_default.TypeArray,
36
+ children: type.type.replace("Nested", "")
37
+ }),
38
+ /* @__PURE__ */ jsx("span", {
39
+ className: style_default.TypeBracket,
40
+ children: "["
41
+ }),
42
+ /* @__PURE__ */ jsx("span", {
43
+ className: style_default.TypeReference,
44
+ children: "Attributes"
45
+ }),
46
+ /* @__PURE__ */ jsx("span", {
47
+ className: style_default.TypeBracket,
48
+ children: "]"
49
+ })
50
+ ]
51
+ });
52
+ case "SingleNested": return /* @__PURE__ */ jsx("span", {
53
+ className: style_default.Type,
54
+ children: /* @__PURE__ */ jsx("span", {
55
+ className: style_default.TypeReference,
56
+ children: "Attributes"
57
+ })
58
+ });
59
+ default: return;
60
+ }
61
+ case "collection": return /* @__PURE__ */ jsxs("span", {
62
+ className: style_default.Type,
63
+ children: [
64
+ /* @__PURE__ */ jsx("span", {
65
+ className: style_default.TypeArray,
66
+ children: type.type
67
+ }),
68
+ /* @__PURE__ */ jsx("span", {
69
+ className: style_default.TypeBracket,
70
+ children: "["
71
+ }),
72
+ /* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
73
+ /* @__PURE__ */ jsx("span", {
74
+ className: style_default.TypeBracket,
75
+ children: "]"
76
+ })
77
+ ]
78
+ });
79
+ case "dynamic": {
80
+ const subtypes = type.allowedSubtypes.length > 0 ? /* @__PURE__ */ jsx(Join, {
81
+ items: type.allowedSubtypes,
82
+ children: " | "
83
+ }) : null;
84
+ return /* @__PURE__ */ jsx("span", {
85
+ className: style_default.Type,
86
+ children: /* @__PURE__ */ jsxs("span", {
87
+ className: style_default.TypeKeyword,
88
+ children: ["Dynamic ", subtypes]
89
+ })
90
+ });
91
+ }
92
+ case "primitive":
93
+ if (type.type === "String") return /* @__PURE__ */ jsx("span", {
94
+ className: style_default.Type,
95
+ children: /* @__PURE__ */ jsx("span", {
96
+ className: style_default.TypeString,
97
+ children: "String"
98
+ })
99
+ });
100
+ return /* @__PURE__ */ jsx("span", {
101
+ className: style_default.Type,
102
+ children: /* @__PURE__ */ jsx("span", {
103
+ className: style_default.TypeKeyword,
104
+ children: type.type
105
+ })
106
+ });
107
+ case "unknown": return /* @__PURE__ */ jsx("span", {
108
+ className: style_default.Type,
109
+ children: /* @__PURE__ */ jsx("span", {
110
+ className: style_default.TypeKeyword,
111
+ children: "JSON"
112
+ })
113
+ });
114
+ }
115
+ }
116
+ function MethodSignature() {
117
+ return null;
118
+ }
119
+ const PropGroups = [
120
+ "required",
121
+ "optional",
122
+ "computed"
123
+ ];
124
+ function Property({ decl, children }) {
125
+ if (!decl) return null;
126
+ switch (decl.kind) {
127
+ case "TerraformDeclAttribute": return children({ name: decl.name });
128
+ }
129
+ }
130
+ function TerraformSource({ path, group }) {
131
+ const Docs = useComponents();
132
+ const decl = useDeclaration(path, true);
133
+ if (decl.kind !== "TerraformDeclSource") return;
134
+ const type = decl.type === "resource" ? "resource" : "data";
135
+ const badge = type === "resource" ? `success` : `note`;
136
+ const children = PropGroups.filter((section) => decl[section].length > 0).map((section) => {
137
+ const propGroupId = `${decl.name}-${section}-${group}`;
138
+ return /* @__PURE__ */ jsxs("div", {
139
+ className: style_default.ResourceContentGroup,
140
+ children: [/* @__PURE__ */ jsxs("h5", {
141
+ className: style_default.ResourceContentGroupModelTitle,
142
+ children: [
143
+ section,
144
+ " ",
145
+ /* @__PURE__ */ jsx(Docs.PropertyToggle, { target: propGroupId })
146
+ ]
147
+ }), /* @__PURE__ */ jsx("div", {
148
+ className: style_default.ResourceContentProperties,
149
+ "data-stldocs-property-group": propGroupId,
150
+ children: /* @__PURE__ */ jsx(Docs.SDKChildren, { paths: decl[section] })
151
+ })]
152
+ }, section);
153
+ });
154
+ return /* @__PURE__ */ jsx("div", {
155
+ className: clsx(style_default.Method, style_default.MethodDoublePane),
156
+ children: /* @__PURE__ */ jsxs("div", {
157
+ className: style_default.MethodBody,
158
+ children: [/* @__PURE__ */ jsxs("div", {
159
+ className: style_default.MethodContentColumn,
160
+ children: [/* @__PURE__ */ jsxs("h4", {
161
+ className: style_default.TerraformResourceTitle,
162
+ children: [
163
+ /* @__PURE__ */ jsx(Badge, {
164
+ intent: badge,
165
+ children: type
166
+ }),
167
+ " ",
168
+ decl.name
169
+ ]
170
+ }), children]
171
+ }), /* @__PURE__ */ jsx("div", {
172
+ className: clsx(style_default.MethodExample, "not-content", "stl-ui-not-prose"),
173
+ children: /* @__PURE__ */ jsx(Docs.SDKExample, { method: {
174
+ title: decl.name,
175
+ stainlessPath: path
176
+ } })
177
+ })]
178
+ })
179
+ });
180
+ }
181
+ function Declaration({ decl }) {
182
+ const Lang = useLanguageComponents();
183
+ if (!decl) return;
184
+ switch (decl.kind) {
185
+ case "TerraformDeclAttribute": {
186
+ const isOptional = decl.configurability === "optional" || decl.configurability === "computed_optional";
187
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
188
+ /* @__PURE__ */ jsx("span", {
189
+ className: style_default.TextIdentifier,
190
+ children: decl.name
191
+ }),
192
+ isOptional && /* @__PURE__ */ jsx("span", {
193
+ className: style_default.TextPunctuation,
194
+ children: "?"
195
+ }),
196
+ /* @__PURE__ */ jsx("span", {
197
+ className: style_default.TextPunctuation,
198
+ children: ": "
199
+ }),
200
+ /* @__PURE__ */ jsx("span", {
201
+ className: style_default.TextKeyword,
202
+ children: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
203
+ })
204
+ ] });
205
+ }
206
+ case "TerraformDeclServiceNode": {
207
+ const { resource, dataSource, listDataSource } = decl;
208
+ return /* @__PURE__ */ jsxs("div", {
209
+ className: style_default.Method,
210
+ children: [
211
+ resource && /* @__PURE__ */ jsx(TerraformSource, {
212
+ path: resource,
213
+ group: "resource"
214
+ }),
215
+ dataSource && /* @__PURE__ */ jsx(TerraformSource, {
216
+ path: dataSource,
217
+ group: "dataSource"
218
+ }),
219
+ listDataSource && /* @__PURE__ */ jsx(TerraformSource, {
220
+ path: listDataSource,
221
+ group: "listDataSource"
222
+ })
223
+ ]
224
+ });
225
+ }
226
+ }
227
+ }
228
+ function isResourceEntirelyUnsupported(resource, decls) {
229
+ if (decls?.[resource.stainlessPath]) return false;
230
+ return Object.values(resource.subresources ?? {}).every((child) => isResourceEntirelyUnsupported(child, decls));
231
+ }
232
+ function Resource({ resource, parents }) {
233
+ const Docs = useComponents();
234
+ const Lang = useLanguageComponents();
235
+ const decl = useDeclaration(resource.stainlessPath, false);
236
+ const spec = useSpec();
237
+ if (decl) return /* @__PURE__ */ jsx("div", {
238
+ className: style_default.Resource,
239
+ "data-stl-resource-language": "terraform",
240
+ children: /* @__PURE__ */ jsxs("div", {
241
+ className: style_default.ResourceContent,
242
+ children: [/* @__PURE__ */ jsx(Docs.SDKResourceHeader, {
243
+ resource,
244
+ parents
245
+ }), /* @__PURE__ */ jsx(Lang.Declaration, { decl })]
246
+ })
247
+ });
248
+ if (!parents && isResourceEntirelyUnsupported(resource, spec?.decls.terraform)) return /* @__PURE__ */ jsxs(Callout, {
249
+ variant: "warning",
250
+ children: [
251
+ "The resource ",
252
+ /* @__PURE__ */ jsx("code", { children: resource.name }),
253
+ " is not supported in Terraform."
254
+ ]
255
+ });
256
+ }
257
+ //#endregion
258
+ export { Declaration, MethodSignature, Property, Resource, TerraformSource, Type, TypeName, isResourceEntirelyUnsupported, terraform_exports as t };
@@ -0,0 +1,2 @@
1
+ import { an as Property, cn as TypeName, in as MethodSignatureProps, nn as DeclarationProps, on as PropertyProps, rn as MethodSignature, sn as Type, tn as Declaration } from "../index-Dt9uPKZP.js";
2
+ export { Declaration, DeclarationProps, MethodSignature, MethodSignatureProps, Property, PropertyProps, Type, TypeName };