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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/breadcrumbs-BaNU4WsC.d.ts +25 -0
  2. package/dist/chunk-pbuEa-1d.js +13 -0
  3. package/dist/component-generics-D9XaPlr8.d.ts +30 -0
  4. package/dist/component-generics-DYxBWv1v.js +42 -0
  5. package/dist/components/MaskedInput.d.ts +14 -0
  6. package/dist/components/MaskedInput.js +74 -0
  7. package/dist/components/breadcrumbs.d.ts +2 -0
  8. package/dist/components/breadcrumbs.js +61 -0
  9. package/dist/components/icons.d.ts +72 -0
  10. package/dist/components/icons.js +953 -0
  11. package/dist/components/index.d.ts +10 -0
  12. package/dist/components/index.js +72 -0
  13. package/dist/components/method.d.ts +2 -0
  14. package/dist/components/method.js +94 -0
  15. package/dist/components/overview.d.ts +2 -0
  16. package/dist/components/overview.js +139 -0
  17. package/dist/components/primitives.d.ts +2 -0
  18. package/dist/components/primitives.js +250 -0
  19. package/dist/components/properties.d.ts +2 -0
  20. package/dist/components/properties.js +143 -0
  21. package/dist/components/sdk-sidebar.d.ts +2 -0
  22. package/dist/components/sdk-sidebar.js +49 -0
  23. package/dist/components/sdk.d.ts +2 -0
  24. package/dist/components/sdk.js +487 -0
  25. package/dist/components/snippets.d.ts +2 -0
  26. package/dist/components/snippets.js +183 -0
  27. package/dist/components/stl-sidebar.d.ts +2 -0
  28. package/dist/components/stl-sidebar.js +111 -0
  29. package/dist/contexts/component-generics.d.ts +2 -0
  30. package/dist/contexts/component-generics.js +2 -0
  31. package/dist/contexts/component-types.d.ts +7 -0
  32. package/dist/contexts/component-types.js +0 -0
  33. package/dist/contexts/component.d.ts +20 -0
  34. package/dist/contexts/component.js +21 -0
  35. package/dist/contexts/docs.d.ts +2 -0
  36. package/dist/contexts/docs.js +89 -0
  37. package/dist/contexts/index.d.ts +6 -0
  38. package/dist/contexts/index.js +43 -0
  39. package/dist/contexts/markdown.d.ts +2 -0
  40. package/dist/contexts/markdown.js +62 -0
  41. package/dist/contexts/navigation.d.ts +2 -0
  42. package/dist/contexts/navigation.js +21 -0
  43. package/dist/contexts/use-components.d.ts +6 -0
  44. package/dist/contexts/use-components.js +5 -0
  45. package/dist/docs-D0qzNoXq.d.ts +62 -0
  46. package/dist/index-DFr9Mesr.d.ts +1776 -0
  47. package/dist/index-Dt9uPKZP.d.ts +464 -0
  48. package/dist/index.d.ts +5 -0
  49. package/dist/index.js +7 -7542
  50. package/dist/languages/cli.d.ts +2 -0
  51. package/dist/languages/cli.js +164 -0
  52. package/dist/languages/csharp.d.ts +2 -0
  53. package/dist/languages/csharp.js +281 -0
  54. package/dist/languages/go.d.ts +2 -0
  55. package/dist/languages/go.js +301 -0
  56. package/dist/languages/http.d.ts +2 -0
  57. package/dist/languages/http.js +381 -0
  58. package/dist/languages/index.d.ts +2 -0
  59. package/dist/languages/index.js +30 -0
  60. package/dist/languages/java.d.ts +2 -0
  61. package/dist/languages/java.js +401 -0
  62. package/dist/languages/php.d.ts +2 -0
  63. package/dist/languages/php.js +310 -0
  64. package/dist/languages/python.d.ts +2 -0
  65. package/dist/languages/python.js +267 -0
  66. package/dist/languages/ruby.d.ts +2 -0
  67. package/dist/languages/ruby.js +385 -0
  68. package/dist/languages/terraform.d.ts +2 -0
  69. package/dist/languages/terraform.js +258 -0
  70. package/dist/languages/typescript.d.ts +2 -0
  71. package/dist/languages/typescript.js +447 -0
  72. package/dist/markdown/index.d.ts +11 -0
  73. package/dist/markdown/index.js +86 -0
  74. package/dist/markdown/md.d.ts +15 -0
  75. package/dist/markdown/md.js +39 -0
  76. package/dist/markdown/printer.d.ts +13 -0
  77. package/dist/markdown/printer.js +73 -0
  78. package/dist/markdown/utils.d.ts +28 -0
  79. package/dist/markdown/utils.js +31 -0
  80. package/dist/markdown-B30HO-Vy.d.ts +33 -0
  81. package/dist/method-BKJnP-rW.d.ts +59 -0
  82. package/dist/navigation-DGl8lR6w.d.ts +29 -0
  83. package/dist/overview-iH1evPEF.d.ts +39 -0
  84. package/dist/primitives-BHt-BuLf.d.ts +107 -0
  85. package/dist/properties-CCbMRhSX.d.ts +54 -0
  86. package/dist/routing-yTSG7nWM.d.ts +61 -0
  87. package/dist/routing.d.ts +2 -0
  88. package/dist/routing.js +174 -150
  89. package/dist/sdk-BengV7mg.d.ts +128 -0
  90. package/dist/sdk-sidebar-CRqLm3YO.d.ts +15 -0
  91. package/dist/spec.d.ts +65 -0
  92. package/dist/spec.js +165 -0
  93. package/dist/stl-sidebar-Pra9uCYo.d.ts +58 -0
  94. package/dist/style.d.ts +178 -0
  95. package/dist/style.js +178 -0
  96. package/dist/styles/main.css +765 -755
  97. package/dist/styles/primitives.css +359 -442
  98. package/dist/styles/resets.css +25 -41
  99. package/dist/styles/search.css +187 -270
  100. package/dist/styles/sidebar.css +155 -69
  101. package/dist/styles/variables.css +23 -89
  102. package/dist/styles.css +3171 -0
  103. package/dist/utils.d.ts +20 -0
  104. package/dist/utils.js +52 -0
  105. package/package.json +75 -22
  106. package/dist/mcp.js +0 -16003
  107. package/dist/styles/snippets.css +0 -132
  108. package/src/components/breadcrumbs.tsx +0 -94
  109. package/src/components/chat.tsx +0 -154
  110. package/src/components/dropdown.tsx +0 -91
  111. package/src/components/icons.tsx +0 -584
  112. package/src/components/index.ts +0 -9
  113. package/src/components/method.tsx +0 -146
  114. package/src/components/overview.tsx +0 -160
  115. package/src/components/primitives.tsx +0 -284
  116. package/src/components/properties.tsx +0 -130
  117. package/src/components/scripts/dropdown.ts +0 -78
  118. package/src/components/sdk.tsx +0 -403
  119. package/src/components/sidebar.tsx +0 -99
  120. package/src/components/snippets.tsx +0 -180
  121. package/src/contexts/component-generics.tsx +0 -48
  122. package/src/contexts/component-types.tsx +0 -5
  123. package/src/contexts/component.tsx +0 -32
  124. package/src/contexts/docs.tsx +0 -75
  125. package/src/contexts/index.tsx +0 -17
  126. package/src/contexts/markdown.tsx +0 -43
  127. package/src/contexts/navigation.tsx +0 -44
  128. package/src/contexts/search.tsx +0 -28
  129. package/src/contexts/use-components.tsx +0 -4
  130. package/src/index.ts +0 -6
  131. package/src/languages/go.tsx +0 -281
  132. package/src/languages/http.tsx +0 -321
  133. package/src/languages/index.ts +0 -26
  134. package/src/languages/java.tsx +0 -358
  135. package/src/languages/python.tsx +0 -255
  136. package/src/languages/ruby.tsx +0 -320
  137. package/src/languages/typescript.tsx +0 -393
  138. package/src/markdown/index.ts +0 -107
  139. package/src/markdown/md.ts +0 -45
  140. package/src/markdown/utils.ts +0 -49
  141. package/src/routing.ts +0 -238
  142. package/src/search/form.tsx +0 -127
  143. package/src/search/index.tsx +0 -1
  144. package/src/search/indexer.ts +0 -246
  145. package/src/search/mcp.ts +0 -61
  146. package/src/search/printer.tsx +0 -86
  147. package/src/search/providers/algolia.ts +0 -88
  148. package/src/search/providers/fuse.ts +0 -19
  149. package/src/search/providers/pagefind.ts +0 -17
  150. package/src/search/providers/walker.ts +0 -30
  151. package/src/search/results.tsx +0 -182
  152. package/src/search/state.ts +0 -64
  153. package/src/search/types.ts +0 -116
  154. package/src/style.ts +0 -196
  155. package/src/styles/main.css +0 -986
  156. package/src/styles/primitives.css +0 -580
  157. package/src/styles/resets.css +0 -39
  158. package/src/styles/search.css +0 -341
  159. package/src/styles/sidebar.css +0 -85
  160. package/src/styles/snippets.css +0 -130
  161. package/src/styles/variables.css +0 -86
  162. package/src/utils.ts +0 -41
@@ -0,0 +1,10 @@
1
+ import { a as Join, c as ListViewProps, d as ToggleButtonProps, f as Tooltip, i as InputProps, l as Markdown, n as Expander, o as Link, p as VirtualExpander, r as Input, s as ListView, t as Badge, u as ToggleButton } from "../primitives-BHt-BuLf.js";
2
+ import { n as generateApiBreadcrumbs, t as SDKBreadcrumbs } from "../breadcrumbs-BaNU4WsC.js";
3
+ import { a as MethodHeaderProps, c as MethodProps, i as MethodHeader, l as MethodRoute, n as MethodDescription, o as MethodInfo, r as MethodDescriptionProps, s as MethodInfoProps, t as Method, u as MethodRouteProps } from "../method-BKJnP-rW.js";
4
+ import { a as PropertyTitle, c as PropertyToggleProps, i as PropertyProps, n as PropertyDescription, o as PropertyTitleProps, r as PropertyDescriptionProps, s as PropertyToggle, t as Property } from "../properties-CCbMRhSX.js";
5
+ import { A as useStreamingResponse, C as SDKRequestTitleProps, D as useDeclarationParents, E as TransformRequestSnippetFn, O as usePropertyModel, S as SDKRequestTitle, T as SDKSnippetLanguagesType, _ as SDKMethodNotImplemented, a as ReferenceNestingContextType, b as SDKModelProps, c as SDKConstraintsProps, d as SDKIcon, f as SDKLanguageBlock, g as SDKMethodInfoContent, h as SDKMethodInfo, i as ReferenceNestingContext, k as useReferenceNesting, l as SDKDeclaration, m as SDKMethodHeader, n as PropertyModelContext, o as SDKChildren, p as SDKMethod, r as PropertyModelContextType, s as SDKConstraints, t as DeclarationParentsContextType, u as SDKExample, v as SDKMethodProps, w as SDKSnippetLanguages, x as SDKReference, y as SDKModel } from "../sdk-BengV7mg.js";
6
+ import { a as SnippetButtons, c as SnippetContainer, d as SnippetProps, f as SnippetRequestContainer, i as Snippet, l as SnippetContainerProps, m as SnippetResponse, n as MultiSnippets, o as SnippetCode, p as SnippetRequestContainerProps, r as MultiSnippetsProps, s as SnippetCodeProps, u as SnippetFooter } from "../index-Dt9uPKZP.js";
7
+ import { a as SDKResource, c as SDKRoot, i as SDKOverviewProps, l as SDKRootProps, n as SDKMethodSummaryProps, o as SDKResourceHeader, r as SDKOverview, s as SDKResourceProps, t as SDKMethodSummary } from "../overview-iH1evPEF.js";
8
+ import { n as SDKSidebarProps, t as SDKSidebar } from "../sdk-sidebar-CRqLm3YO.js";
9
+ import { a as StlSidebarProps, i as StlSidebarLink, n as StlSidebarEntry, o as StlSidebarTarget, r as StlSidebarGroup, t as StlSidebar } from "../stl-sidebar-Pra9uCYo.js";
10
+ export { Badge, DeclarationParentsContextType, Expander, Input, InputProps, Join, Link, ListView, ListViewProps, Markdown, Method, MethodDescription, MethodDescriptionProps, MethodHeader, MethodHeaderProps, MethodInfo, MethodInfoProps, MethodProps, MethodRoute, MethodRouteProps, MultiSnippets, MultiSnippetsProps, Property, PropertyDescription, PropertyDescriptionProps, PropertyModelContext, PropertyModelContextType, PropertyProps, PropertyTitle, PropertyTitleProps, PropertyToggle, PropertyToggleProps, ReferenceNestingContext, ReferenceNestingContextType, SDKBreadcrumbs, SDKChildren, SDKConstraints, SDKConstraintsProps, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodInfoContent, SDKMethodNotImplemented, SDKMethodProps, SDKMethodSummary, SDKMethodSummaryProps, SDKModel, SDKModelProps, SDKOverview, SDKOverviewProps, SDKReference, SDKRequestTitle, SDKRequestTitleProps, SDKResource, SDKResourceHeader, SDKResourceProps, SDKRoot, SDKRootProps, SDKSidebar, SDKSidebarProps, SDKSnippetLanguages, SDKSnippetLanguagesType, Snippet, SnippetButtons, SnippetCode, SnippetCodeProps, SnippetContainer, SnippetContainerProps, SnippetFooter, SnippetProps, SnippetRequestContainer, SnippetRequestContainerProps, SnippetResponse, StlSidebar, StlSidebarEntry, StlSidebarGroup, StlSidebarLink, StlSidebarProps, StlSidebarTarget, ToggleButton, ToggleButtonProps, Tooltip, TransformRequestSnippetFn, VirtualExpander, generateApiBreadcrumbs, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse };
@@ -0,0 +1,72 @@
1
+ import { t as __exportAll } from "../chunk-pbuEa-1d.js";
2
+ import { Property, PropertyDescription, PropertyTitle, PropertyToggle } from "./properties.js";
3
+ import { Method, MethodDescription, MethodHeader, MethodInfo, MethodRoute } from "./method.js";
4
+ import { Badge, Expander, Input, Join, Link, ListView, Markdown, ToggleButton, Tooltip, VirtualExpander } from "./primitives.js";
5
+ import { PropertyModelContext, ReferenceNestingContext, SDKChildren, SDKConstraints, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodInfoContent, SDKMethodNotImplemented, SDKModel, SDKReference, SDKRequestTitle, SDKSnippetLanguages, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse } from "./sdk.js";
6
+ import { MultiSnippets, Snippet, SnippetButtons, SnippetCode, SnippetContainer, SnippetFooter, SnippetRequestContainer, SnippetResponse } from "./snippets.js";
7
+ import { SDKMethodSummary, SDKOverview, SDKResource, SDKResourceHeader, SDKRoot } from "./overview.js";
8
+ import { SDKBreadcrumbs, generateApiBreadcrumbs } from "./breadcrumbs.js";
9
+ import { StlSidebar } from "./stl-sidebar.js";
10
+ import { SDKSidebar } from "./sdk-sidebar.js";
11
+ //#region src/components/index.ts
12
+ var components_exports = /* @__PURE__ */ __exportAll({
13
+ Badge: () => Badge,
14
+ Expander: () => Expander,
15
+ Input: () => Input,
16
+ Join: () => Join,
17
+ Link: () => Link,
18
+ ListView: () => ListView,
19
+ Markdown: () => Markdown,
20
+ Method: () => Method,
21
+ MethodDescription: () => MethodDescription,
22
+ MethodHeader: () => MethodHeader,
23
+ MethodInfo: () => MethodInfo,
24
+ MethodRoute: () => MethodRoute,
25
+ MultiSnippets: () => MultiSnippets,
26
+ Property: () => Property,
27
+ PropertyDescription: () => PropertyDescription,
28
+ PropertyModelContext: () => PropertyModelContext,
29
+ PropertyTitle: () => PropertyTitle,
30
+ PropertyToggle: () => PropertyToggle,
31
+ ReferenceNestingContext: () => ReferenceNestingContext,
32
+ SDKBreadcrumbs: () => SDKBreadcrumbs,
33
+ SDKChildren: () => SDKChildren,
34
+ SDKConstraints: () => SDKConstraints,
35
+ SDKDeclaration: () => SDKDeclaration,
36
+ SDKExample: () => SDKExample,
37
+ SDKIcon: () => SDKIcon,
38
+ SDKLanguageBlock: () => SDKLanguageBlock,
39
+ SDKMethod: () => SDKMethod,
40
+ SDKMethodHeader: () => SDKMethodHeader,
41
+ SDKMethodInfo: () => SDKMethodInfo,
42
+ SDKMethodInfoContent: () => SDKMethodInfoContent,
43
+ SDKMethodNotImplemented: () => SDKMethodNotImplemented,
44
+ SDKMethodSummary: () => SDKMethodSummary,
45
+ SDKModel: () => SDKModel,
46
+ SDKOverview: () => SDKOverview,
47
+ SDKReference: () => SDKReference,
48
+ SDKRequestTitle: () => SDKRequestTitle,
49
+ SDKResource: () => SDKResource,
50
+ SDKResourceHeader: () => SDKResourceHeader,
51
+ SDKRoot: () => SDKRoot,
52
+ SDKSidebar: () => SDKSidebar,
53
+ SDKSnippetLanguages: () => SDKSnippetLanguages,
54
+ Snippet: () => Snippet,
55
+ SnippetButtons: () => SnippetButtons,
56
+ SnippetCode: () => SnippetCode,
57
+ SnippetContainer: () => SnippetContainer,
58
+ SnippetFooter: () => SnippetFooter,
59
+ SnippetRequestContainer: () => SnippetRequestContainer,
60
+ SnippetResponse: () => SnippetResponse,
61
+ StlSidebar: () => StlSidebar,
62
+ ToggleButton: () => ToggleButton,
63
+ Tooltip: () => Tooltip,
64
+ VirtualExpander: () => VirtualExpander,
65
+ generateApiBreadcrumbs: () => generateApiBreadcrumbs,
66
+ useDeclarationParents: () => useDeclarationParents,
67
+ usePropertyModel: () => usePropertyModel,
68
+ useReferenceNesting: () => useReferenceNesting,
69
+ useStreamingResponse: () => useStreamingResponse
70
+ });
71
+ //#endregion
72
+ export { Badge, Expander, Input, Join, Link, ListView, Markdown, Method, MethodDescription, MethodHeader, MethodInfo, MethodRoute, MultiSnippets, Property, PropertyDescription, PropertyModelContext, PropertyTitle, PropertyToggle, ReferenceNestingContext, SDKBreadcrumbs, SDKChildren, SDKConstraints, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodInfoContent, SDKMethodNotImplemented, SDKMethodSummary, SDKModel, SDKOverview, SDKReference, SDKRequestTitle, SDKResource, SDKResourceHeader, SDKRoot, SDKSidebar, SDKSnippetLanguages, Snippet, SnippetButtons, SnippetCode, SnippetContainer, SnippetFooter, SnippetRequestContainer, SnippetResponse, StlSidebar, ToggleButton, Tooltip, VirtualExpander, generateApiBreadcrumbs, components_exports as t, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse };
@@ -0,0 +1,2 @@
1
+ import { a as MethodHeaderProps, c as MethodProps, i as MethodHeader, l as MethodRoute, n as MethodDescription, o as MethodInfo, r as MethodDescriptionProps, s as MethodInfoProps, t as Method, u as MethodRouteProps } from "../method-BKJnP-rW.js";
2
+ export { Method, MethodDescription, MethodDescriptionProps, MethodHeader, MethodHeaderProps, MethodInfo, MethodInfoProps, MethodProps, MethodRoute, MethodRouteProps };
@@ -0,0 +1,94 @@
1
+ import { useComponents } from "../contexts/use-components.js";
2
+ import style_default from "../style.js";
3
+ import { PropertyToggle } from "./properties.js";
4
+ import "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import clsx from "clsx";
7
+ import { Badge, getHttpMethod } from "@stainless-api/ui-primitives";
8
+ import { FunctionIcon } from "@stainless-api/ui-primitives/icons";
9
+ //#region src/components/method.tsx
10
+ function MethodHeader({ title, badges, signature, children, level }) {
11
+ const Heading = level ?? "h5";
12
+ return /* @__PURE__ */ jsxs("div", {
13
+ className: style_default.MethodHeader,
14
+ children: [
15
+ /* @__PURE__ */ jsx(Heading, {
16
+ className: style_default.MethodTitle,
17
+ children: title
18
+ }),
19
+ badges ? /* @__PURE__ */ jsx("div", {
20
+ className: style_default.MethodBadges,
21
+ children: badges
22
+ }) : null,
23
+ signature,
24
+ children
25
+ ]
26
+ });
27
+ }
28
+ function MethodRoute({ httpMethod, endpoint, iconOnly }) {
29
+ const httpMethodTyped = getHttpMethod(httpMethod);
30
+ return /* @__PURE__ */ jsxs("div", {
31
+ className: style_default.MethodRoute,
32
+ children: [httpMethod ? httpMethodTyped && /* @__PURE__ */ jsx(Badge.HTTP, {
33
+ method: httpMethodTyped,
34
+ iconOnly,
35
+ size: "sm"
36
+ }) : /* @__PURE__ */ jsx(Badge, {
37
+ size: "sm",
38
+ icon: /* @__PURE__ */ jsx(FunctionIcon, {}),
39
+ intent: "info",
40
+ children: !iconOnly && "Function"
41
+ }), endpoint ? /* @__PURE__ */ jsx("span", {
42
+ className: style_default.MethodRouteEndpoint,
43
+ children: endpoint
44
+ }) : null]
45
+ });
46
+ }
47
+ function MethodDescription({ description }) {
48
+ const { Markdown } = useComponents();
49
+ if (description) return /* @__PURE__ */ jsx("div", {
50
+ className: style_default.MethodDescription,
51
+ children: /* @__PURE__ */ jsx(Markdown, { content: description })
52
+ });
53
+ }
54
+ function MethodInfo({ children, parameters, returns }) {
55
+ return /* @__PURE__ */ jsxs("div", {
56
+ className: style_default.MethodInfo,
57
+ children: [
58
+ children ? /* @__PURE__ */ jsx("div", {
59
+ className: style_default.MethodContent,
60
+ children
61
+ }) : null,
62
+ parameters ? /* @__PURE__ */ jsxs("div", {
63
+ className: style_default.MethodInfoSection,
64
+ children: [/* @__PURE__ */ jsxs("h5", { children: ["Parameters", /* @__PURE__ */ jsx(PropertyToggle, { target: "parameters" })] }), /* @__PURE__ */ jsx("div", {
65
+ className: style_default.MethodParameters,
66
+ "data-stldocs-property-group": "parameters",
67
+ children: parameters
68
+ })]
69
+ }) : null,
70
+ returns ? /* @__PURE__ */ jsxs("div", {
71
+ className: style_default.MethodInfoSection,
72
+ children: [/* @__PURE__ */ jsxs("h5", { children: ["Returns", /* @__PURE__ */ jsx(PropertyToggle, { target: "returns" })] }), /* @__PURE__ */ jsx("div", {
73
+ className: style_default.MethodReturns,
74
+ "data-stldocs-property-group": "returns",
75
+ children: returns
76
+ })]
77
+ }) : null
78
+ ]
79
+ });
80
+ }
81
+ function Method({ id, header, children, className, ...props }) {
82
+ return /* @__PURE__ */ jsxs("div", {
83
+ id,
84
+ className: clsx(style_default.Method, className),
85
+ tabIndex: 0,
86
+ ...props,
87
+ children: [header, /* @__PURE__ */ jsx("div", {
88
+ className: style_default.MethodBody,
89
+ children
90
+ })]
91
+ });
92
+ }
93
+ //#endregion
94
+ export { Method, MethodDescription, MethodHeader, MethodInfo, MethodRoute };
@@ -0,0 +1,2 @@
1
+ import { a as SDKResource, c as SDKRoot, i as SDKOverviewProps, l as SDKRootProps, n as SDKMethodSummaryProps, o as SDKResourceHeader, r as SDKOverview, s as SDKResourceProps, t as SDKMethodSummary } from "../overview-iH1evPEF.js";
2
+ export { SDKMethodSummary, SDKMethodSummaryProps, SDKOverview, SDKOverviewProps, SDKResource, SDKResourceHeader, SDKResourceProps, SDKRoot, SDKRootProps };
@@ -0,0 +1,139 @@
1
+ import { useDeclaration, useLanguage, useSpec } from "../contexts/docs.js";
2
+ import { useLanguageComponents } from "../contexts/index.js";
3
+ import { useComponents } from "../contexts/use-components.js";
4
+ import style_default from "../style.js";
5
+ import { PropertyToggle } from "./properties.js";
6
+ import { parseStainlessPath } from "../routing.js";
7
+ import { Markdown } from "./primitives.js";
8
+ import { flatResources, getResourceFromSpec } from "../utils.js";
9
+ import * as React$1 from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { ChevronRight } from "lucide-react";
12
+ //#region src/components/overview.tsx
13
+ function SDKResourceHeader({ resource, parents }) {
14
+ const segments = parents?.map((parent, index) => /* @__PURE__ */ jsxs("span", {
15
+ className: style_default.ResourceTitleSegment,
16
+ children: [parent.title, index < parents.length && /* @__PURE__ */ jsx(ChevronRight, {
17
+ size: 16,
18
+ className: style_default.Icon
19
+ })]
20
+ }, parent.stainlessPath));
21
+ if (!segments && !resource.description) return null;
22
+ return /* @__PURE__ */ jsxs("div", {
23
+ className: style_default.ResourceHeader,
24
+ children: [segments && /* @__PURE__ */ jsxs("h4", {
25
+ id: resource.stainlessPath,
26
+ className: style_default.ResourceTitle,
27
+ children: [segments, /* @__PURE__ */ jsx("span", {
28
+ className: style_default.ResourceTitleSegment,
29
+ children: resource.title
30
+ })]
31
+ }), resource.description && /* @__PURE__ */ jsx("div", {
32
+ className: style_default.ResourceDescription,
33
+ children: /* @__PURE__ */ jsx(Markdown, { content: resource.description })
34
+ })]
35
+ });
36
+ }
37
+ function SDKMethodSummary({ method }) {
38
+ const Docs = useComponents();
39
+ const Lang = useLanguageComponents();
40
+ const decl = useDeclaration(method.stainlessPath, true);
41
+ return /* @__PURE__ */ jsx(Docs.MethodHeader, {
42
+ level: "h5",
43
+ title: /* @__PURE__ */ jsx(Docs.Link, {
44
+ stainlessPath: method.stainlessPath,
45
+ children: method.summary || method.title
46
+ }),
47
+ signature: /* @__PURE__ */ jsx(Lang.MethodSignature, { decl }),
48
+ badges: method.deprecated && /* @__PURE__ */ jsx(Docs.Badge, {
49
+ id: "deprecated",
50
+ children: "Deprecated"
51
+ }),
52
+ children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
53
+ httpMethod: method.httpMethod,
54
+ endpoint: method.endpoint.split(" ", 2).at(-1)
55
+ })
56
+ });
57
+ }
58
+ function SDKResource({ resource, parents, showModels }) {
59
+ const Docs = useComponents();
60
+ const Lang = useLanguageComponents();
61
+ const language = useLanguage();
62
+ const spec = useSpec();
63
+ const methods = Object.values(resource.methods).filter((method) => spec?.decls?.[language]?.[method.stainlessPath]);
64
+ const models = Object.values(resource.models).filter((model) => spec?.decls?.[language]?.[`${model.stainlessPath} > (schema)`]);
65
+ if (Lang.Resource) return /* @__PURE__ */ jsx(Lang.Resource, {
66
+ resource,
67
+ parents
68
+ });
69
+ return /* @__PURE__ */ jsx("div", {
70
+ className: style_default.Resource,
71
+ "data-stl-resource-language": language,
72
+ children: /* @__PURE__ */ jsxs("div", {
73
+ className: style_default.ResourceContent,
74
+ children: [
75
+ /* @__PURE__ */ jsx(Docs.SDKResourceHeader, {
76
+ resource,
77
+ parents
78
+ }),
79
+ methods.length > 0 && /* @__PURE__ */ jsx("div", {
80
+ className: style_default.ResourceContentGroup,
81
+ children: methods.map((method) => /* @__PURE__ */ jsx("div", {
82
+ className: style_default.MethodSummary,
83
+ children: /* @__PURE__ */ jsx(Docs.SDKMethodSummary, { method })
84
+ }, method.stainlessPath))
85
+ }),
86
+ showModels !== false && models.length > 0 && /* @__PURE__ */ jsxs("div", {
87
+ className: style_default.ResourceContentGroup,
88
+ "data-stldocs-property-group": "models",
89
+ children: [/* @__PURE__ */ jsxs("h5", {
90
+ className: style_default.ResourceContentGroupModelTitle,
91
+ children: ["Models", /* @__PURE__ */ jsx(PropertyToggle, { target: "models" })]
92
+ }), models.map((model) => /* @__PURE__ */ jsx(Docs.SDKModel, { model }, model.stainlessPath))]
93
+ })
94
+ ]
95
+ })
96
+ });
97
+ }
98
+ function SDKOverview({ resource }) {
99
+ const { SDKResource } = useComponents();
100
+ const nested = React$1.useMemo(() => flatResources(resource.subresources, [resource]), [resource]);
101
+ return /* @__PURE__ */ jsxs("div", {
102
+ className: style_default.Overview,
103
+ children: [
104
+ /* @__PURE__ */ jsx("div", {
105
+ className: style_default.OverviewHeader,
106
+ children: /* @__PURE__ */ jsx("h1", { children: resource.title })
107
+ }),
108
+ /* @__PURE__ */ jsx(SDKResource, { resource }),
109
+ nested.map((props, index) => /* @__PURE__ */ jsx(SDKResource, { ...props }, index))
110
+ ]
111
+ });
112
+ }
113
+ function SDKRoot({ stainlessPath }) {
114
+ const spec = useSpec();
115
+ const Docs = useComponents();
116
+ const parsed = parseStainlessPath(stainlessPath);
117
+ const resource = spec && getResourceFromSpec(stainlessPath, spec);
118
+ if (!resource || !parsed) {
119
+ console.warn(`Could not find resource or parsed path for '${stainlessPath}'`);
120
+ return null;
121
+ }
122
+ if (parsed.method) {
123
+ const method = resource.methods[parsed.method];
124
+ if (!method) {
125
+ console.warn(`Method '${parsed.method}' not found in resource '${resource.stainlessPath}'`);
126
+ return null;
127
+ }
128
+ return /* @__PURE__ */ jsx("div", {
129
+ className: style_default.Root,
130
+ children: /* @__PURE__ */ jsx(Docs.SDKMethod, { method })
131
+ });
132
+ }
133
+ return /* @__PURE__ */ jsx("div", {
134
+ className: style_default.Root,
135
+ children: /* @__PURE__ */ jsx(Docs.SDKOverview, { resource })
136
+ });
137
+ }
138
+ //#endregion
139
+ export { SDKMethodSummary, SDKOverview, SDKResource, SDKResourceHeader, SDKRoot };
@@ -0,0 +1,2 @@
1
+ import { a as Join, c as ListViewProps, d as ToggleButtonProps, f as Tooltip, i as InputProps, l as Markdown, n as Expander, o as Link, p as VirtualExpander, r as Input, s as ListView, t as Badge, u as ToggleButton } from "../primitives-BHt-BuLf.js";
2
+ export { Badge, Expander, Input, InputProps, Join, Link, ListView, ListViewProps, Markdown, ToggleButton, ToggleButtonProps, Tooltip, VirtualExpander };
@@ -0,0 +1,250 @@
1
+ import { useLanguage, useSettings } from "../contexts/docs.js";
2
+ import { useNavigation } from "../contexts/navigation.js";
3
+ import { useRenderMarkdown } from "../contexts/markdown.js";
4
+ import "../contexts/index.js";
5
+ import style_default from "../style.js";
6
+ import { generateRoute } from "../routing.js";
7
+ import { Fragment, createContext, use, useCallback, useEffect, useMemo, useRef, useState } from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import clsx from "clsx";
10
+ import { MinusIcon, PlusIcon } from "lucide-react";
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, style: cssStyle }) {
87
+ const rendered = useRenderMarkdown(content);
88
+ return rendered && /* @__PURE__ */ jsx("div", {
89
+ style: cssStyle,
90
+ className: clsx(style_default.Markdown, style_default.Content, "stl-ui-prose"),
91
+ dangerouslySetInnerHTML: { __html: rendered }
92
+ });
93
+ }
94
+ function Badge({ id, children }) {
95
+ return /* @__PURE__ */ jsx("span", {
96
+ className: style_default.Badge,
97
+ "data-badge-id": id,
98
+ children: children ?? id
99
+ });
100
+ }
101
+ const TooltipNestingContext = createContext(false);
102
+ function Tooltip({ content, children }) {
103
+ if (use(TooltipNestingContext)) return children;
104
+ return /* @__PURE__ */ jsxs("span", {
105
+ className: style_default.Tooltip,
106
+ children: [/* @__PURE__ */ jsx("span", {
107
+ className: style_default.TooltipContent,
108
+ children: /* @__PURE__ */ jsx(TooltipNestingContext, {
109
+ value: true,
110
+ children: content
111
+ })
112
+ }), /* @__PURE__ */ jsx("span", {
113
+ className: style_default.TooltipHost,
114
+ children
115
+ })]
116
+ });
117
+ }
118
+ function Link({ stainlessPath, scroll = true, children, ...props }) {
119
+ const { basePath, onNavigate } = useNavigation();
120
+ const language = useLanguage();
121
+ const href = useMemo(() => {
122
+ if (props.href) return props.href;
123
+ if (stainlessPath && basePath) return generateRoute(basePath, language, stainlessPath);
124
+ }, [
125
+ basePath,
126
+ language,
127
+ stainlessPath,
128
+ props.href
129
+ ]);
130
+ const handleClick = useCallback((e) => {
131
+ if (props.onClick) props.onClick(e);
132
+ if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
133
+ if (href && stainlessPath) onNavigate?.(e, {
134
+ href,
135
+ language,
136
+ stainlessPath,
137
+ scroll
138
+ });
139
+ }, [
140
+ href,
141
+ scroll,
142
+ onNavigate,
143
+ language,
144
+ props,
145
+ stainlessPath
146
+ ]);
147
+ if (!href) return children;
148
+ return /* @__PURE__ */ jsx("a", {
149
+ href,
150
+ onClick: handleClick,
151
+ ...props,
152
+ children
153
+ });
154
+ }
155
+ function Input({ left, right, ref, className, ...props }) {
156
+ return /* @__PURE__ */ jsxs("div", {
157
+ className: clsx(style_default.Input, props.disabled && style_default.InputDisabled, className),
158
+ children: [
159
+ left,
160
+ /* @__PURE__ */ jsx("input", {
161
+ ...props,
162
+ ref,
163
+ className: style_default.InputTextField
164
+ }),
165
+ right
166
+ ]
167
+ });
168
+ }
169
+ function ToggleButton({ children, selected, ref, ...props }) {
170
+ return /* @__PURE__ */ jsx("button", {
171
+ ...props,
172
+ ref,
173
+ className: style_default.ToggleButton,
174
+ "data-stldocs-toggle-selected": selected,
175
+ children
176
+ });
177
+ }
178
+ function ListView({ items, itemDelegate, onSelectListItem, ...rest }) {
179
+ const [selectedIndex, setSelectedIndex] = useState(0);
180
+ const [keyboardIndex, setKeyboardIndex] = useState(0);
181
+ const listRef = useRef(null);
182
+ const itemRef = useRef(null);
183
+ const handleSelect = useCallback(() => {
184
+ const item = items[selectedIndex];
185
+ if (item) onSelectListItem?.(item);
186
+ }, [
187
+ items,
188
+ selectedIndex,
189
+ onSelectListItem
190
+ ]);
191
+ useEffect(() => {
192
+ const ac = new AbortController();
193
+ document.addEventListener("keydown", (ev) => {
194
+ switch (ev.key) {
195
+ case "ArrowUp": {
196
+ ev.preventDefault();
197
+ const value = Math.max(0, selectedIndex - 1);
198
+ setSelectedIndex(value);
199
+ setKeyboardIndex(value);
200
+ break;
201
+ }
202
+ case "ArrowDown": {
203
+ ev.preventDefault();
204
+ const value = Math.min(items.length, selectedIndex + 1);
205
+ setSelectedIndex(value);
206
+ setKeyboardIndex(value);
207
+ break;
208
+ }
209
+ case "Enter":
210
+ ev.preventDefault();
211
+ handleSelect();
212
+ break;
213
+ }
214
+ }, { signal: ac.signal });
215
+ return () => ac.abort();
216
+ }, [
217
+ items,
218
+ selectedIndex,
219
+ handleSelect
220
+ ]);
221
+ useEffect(() => {
222
+ if (!keyboardIndex || !itemRef.current || !listRef.current) {
223
+ listRef?.current?.scroll(0, 0);
224
+ return;
225
+ }
226
+ const selectedBounds = itemRef.current.getBoundingClientRect();
227
+ const listBounds = listRef.current.getBoundingClientRect();
228
+ if (selectedBounds.top < listBounds.top || selectedBounds.bottom > listBounds.bottom) itemRef.current.scrollIntoView({ block: "nearest" });
229
+ }, [
230
+ keyboardIndex,
231
+ items,
232
+ listRef
233
+ ]);
234
+ return /* @__PURE__ */ jsx("div", {
235
+ ref: listRef,
236
+ className: style_default.ListView,
237
+ tabIndex: 0,
238
+ ...rest,
239
+ children: items.map((item, index) => /* @__PURE__ */ jsx("div", {
240
+ ref: index === selectedIndex ? itemRef : null,
241
+ className: style_default.ListViewItem,
242
+ "data-stldocs-listview-selected": index === selectedIndex,
243
+ onClick: handleSelect,
244
+ onMouseEnter: () => setSelectedIndex(index),
245
+ children: itemDelegate(item, index === selectedIndex)
246
+ }, index))
247
+ });
248
+ }
249
+ //#endregion
250
+ export { Badge, Expander, Input, Join, Link, ListView, Markdown, ToggleButton, Tooltip, VirtualExpander };
@@ -0,0 +1,2 @@
1
+ import { a as PropertyTitle, c as PropertyToggleProps, i as PropertyProps, n as PropertyDescription, o as PropertyTitleProps, r as PropertyDescriptionProps, s as PropertyToggle, t as Property } from "../properties-CCbMRhSX.js";
2
+ export { Property, PropertyDescription, PropertyDescriptionProps, PropertyProps, PropertyTitle, PropertyTitleProps, PropertyToggle, PropertyToggleProps };