@stainless-api/docs-ui 0.1.0-beta.8 → 0.1.0-beta.81
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.
- package/dist/chunk-BYypO7fO.js +18 -0
- package/dist/components/MaskedInput.d.ts +14 -0
- package/dist/components/MaskedInput.js +76 -0
- package/dist/components/breadcrumbs.d.ts +25 -0
- package/dist/components/breadcrumbs.js +64 -0
- package/dist/components/icons.d.ts +65 -0
- package/dist/components/icons.js +941 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.js +75 -0
- package/dist/components/method.d.ts +59 -0
- package/dist/components/method.js +97 -0
- package/dist/components/overview.d.ts +39 -0
- package/dist/components/overview.js +139 -0
- package/dist/components/primitives.d.ts +107 -0
- package/dist/components/primitives.js +253 -0
- package/dist/components/properties.d.ts +54 -0
- package/dist/components/properties.js +146 -0
- package/dist/components/sdk-sidebar.d.ts +15 -0
- package/dist/components/sdk-sidebar.js +52 -0
- package/dist/components/sdk.d.ts +128 -0
- package/dist/components/sdk.js +490 -0
- package/dist/components/snippets.d.ts +71 -0
- package/dist/components/snippets.js +184 -0
- package/dist/components/stl-sidebar.d.ts +58 -0
- package/dist/components/stl-sidebar.js +114 -0
- package/dist/contexts/component-generics.d.ts +30 -0
- package/dist/contexts/component-generics.js +33 -0
- package/dist/contexts/component-types.d.ts +8 -0
- package/dist/contexts/component-types.js +0 -0
- package/dist/contexts/component.d.ts +21 -0
- package/dist/contexts/component.js +24 -0
- package/dist/contexts/docs.d.ts +62 -0
- package/dist/contexts/docs.js +91 -0
- package/dist/contexts/index.d.ts +13 -0
- package/dist/contexts/index.js +45 -0
- package/dist/contexts/markdown.d.ts +22 -0
- package/dist/contexts/markdown.js +49 -0
- package/dist/contexts/navigation.d.ts +29 -0
- package/dist/contexts/navigation.js +24 -0
- package/dist/contexts/use-components.d.ts +6 -0
- package/dist/contexts/use-components.js +8 -0
- package/dist/index-pvh-w1xa.d.ts +1776 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +9 -7542
- package/dist/languages/cli.d.ts +38 -0
- package/dist/languages/cli.js +167 -0
- package/dist/languages/csharp.d.ts +42 -0
- package/dist/languages/csharp.js +284 -0
- package/dist/languages/go.d.ts +40 -0
- package/dist/languages/go.js +304 -0
- package/dist/languages/http.d.ts +46 -0
- package/dist/languages/http.js +387 -0
- package/dist/languages/index.d.ts +51 -0
- package/dist/languages/index.js +33 -0
- package/dist/languages/java.d.ts +43 -0
- package/dist/languages/java.js +404 -0
- package/dist/languages/php.d.ts +40 -0
- package/dist/languages/php.js +313 -0
- package/dist/languages/python.d.ts +40 -0
- package/dist/languages/python.js +270 -0
- package/dist/languages/ruby.d.ts +40 -0
- package/dist/languages/ruby.js +388 -0
- package/dist/languages/terraform.d.ts +48 -0
- package/dist/languages/terraform.js +244 -0
- package/dist/languages/typescript.d.ts +40 -0
- package/dist/languages/typescript.js +450 -0
- package/dist/markdown/index.d.ts +11 -0
- package/dist/markdown/index.js +80 -0
- package/dist/markdown/md.d.ts +15 -0
- package/dist/markdown/md.js +41 -0
- package/dist/markdown/printer.d.ts +13 -0
- package/dist/markdown/printer.js +76 -0
- package/dist/markdown/utils.d.ts +21 -0
- package/dist/markdown/utils.js +31 -0
- package/dist/routing.d.ts +61 -0
- package/dist/routing.js +176 -150
- package/dist/spec.d.ts +65 -0
- package/dist/spec.js +167 -0
- package/dist/style.d.ts +178 -0
- package/dist/style.js +179 -0
- package/dist/styles/main.css +784 -752
- package/dist/styles/main.js +0 -0
- package/dist/styles/primitives.css +408 -446
- package/dist/styles/primitives.js +0 -0
- package/dist/styles/resets.css +32 -41
- package/dist/styles/resets.js +0 -0
- package/dist/styles/search.css +192 -270
- package/dist/styles/search.js +0 -0
- package/dist/styles/sidebar.css +182 -69
- package/dist/styles/sidebar.js +0 -0
- package/dist/styles/variables.css +28 -89
- package/dist/styles/variables.js +0 -0
- package/dist/styles.css +3423 -0
- package/dist/styles.mjs +1 -0
- package/dist/use-strict-context-L0c8JKg4.js +16 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +54 -0
- package/package.json +74 -22
- package/dist/mcp.js +0 -16003
- package/dist/styles/snippets.css +0 -132
- package/src/components/breadcrumbs.tsx +0 -94
- package/src/components/chat.tsx +0 -154
- package/src/components/dropdown.tsx +0 -91
- package/src/components/icons.tsx +0 -584
- package/src/components/index.ts +0 -9
- package/src/components/method.tsx +0 -146
- package/src/components/overview.tsx +0 -160
- package/src/components/primitives.tsx +0 -284
- package/src/components/properties.tsx +0 -130
- package/src/components/scripts/dropdown.ts +0 -78
- package/src/components/sdk.tsx +0 -403
- package/src/components/sidebar.tsx +0 -99
- package/src/components/snippets.tsx +0 -180
- package/src/contexts/component-generics.tsx +0 -48
- package/src/contexts/component-types.tsx +0 -5
- package/src/contexts/component.tsx +0 -32
- package/src/contexts/docs.tsx +0 -75
- package/src/contexts/index.tsx +0 -17
- package/src/contexts/markdown.tsx +0 -43
- package/src/contexts/navigation.tsx +0 -44
- package/src/contexts/search.tsx +0 -28
- package/src/contexts/use-components.tsx +0 -4
- package/src/index.ts +0 -6
- package/src/languages/go.tsx +0 -281
- package/src/languages/http.tsx +0 -321
- package/src/languages/index.ts +0 -26
- package/src/languages/java.tsx +0 -358
- package/src/languages/python.tsx +0 -255
- package/src/languages/ruby.tsx +0 -320
- package/src/languages/typescript.tsx +0 -393
- package/src/markdown/index.ts +0 -107
- package/src/markdown/md.ts +0 -45
- package/src/markdown/utils.ts +0 -49
- package/src/routing.ts +0 -238
- package/src/search/form.tsx +0 -127
- package/src/search/index.tsx +0 -1
- package/src/search/indexer.ts +0 -246
- package/src/search/mcp.ts +0 -61
- package/src/search/printer.tsx +0 -86
- package/src/search/providers/algolia.ts +0 -88
- package/src/search/providers/fuse.ts +0 -19
- package/src/search/providers/pagefind.ts +0 -17
- package/src/search/providers/walker.ts +0 -30
- package/src/search/results.tsx +0 -182
- package/src/search/state.ts +0 -64
- package/src/search/types.ts +0 -116
- package/src/style.ts +0 -196
- package/src/styles/main.css +0 -986
- package/src/styles/primitives.css +0 -580
- package/src/styles/resets.css +0 -39
- package/src/styles/search.css +0 -341
- package/src/styles/sidebar.css +0 -85
- package/src/styles/snippets.css +0 -130
- package/src/styles/variables.css +0 -86
- package/src/utils.ts +0 -41
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Badge, Expander, Input, InputProps, Join, Link, ListView, ListViewProps, Markdown, ToggleButton, ToggleButtonProps, Tooltip, VirtualExpander } from "./primitives.js";
|
|
2
|
+
import { SDKBreadcrumbs, generateApiBreadcrumbs } from "./breadcrumbs.js";
|
|
3
|
+
import { Method, MethodDescription, MethodDescriptionProps, MethodHeader, MethodHeaderProps, MethodInfo, MethodInfoProps, MethodProps, MethodRoute, MethodRouteProps } from "./method.js";
|
|
4
|
+
import { Property, PropertyDescription, PropertyDescriptionProps, PropertyProps, PropertyTitle, PropertyTitleProps, PropertyToggle, PropertyToggleProps } from "./properties.js";
|
|
5
|
+
import { DeclarationParentsContextType, PropertyModelContext, PropertyModelContextType, ReferenceNestingContext, ReferenceNestingContextType, SDKChildren, SDKConstraints, SDKConstraintsProps, SDKDeclaration, SDKExample, SDKIcon, SDKLanguageBlock, SDKMethod, SDKMethodHeader, SDKMethodInfo, SDKMethodInfoContent, SDKMethodNotImplemented, SDKMethodProps, SDKModel, SDKModelProps, SDKReference, SDKRequestTitle, SDKRequestTitleProps, SDKSnippetLanguages, SDKSnippetLanguagesType, TransformRequestSnippetFn, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse } from "./sdk.js";
|
|
6
|
+
import { MultiSnippets, MultiSnippetsProps, Snippet, SnippetButtons, SnippetCode, SnippetCodeProps, SnippetContainer, SnippetContainerProps, SnippetFooter, SnippetProps, SnippetRequestContainer, SnippetRequestContainerProps, SnippetResponse } from "./snippets.js";
|
|
7
|
+
import { SDKMethodSummary, SDKMethodSummaryProps, SDKOverview, SDKOverviewProps, SDKResource, SDKResourceHeader, SDKResourceProps, SDKRoot, SDKRootProps } from "./overview.js";
|
|
8
|
+
import { SDKSidebar, SDKSidebarProps } from "./sdk-sidebar.js";
|
|
9
|
+
import { StlSidebar, StlSidebarEntry, StlSidebarGroup, StlSidebarLink, StlSidebarProps, StlSidebarTarget } from "./stl-sidebar.js";
|
|
10
|
+
|
|
11
|
+
//#region src/components/index.d.ts
|
|
12
|
+
declare namespace index_d_exports {
|
|
13
|
+
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 };
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
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, index_d_exports as t, useDeclarationParents, usePropertyModel, useReferenceNesting, useStreamingResponse };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
+
import "../use-strict-context-L0c8JKg4.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
|
+
|
|
13
|
+
//#region src/components/index.ts
|
|
14
|
+
var components_exports = /* @__PURE__ */ __exportAll({
|
|
15
|
+
Badge: () => Badge,
|
|
16
|
+
Expander: () => Expander,
|
|
17
|
+
Input: () => Input,
|
|
18
|
+
Join: () => Join,
|
|
19
|
+
Link: () => Link,
|
|
20
|
+
ListView: () => ListView,
|
|
21
|
+
Markdown: () => Markdown,
|
|
22
|
+
Method: () => Method,
|
|
23
|
+
MethodDescription: () => MethodDescription,
|
|
24
|
+
MethodHeader: () => MethodHeader,
|
|
25
|
+
MethodInfo: () => MethodInfo,
|
|
26
|
+
MethodRoute: () => MethodRoute,
|
|
27
|
+
MultiSnippets: () => MultiSnippets,
|
|
28
|
+
Property: () => Property,
|
|
29
|
+
PropertyDescription: () => PropertyDescription,
|
|
30
|
+
PropertyModelContext: () => PropertyModelContext,
|
|
31
|
+
PropertyTitle: () => PropertyTitle,
|
|
32
|
+
PropertyToggle: () => PropertyToggle,
|
|
33
|
+
ReferenceNestingContext: () => ReferenceNestingContext,
|
|
34
|
+
SDKBreadcrumbs: () => SDKBreadcrumbs,
|
|
35
|
+
SDKChildren: () => SDKChildren,
|
|
36
|
+
SDKConstraints: () => SDKConstraints,
|
|
37
|
+
SDKDeclaration: () => SDKDeclaration,
|
|
38
|
+
SDKExample: () => SDKExample,
|
|
39
|
+
SDKIcon: () => SDKIcon,
|
|
40
|
+
SDKLanguageBlock: () => SDKLanguageBlock,
|
|
41
|
+
SDKMethod: () => SDKMethod,
|
|
42
|
+
SDKMethodHeader: () => SDKMethodHeader,
|
|
43
|
+
SDKMethodInfo: () => SDKMethodInfo,
|
|
44
|
+
SDKMethodInfoContent: () => SDKMethodInfoContent,
|
|
45
|
+
SDKMethodNotImplemented: () => SDKMethodNotImplemented,
|
|
46
|
+
SDKMethodSummary: () => SDKMethodSummary,
|
|
47
|
+
SDKModel: () => SDKModel,
|
|
48
|
+
SDKOverview: () => SDKOverview,
|
|
49
|
+
SDKReference: () => SDKReference,
|
|
50
|
+
SDKRequestTitle: () => SDKRequestTitle,
|
|
51
|
+
SDKResource: () => SDKResource,
|
|
52
|
+
SDKResourceHeader: () => SDKResourceHeader,
|
|
53
|
+
SDKRoot: () => SDKRoot,
|
|
54
|
+
SDKSidebar: () => SDKSidebar,
|
|
55
|
+
SDKSnippetLanguages: () => SDKSnippetLanguages,
|
|
56
|
+
Snippet: () => Snippet,
|
|
57
|
+
SnippetButtons: () => SnippetButtons,
|
|
58
|
+
SnippetCode: () => SnippetCode,
|
|
59
|
+
SnippetContainer: () => SnippetContainer,
|
|
60
|
+
SnippetFooter: () => SnippetFooter,
|
|
61
|
+
SnippetRequestContainer: () => SnippetRequestContainer,
|
|
62
|
+
SnippetResponse: () => SnippetResponse,
|
|
63
|
+
StlSidebar: () => StlSidebar,
|
|
64
|
+
ToggleButton: () => ToggleButton,
|
|
65
|
+
Tooltip: () => Tooltip,
|
|
66
|
+
VirtualExpander: () => VirtualExpander,
|
|
67
|
+
generateApiBreadcrumbs: () => generateApiBreadcrumbs,
|
|
68
|
+
useDeclarationParents: () => useDeclarationParents,
|
|
69
|
+
usePropertyModel: () => usePropertyModel,
|
|
70
|
+
useReferenceNesting: () => useReferenceNesting,
|
|
71
|
+
useStreamingResponse: () => useStreamingResponse
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
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,59 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import * as react_jsx_runtime0 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_runtime0.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_runtime0.JSX.Element;
|
|
30
|
+
type MethodDescriptionProps = {
|
|
31
|
+
description?: string;
|
|
32
|
+
};
|
|
33
|
+
declare function MethodDescription({
|
|
34
|
+
description
|
|
35
|
+
}: MethodDescriptionProps): react_jsx_runtime0.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_runtime0.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_runtime0.JSX.Element;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { Method, MethodDescription, MethodDescriptionProps, MethodHeader, MethodHeaderProps, MethodInfo, MethodInfoProps, MethodProps, MethodRoute, MethodRouteProps };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import "../use-strict-context-L0c8JKg4.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
|
+
|
|
11
|
+
//#region src/components/method.tsx
|
|
12
|
+
function MethodHeader({ title, badges, signature, children, level }) {
|
|
13
|
+
const Heading = level ?? "h5";
|
|
14
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
15
|
+
className: style_default.MethodHeader,
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Heading, {
|
|
18
|
+
className: style_default.MethodTitle,
|
|
19
|
+
children: title
|
|
20
|
+
}),
|
|
21
|
+
badges && /* @__PURE__ */ jsx("div", {
|
|
22
|
+
className: style_default.MethodBadges,
|
|
23
|
+
children: badges
|
|
24
|
+
}),
|
|
25
|
+
signature,
|
|
26
|
+
children
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function MethodRoute({ httpMethod, endpoint, iconOnly }) {
|
|
31
|
+
const httpMethodTyped = getHttpMethod(httpMethod);
|
|
32
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: style_default.MethodRoute,
|
|
34
|
+
children: [httpMethod ? httpMethodTyped && /* @__PURE__ */ jsx(Badge.HTTP, {
|
|
35
|
+
method: httpMethodTyped,
|
|
36
|
+
iconOnly,
|
|
37
|
+
size: "sm"
|
|
38
|
+
}) : /* @__PURE__ */ jsx(Badge, {
|
|
39
|
+
size: "sm",
|
|
40
|
+
icon: /* @__PURE__ */ jsx(FunctionIcon, {}),
|
|
41
|
+
intent: "info",
|
|
42
|
+
children: !iconOnly && "Function"
|
|
43
|
+
}), endpoint && /* @__PURE__ */ jsx("span", {
|
|
44
|
+
className: style_default.MethodRouteEndpoint,
|
|
45
|
+
children: endpoint
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function MethodDescription({ description }) {
|
|
50
|
+
const { Markdown } = useComponents();
|
|
51
|
+
if (description) return /* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: style_default.MethodDescription,
|
|
53
|
+
children: /* @__PURE__ */ jsx(Markdown, { content: description })
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function MethodInfo({ children, parameters, returns }) {
|
|
57
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
58
|
+
className: style_default.MethodInfo,
|
|
59
|
+
children: [
|
|
60
|
+
children && /* @__PURE__ */ jsx("div", {
|
|
61
|
+
className: style_default.MethodContent,
|
|
62
|
+
children
|
|
63
|
+
}),
|
|
64
|
+
parameters && /* @__PURE__ */ jsxs("div", {
|
|
65
|
+
className: style_default.MethodInfoSection,
|
|
66
|
+
children: [/* @__PURE__ */ jsxs("h5", { children: ["Parameters", /* @__PURE__ */ jsx(PropertyToggle, { target: "parameters" })] }), /* @__PURE__ */ jsx("div", {
|
|
67
|
+
className: style_default.MethodParameters,
|
|
68
|
+
"data-stldocs-property-group": "parameters",
|
|
69
|
+
children: parameters
|
|
70
|
+
})]
|
|
71
|
+
}),
|
|
72
|
+
returns && /* @__PURE__ */ jsxs("div", {
|
|
73
|
+
className: style_default.MethodInfoSection,
|
|
74
|
+
children: [/* @__PURE__ */ jsxs("h5", { children: ["Returns", /* @__PURE__ */ jsx(PropertyToggle, { target: "returns" })] }), /* @__PURE__ */ jsx("div", {
|
|
75
|
+
className: style_default.MethodReturns,
|
|
76
|
+
"data-stldocs-property-group": "returns",
|
|
77
|
+
children: returns
|
|
78
|
+
})]
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function Method({ id, header, children, className, ...props }) {
|
|
84
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
85
|
+
id,
|
|
86
|
+
className: clsx(style_default.Method, className),
|
|
87
|
+
tabIndex: 0,
|
|
88
|
+
...props,
|
|
89
|
+
children: [header, /* @__PURE__ */ jsx("div", {
|
|
90
|
+
className: style_default.MethodBody,
|
|
91
|
+
children
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
export { Method, MethodDescription, MethodHeader, MethodInfo, MethodRoute };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { d as Method, h as Resource } from "../index-pvh-w1xa.js";
|
|
2
|
+
import * as react_jsx_runtime0 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_runtime0.JSX.Element | null;
|
|
13
|
+
type SDKMethodSummaryProps = {
|
|
14
|
+
method: Method;
|
|
15
|
+
};
|
|
16
|
+
declare function SDKMethodSummary({
|
|
17
|
+
method
|
|
18
|
+
}: SDKMethodSummaryProps): react_jsx_runtime0.JSX.Element;
|
|
19
|
+
declare function SDKResource({
|
|
20
|
+
resource,
|
|
21
|
+
parents,
|
|
22
|
+
showModels
|
|
23
|
+
}: SDKResourceProps & {
|
|
24
|
+
showModels?: boolean;
|
|
25
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
26
|
+
type SDKOverviewProps = {
|
|
27
|
+
resource: Resource;
|
|
28
|
+
};
|
|
29
|
+
declare function SDKOverview({
|
|
30
|
+
resource
|
|
31
|
+
}: SDKOverviewProps): react_jsx_runtime0.JSX.Element;
|
|
32
|
+
type SDKRootProps = {
|
|
33
|
+
stainlessPath: string;
|
|
34
|
+
};
|
|
35
|
+
declare function SDKRoot({
|
|
36
|
+
stainlessPath
|
|
37
|
+
}: SDKRootProps): react_jsx_runtime0.JSX.Element | null;
|
|
38
|
+
//#endregion
|
|
39
|
+
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 "../use-strict-context-L0c8JKg4.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
|
+
|
|
14
|
+
//#region src/components/overview.tsx
|
|
15
|
+
function SDKResourceHeader({ resource, parents }) {
|
|
16
|
+
const segments = parents?.map((parent, index) => /* @__PURE__ */ jsxs("span", {
|
|
17
|
+
className: style_default.ResourceTitleSegment,
|
|
18
|
+
children: [parent.title, index < parents.length && /* @__PURE__ */ jsx(ChevronRight, {
|
|
19
|
+
size: 16,
|
|
20
|
+
className: style_default.Icon
|
|
21
|
+
})]
|
|
22
|
+
}, parent.stainlessPath));
|
|
23
|
+
if (!segments && !resource.description) return null;
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
25
|
+
className: style_default.ResourceHeader,
|
|
26
|
+
children: [segments && /* @__PURE__ */ jsxs("h4", {
|
|
27
|
+
id: resource.stainlessPath,
|
|
28
|
+
className: style_default.ResourceTitle,
|
|
29
|
+
children: [segments, /* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: style_default.ResourceTitleSegment,
|
|
31
|
+
children: resource.title
|
|
32
|
+
})]
|
|
33
|
+
}), resource.description && /* @__PURE__ */ jsx("div", {
|
|
34
|
+
className: style_default.ResourceDescription,
|
|
35
|
+
children: /* @__PURE__ */ jsx(Markdown, { content: resource.description })
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function SDKMethodSummary({ method }) {
|
|
40
|
+
const Docs = useComponents();
|
|
41
|
+
const Lang = useLanguageComponents();
|
|
42
|
+
const decl = useDeclaration(method.stainlessPath, true);
|
|
43
|
+
return /* @__PURE__ */ jsx(Docs.MethodHeader, {
|
|
44
|
+
level: "h5",
|
|
45
|
+
title: /* @__PURE__ */ jsx(Docs.Link, {
|
|
46
|
+
stainlessPath: method.stainlessPath,
|
|
47
|
+
children: method.summary || method.title
|
|
48
|
+
}),
|
|
49
|
+
signature: /* @__PURE__ */ jsx(Lang.MethodSignature, { decl }),
|
|
50
|
+
badges: method.deprecated && /* @__PURE__ */ jsx(Docs.Badge, {
|
|
51
|
+
id: "deprecated",
|
|
52
|
+
children: "Deprecated"
|
|
53
|
+
}),
|
|
54
|
+
children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
|
|
55
|
+
httpMethod: method.httpMethod,
|
|
56
|
+
endpoint: method.endpoint.split(" ", 2).at(-1)
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function SDKResource({ resource, parents, showModels }) {
|
|
61
|
+
const Docs = useComponents();
|
|
62
|
+
const Lang = useLanguageComponents();
|
|
63
|
+
const language = useLanguage();
|
|
64
|
+
const spec = useSpec();
|
|
65
|
+
const methods = Object.values(resource.methods).filter((method) => spec?.decls?.[language]?.[method.stainlessPath]);
|
|
66
|
+
const models = Object.values(resource.models).filter((model) => spec?.decls?.[language]?.[`${model.stainlessPath} > (schema)`]);
|
|
67
|
+
return /* @__PURE__ */ jsx("div", {
|
|
68
|
+
className: style_default.Resource,
|
|
69
|
+
"data-stl-resource-language": language,
|
|
70
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
71
|
+
className: style_default.ResourceContent,
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ jsx(Docs.SDKResourceHeader, {
|
|
74
|
+
resource,
|
|
75
|
+
parents
|
|
76
|
+
}),
|
|
77
|
+
Lang.Resource && /* @__PURE__ */ jsx(Lang.Resource, { resource }),
|
|
78
|
+
methods.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
79
|
+
className: style_default.ResourceContentGroup,
|
|
80
|
+
children: methods.map((method) => /* @__PURE__ */ jsx("div", {
|
|
81
|
+
className: style_default.MethodSummary,
|
|
82
|
+
children: /* @__PURE__ */ jsx(Docs.SDKMethodSummary, { method })
|
|
83
|
+
}, method.stainlessPath))
|
|
84
|
+
}),
|
|
85
|
+
showModels !== false && models.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
86
|
+
className: style_default.ResourceContentGroup,
|
|
87
|
+
"data-stldocs-property-group": "models",
|
|
88
|
+
children: [/* @__PURE__ */ jsxs("h5", {
|
|
89
|
+
className: style_default.ResourceContentGroupModelTitle,
|
|
90
|
+
children: ["Models", /* @__PURE__ */ jsx(PropertyToggle, { target: "models" })]
|
|
91
|
+
}), models.map((model) => /* @__PURE__ */ jsx(Docs.SDKModel, { model }, model.stainlessPath))]
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function SDKOverview({ resource }) {
|
|
98
|
+
const { SDKResource } = useComponents();
|
|
99
|
+
const nested = React$1.useMemo(() => flatResources(resource.subresources, [resource]), [resource]);
|
|
100
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
101
|
+
className: style_default.Overview,
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ jsx("div", {
|
|
104
|
+
className: style_default.OverviewHeader,
|
|
105
|
+
children: /* @__PURE__ */ jsx("h1", { children: resource.title })
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ jsx(SDKResource, { resource }),
|
|
108
|
+
nested.map((props, index) => /* @__PURE__ */ jsx(SDKResource, { ...props }, index))
|
|
109
|
+
]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function SDKRoot({ stainlessPath }) {
|
|
113
|
+
const spec = useSpec();
|
|
114
|
+
const Docs = useComponents();
|
|
115
|
+
const parsed = parseStainlessPath(stainlessPath);
|
|
116
|
+
const resource = spec && getResourceFromSpec(stainlessPath, spec);
|
|
117
|
+
if (!resource || !parsed) {
|
|
118
|
+
console.warn(`Could not find resource or parsed path for '${stainlessPath}'`);
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
if (parsed.method) {
|
|
122
|
+
const method = resource.methods[parsed.method];
|
|
123
|
+
if (!method) {
|
|
124
|
+
console.warn(`Method '${parsed.method}' not found in resource '${resource.stainlessPath}'`);
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
return /* @__PURE__ */ jsx("div", {
|
|
128
|
+
className: style_default.Root,
|
|
129
|
+
children: /* @__PURE__ */ jsx(Docs.SDKMethod, { method })
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return /* @__PURE__ */ jsx("div", {
|
|
133
|
+
className: style_default.Root,
|
|
134
|
+
children: /* @__PURE__ */ jsx(Docs.SDKOverview, { resource })
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
//#endregion
|
|
139
|
+
export { SDKMethodSummary, SDKOverview, SDKResource, SDKResourceHeader, SDKRoot };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/primitives.d.ts
|
|
6
|
+
type JoinProps = {
|
|
7
|
+
items: ReactNode[];
|
|
8
|
+
limit?: number;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
declare function Join({
|
|
12
|
+
items,
|
|
13
|
+
limit,
|
|
14
|
+
children
|
|
15
|
+
}: JoinProps): react_jsx_runtime0.JSX.Element[];
|
|
16
|
+
type ExpanderProps = {
|
|
17
|
+
id?: string;
|
|
18
|
+
open?: boolean;
|
|
19
|
+
summary: ReactNode;
|
|
20
|
+
virtual?: boolean;
|
|
21
|
+
muted?: boolean;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
};
|
|
24
|
+
declare function Expander({
|
|
25
|
+
id,
|
|
26
|
+
open,
|
|
27
|
+
summary,
|
|
28
|
+
virtual,
|
|
29
|
+
muted,
|
|
30
|
+
children
|
|
31
|
+
}: ExpanderProps): react_jsx_runtime0.JSX.Element;
|
|
32
|
+
declare function VirtualExpander({
|
|
33
|
+
id,
|
|
34
|
+
open: isOpen,
|
|
35
|
+
muted,
|
|
36
|
+
summary,
|
|
37
|
+
children
|
|
38
|
+
}: Omit<ExpanderProps, 'virtual'>): react_jsx_runtime0.JSX.Element;
|
|
39
|
+
declare function Markdown({
|
|
40
|
+
content,
|
|
41
|
+
style: cssStyle
|
|
42
|
+
}: {
|
|
43
|
+
content: string;
|
|
44
|
+
style?: React.CSSProperties;
|
|
45
|
+
}): "" | react_jsx_runtime0.JSX.Element | undefined;
|
|
46
|
+
type BadgeProps = {
|
|
47
|
+
id: string;
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
};
|
|
50
|
+
declare function Badge({
|
|
51
|
+
id,
|
|
52
|
+
children
|
|
53
|
+
}: BadgeProps): react_jsx_runtime0.JSX.Element;
|
|
54
|
+
type TooltipProps = {
|
|
55
|
+
content: ReactNode;
|
|
56
|
+
children: ReactNode;
|
|
57
|
+
};
|
|
58
|
+
declare function Tooltip({
|
|
59
|
+
content,
|
|
60
|
+
children
|
|
61
|
+
}: TooltipProps): string | number | bigint | boolean | react_jsx_runtime0.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
62
|
+
type LinkProps = {
|
|
63
|
+
stainlessPath?: string;
|
|
64
|
+
scroll?: boolean;
|
|
65
|
+
children?: ReactNode;
|
|
66
|
+
} & React.HTMLProps<HTMLAnchorElement>;
|
|
67
|
+
declare function Link({
|
|
68
|
+
stainlessPath,
|
|
69
|
+
scroll,
|
|
70
|
+
children,
|
|
71
|
+
...props
|
|
72
|
+
}: LinkProps): string | number | bigint | boolean | react_jsx_runtime0.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
73
|
+
type InputProps = {
|
|
74
|
+
left?: ReactNode;
|
|
75
|
+
right?: ReactNode;
|
|
76
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
77
|
+
} & React.InputHTMLAttributes<HTMLInputElement>;
|
|
78
|
+
declare function Input({
|
|
79
|
+
left,
|
|
80
|
+
right,
|
|
81
|
+
ref,
|
|
82
|
+
className,
|
|
83
|
+
...props
|
|
84
|
+
}: InputProps): react_jsx_runtime0.JSX.Element;
|
|
85
|
+
type ToggleButtonProps = {
|
|
86
|
+
children?: ReactNode;
|
|
87
|
+
selected?: boolean;
|
|
88
|
+
} & React.ComponentProps<'button'>;
|
|
89
|
+
declare function ToggleButton({
|
|
90
|
+
children,
|
|
91
|
+
selected,
|
|
92
|
+
ref,
|
|
93
|
+
...props
|
|
94
|
+
}: ToggleButtonProps): react_jsx_runtime0.JSX.Element;
|
|
95
|
+
type ListViewProps<TItem> = {
|
|
96
|
+
items: Array<TItem>;
|
|
97
|
+
itemDelegate: (item: TItem, selected: boolean) => React.ReactNode;
|
|
98
|
+
onSelectListItem?: (item: TItem) => void;
|
|
99
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
100
|
+
declare function ListView<TItem>({
|
|
101
|
+
items,
|
|
102
|
+
itemDelegate,
|
|
103
|
+
onSelectListItem,
|
|
104
|
+
...rest
|
|
105
|
+
}: ListViewProps<TItem>): react_jsx_runtime0.JSX.Element;
|
|
106
|
+
//#endregion
|
|
107
|
+
export { Badge, Expander, Input, InputProps, Join, Link, ListView, ListViewProps, Markdown, ToggleButton, ToggleButtonProps, Tooltip, VirtualExpander };
|