@stainless-api/docs-ui 0.1.0-beta.5 → 0.1.0-beta.51

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 (212) hide show
  1. package/dist/breadcrumbs-BdYnaHA8.d.ts +20 -0
  2. package/dist/breadcrumbs-CA7GmW_8.d.ts +20 -0
  3. package/dist/breadcrumbs-nSFZO5Gf.js +63 -0
  4. package/dist/chunk-DRcLgZ1e.js +18 -0
  5. package/dist/component-DRO8kQSp.js +23 -0
  6. package/dist/component-generics-B6Fn47Mz.js +45 -0
  7. package/dist/component-generics-BHFUK06s.d.ts +30 -0
  8. package/dist/component-generics-BJSyydZ-.d.ts +30 -0
  9. package/dist/components/MaskedInput.d.ts +14 -0
  10. package/dist/components/MaskedInput.js +76 -0
  11. package/dist/components/breadcrumbs.d.ts +2 -0
  12. package/dist/components/breadcrumbs.js +9 -0
  13. package/dist/components/icons.d.ts +55 -0
  14. package/dist/components/icons.js +3 -0
  15. package/dist/components/index.d.ts +10 -0
  16. package/dist/components/index.js +18 -0
  17. package/dist/components/method.d.ts +2 -0
  18. package/dist/components/method.js +10 -0
  19. package/dist/components/overview.d.ts +2 -0
  20. package/dist/components/overview.js +11 -0
  21. package/dist/components/primitives.d.ts +2 -0
  22. package/dist/components/primitives.js +8 -0
  23. package/dist/components/properties.d.ts +2 -0
  24. package/dist/components/properties.js +9 -0
  25. package/dist/components/sdk.d.ts +2 -0
  26. package/dist/components/sdk.js +10 -0
  27. package/dist/components/sidebar.d.ts +2 -0
  28. package/dist/components/sidebar.js +11 -0
  29. package/dist/components/snippets.d.ts +3 -0
  30. package/dist/components/snippets.js +9 -0
  31. package/dist/components-D7M-BwNI.js +71 -0
  32. package/dist/contexts/component-generics.d.ts +2 -0
  33. package/dist/contexts/component-generics.js +3 -0
  34. package/dist/contexts/component-types.d.ts +16 -0
  35. package/dist/contexts/component-types.js +0 -0
  36. package/dist/contexts/component.d.ts +29 -0
  37. package/dist/contexts/component.js +27 -0
  38. package/dist/contexts/docs.d.ts +2 -0
  39. package/dist/contexts/docs.js +3 -0
  40. package/dist/contexts/index.d.ts +16 -0
  41. package/dist/contexts/index.js +7 -0
  42. package/dist/contexts/markdown.d.ts +2 -0
  43. package/dist/contexts/markdown.js +4 -0
  44. package/dist/contexts/navigation.d.ts +2 -0
  45. package/dist/contexts/navigation.js +3 -0
  46. package/dist/contexts/use-components.d.ts +14 -0
  47. package/dist/contexts/use-components.js +4 -0
  48. package/dist/contexts-p3rRZDlM.js +39 -0
  49. package/dist/csharp-CDSxfCZE.js +283 -0
  50. package/dist/docs-BUS__I1m.d.ts +47 -0
  51. package/dist/docs-CXqi26jB.js +54 -0
  52. package/dist/docs-fKyo35eI.d.ts +47 -0
  53. package/dist/go-1c3S5ETL.js +303 -0
  54. package/dist/http-2QNWXH9t.js +330 -0
  55. package/dist/icons-Ckod9aod.js +869 -0
  56. package/dist/index-5Yl-BBg3.d.ts +15 -0
  57. package/dist/index-9LRO8R1a.d.ts +274 -0
  58. package/dist/index-CBIJwoyp.d.ts +13 -0
  59. package/dist/index-ClCZKGcw.d.ts +274 -0
  60. package/dist/index-pMKpm2Jk.d.ts +13 -0
  61. package/dist/index-q3bZhNWj.d.ts +15 -0
  62. package/dist/index.d.ts +19 -0
  63. package/dist/index.js +29 -7542
  64. package/dist/java-BbjF_oUI.js +403 -0
  65. package/dist/languages/csharp.d.ts +11 -0
  66. package/dist/languages/csharp.js +9 -0
  67. package/dist/languages/go.d.ts +11 -0
  68. package/dist/languages/go.js +9 -0
  69. package/dist/languages/http.d.ts +11 -0
  70. package/dist/languages/http.js +19 -0
  71. package/dist/languages/index.d.ts +11 -0
  72. package/dist/languages/index.js +26 -0
  73. package/dist/languages/java.d.ts +11 -0
  74. package/dist/languages/java.js +9 -0
  75. package/dist/languages/python.d.ts +11 -0
  76. package/dist/languages/python.js +9 -0
  77. package/dist/languages/ruby.d.ts +11 -0
  78. package/dist/languages/ruby.js +9 -0
  79. package/dist/languages/typescript.d.ts +11 -0
  80. package/dist/languages/typescript.js +9 -0
  81. package/dist/languages-BCYZjzuS.js +26 -0
  82. package/dist/markdown/index.d.ts +12 -0
  83. package/dist/markdown/index.js +104 -0
  84. package/dist/markdown/md.d.ts +15 -0
  85. package/dist/markdown/md.js +3 -0
  86. package/dist/markdown/printer.d.ts +2 -0
  87. package/dist/markdown/printer.js +28 -0
  88. package/dist/markdown/utils.d.ts +3 -0
  89. package/dist/markdown/utils.js +3 -0
  90. package/dist/markdown-C8o8WrwG.d.ts +22 -0
  91. package/dist/markdown-CqJohZei.d.ts +22 -0
  92. package/dist/markdown-CxdeWgjV.js +48 -0
  93. package/dist/md-oM2tUaCA.js +41 -0
  94. package/dist/method-CE08mUME.js +115 -0
  95. package/dist/method-CMt6uyix.d.ts +71 -0
  96. package/dist/method-r5UAB40b.d.ts +71 -0
  97. package/dist/navigation-9_4wRkcT.d.ts +29 -0
  98. package/dist/navigation-C5TN0SgC.js +24 -0
  99. package/dist/navigation-zuoWsXzh.d.ts +29 -0
  100. package/dist/overview-DXmLmmr7.d.ts +39 -0
  101. package/dist/overview-S2hUqPXA.js +139 -0
  102. package/dist/overview-ixhAhHj8.d.ts +39 -0
  103. package/dist/primitives-BIWfwN5L.js +258 -0
  104. package/dist/primitives-BVXfSSiS.d.ts +97 -0
  105. package/dist/primitives-Bl0wzAGo.d.ts +97 -0
  106. package/dist/printer-DBw4S_Jn.d.ts +13 -0
  107. package/dist/printer-bNxiG6UB.js +74 -0
  108. package/dist/properties-C-NU_ghj.d.ts +54 -0
  109. package/dist/properties-GT9ixNTg.d.ts +54 -0
  110. package/dist/properties-jlGW3USi.js +131 -0
  111. package/dist/python-USOwFDv_.js +279 -0
  112. package/dist/routing-CMqh1cTZ.d.ts +54 -0
  113. package/dist/routing-Wbb7YECB.js +194 -0
  114. package/dist/routing.d.ts +2 -0
  115. package/dist/routing.js +3 -180
  116. package/dist/ruby-CSvGbSLe.js +387 -0
  117. package/dist/sdk-B5W3VipN.d.ts +118 -0
  118. package/dist/sdk-CS6A3HW3.d.ts +118 -0
  119. package/dist/sdk-CSCbbn3O.js +336 -0
  120. package/dist/sidebar-C3fZrgmP.d.ts +36 -0
  121. package/dist/sidebar-CWyvCrJ0.js +81 -0
  122. package/dist/sidebar-CbCLUteD.d.ts +36 -0
  123. package/dist/snippets-BQLXEIf6.js +161 -0
  124. package/dist/snippets-C72s2IwS.d.ts +51 -0
  125. package/dist/snippets-DcFph7ir.d.ts +51 -0
  126. package/dist/spec.d.ts +65 -0
  127. package/dist/spec.js +167 -0
  128. package/dist/style-D7RO5ymE.d.ts +168 -0
  129. package/dist/style-gnVEeXFj.js +169 -0
  130. package/dist/style.d.ts +2 -0
  131. package/dist/style.js +3 -0
  132. package/dist/styles/main.css +727 -754
  133. package/dist/styles/main.js +0 -0
  134. package/dist/styles/primitives.css +317 -461
  135. package/dist/styles/primitives.js +0 -0
  136. package/dist/styles/resets.css +32 -41
  137. package/dist/styles/resets.js +0 -0
  138. package/dist/styles/search.css +175 -274
  139. package/dist/styles/search.js +0 -0
  140. package/dist/styles/sidebar.css +59 -60
  141. package/dist/styles/sidebar.js +0 -0
  142. package/dist/styles/variables.css +26 -89
  143. package/dist/styles/variables.js +0 -0
  144. package/dist/styles.css +2910 -0
  145. package/dist/styles.mjs +1 -0
  146. package/dist/typescript-DXG9psK3.js +449 -0
  147. package/dist/use-components-RWQbviGq.js +7 -0
  148. package/dist/utils-CqnL9Fc3.js +31 -0
  149. package/dist/utils-DGnJ6mcU.d.ts +21 -0
  150. package/dist/utils-D_1AWSRX.js +32 -0
  151. package/dist/utils-d8paVwKN.d.ts +14 -0
  152. package/dist/utils-uQbtk0-_.d.ts +21 -0
  153. package/dist/utils.d.ts +2 -0
  154. package/dist/utils.js +3 -0
  155. package/package.json +73 -21
  156. package/dist/mcp.js +0 -16003
  157. package/dist/styles/snippets.css +0 -132
  158. package/src/components/breadcrumbs.tsx +0 -94
  159. package/src/components/chat.tsx +0 -154
  160. package/src/components/dropdown.tsx +0 -91
  161. package/src/components/icons.tsx +0 -584
  162. package/src/components/index.ts +0 -9
  163. package/src/components/method.tsx +0 -144
  164. package/src/components/overview.tsx +0 -159
  165. package/src/components/primitives.tsx +0 -284
  166. package/src/components/properties.tsx +0 -130
  167. package/src/components/scripts/dropdown.ts +0 -78
  168. package/src/components/sdk.tsx +0 -402
  169. package/src/components/sidebar.tsx +0 -99
  170. package/src/components/snippets.tsx +0 -179
  171. package/src/contexts/component-generics.tsx +0 -48
  172. package/src/contexts/component-types.tsx +0 -5
  173. package/src/contexts/component.tsx +0 -32
  174. package/src/contexts/docs.tsx +0 -75
  175. package/src/contexts/index.tsx +0 -17
  176. package/src/contexts/markdown.tsx +0 -43
  177. package/src/contexts/navigation.tsx +0 -44
  178. package/src/contexts/search.tsx +0 -28
  179. package/src/contexts/use-components.tsx +0 -4
  180. package/src/index.ts +0 -6
  181. package/src/languages/go.tsx +0 -281
  182. package/src/languages/http.tsx +0 -321
  183. package/src/languages/index.ts +0 -26
  184. package/src/languages/java.tsx +0 -358
  185. package/src/languages/python.tsx +0 -255
  186. package/src/languages/ruby.tsx +0 -320
  187. package/src/languages/typescript.tsx +0 -393
  188. package/src/markdown/index.ts +0 -107
  189. package/src/markdown/md.ts +0 -45
  190. package/src/markdown/utils.ts +0 -49
  191. package/src/routing.ts +0 -238
  192. package/src/search/form.tsx +0 -127
  193. package/src/search/index.tsx +0 -1
  194. package/src/search/indexer.ts +0 -246
  195. package/src/search/mcp.ts +0 -61
  196. package/src/search/printer.tsx +0 -86
  197. package/src/search/providers/algolia.ts +0 -88
  198. package/src/search/providers/fuse.ts +0 -19
  199. package/src/search/providers/pagefind.ts +0 -17
  200. package/src/search/providers/walker.ts +0 -30
  201. package/src/search/results.tsx +0 -181
  202. package/src/search/state.ts +0 -64
  203. package/src/search/types.ts +0 -116
  204. package/src/style.ts +0 -197
  205. package/src/styles/main.css +0 -993
  206. package/src/styles/primitives.css +0 -573
  207. package/src/styles/resets.css +0 -47
  208. package/src/styles/search.css +0 -342
  209. package/src/styles/sidebar.css +0 -87
  210. package/src/styles/snippets.css +0 -132
  211. package/src/styles/variables.css +0 -90
  212. package/src/utils.ts +0 -41
@@ -0,0 +1,74 @@
1
+ import { t as __export } from "./chunk-DRcLgZ1e.js";
2
+ import { t as DocsProvider } from "./docs-CXqi26jB.js";
3
+ import { n as useLanguageComponents } from "./contexts-p3rRZDlM.js";
4
+ import { t as style_default } from "./style-gnVEeXFj.js";
5
+ import { t as ComponentProvider } from "./component-DRO8kQSp.js";
6
+ import "react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ import { renderToStaticMarkup } from "react-dom/server";
9
+
10
+ //#region src/markdown/printer.tsx
11
+ var printer_exports = /* @__PURE__ */ __export({
12
+ declaration: () => declaration,
13
+ methodSignature: () => methodSignature,
14
+ type: () => type,
15
+ typeName: () => typeName
16
+ });
17
+ function Providers({ language, children }) {
18
+ return /* @__PURE__ */ jsx(DocsProvider, {
19
+ spec: null,
20
+ language,
21
+ children: /* @__PURE__ */ jsx(ComponentProvider, {
22
+ components: { SDKReference({ stainlessPath, children: children$1 }) {
23
+ if (!stainlessPath) return children$1;
24
+ return /* @__PURE__ */ jsx("span", {
25
+ className: style_default.TypeReference,
26
+ children: children$1
27
+ });
28
+ } },
29
+ children
30
+ })
31
+ });
32
+ }
33
+ function RenderType({ type: type$1, full }) {
34
+ const { Type, TypeName } = useLanguageComponents();
35
+ return full ? /* @__PURE__ */ jsx(Type, { type: type$1 }) : /* @__PURE__ */ jsx(TypeName, { type: type$1 });
36
+ }
37
+ function typeName(language, type$1) {
38
+ return renderToStaticMarkup(/* @__PURE__ */ jsx(Providers, {
39
+ language,
40
+ children: /* @__PURE__ */ jsx(RenderType, { type: type$1 })
41
+ }));
42
+ }
43
+ function type(language, type$1) {
44
+ return renderToStaticMarkup(/* @__PURE__ */ jsx(Providers, {
45
+ language,
46
+ children: /* @__PURE__ */ jsx(RenderType, {
47
+ type: type$1,
48
+ full: true
49
+ })
50
+ }));
51
+ }
52
+ function RenderDeclaration({ decl }) {
53
+ const { Declaration } = useLanguageComponents();
54
+ return /* @__PURE__ */ jsx(Declaration, { decl });
55
+ }
56
+ function declaration(language, decl) {
57
+ return renderToStaticMarkup(/* @__PURE__ */ jsx(Providers, {
58
+ language,
59
+ children: /* @__PURE__ */ jsx(RenderDeclaration, { decl })
60
+ }));
61
+ }
62
+ function RenderMethod({ method }) {
63
+ const { MethodSignature } = useLanguageComponents();
64
+ return /* @__PURE__ */ jsx(MethodSignature, { decl: method });
65
+ }
66
+ function methodSignature(language, decl) {
67
+ return renderToStaticMarkup(/* @__PURE__ */ jsx(Providers, {
68
+ language,
69
+ children: /* @__PURE__ */ jsx(RenderMethod, { method: decl })
70
+ }));
71
+ }
72
+
73
+ //#endregion
74
+ export { typeName as a, type as i, methodSignature as n, printer_exports as r, declaration as t };
@@ -0,0 +1,54 @@
1
+ import { ReactNode } from "react";
2
+ import * as react_jsx_runtime62 from "react/jsx-runtime";
3
+
4
+ //#region src/components/properties.d.ts
5
+ type PropertyToggleProps = {
6
+ target: string;
7
+ };
8
+ declare function PropertyToggle({
9
+ target
10
+ }: PropertyToggleProps): react_jsx_runtime62.JSX.Element;
11
+ type PropertyDescriptionProps = {
12
+ description?: string;
13
+ };
14
+ declare function PropertyDescription({
15
+ description
16
+ }: PropertyDescriptionProps): react_jsx_runtime62.JSX.Element | undefined;
17
+ type PropertyTitleProps = {
18
+ title?: string;
19
+ };
20
+ declare function PropertyTitle({
21
+ title
22
+ }: PropertyTitleProps): react_jsx_runtime62.JSX.Element | undefined;
23
+ type PropertyProps = {
24
+ id?: string;
25
+ name?: ReactNode;
26
+ typeName?: ReactNode;
27
+ badges?: ReactNode;
28
+ type?: ReactNode;
29
+ description?: string;
30
+ title?: string;
31
+ expand?: boolean;
32
+ deprecated?: boolean | string;
33
+ additional?: ReactNode;
34
+ declaration?: ReactNode;
35
+ constraints?: ReactNode;
36
+ children?: ReactNode;
37
+ };
38
+ declare function Property({
39
+ id,
40
+ name,
41
+ typeName,
42
+ badges,
43
+ type,
44
+ declaration,
45
+ description,
46
+ title,
47
+ deprecated,
48
+ expand,
49
+ additional,
50
+ constraints,
51
+ children
52
+ }: PropertyProps): react_jsx_runtime62.JSX.Element;
53
+ //#endregion
54
+ export { PropertyTitle as a, PropertyToggleProps as c, PropertyProps as i, PropertyDescription as n, PropertyTitleProps as o, PropertyDescriptionProps as r, PropertyToggle as s, Property as t };
@@ -0,0 +1,54 @@
1
+ import { ReactNode } from "react";
2
+ import * as react_jsx_runtime85 from "react/jsx-runtime";
3
+
4
+ //#region src/components/properties.d.ts
5
+ type PropertyToggleProps = {
6
+ target: string;
7
+ };
8
+ declare function PropertyToggle({
9
+ target
10
+ }: PropertyToggleProps): react_jsx_runtime85.JSX.Element;
11
+ type PropertyDescriptionProps = {
12
+ description?: string;
13
+ };
14
+ declare function PropertyDescription({
15
+ description
16
+ }: PropertyDescriptionProps): react_jsx_runtime85.JSX.Element | undefined;
17
+ type PropertyTitleProps = {
18
+ title?: string;
19
+ };
20
+ declare function PropertyTitle({
21
+ title
22
+ }: PropertyTitleProps): react_jsx_runtime85.JSX.Element | undefined;
23
+ type PropertyProps = {
24
+ id?: string;
25
+ name?: ReactNode;
26
+ typeName?: ReactNode;
27
+ badges?: ReactNode;
28
+ type?: ReactNode;
29
+ description?: string;
30
+ title?: string;
31
+ expand?: boolean;
32
+ deprecated?: boolean | string;
33
+ additional?: ReactNode;
34
+ declaration?: ReactNode;
35
+ constraints?: ReactNode;
36
+ children?: ReactNode;
37
+ };
38
+ declare function Property({
39
+ id,
40
+ name,
41
+ typeName,
42
+ badges,
43
+ type,
44
+ declaration,
45
+ description,
46
+ title,
47
+ deprecated,
48
+ expand,
49
+ additional,
50
+ constraints,
51
+ children
52
+ }: PropertyProps): react_jsx_runtime85.JSX.Element;
53
+ //#endregion
54
+ export { PropertyTitle as a, PropertyToggleProps as c, PropertyProps as i, PropertyDescription as n, PropertyTitleProps as o, PropertyDescriptionProps as r, PropertyToggle as s, Property as t };
@@ -0,0 +1,131 @@
1
+ import { a as useLanguage, s as useSettings } from "./docs-CXqi26jB.js";
2
+ import { t as useComponents } from "./use-components-RWQbviGq.js";
3
+ import { t as style_default } from "./style-gnVEeXFj.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { ArrowDownWideNarrowIcon, ArrowUpNarrowWideIcon } from "lucide-react";
6
+
7
+ //#region src/components/properties.tsx
8
+ function PropertyToggle({ target }) {
9
+ return /* @__PURE__ */ jsxs("span", {
10
+ className: style_default.ExpandToggle,
11
+ "data-stldocs-property-toggle-expanded": "false",
12
+ "data-stldocs-property-toggle-target": target,
13
+ children: [/* @__PURE__ */ jsxs("span", {
14
+ className: style_default.ExpandToggleContent,
15
+ children: ["Expand ", /* @__PURE__ */ jsx(ArrowDownWideNarrowIcon, {
16
+ className: style_default.Icon,
17
+ size: 16
18
+ })]
19
+ }), /* @__PURE__ */ jsxs("span", {
20
+ className: style_default.ExpandToggleContent,
21
+ children: ["Collapse ", /* @__PURE__ */ jsx(ArrowUpNarrowWideIcon, {
22
+ className: style_default.Icon,
23
+ size: 16
24
+ })]
25
+ })]
26
+ });
27
+ }
28
+ function PropertyDescription({ description }) {
29
+ const { Markdown } = useComponents();
30
+ if (description) return /* @__PURE__ */ jsx("div", {
31
+ className: style_default.PropertyDescription,
32
+ children: /* @__PURE__ */ jsx(Markdown, { content: description })
33
+ });
34
+ }
35
+ function PropertyTitle({ title }) {
36
+ const { Markdown } = useComponents();
37
+ if (title) return /* @__PURE__ */ jsx("div", {
38
+ className: style_default.PropertyTitle,
39
+ children: /* @__PURE__ */ jsx(Markdown, { content: title })
40
+ });
41
+ }
42
+ function Property({ id, name, typeName, badges, type, declaration, description, title, deprecated, expand, additional, constraints, children }) {
43
+ const Docs = useComponents();
44
+ const language = useLanguage();
45
+ const properties = useSettings()?.properties;
46
+ const { collapseDescription, showTitle } = properties ?? {};
47
+ const types = properties?.types;
48
+ const textContent = /* @__PURE__ */ jsxs(Fragment, { children: [
49
+ typeof deprecated === "string" && /* @__PURE__ */ jsx("div", {
50
+ className: style_default.PropertyDeprecatedMessage,
51
+ children: deprecated
52
+ }),
53
+ description && /* @__PURE__ */ jsx(Docs.PropertyDescription, { description }),
54
+ constraints && /* @__PURE__ */ jsx("div", {
55
+ className: style_default.PropertyContent,
56
+ children: constraints
57
+ })
58
+ ] });
59
+ const rich = /* @__PURE__ */ jsxs(Fragment, { children: [
60
+ /* @__PURE__ */ jsxs("div", {
61
+ className: style_default.PropertyDeclaration,
62
+ children: [
63
+ deprecated && /* @__PURE__ */ jsx("span", {
64
+ className: style_default.PropertyDeprecated,
65
+ children: "Deprecated"
66
+ }),
67
+ declaration,
68
+ badges && /* @__PURE__ */ jsx("span", {
69
+ className: style_default.PropertyBadges,
70
+ children: badges
71
+ })
72
+ ]
73
+ }),
74
+ title && showTitle && /* @__PURE__ */ jsx(Docs.PropertyTitle, { title }),
75
+ collapseDescription === false ? textContent : null
76
+ ] });
77
+ const simple = /* @__PURE__ */ jsxs(Fragment, { children: [
78
+ name && /* @__PURE__ */ jsxs("div", {
79
+ className: style_default.PropertyHeader,
80
+ children: [
81
+ deprecated && /* @__PURE__ */ jsx("span", {
82
+ className: style_default.PropertyDeprecated,
83
+ children: "Deprecated"
84
+ }),
85
+ name && /* @__PURE__ */ jsx("span", {
86
+ className: style_default.PropertyName,
87
+ children: name
88
+ }),
89
+ typeName && /* @__PURE__ */ jsx("span", {
90
+ className: style_default.PropertyTypeName,
91
+ children: typeName
92
+ }),
93
+ badges && /* @__PURE__ */ jsx("span", {
94
+ className: style_default.PropertyBadges,
95
+ children: badges
96
+ })
97
+ ]
98
+ }),
99
+ type && /* @__PURE__ */ jsx("div", {
100
+ className: style_default.PropertyType,
101
+ children: type
102
+ }),
103
+ title && showTitle && /* @__PURE__ */ jsx(Docs.PropertyTitle, { title }),
104
+ collapseDescription === false ? textContent : null
105
+ ] });
106
+ const content = /* @__PURE__ */ jsx("div", {
107
+ id,
108
+ className: style_default.PropertyInfo,
109
+ children: types === "simple" ? simple : rich
110
+ });
111
+ return /* @__PURE__ */ jsx("div", {
112
+ className: style_default.Property,
113
+ "data-stldocs-language": language,
114
+ children: children || collapseDescription !== false && description ? /* @__PURE__ */ jsxs(Docs.Expander, {
115
+ summary: content,
116
+ muted: !children,
117
+ open: expand,
118
+ children: [
119
+ collapseDescription !== false ? textContent : null,
120
+ additional,
121
+ children && /* @__PURE__ */ jsx("div", {
122
+ className: style_default.PropertyChildren,
123
+ children
124
+ })
125
+ ]
126
+ }) : content
127
+ });
128
+ }
129
+
130
+ //#endregion
131
+ export { PropertyToggle as i, PropertyDescription as n, PropertyTitle as r, Property as t };
@@ -0,0 +1,279 @@
1
+ import { t as __export } from "./chunk-DRcLgZ1e.js";
2
+ import { n as useLanguageComponents } from "./contexts-p3rRZDlM.js";
3
+ import { t as useComponents } from "./use-components-RWQbviGq.js";
4
+ import { t as style_default } from "./style-gnVEeXFj.js";
5
+ import * as React$1 from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
+
8
+ //#region src/languages/python.tsx
9
+ var python_exports = /* @__PURE__ */ __export({
10
+ Declaration: () => Declaration,
11
+ MethodSignature: () => MethodSignature,
12
+ Property: () => Property,
13
+ Type: () => Type,
14
+ TypeName: () => TypeName
15
+ });
16
+ const constStyle = {
17
+ string: style_default.LiteralString,
18
+ number: style_default.LiteralNumeric,
19
+ boolean: style_default.LiteralBoolean
20
+ };
21
+ function showFullType(type) {
22
+ if (type.kind !== "PythonTypeReference") return false;
23
+ return type.typeName === "Optional" ? showFullType(type.typeParameters[0]) : type.typeParameters.length > 0;
24
+ }
25
+ function TypeName({ type }) {
26
+ const Lang = useLanguageComponents();
27
+ if (type.kind === "PythonTypeReference") switch (type.typeName) {
28
+ case "Optional": return /* @__PURE__ */ jsx(Lang.TypeName, { type: type.typeParameters[0] });
29
+ case "List":
30
+ case "Iterable":
31
+ case "Literal":
32
+ case "Union": return type.typeName.toLowerCase();
33
+ }
34
+ return /* @__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 "PythonTypeAny":
41
+ case "PythonTypeUnknown":
42
+ case "PythonTypeInt":
43
+ case "PythonTypeFloat":
44
+ case "PythonTypeBool": return /* @__PURE__ */ jsx("span", {
45
+ className: style_default.Type,
46
+ children: /* @__PURE__ */ jsx("span", {
47
+ className: style_default.TypeKeyword,
48
+ children: type.kind.slice(10).toLowerCase()
49
+ })
50
+ });
51
+ case "PythonTypeString": return /* @__PURE__ */ jsx("span", {
52
+ className: style_default.Type,
53
+ children: /* @__PURE__ */ jsx("span", {
54
+ className: style_default.TypeString,
55
+ children: "str"
56
+ })
57
+ });
58
+ case "PythonTypeLiteral": return /* @__PURE__ */ jsx("span", {
59
+ className: style_default.Type,
60
+ children: /* @__PURE__ */ jsx("span", {
61
+ className: constStyle[typeof type.literal.value],
62
+ children: JSON.stringify(type.literal.value)
63
+ })
64
+ });
65
+ case "PythonTypeArray": return /* @__PURE__ */ jsxs("span", {
66
+ className: style_default.Type,
67
+ children: [
68
+ /* @__PURE__ */ jsx("span", {
69
+ className: style_default.TypeArray,
70
+ children: "Array<"
71
+ }),
72
+ /* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
73
+ /* @__PURE__ */ jsx("span", {
74
+ className: style_default.TypeArray,
75
+ children: ">"
76
+ })
77
+ ]
78
+ });
79
+ case "PythonTypeClass": return /* @__PURE__ */ jsx("span", {
80
+ className: style_default.Type,
81
+ children: /* @__PURE__ */ jsx("span", {
82
+ className: style_default.TypeKeyword,
83
+ children: "class"
84
+ })
85
+ });
86
+ case "PythonTypeMap": return /* @__PURE__ */ jsx("span", {
87
+ className: style_default.Type,
88
+ children: /* @__PURE__ */ jsx("span", {
89
+ className: style_default.TypeKeyword,
90
+ children: "Dict"
91
+ })
92
+ });
93
+ case "PythonTypeReference": {
94
+ const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
95
+ return /* @__PURE__ */ jsxs("span", {
96
+ className: style_default.Type,
97
+ children: [/* @__PURE__ */ jsx("span", {
98
+ className: type.typeName === "Optional" ? style_default.TypeArray : "",
99
+ children: /* @__PURE__ */ jsx(SDKReference, {
100
+ stainlessPath: type.$ref,
101
+ children: type.typeName
102
+ })
103
+ }), params && params.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
104
+ /* @__PURE__ */ jsx("span", {
105
+ className: style_default.TypeBracket,
106
+ children: "["
107
+ }),
108
+ /* @__PURE__ */ jsx(Join, {
109
+ items: params,
110
+ limit: 3,
111
+ children: /* @__PURE__ */ jsx("span", {
112
+ className: style_default.TextOperator,
113
+ children: ", "
114
+ })
115
+ }),
116
+ /* @__PURE__ */ jsx("span", {
117
+ className: style_default.TypeBracket,
118
+ children: "]"
119
+ })
120
+ ] })]
121
+ });
122
+ }
123
+ }
124
+ }
125
+ function MethodSignature({ decl }) {
126
+ const Lang = useLanguageComponents();
127
+ const { Join, Tooltip } = useComponents();
128
+ const params = decl.parameters.map((param, i) => /* @__PURE__ */ jsx(React$1.Fragment, { children: /* @__PURE__ */ jsx(Tooltip, {
129
+ content: /* @__PURE__ */ jsx(Lang.Type, { type: param.type }),
130
+ children: /* @__PURE__ */ jsx("span", {
131
+ className: style_default.TextIdentifier,
132
+ children: param.ident
133
+ })
134
+ }) }, i));
135
+ return /* @__PURE__ */ jsx("div", {
136
+ className: style_default.MethodSignature,
137
+ children: /* @__PURE__ */ jsxs("span", {
138
+ className: style_default.SignatureTitle,
139
+ children: [
140
+ decl.async && /* @__PURE__ */ jsx("span", {
141
+ className: style_default.TextKeyword,
142
+ children: "async "
143
+ }),
144
+ decl.qualified && /* @__PURE__ */ jsx("span", {
145
+ className: style_default.SignatureQualified,
146
+ children: /* @__PURE__ */ jsx("span", {
147
+ className: style_default.TextIdentifier,
148
+ children: decl.qualified?.slice(0, -decl.ident.length)
149
+ })
150
+ }),
151
+ /* @__PURE__ */ jsx("span", {
152
+ className: style_default.SignatureName,
153
+ children: /* @__PURE__ */ jsx("span", {
154
+ className: style_default.TextIdentifier,
155
+ children: decl.ident
156
+ })
157
+ }),
158
+ /* @__PURE__ */ jsxs("span", {
159
+ className: style_default.MethodSignature,
160
+ children: [
161
+ /* @__PURE__ */ jsx("span", {
162
+ className: style_default.SignatureParen,
163
+ children: "("
164
+ }),
165
+ /* @__PURE__ */ jsx("span", {
166
+ className: style_default.SignatureParams,
167
+ children: /* @__PURE__ */ jsx(Join, {
168
+ items: params,
169
+ children: /* @__PURE__ */ jsx("span", {
170
+ className: style_default.TextOperator,
171
+ children: ", "
172
+ })
173
+ })
174
+ }),
175
+ /* @__PURE__ */ jsxs("span", {
176
+ className: style_default.SignatureParen,
177
+ children: [")", " "]
178
+ }),
179
+ decl.returns && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
180
+ className: style_default.TextOperator,
181
+ children: " -> "
182
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: decl.returns })] })
183
+ ]
184
+ })
185
+ ]
186
+ })
187
+ });
188
+ }
189
+ function Property({ decl, children }) {
190
+ const Lang = useLanguageComponents();
191
+ if (!decl) return;
192
+ switch (decl.kind) {
193
+ case "PythonDeclProperty": return children({
194
+ name: decl.ident,
195
+ typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
196
+ type: showFullType(decl.type) && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
197
+ });
198
+ case "PythonDeclClass": return children({
199
+ name: decl.ident,
200
+ typeName: "class"
201
+ });
202
+ case "PythonDeclType": return children({
203
+ name: decl.ident,
204
+ typeName: "type",
205
+ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
206
+ });
207
+ case "PythonDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
208
+ }
209
+ }
210
+ function Declaration({ decl }) {
211
+ const Lang = useLanguageComponents();
212
+ if (!decl) return;
213
+ switch (decl.kind) {
214
+ case "PythonDeclProperty": {
215
+ const nullable = decl.type.kind === "PythonTypeReference" && decl.type.typeName === "Optional" && (decl.type.typeParameters ?? []).length > 0;
216
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
217
+ /* @__PURE__ */ jsx("span", {
218
+ className: style_default.TypePropertyName,
219
+ children: /* @__PURE__ */ jsx("span", {
220
+ className: style_default.TextIdentifier,
221
+ children: decl.ident
222
+ })
223
+ }),
224
+ /* @__PURE__ */ jsx("span", {
225
+ className: style_default.TextPunctuation,
226
+ children: ": "
227
+ }),
228
+ decl.optional && !nullable ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
229
+ /* @__PURE__ */ jsx("span", {
230
+ className: style_default.TypePlain,
231
+ children: "Optional"
232
+ }),
233
+ /* @__PURE__ */ jsx("span", {
234
+ className: style_default.TypeBracket,
235
+ children: "["
236
+ }),
237
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }),
238
+ /* @__PURE__ */ jsx("span", {
239
+ className: style_default.TypeBrace,
240
+ children: "]"
241
+ })
242
+ ] }) : /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
243
+ ] });
244
+ }
245
+ case "PythonDeclClass": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
246
+ /* @__PURE__ */ jsx("span", {
247
+ className: style_default.TextKeyword,
248
+ children: "class "
249
+ }),
250
+ /* @__PURE__ */ jsx("span", {
251
+ className: style_default.TextIdentifier,
252
+ children: decl.ident
253
+ }),
254
+ /* @__PURE__ */ jsx("span", {
255
+ className: style_default.TextPunctuation,
256
+ children: ": "
257
+ }),
258
+ /* @__PURE__ */ jsx("span", {
259
+ className: `${style_default.TypePreviewContent} ${style_default.TextPunctuation}`,
260
+ children: "…"
261
+ })
262
+ ] });
263
+ case "PythonDeclType": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
264
+ /* @__PURE__ */ jsx("span", {
265
+ className: style_default.TextIdentifier,
266
+ children: decl.ident
267
+ }),
268
+ /* @__PURE__ */ jsx("span", {
269
+ className: style_default.TextOperator,
270
+ children: " = "
271
+ }),
272
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
273
+ ] });
274
+ case "PythonDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
275
+ }
276
+ }
277
+
278
+ //#endregion
279
+ export { TypeName as a, Type as i, MethodSignature as n, python_exports as o, Property as r, Declaration as t };
@@ -0,0 +1,54 @@
1
+ import * as SDKJSON from "@stainless/sdk-json";
2
+
3
+ //#region src/routing.d.ts
4
+ declare namespace routing_d_exports {
5
+ export { DocsLanguage, LanguageNames, Languages, ParsedStainlessPath, RouteEntry, SpecTreeEntry, SupportedLanguageSyntaxes, expandToElement, findNavigationPath, generateRoute, generateRouteList, getLanguageSnippet, getResource, isSupportedLanguage, parseRoute, parseStainlessPath, scrollToPath, trimStainlessPath, updateHistory, walkTree };
6
+ }
7
+ declare const Languages: readonly ["http", "node", "python", "go", "typescript", "terraform", "ruby", "java", "kotlin", "csharp", "php"];
8
+ declare const SupportedLanguageSyntaxes: string[];
9
+ type DocsLanguage = (typeof Languages)[number];
10
+ declare const LanguageNames: Record<DocsLanguage, string>;
11
+ declare function getLanguageSnippet(language: DocsLanguage): "http.curl" | "node.default" | "python.default" | "go.default" | "typescript.default" | "terraform.default" | "ruby.default" | "java.default" | "kotlin.default" | "csharp.default" | "php.default";
12
+ declare function isSupportedLanguage(language: string): language is DocsLanguage;
13
+ type ParsedStainlessPath = ReturnType<typeof parseStainlessPath>;
14
+ declare function parseStainlessPath(stainlessPath: string): {
15
+ resource: string[] | null;
16
+ method: string | null;
17
+ model: string | null;
18
+ routable: string | undefined;
19
+ } | null;
20
+ declare function trimStainlessPath(stainlessPath: string): string;
21
+ declare function getResource(stainlessPath: string): string | undefined;
22
+ declare function parseRoute(basePath: string, route: string): {
23
+ stainlessPath: string;
24
+ language: DocsLanguage;
25
+ };
26
+ declare function generateRoute(basePath: string, language: string, stainlessPath: string): string | null;
27
+ type SpecTreeEntry = {
28
+ data: SDKJSON.Method | SDKJSON.Resource | SDKJSON.Model;
29
+ path: string[];
30
+ };
31
+ declare function walkTree(spec: SDKJSON.Spec, includeModels?: boolean): Generator<SpecTreeEntry, void, any>;
32
+ type RouteEntry = {
33
+ title: string;
34
+ kind: SpecTreeEntry['data']['kind'];
35
+ language: DocsLanguage;
36
+ stainlessPath: string;
37
+ slug: string;
38
+ };
39
+ declare function generateRouteList({
40
+ spec,
41
+ languages,
42
+ excludeLanguages
43
+ }: {
44
+ spec: SDKJSON.Spec;
45
+ languages?: DocsLanguage[];
46
+ excludeLanguages?: DocsLanguage[];
47
+ }): RouteEntry[];
48
+ type ResourceOrMethod = SDKJSON.Resource | SDKJSON.Method;
49
+ declare function findNavigationPath(items: ResourceOrMethod[], target: string): string[] | undefined;
50
+ declare function expandToElement(el: HTMLElement | null): void;
51
+ declare function scrollToPath(stainlessPath: string): void;
52
+ declare function updateHistory(basePath: string, language: DocsLanguage, stainlessPath: string): void;
53
+ //#endregion
54
+ export { routing_d_exports as _, RouteEntry as a, updateHistory as b, expandToElement as c, generateRouteList as d, getLanguageSnippet as f, parseStainlessPath as g, parseRoute as h, ParsedStainlessPath as i, findNavigationPath as l, isSupportedLanguage as m, LanguageNames as n, SpecTreeEntry as o, getResource as p, Languages as r, SupportedLanguageSyntaxes as s, DocsLanguage as t, generateRoute as u, scrollToPath as v, walkTree as x, trimStainlessPath as y };