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

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