@stainless-api/docs-ui 0.1.0-beta.7 → 0.1.0-beta.70

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 (215) hide show
  1. package/dist/breadcrumbs-BhYwbXkc.d.ts +25 -0
  2. package/dist/breadcrumbs-Cvm5Ifm7.d.ts +25 -0
  3. package/dist/breadcrumbs-DA4WgDhR.js +63 -0
  4. package/dist/chunk-BN_g-Awi.js +18 -0
  5. package/dist/cli-F3kMmeoJ.js +166 -0
  6. package/dist/component-P9sn5yyG.js +23 -0
  7. package/dist/component-generics-ByGsYTc8.d.ts +30 -0
  8. package/dist/component-generics-POFirVVb.js +45 -0
  9. package/dist/component-generics-zU0Pqx8m.d.ts +30 -0
  10. package/dist/components/MaskedInput.d.ts +14 -0
  11. package/dist/components/MaskedInput.js +76 -0
  12. package/dist/components/breadcrumbs.d.ts +2 -0
  13. package/dist/components/breadcrumbs.js +9 -0
  14. package/dist/components/icons.d.ts +60 -0
  15. package/dist/components/icons.js +3 -0
  16. package/dist/components/index.d.ts +11 -0
  17. package/dist/components/index.js +19 -0
  18. package/dist/components/method.d.ts +2 -0
  19. package/dist/components/method.js +10 -0
  20. package/dist/components/overview.d.ts +2 -0
  21. package/dist/components/overview.js +11 -0
  22. package/dist/components/primitives.d.ts +2 -0
  23. package/dist/components/primitives.js +8 -0
  24. package/dist/components/properties.d.ts +2 -0
  25. package/dist/components/properties.js +9 -0
  26. package/dist/components/sdk-sidebar.d.ts +2 -0
  27. package/dist/components/sdk-sidebar.js +10 -0
  28. package/dist/components/sdk.d.ts +2 -0
  29. package/dist/components/sdk.js +10 -0
  30. package/dist/components/snippets.d.ts +3 -0
  31. package/dist/components/snippets.js +9 -0
  32. package/dist/components/stl-sidebar.d.ts +2 -0
  33. package/dist/components/stl-sidebar.js +5 -0
  34. package/dist/components-w1JmIrB0.js +71 -0
  35. package/dist/contexts/component-generics.d.ts +2 -0
  36. package/dist/contexts/component-generics.js +3 -0
  37. package/dist/contexts/component-types.d.ts +17 -0
  38. package/dist/contexts/component-types.js +0 -0
  39. package/dist/contexts/component.d.ts +30 -0
  40. package/dist/contexts/component.js +30 -0
  41. package/dist/contexts/docs.d.ts +2 -0
  42. package/dist/contexts/docs.js +3 -0
  43. package/dist/contexts/index.d.ts +23 -0
  44. package/dist/contexts/index.js +7 -0
  45. package/dist/contexts/markdown.d.ts +2 -0
  46. package/dist/contexts/markdown.js +4 -0
  47. package/dist/contexts/navigation.d.ts +2 -0
  48. package/dist/contexts/navigation.js +3 -0
  49. package/dist/contexts/use-components.d.ts +15 -0
  50. package/dist/contexts/use-components.js +4 -0
  51. package/dist/contexts-CVj20VV4.js +41 -0
  52. package/dist/csharp-D6_jlynY.js +283 -0
  53. package/dist/docs-BmOB2f-I.js +61 -0
  54. package/dist/docs-g4IPmtZr.d.ts +48 -0
  55. package/dist/docs-z3fl2eW-.d.ts +48 -0
  56. package/dist/go-COaHV3Hc.js +303 -0
  57. package/dist/http-fOPCX17A.js +389 -0
  58. package/dist/icons-BYKn5X8E.js +885 -0
  59. package/dist/index-B8Zys1C2.d.ts +347 -0
  60. package/dist/index-C5Zmb2CI.d.ts +16 -0
  61. package/dist/index-CwjGm9zX.d.ts +1722 -0
  62. package/dist/index-D7PkxNgB.d.ts +16 -0
  63. package/dist/index-DIaM6Ync.d.ts +347 -0
  64. package/dist/index.d.ts +20 -0
  65. package/dist/index.js +32 -7542
  66. package/dist/java-CxGSJVvv.js +403 -0
  67. package/dist/languages/cli.d.ts +12 -0
  68. package/dist/languages/cli.js +21 -0
  69. package/dist/languages/csharp.d.ts +12 -0
  70. package/dist/languages/csharp.js +9 -0
  71. package/dist/languages/go.d.ts +12 -0
  72. package/dist/languages/go.js +9 -0
  73. package/dist/languages/http.d.ts +12 -0
  74. package/dist/languages/http.js +20 -0
  75. package/dist/languages/index.d.ts +12 -0
  76. package/dist/languages/index.js +29 -0
  77. package/dist/languages/java.d.ts +12 -0
  78. package/dist/languages/java.js +9 -0
  79. package/dist/languages/python.d.ts +12 -0
  80. package/dist/languages/python.js +9 -0
  81. package/dist/languages/ruby.d.ts +12 -0
  82. package/dist/languages/ruby.js +9 -0
  83. package/dist/languages/terraform.d.ts +12 -0
  84. package/dist/languages/terraform.js +9 -0
  85. package/dist/languages/typescript.d.ts +12 -0
  86. package/dist/languages/typescript.js +9 -0
  87. package/dist/languages-B6eap2M6.js +30 -0
  88. package/dist/markdown/index.d.ts +12 -0
  89. package/dist/markdown/index.js +107 -0
  90. package/dist/markdown/md.d.ts +15 -0
  91. package/dist/markdown/md.js +41 -0
  92. package/dist/markdown/printer.d.ts +13 -0
  93. package/dist/markdown/printer.js +100 -0
  94. package/dist/markdown/utils.d.ts +21 -0
  95. package/dist/markdown/utils.js +31 -0
  96. package/dist/markdown-CTKHMLVr.js +49 -0
  97. package/dist/markdown-Cdh0TSHp.d.ts +22 -0
  98. package/dist/markdown-Cibv9fDR.d.ts +22 -0
  99. package/dist/method-630cPKDl.d.ts +59 -0
  100. package/dist/method-BPDUyBlD.js +96 -0
  101. package/dist/method-BzkPRXGL.d.ts +59 -0
  102. package/dist/navigation-BW-SBvb4.d.ts +29 -0
  103. package/dist/navigation-DWYqC_HX.d.ts +29 -0
  104. package/dist/navigation-aoYZ_tl4.js +24 -0
  105. package/dist/overview-Cui1XtuC.d.ts +39 -0
  106. package/dist/overview-DFwfIK6k.js +138 -0
  107. package/dist/overview-RXc9iPzz.d.ts +39 -0
  108. package/dist/primitives-DJEqe_r1.js +250 -0
  109. package/dist/primitives-DhGxFYx6.d.ts +105 -0
  110. package/dist/primitives-MsH-h0bU.d.ts +105 -0
  111. package/dist/properties-BnbBKd5a.js +132 -0
  112. package/dist/properties-Bynmj9_H.d.ts +54 -0
  113. package/dist/properties-C9W4QJ_F.d.ts +54 -0
  114. package/dist/python-DsTuWCKE.js +269 -0
  115. package/dist/routing-C64k4fmX.js +205 -0
  116. package/dist/routing-Cm_9XJiQ.d.ts +61 -0
  117. package/dist/routing-utiR5mY3.d.ts +61 -0
  118. package/dist/routing.d.ts +2 -0
  119. package/dist/routing.js +3 -180
  120. package/dist/ruby-BncKp6hd.js +387 -0
  121. package/dist/sdk-BvZeXpsj.d.ts +122 -0
  122. package/dist/sdk-Bw99eXxA.js +399 -0
  123. package/dist/sdk-GMOw94wL.d.ts +122 -0
  124. package/dist/sdk-sidebar-NCBSWuUW.d.ts +15 -0
  125. package/dist/sdk-sidebar-VNY2-O1Y.d.ts +15 -0
  126. package/dist/sdk-sidebar-V_MTkVw8.js +50 -0
  127. package/dist/snippets-BehbU3rt.js +164 -0
  128. package/dist/snippets-Bj7Ey56K.d.ts +53 -0
  129. package/dist/snippets-CQQSDvg2.d.ts +53 -0
  130. package/dist/spec.d.ts +65 -0
  131. package/dist/spec.js +167 -0
  132. package/dist/stl-sidebar-CXzs_shz.d.ts +58 -0
  133. package/dist/stl-sidebar-DSkUHwcU.d.ts +58 -0
  134. package/dist/stl-sidebar-WtimNrk1.js +106 -0
  135. package/dist/style-HpXpcJ9v.js +172 -0
  136. package/dist/style.d.ts +171 -0
  137. package/dist/style.js +3 -0
  138. package/dist/styles/main.css +744 -754
  139. package/dist/styles/main.js +0 -0
  140. package/dist/styles/primitives.css +327 -458
  141. package/dist/styles/primitives.js +0 -0
  142. package/dist/styles/resets.css +32 -41
  143. package/dist/styles/resets.js +0 -0
  144. package/dist/styles/search.css +192 -270
  145. package/dist/styles/search.js +0 -0
  146. package/dist/styles/sidebar.css +170 -69
  147. package/dist/styles/sidebar.js +0 -0
  148. package/dist/styles/variables.css +26 -89
  149. package/dist/styles/variables.js +0 -0
  150. package/dist/styles.css +3273 -0
  151. package/dist/styles.mjs +1 -0
  152. package/dist/terraform-B95X4rNK.js +243 -0
  153. package/dist/typescript-n46M9OtL.js +449 -0
  154. package/dist/use-components-BUz3GbO4.js +7 -0
  155. package/dist/utils-DPbkW1Tz.js +54 -0
  156. package/dist/utils.d.ts +20 -0
  157. package/dist/utils.js +3 -0
  158. package/package.json +74 -22
  159. package/dist/mcp.js +0 -16003
  160. package/dist/styles/snippets.css +0 -132
  161. package/src/components/breadcrumbs.tsx +0 -94
  162. package/src/components/chat.tsx +0 -154
  163. package/src/components/dropdown.tsx +0 -91
  164. package/src/components/icons.tsx +0 -584
  165. package/src/components/index.ts +0 -9
  166. package/src/components/method.tsx +0 -144
  167. package/src/components/overview.tsx +0 -159
  168. package/src/components/primitives.tsx +0 -284
  169. package/src/components/properties.tsx +0 -130
  170. package/src/components/scripts/dropdown.ts +0 -78
  171. package/src/components/sdk.tsx +0 -402
  172. package/src/components/sidebar.tsx +0 -99
  173. package/src/components/snippets.tsx +0 -179
  174. package/src/contexts/component-generics.tsx +0 -48
  175. package/src/contexts/component-types.tsx +0 -5
  176. package/src/contexts/component.tsx +0 -32
  177. package/src/contexts/docs.tsx +0 -75
  178. package/src/contexts/index.tsx +0 -17
  179. package/src/contexts/markdown.tsx +0 -43
  180. package/src/contexts/navigation.tsx +0 -44
  181. package/src/contexts/search.tsx +0 -28
  182. package/src/contexts/use-components.tsx +0 -4
  183. package/src/index.ts +0 -6
  184. package/src/languages/go.tsx +0 -281
  185. package/src/languages/http.tsx +0 -321
  186. package/src/languages/index.ts +0 -26
  187. package/src/languages/java.tsx +0 -358
  188. package/src/languages/python.tsx +0 -255
  189. package/src/languages/ruby.tsx +0 -320
  190. package/src/languages/typescript.tsx +0 -393
  191. package/src/markdown/index.ts +0 -107
  192. package/src/markdown/md.ts +0 -45
  193. package/src/markdown/utils.ts +0 -49
  194. package/src/routing.ts +0 -238
  195. package/src/search/form.tsx +0 -127
  196. package/src/search/index.tsx +0 -1
  197. package/src/search/indexer.ts +0 -246
  198. package/src/search/mcp.ts +0 -61
  199. package/src/search/printer.tsx +0 -86
  200. package/src/search/providers/algolia.ts +0 -88
  201. package/src/search/providers/fuse.ts +0 -19
  202. package/src/search/providers/pagefind.ts +0 -17
  203. package/src/search/providers/walker.ts +0 -30
  204. package/src/search/results.tsx +0 -181
  205. package/src/search/state.ts +0 -64
  206. package/src/search/types.ts +0 -116
  207. package/src/style.ts +0 -197
  208. package/src/styles/main.css +0 -993
  209. package/src/styles/primitives.css +0 -572
  210. package/src/styles/resets.css +0 -47
  211. package/src/styles/search.css +0 -342
  212. package/src/styles/sidebar.css +0 -87
  213. package/src/styles/snippets.css +0 -132
  214. package/src/styles/variables.css +0 -90
  215. package/src/utils.ts +0 -41
@@ -0,0 +1,59 @@
1
+ import * as React$1 from "react";
2
+ import { ReactNode } from "react";
3
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
4
+
5
+ //#region src/components/method.d.ts
6
+ type MethodHeaderProps = {
7
+ title: ReactNode;
8
+ level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
9
+ signature?: ReactNode;
10
+ badges?: ReactNode;
11
+ children?: ReactNode;
12
+ };
13
+ declare function MethodHeader({
14
+ title,
15
+ badges,
16
+ signature,
17
+ children,
18
+ level
19
+ }: MethodHeaderProps): react_jsx_runtime5.JSX.Element;
20
+ type MethodRouteProps = {
21
+ httpMethod?: string;
22
+ endpoint?: string | ReactNode;
23
+ iconOnly?: boolean;
24
+ };
25
+ declare function MethodRoute({
26
+ httpMethod,
27
+ endpoint,
28
+ iconOnly
29
+ }: MethodRouteProps): react_jsx_runtime5.JSX.Element;
30
+ type MethodDescriptionProps = {
31
+ description?: string;
32
+ };
33
+ declare function MethodDescription({
34
+ description
35
+ }: MethodDescriptionProps): react_jsx_runtime5.JSX.Element | undefined;
36
+ type MethodInfoProps = {
37
+ children?: ReactNode;
38
+ parameters?: ReactNode;
39
+ returns?: ReactNode;
40
+ };
41
+ declare function MethodInfo({
42
+ children,
43
+ parameters,
44
+ returns
45
+ }: MethodInfoProps): react_jsx_runtime5.JSX.Element;
46
+ type MethodProps = {
47
+ id?: string;
48
+ header?: ReactNode;
49
+ children?: ReactNode;
50
+ } & React$1.HTMLProps<HTMLDivElement>;
51
+ declare function Method({
52
+ id,
53
+ header,
54
+ children,
55
+ className,
56
+ ...props
57
+ }: MethodProps): react_jsx_runtime5.JSX.Element;
58
+ //#endregion
59
+ export { MethodHeaderProps as a, MethodProps as c, MethodHeader as i, MethodRoute as l, MethodDescription as n, MethodInfo as o, MethodDescriptionProps as r, MethodInfoProps as s, Method as t, MethodRouteProps as u };
@@ -0,0 +1,29 @@
1
+ import { t as DocsLanguage } from "./routing-utiR5mY3.js";
2
+ import * as React$1 from "react";
3
+ import * as react_jsx_runtime86 from "react/jsx-runtime";
4
+
5
+ //#region src/contexts/navigation.d.ts
6
+ type NavigationHandler = (ev: React$1.MouseEvent | null, opts: {
7
+ href: string;
8
+ language: DocsLanguage;
9
+ stainlessPath: string;
10
+ scroll: boolean;
11
+ }) => void;
12
+ type NavigationContextType = {
13
+ basePath?: string;
14
+ selectedPath?: string;
15
+ navigationPath?: string[];
16
+ onNavigate?: NavigationHandler;
17
+ };
18
+ declare function useNavigation(): NavigationContextType;
19
+ type NavigationProviderProps = NavigationContextType & {
20
+ children: React$1.ReactNode;
21
+ };
22
+ declare function NavigationProvider({
23
+ basePath,
24
+ selectedPath,
25
+ onNavigate,
26
+ children
27
+ }: NavigationProviderProps): react_jsx_runtime86.JSX.Element;
28
+ //#endregion
29
+ export { useNavigation as a, NavigationProviderProps as i, NavigationHandler as n, NavigationProvider as r, NavigationContextType as t };
@@ -0,0 +1,29 @@
1
+ import { t as DocsLanguage } from "./routing-Cm_9XJiQ.js";
2
+ import * as React$1 from "react";
3
+ import * as react_jsx_runtime48 from "react/jsx-runtime";
4
+
5
+ //#region src/contexts/navigation.d.ts
6
+ type NavigationHandler = (ev: React$1.MouseEvent | null, opts: {
7
+ href: string;
8
+ language: DocsLanguage;
9
+ stainlessPath: string;
10
+ scroll: boolean;
11
+ }) => void;
12
+ type NavigationContextType = {
13
+ basePath?: string;
14
+ selectedPath?: string;
15
+ navigationPath?: string[];
16
+ onNavigate?: NavigationHandler;
17
+ };
18
+ declare function useNavigation(): NavigationContextType;
19
+ type NavigationProviderProps = NavigationContextType & {
20
+ children: React$1.ReactNode;
21
+ };
22
+ declare function NavigationProvider({
23
+ basePath,
24
+ selectedPath,
25
+ onNavigate,
26
+ children
27
+ }: NavigationProviderProps): react_jsx_runtime48.JSX.Element;
28
+ //#endregion
29
+ export { useNavigation as a, NavigationProviderProps as i, NavigationHandler as n, NavigationProvider as r, NavigationContextType as t };
@@ -0,0 +1,24 @@
1
+ import * as React$1 from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+
4
+ //#region src/contexts/navigation.tsx
5
+ const Defaults = { basePath: "/" };
6
+ const NavigationContext = React$1.createContext(Defaults);
7
+ function useNavigation() {
8
+ return React$1.useContext(NavigationContext);
9
+ }
10
+ function NavigationProvider({ basePath, selectedPath, onNavigate, children }) {
11
+ const value = {
12
+ ...Defaults,
13
+ onNavigate,
14
+ basePath,
15
+ selectedPath
16
+ };
17
+ return /* @__PURE__ */ jsx(NavigationContext.Provider, {
18
+ value,
19
+ children
20
+ });
21
+ }
22
+
23
+ //#endregion
24
+ export { useNavigation as n, NavigationProvider as t };
@@ -0,0 +1,39 @@
1
+ import { d as Method, m as Resource } from "./index-CwjGm9zX.js";
2
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
3
+
4
+ //#region src/components/overview.d.ts
5
+ type SDKResourceProps = {
6
+ resource: Resource;
7
+ parents?: Resource[];
8
+ };
9
+ declare function SDKResourceHeader({
10
+ resource,
11
+ parents
12
+ }: SDKResourceProps): react_jsx_runtime10.JSX.Element | null;
13
+ type SDKMethodSummaryProps = {
14
+ method: Method;
15
+ };
16
+ declare function SDKMethodSummary({
17
+ method
18
+ }: SDKMethodSummaryProps): react_jsx_runtime10.JSX.Element;
19
+ declare function SDKResource({
20
+ resource,
21
+ parents,
22
+ showModels
23
+ }: SDKResourceProps & {
24
+ showModels?: boolean;
25
+ }): react_jsx_runtime10.JSX.Element;
26
+ type SDKOverviewProps = {
27
+ resource: Resource;
28
+ };
29
+ declare function SDKOverview({
30
+ resource
31
+ }: SDKOverviewProps): react_jsx_runtime10.JSX.Element;
32
+ type SDKRootProps = {
33
+ stainlessPath: string;
34
+ };
35
+ declare function SDKRoot({
36
+ stainlessPath
37
+ }: SDKRootProps): react_jsx_runtime10.JSX.Element | null;
38
+ //#endregion
39
+ export { SDKResource as a, SDKRoot as c, SDKOverviewProps as i, SDKRootProps as l, SDKMethodSummaryProps as n, SDKResourceHeader as o, SDKOverview as r, SDKResourceProps as s, SDKMethodSummary as t };
@@ -0,0 +1,138 @@
1
+ import { d as useSpec, i as useDeclaration, s as useLanguage } from "./docs-BmOB2f-I.js";
2
+ import { n as useLanguageComponents } from "./contexts-CVj20VV4.js";
3
+ import { t as useComponents } from "./use-components-BUz3GbO4.js";
4
+ import { t as style_default } from "./style-HpXpcJ9v.js";
5
+ import { i as PropertyToggle } from "./properties-BnbBKd5a.js";
6
+ import { p as parseStainlessPath } from "./routing-C64k4fmX.js";
7
+ import { s as Markdown } from "./primitives-DJEqe_r1.js";
8
+ import { r as getResourceFromSpec, t as flatResources } from "./utils-DPbkW1Tz.js";
9
+ import * as React$1 from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { ChevronRight } from "lucide-react";
12
+
13
+ //#region src/components/overview.tsx
14
+ function SDKResourceHeader({ resource, parents }) {
15
+ const segments = parents?.map((parent, index) => /* @__PURE__ */ jsxs("span", {
16
+ className: style_default.ResourceTitleSegment,
17
+ children: [parent.title, index < parents.length && /* @__PURE__ */ jsx(ChevronRight, {
18
+ size: 16,
19
+ className: style_default.Icon
20
+ })]
21
+ }, parent.stainlessPath));
22
+ if (!segments && !resource.description) return null;
23
+ return /* @__PURE__ */ jsxs("div", {
24
+ className: style_default.ResourceHeader,
25
+ children: [segments && /* @__PURE__ */ jsxs("h4", {
26
+ id: resource.stainlessPath,
27
+ className: style_default.ResourceTitle,
28
+ children: [segments, /* @__PURE__ */ jsx("span", {
29
+ className: style_default.ResourceTitleSegment,
30
+ children: resource.title
31
+ })]
32
+ }), resource.description && /* @__PURE__ */ jsx("div", {
33
+ className: style_default.ResourceDescription,
34
+ children: /* @__PURE__ */ jsx(Markdown, { content: resource.description })
35
+ })]
36
+ });
37
+ }
38
+ function SDKMethodSummary({ method }) {
39
+ const Docs = useComponents();
40
+ const Lang = useLanguageComponents();
41
+ const decl = useDeclaration(method.stainlessPath, true);
42
+ return /* @__PURE__ */ jsx(Docs.MethodHeader, {
43
+ level: "h5",
44
+ title: /* @__PURE__ */ jsx(Docs.Link, {
45
+ stainlessPath: method.stainlessPath,
46
+ children: method.summary || method.title
47
+ }),
48
+ signature: /* @__PURE__ */ jsx(Lang.MethodSignature, { decl }),
49
+ badges: method.deprecated && /* @__PURE__ */ jsx(Docs.Badge, {
50
+ id: "deprecated",
51
+ children: "Deprecated"
52
+ }),
53
+ children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
54
+ httpMethod: method.httpMethod,
55
+ endpoint: method.endpoint.split(" ", 2).at(-1)
56
+ })
57
+ });
58
+ }
59
+ function SDKResource({ resource, parents, showModels }) {
60
+ const Docs = useComponents();
61
+ const Lang = useLanguageComponents();
62
+ const language = useLanguage();
63
+ const spec = useSpec();
64
+ const methods = Object.values(resource.methods).filter((method) => spec?.decls?.[language]?.[method.stainlessPath]);
65
+ const models = Object.values(resource.models).filter((model) => spec?.decls?.[language]?.[`${model.stainlessPath} > (schema)`]);
66
+ return /* @__PURE__ */ jsx("div", {
67
+ className: style_default.Resource,
68
+ "data-stl-resource-language": language,
69
+ children: /* @__PURE__ */ jsxs("div", {
70
+ className: style_default.ResourceContent,
71
+ children: [
72
+ /* @__PURE__ */ jsx(Docs.SDKResourceHeader, {
73
+ resource,
74
+ parents
75
+ }),
76
+ Lang.Resource && /* @__PURE__ */ jsx(Lang.Resource, { resource }),
77
+ methods.length > 0 && /* @__PURE__ */ jsx("div", {
78
+ className: style_default.ResourceContentGroup,
79
+ children: methods.map((method) => /* @__PURE__ */ jsx("div", {
80
+ className: style_default.MethodSummary,
81
+ children: /* @__PURE__ */ jsx(Docs.SDKMethodSummary, { method })
82
+ }, method.stainlessPath))
83
+ }),
84
+ showModels !== false && models.length > 0 && /* @__PURE__ */ jsxs("div", {
85
+ className: style_default.ResourceContentGroup,
86
+ "data-stldocs-property-group": "models",
87
+ children: [/* @__PURE__ */ jsxs("h5", {
88
+ className: style_default.ResourceContentGroupModelTitle,
89
+ children: ["Models", /* @__PURE__ */ jsx(PropertyToggle, { target: "models" })]
90
+ }), models.map((model) => /* @__PURE__ */ jsx(Docs.SDKModel, { model }, model.stainlessPath))]
91
+ })
92
+ ]
93
+ })
94
+ });
95
+ }
96
+ function SDKOverview({ resource }) {
97
+ const { SDKResource } = useComponents();
98
+ const nested = React$1.useMemo(() => flatResources(resource.subresources, [resource]), [resource]);
99
+ return /* @__PURE__ */ jsxs("div", {
100
+ className: style_default.Overview,
101
+ children: [
102
+ /* @__PURE__ */ jsx("div", {
103
+ className: style_default.OverviewHeader,
104
+ children: /* @__PURE__ */ jsx("h1", { children: resource.title })
105
+ }),
106
+ /* @__PURE__ */ jsx(SDKResource, { resource }),
107
+ nested.map((props, index) => /* @__PURE__ */ jsx(SDKResource, { ...props }, index))
108
+ ]
109
+ });
110
+ }
111
+ function SDKRoot({ stainlessPath }) {
112
+ const spec = useSpec();
113
+ const Docs = useComponents();
114
+ const parsed = parseStainlessPath(stainlessPath);
115
+ const resource = spec && getResourceFromSpec(stainlessPath, spec);
116
+ if (!resource || !parsed) {
117
+ console.warn(`Could not find resource or parsed path for '${stainlessPath}'`);
118
+ return null;
119
+ }
120
+ if (parsed.method) {
121
+ const method = resource.methods[parsed.method];
122
+ if (!method) {
123
+ console.warn(`Method '${parsed.method}' not found in resource '${resource.stainlessPath}'`);
124
+ return null;
125
+ }
126
+ return /* @__PURE__ */ jsx("div", {
127
+ className: style_default.Root,
128
+ children: /* @__PURE__ */ jsx(Docs.SDKMethod, { method })
129
+ });
130
+ }
131
+ return /* @__PURE__ */ jsx("div", {
132
+ className: style_default.Root,
133
+ children: /* @__PURE__ */ jsx(Docs.SDKOverview, { resource })
134
+ });
135
+ }
136
+
137
+ //#endregion
138
+ export { SDKRoot as a, SDKResourceHeader as i, SDKOverview as n, SDKResource as r, SDKMethodSummary as t };
@@ -0,0 +1,39 @@
1
+ import { d as Method, m as Resource } from "./index-CwjGm9zX.js";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
+
4
+ //#region src/components/overview.d.ts
5
+ type SDKResourceProps = {
6
+ resource: Resource;
7
+ parents?: Resource[];
8
+ };
9
+ declare function SDKResourceHeader({
10
+ resource,
11
+ parents
12
+ }: SDKResourceProps): react_jsx_runtime1.JSX.Element | null;
13
+ type SDKMethodSummaryProps = {
14
+ method: Method;
15
+ };
16
+ declare function SDKMethodSummary({
17
+ method
18
+ }: SDKMethodSummaryProps): react_jsx_runtime1.JSX.Element;
19
+ declare function SDKResource({
20
+ resource,
21
+ parents,
22
+ showModels
23
+ }: SDKResourceProps & {
24
+ showModels?: boolean;
25
+ }): react_jsx_runtime1.JSX.Element;
26
+ type SDKOverviewProps = {
27
+ resource: Resource;
28
+ };
29
+ declare function SDKOverview({
30
+ resource
31
+ }: SDKOverviewProps): react_jsx_runtime1.JSX.Element;
32
+ type SDKRootProps = {
33
+ stainlessPath: string;
34
+ };
35
+ declare function SDKRoot({
36
+ stainlessPath
37
+ }: SDKRootProps): react_jsx_runtime1.JSX.Element | null;
38
+ //#endregion
39
+ export { SDKResource as a, SDKRoot as c, SDKOverviewProps as i, SDKRootProps as l, SDKMethodSummaryProps as n, SDKResourceHeader as o, SDKOverview as r, SDKResourceProps as s, SDKMethodSummary as t };
@@ -0,0 +1,250 @@
1
+ import { l as useSettings, s as useLanguage } from "./docs-BmOB2f-I.js";
2
+ import { n as useNavigation } from "./navigation-aoYZ_tl4.js";
3
+ import { a as useRenderMarkdown } from "./markdown-CTKHMLVr.js";
4
+ import { t as style_default } from "./style-HpXpcJ9v.js";
5
+ import { s as generateRoute } from "./routing-C64k4fmX.js";
6
+ import { Fragment, createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import clsx from "clsx";
9
+ import { MinusIcon, PlusIcon } from "lucide-react";
10
+
11
+ //#region src/components/primitives.tsx
12
+ function Join({ items, limit, children }) {
13
+ return (limit && items.length > limit + 1 ? [...items.slice(0, limit), /* @__PURE__ */ jsxs("span", {
14
+ className: style_default.Truncation,
15
+ children: [items.length - limit, " more"]
16
+ }, "truncation")] : items).map((item, index) => /* @__PURE__ */ jsxs(Fragment, { children: [!!index && children, item] }, `iterator:${index}`));
17
+ }
18
+ function Expander({ id, open, summary, virtual, muted, children }) {
19
+ const virtualExpanders = useSettings()?.virtualExpanders;
20
+ if (virtual || virtualExpanders) return /* @__PURE__ */ jsx(VirtualExpander, {
21
+ summary,
22
+ open,
23
+ muted,
24
+ id,
25
+ children
26
+ }, open ? "open" : "closed");
27
+ return /* @__PURE__ */ jsxs("details", {
28
+ className: style_default.Expander,
29
+ open,
30
+ "data-stldocs-expander-muted": muted,
31
+ "data-stldocs-expander-initial-state": open,
32
+ children: [/* @__PURE__ */ jsxs("summary", {
33
+ className: style_default.ExpanderSummary,
34
+ children: [/* @__PURE__ */ jsxs("div", {
35
+ className: style_default.ExpanderSummaryIcon,
36
+ children: [/* @__PURE__ */ jsx(PlusIcon, {
37
+ size: 16,
38
+ strokeWidth: 1,
39
+ className: style_default.Icon
40
+ }), /* @__PURE__ */ jsx(MinusIcon, {
41
+ size: 16,
42
+ strokeWidth: 1,
43
+ className: style_default.Icon
44
+ })]
45
+ }), /* @__PURE__ */ jsx("div", {
46
+ className: style_default.ExpanderSummaryContent,
47
+ children: summary
48
+ })]
49
+ }), /* @__PURE__ */ jsx("div", {
50
+ className: style_default.ExpanderContent,
51
+ id,
52
+ children
53
+ })]
54
+ });
55
+ }
56
+ function VirtualExpander({ id, open: isOpen, muted, summary, children }) {
57
+ const [open, setOpen] = useState(isOpen ?? false);
58
+ return /* @__PURE__ */ jsxs("div", {
59
+ className: style_default.Expander,
60
+ "data-open": open,
61
+ "data-stldocs-expander-muted": muted,
62
+ "data-stldocs-expander-initial-state": open,
63
+ children: [/* @__PURE__ */ jsxs("div", {
64
+ className: style_default.ExpanderSummary,
65
+ onClick: () => setOpen(!open),
66
+ children: [/* @__PURE__ */ jsxs("div", {
67
+ className: style_default.ExpanderSummaryIcon,
68
+ children: [/* @__PURE__ */ jsx(PlusIcon, {
69
+ size: 16,
70
+ className: style_default.Icon
71
+ }), /* @__PURE__ */ jsx(MinusIcon, {
72
+ size: 16,
73
+ className: style_default.Icon
74
+ })]
75
+ }), /* @__PURE__ */ jsx("div", {
76
+ className: style_default.ExpanderSummaryContent,
77
+ children: summary
78
+ })]
79
+ }), open && /* @__PURE__ */ jsx("div", {
80
+ className: style_default.ExpanderContent,
81
+ id,
82
+ children
83
+ })]
84
+ });
85
+ }
86
+ function Markdown({ content }) {
87
+ const rendered = useRenderMarkdown(content);
88
+ return rendered && /* @__PURE__ */ jsx("div", {
89
+ className: clsx(style_default.Markdown, style_default.Content, "stl-ui-prose"),
90
+ dangerouslySetInnerHTML: { __html: rendered }
91
+ });
92
+ }
93
+ function Badge({ id, children }) {
94
+ return /* @__PURE__ */ jsx("span", {
95
+ className: style_default.Badge,
96
+ "data-badge-id": id,
97
+ children: children ?? id
98
+ });
99
+ }
100
+ const TooltipNestingContext = createContext(false);
101
+ function Tooltip({ content, children }) {
102
+ if (useContext(TooltipNestingContext)) return children;
103
+ return /* @__PURE__ */ jsxs("span", {
104
+ className: style_default.Tooltip,
105
+ children: [/* @__PURE__ */ jsx("span", {
106
+ className: style_default.TooltipContent,
107
+ children: /* @__PURE__ */ jsx(TooltipNestingContext.Provider, {
108
+ value: true,
109
+ children: content
110
+ })
111
+ }), /* @__PURE__ */ jsx("span", {
112
+ className: style_default.TooltipHost,
113
+ children
114
+ })]
115
+ });
116
+ }
117
+ function Link({ stainlessPath, scroll = true, children, ...props }) {
118
+ const { basePath, onNavigate } = useNavigation();
119
+ const language = useLanguage();
120
+ const href = useMemo(() => {
121
+ if (props.href) return props.href;
122
+ if (stainlessPath && basePath) return generateRoute(basePath, language, stainlessPath);
123
+ }, [
124
+ basePath,
125
+ language,
126
+ stainlessPath,
127
+ props.href
128
+ ]);
129
+ const handleClick = useCallback((e) => {
130
+ if (props.onClick) props.onClick(e);
131
+ if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
132
+ if (href && stainlessPath) onNavigate?.(e, {
133
+ href,
134
+ language,
135
+ stainlessPath,
136
+ scroll
137
+ });
138
+ }, [
139
+ href,
140
+ scroll,
141
+ onNavigate,
142
+ language,
143
+ props,
144
+ stainlessPath
145
+ ]);
146
+ if (!href) return children;
147
+ return /* @__PURE__ */ jsx("a", {
148
+ href,
149
+ onClick: handleClick,
150
+ ...props,
151
+ children
152
+ });
153
+ }
154
+ function Input({ left, right, ref, className, ...props }) {
155
+ return /* @__PURE__ */ jsxs("div", {
156
+ className: clsx(style_default.Input, props.disabled && style_default.InputDisabled, className),
157
+ children: [
158
+ left,
159
+ /* @__PURE__ */ jsx("input", {
160
+ ...props,
161
+ ref,
162
+ className: style_default.InputTextField
163
+ }),
164
+ right
165
+ ]
166
+ });
167
+ }
168
+ function ToggleButton({ children, selected, ref, ...props }) {
169
+ return /* @__PURE__ */ jsx("button", {
170
+ ...props,
171
+ ref,
172
+ className: style_default.ToggleButton,
173
+ "data-stldocs-toggle-selected": selected,
174
+ children
175
+ });
176
+ }
177
+ function ListView({ items, itemDelegate, onSelectListItem, ...rest }) {
178
+ const [selectedIndex, setSelectedIndex] = useState(0);
179
+ const [keyboardIndex, setKeyboardIndex] = useState(0);
180
+ const listRef = useRef(null);
181
+ const itemRef = useRef(null);
182
+ const handleSelect = useCallback(() => {
183
+ const item = items[selectedIndex];
184
+ if (item) onSelectListItem?.(item);
185
+ }, [
186
+ items,
187
+ selectedIndex,
188
+ onSelectListItem
189
+ ]);
190
+ useEffect(() => {
191
+ const ac = new AbortController();
192
+ document.addEventListener("keydown", (ev) => {
193
+ switch (ev.key) {
194
+ case "ArrowUp": {
195
+ ev.preventDefault();
196
+ const value = Math.max(0, selectedIndex - 1);
197
+ setSelectedIndex(value);
198
+ setKeyboardIndex(value);
199
+ break;
200
+ }
201
+ case "ArrowDown": {
202
+ ev.preventDefault();
203
+ const value = Math.min(items.length, selectedIndex + 1);
204
+ setSelectedIndex(value);
205
+ setKeyboardIndex(value);
206
+ break;
207
+ }
208
+ case "Enter":
209
+ ev.preventDefault();
210
+ handleSelect();
211
+ break;
212
+ }
213
+ }, { signal: ac.signal });
214
+ return () => ac.abort();
215
+ }, [
216
+ items,
217
+ selectedIndex,
218
+ handleSelect
219
+ ]);
220
+ useEffect(() => {
221
+ if (!keyboardIndex || !itemRef.current || !listRef.current) {
222
+ listRef?.current?.scroll(0, 0);
223
+ return;
224
+ }
225
+ const selectedBounds = itemRef.current.getBoundingClientRect();
226
+ const listBounds = listRef.current.getBoundingClientRect();
227
+ if (selectedBounds.top < listBounds.top || selectedBounds.bottom > listBounds.bottom) itemRef.current.scrollIntoView({ block: "nearest" });
228
+ }, [
229
+ keyboardIndex,
230
+ items,
231
+ listRef
232
+ ]);
233
+ return /* @__PURE__ */ jsx("div", {
234
+ ref: listRef,
235
+ className: style_default.ListView,
236
+ tabIndex: 0,
237
+ ...rest,
238
+ children: items.map((item, index) => /* @__PURE__ */ jsx("div", {
239
+ ref: index === selectedIndex ? itemRef : null,
240
+ className: style_default.ListViewItem,
241
+ "data-stldocs-listview-selected": index === selectedIndex,
242
+ onClick: handleSelect,
243
+ onMouseEnter: () => setSelectedIndex(index),
244
+ children: itemDelegate(item, index === selectedIndex)
245
+ }, index))
246
+ });
247
+ }
248
+
249
+ //#endregion
250
+ export { Link as a, ToggleButton as c, Join as i, Tooltip as l, Expander as n, ListView as o, Input as r, Markdown as s, Badge as t, VirtualExpander as u };