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

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