@stainless-api/docs-ui 0.1.0-beta.71 → 0.1.0-beta.73

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 (137) hide show
  1. package/dist/{breadcrumbs-Cvm5Ifm7.d.ts → breadcrumbs-Dei_5sHd.d.ts} +3 -3
  2. package/dist/{breadcrumbs-DA4WgDhR.js → breadcrumbs-oUp-6oJK.js} +3 -3
  3. package/dist/{cli-DhMMZoiU.js → cli-BX9ofVCR.js} +3 -3
  4. package/dist/{component-Drp93QK-.js → component-Dl5ZEHxB.js} +2 -2
  5. package/dist/{component-generics-t_S0Wc9i.d.ts → component-generics-C9ALAcZI.d.ts} +2 -2
  6. package/dist/components/MaskedInput.d.ts +3 -3
  7. package/dist/components/MaskedInput.js +1 -1
  8. package/dist/components/breadcrumbs.d.ts +1 -1
  9. package/dist/components/breadcrumbs.js +5 -5
  10. package/dist/components/icons.d.ts +12 -12
  11. package/dist/components/index.d.ts +14 -11
  12. package/dist/components/index.js +14 -14
  13. package/dist/components/method.d.ts +1 -1
  14. package/dist/components/method.js +5 -5
  15. package/dist/components/overview.d.ts +1 -1
  16. package/dist/components/overview.js +6 -6
  17. package/dist/components/primitives.d.ts +1 -1
  18. package/dist/components/primitives.js +4 -4
  19. package/dist/components/properties.d.ts +1 -1
  20. package/dist/components/properties.js +4 -4
  21. package/dist/components/sdk-sidebar.d.ts +1 -1
  22. package/dist/components/sdk-sidebar.js +5 -5
  23. package/dist/components/sdk.d.ts +1 -1
  24. package/dist/components/sdk.js +4 -4
  25. package/dist/components/snippets.d.ts +14 -3
  26. package/dist/components/snippets.js +5 -5
  27. package/dist/components/stl-sidebar.d.ts +1 -1
  28. package/dist/components/stl-sidebar.js +1 -1
  29. package/dist/{components-BbJAAdUU.js → components-DQPlXEwE.js} +10 -9
  30. package/dist/contexts/component-generics.d.ts +1 -1
  31. package/dist/contexts/component-types.d.ts +13 -11
  32. package/dist/contexts/component.d.ts +15 -14
  33. package/dist/contexts/component.js +24 -24
  34. package/dist/contexts/docs.d.ts +2 -2
  35. package/dist/contexts/docs.js +2 -2
  36. package/dist/contexts/index.d.ts +14 -23
  37. package/dist/contexts/index.js +4 -4
  38. package/dist/contexts/markdown.d.ts +1 -1
  39. package/dist/contexts/markdown.js +2 -2
  40. package/dist/contexts/navigation.d.ts +1 -1
  41. package/dist/contexts/use-components.d.ts +13 -10
  42. package/dist/{contexts-CVj20VV4.js → contexts-_NNW5yqC.js} +5 -2
  43. package/dist/{csharp-D6_jlynY.js → csharp-sn5CJu9t.js} +2 -2
  44. package/dist/docs-YgoQ3bzY.js +81 -0
  45. package/dist/{docs-CceV-0oK.d.ts → docs-x-kfjRMc.d.ts} +24 -6
  46. package/dist/{go-COaHV3Hc.js → go-BoaAVmP0.js} +2 -2
  47. package/dist/{http-DVyJ-D6t.js → http-Ccj1dOvE.js} +7 -7
  48. package/dist/{index-CwjGm9zX.d.ts → index-HDt5wRiR.d.ts} +47 -32
  49. package/dist/index-OCM-LZIo.d.ts +428 -0
  50. package/dist/index.d.ts +14 -17
  51. package/dist/index.js +26 -26
  52. package/dist/{java-CxGSJVvv.js → java-BiLRuLuD.js} +3 -3
  53. package/dist/languages/cli.d.ts +13 -11
  54. package/dist/languages/cli.js +15 -15
  55. package/dist/languages/csharp.d.ts +13 -11
  56. package/dist/languages/csharp.js +4 -4
  57. package/dist/languages/go.d.ts +13 -11
  58. package/dist/languages/go.js +4 -4
  59. package/dist/languages/http.d.ts +13 -11
  60. package/dist/languages/http.js +14 -14
  61. package/dist/languages/index.d.ts +13 -11
  62. package/dist/languages/index.js +23 -23
  63. package/dist/languages/java.d.ts +13 -11
  64. package/dist/languages/java.js +4 -4
  65. package/dist/languages/python.d.ts +13 -11
  66. package/dist/languages/python.js +4 -4
  67. package/dist/languages/ruby.d.ts +13 -11
  68. package/dist/languages/ruby.js +4 -4
  69. package/dist/languages/terraform.d.ts +13 -11
  70. package/dist/languages/terraform.js +4 -4
  71. package/dist/languages/typescript.d.ts +13 -11
  72. package/dist/languages/typescript.js +4 -4
  73. package/dist/languages-COjc0Nwx.js +30 -0
  74. package/dist/markdown/index.d.ts +2 -2
  75. package/dist/markdown/index.js +24 -24
  76. package/dist/markdown/printer.d.ts +2 -2
  77. package/dist/markdown/printer.js +25 -25
  78. package/dist/markdown/utils.d.ts +4 -4
  79. package/dist/markdown/utils.js +3 -3
  80. package/dist/{markdown-HJXGh2Yn.d.ts → markdown-BszOPZhh.d.ts} +2 -2
  81. package/dist/{markdown-CTKHMLVr.js → markdown-Cq3XEhrR.js} +1 -1
  82. package/dist/{method-iAV6cZjF.js → method-DjzVBzZe.js} +2 -2
  83. package/dist/{method-DPnfsySL.d.ts → method-KkWyhvKa.d.ts} +6 -6
  84. package/dist/{navigation-QXH2ufM3.d.ts → navigation-BZjwfN2P.d.ts} +3 -3
  85. package/dist/{overview-BR3WhCoz.d.ts → overview-BNmMeDUE.d.ts} +7 -7
  86. package/dist/{overview-DQIrvYJr.js → overview-Clq5psZe.js} +7 -7
  87. package/dist/{primitives-D0h4FgbU.d.ts → primitives-B8OnSXRP.d.ts} +11 -11
  88. package/dist/{primitives-DJEqe_r1.js → primitives-BBUs_flm.js} +4 -4
  89. package/dist/{properties-CjUi1Cjx.d.ts → properties-BhlRtWo4.d.ts} +5 -5
  90. package/dist/{properties-PNuJPLqP.js → properties-DQU0NBzb.js} +2 -2
  91. package/dist/{python-DsTuWCKE.js → python-nqOBH7GS.js} +2 -2
  92. package/dist/{routing-C64k4fmX.js → routing-GvhEMw6E.js} +1 -1
  93. package/dist/{routing-utiR5mY3.d.ts → routing-qJMPICGo.d.ts} +2 -2
  94. package/dist/routing.d.ts +1 -1
  95. package/dist/routing.js +1 -1
  96. package/dist/{ruby-BncKp6hd.js → ruby-BBc8HdIt.js} +3 -3
  97. package/dist/{sdk-D3U444dU.d.ts → sdk-C8C6IRQp.d.ts} +17 -17
  98. package/dist/{sdk-Bw99eXxA.js → sdk-DzCHhEoX.js} +14 -8
  99. package/dist/{sdk-sidebar-V_MTkVw8.js → sdk-sidebar-CkjSLggl.js} +2 -2
  100. package/dist/{sdk-sidebar-f7SS4xxq.d.ts → sdk-sidebar-lgNmf-ns.d.ts} +3 -3
  101. package/dist/snippets-CLpNVNlA.js +181 -0
  102. package/dist/spec.d.ts +4 -4
  103. package/dist/spec.js +3 -3
  104. package/dist/{stl-sidebar-CItXFC3n.d.ts → stl-sidebar-8jF9cdnn.d.ts} +2 -2
  105. package/dist/{stl-sidebar-WtimNrk1.js → stl-sidebar-DC5UOJiT.js} +1 -1
  106. package/dist/{style-HpXpcJ9v.js → style-DJIYkFhO.js} +6 -0
  107. package/dist/style.d.ts +6 -0
  108. package/dist/style.js +1 -1
  109. package/dist/styles/main.css +53 -14
  110. package/dist/styles.css +53 -14
  111. package/dist/{terraform-B95X4rNK.js → terraform-DVx2ea2h.js} +3 -3
  112. package/dist/{typescript-n46M9OtL.js → typescript-Cmk-jBBw.js} +3 -3
  113. package/dist/{utils-DPbkW1Tz.js → utils-D6zJxUZ9.js} +1 -1
  114. package/dist/utils.d.ts +1 -1
  115. package/dist/utils.js +1 -1
  116. package/package.json +2 -2
  117. package/dist/breadcrumbs-7G1MoVzo.d.ts +0 -25
  118. package/dist/component-generics-5cSjFCLn.d.ts +0 -30
  119. package/dist/docs---kdT2w-.d.ts +0 -48
  120. package/dist/docs-BmOB2f-I.js +0 -61
  121. package/dist/index-Bc1tYWPC.d.ts +0 -347
  122. package/dist/index-Cuw1pZs8.d.ts +0 -16
  123. package/dist/index-DIchpgQZ.d.ts +0 -16
  124. package/dist/index-DSeLOs29.d.ts +0 -347
  125. package/dist/languages-C8iNdbjN.js +0 -30
  126. package/dist/markdown-Cdh0TSHp.d.ts +0 -22
  127. package/dist/method-R97dH39J.d.ts +0 -59
  128. package/dist/navigation-dh0gX_lm.d.ts +0 -29
  129. package/dist/overview-Ddh84S6_.d.ts +0 -39
  130. package/dist/primitives-xbTKYFgQ.d.ts +0 -105
  131. package/dist/properties-q3XaAaRo.d.ts +0 -54
  132. package/dist/sdk-CSKStkB5.d.ts +0 -122
  133. package/dist/sdk-sidebar-Cf04O8rR.d.ts +0 -15
  134. package/dist/snippets-BehbU3rt.js +0 -164
  135. package/dist/snippets-CMtWGDSE.d.ts +0 -53
  136. package/dist/snippets-DZAozdda.d.ts +0 -53
  137. package/dist/stl-sidebar-DpnXVa_V.d.ts +0 -58
@@ -0,0 +1,181 @@
1
+ import { d as useSnippetIds, f as useSnippetResponse, i as useDeclaration, s as useLanguage, u as useSnippet } from "./docs-YgoQ3bzY.js";
2
+ import { r as useHighlight } from "./markdown-Cq3XEhrR.js";
3
+ import { t as useComponents } from "./use-components-BUz3GbO4.js";
4
+ import { t as style_default } from "./style-DJIYkFhO.js";
5
+ import * as React$1 from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import clsx from "clsx";
8
+ import { CheckIcon, CircleAlertIcon, CopyIcon } from "lucide-react";
9
+ import { Badge, Button, getHttpMethod } from "@stainless-api/ui-primitives";
10
+
11
+ //#region src/components/snippets.tsx
12
+ function SnippetCode({ content, language }) {
13
+ const lang = useLanguage();
14
+ const highlighted = useHighlight(content, language || lang);
15
+ return /* @__PURE__ */ jsx("div", {
16
+ className: style_default.SnippetCode,
17
+ "data-stldocs-copy-content": true,
18
+ dangerouslySetInnerHTML: { __html: highlighted }
19
+ });
20
+ }
21
+ function SnippetContainer({ children, className, ...props }) {
22
+ return /* @__PURE__ */ jsx("div", {
23
+ className: clsx(style_default.Snippet, className),
24
+ ...props,
25
+ children
26
+ });
27
+ }
28
+ function SnippetRequestContainer({ children }) {
29
+ return /* @__PURE__ */ jsx("div", { children });
30
+ }
31
+ function Snippet({ requestTitle, method, snippet, transformRequestSnippet }) {
32
+ const Docs = useComponents();
33
+ const language = useLanguage();
34
+ const originalSnippetContent = useSnippet(method.stainlessPath, void 0, snippet);
35
+ const snippetResponses = useSnippetResponse(method.stainlessPath, snippet);
36
+ const decl = useDeclaration(method.stainlessPath, false);
37
+ const signature = decl && "qualified" in decl ? decl.qualified : void 0;
38
+ if (!originalSnippetContent) {
39
+ console.warn(`Snippet not found for method '${method.stainlessPath}'`);
40
+ return null;
41
+ }
42
+ const snippetContent = transformRequestSnippet ? transformRequestSnippet({
43
+ snippet: originalSnippetContent,
44
+ language
45
+ }) : originalSnippetContent;
46
+ const httpMethod = getHttpMethod(method.httpMethod);
47
+ return /* @__PURE__ */ jsxs(Docs.SnippetContainer, {
48
+ signature,
49
+ method,
50
+ children: [snippetContent && /* @__PURE__ */ jsx(Docs.SnippetRequestContainer, {
51
+ signature,
52
+ children: /* @__PURE__ */ jsxs("div", {
53
+ className: style_default.SnippetRequest,
54
+ "data-stldocs-copy-parent": true,
55
+ children: [
56
+ /* @__PURE__ */ jsxs("div", {
57
+ className: style_default.SnippetRequestTitle,
58
+ children: [
59
+ /* @__PURE__ */ jsxs("div", {
60
+ className: style_default.SnippetRequestTitleMethod,
61
+ children: [httpMethod && /* @__PURE__ */ jsx(Badge.HTTP, {
62
+ method: httpMethod,
63
+ iconOnly: true
64
+ }), /* @__PURE__ */ jsx("h3", { children: method.summary || method.title })]
65
+ }),
66
+ /* @__PURE__ */ jsx("div", {
67
+ className: style_default.SnippetRequestTitleContent,
68
+ children: requestTitle
69
+ }),
70
+ /* @__PURE__ */ jsx(Docs.SnippetButtons, { content: snippetContent })
71
+ ]
72
+ }),
73
+ /* @__PURE__ */ jsx(Docs.SnippetCode, {
74
+ content: snippetContent,
75
+ signature
76
+ }),
77
+ /* @__PURE__ */ jsx(Docs.SnippetFooter, {})
78
+ ]
79
+ })
80
+ }), /* @__PURE__ */ jsx(Docs.SnippetResponse, { responses: snippetResponses })]
81
+ });
82
+ }
83
+ function MultiSnippets({ requestTitle, method }) {
84
+ const snippetIds = useSnippetIds(method.stainlessPath)?.filter((id) => id !== "default");
85
+ const radioId = React$1.useId();
86
+ if (!snippetIds) return null;
87
+ return /* @__PURE__ */ jsxs("div", {
88
+ className: style_default.SnippetMulti,
89
+ "data-stldocs-multi-snippet-container": true,
90
+ children: [/* @__PURE__ */ jsx("div", {
91
+ className: style_default.SnippetMultiTabs,
92
+ "data-stldocs-multi-snippet-tabs": true,
93
+ children: snippetIds.map((snid, idx) => /* @__PURE__ */ jsxs("label", {
94
+ className: style_default.SnippetMultiTab,
95
+ children: [/* @__PURE__ */ jsx("input", {
96
+ type: "radio",
97
+ name: `snippet-example-radio-${radioId}`,
98
+ value: idx,
99
+ defaultChecked: idx === 0
100
+ }), /* @__PURE__ */ jsx("span", { children: snid.slice(7) })]
101
+ }, `snippet-example-${idx}`))
102
+ }), /* @__PURE__ */ jsx("div", {
103
+ className: style_default.SnippetMultiContent,
104
+ children: snippetIds.map((snid, idx) => {
105
+ return /* @__PURE__ */ jsx("div", {
106
+ className: clsx(style_default.SnippetMultiPane, idx === 0 && style_default.SnippetMultiPaneActive),
107
+ "data-stldocs-multi-snippet-id": idx,
108
+ children: /* @__PURE__ */ jsx(Snippet, {
109
+ method,
110
+ snippet: snid,
111
+ requestTitle
112
+ })
113
+ }, `snippet-example-content-${idx}`);
114
+ })
115
+ })]
116
+ });
117
+ }
118
+ function SnippetButtons({ content }) {
119
+ const [CopyButtonIcon, setCopyIcon] = React$1.useState(CopyIcon);
120
+ async function handleCopy() {
121
+ try {
122
+ await navigator.clipboard.writeText(content);
123
+ setCopyIcon(CheckIcon);
124
+ } catch {
125
+ setCopyIcon(CircleAlertIcon);
126
+ }
127
+ setTimeout(() => setCopyIcon(CopyIcon), 1e3);
128
+ }
129
+ return /* @__PURE__ */ jsx(Button, {
130
+ variant: "outline",
131
+ "data-stldocs-snippet-copy": true,
132
+ children: /* @__PURE__ */ jsx(CopyButtonIcon, {
133
+ size: 16,
134
+ className: style_default.Icon,
135
+ onClick: handleCopy
136
+ })
137
+ });
138
+ }
139
+ function SnippetFooter() {
140
+ return null;
141
+ }
142
+ function SnippetResponse({ responses }) {
143
+ const Docs = useComponents();
144
+ if (!responses || responses.length === 0) return null;
145
+ const tabs = responses.map(({ status }, index) => ({
146
+ status,
147
+ index,
148
+ label: status ? `${status} example` : null
149
+ }));
150
+ const hasTabs = tabs.length > 1 || tabs.some((tab) => tab.label);
151
+ return /* @__PURE__ */ jsx("div", {
152
+ className: style_default.SnippetMultiResponse,
153
+ children: /* @__PURE__ */ jsxs("div", {
154
+ className: clsx(style_default.Snippet),
155
+ children: [hasTabs && /* @__PURE__ */ jsx("div", {
156
+ className: clsx(style_default.SnippetResponseTab, tabs.length === 1 && style_default.SnippetResponseTabSingleReturn),
157
+ children: tabs.map(({ status, label }, index) => /* @__PURE__ */ jsx("div", {
158
+ "data-snippet-response-tab-id": `snippet-response-tab-${status}-${index}`,
159
+ className: clsx(style_default.SnippetResponseTabItem, index === 0 && style_default.SnippetResponseTabItemActive),
160
+ children: /* @__PURE__ */ jsx(Button, {
161
+ disabled: responses.length === 1,
162
+ variant: "ghost",
163
+ children: label ?? `Example ${index + 1}`
164
+ })
165
+ }, `snippet-response-tab-item-${status}-${index}`))
166
+ }), responses.map(({ status, content, contentType }, index) => {
167
+ return typeof content === "string" ? /* @__PURE__ */ jsx("div", {
168
+ className: clsx(style_default.SnippetResponsePane, index === 0 && style_default.SnippetResponsePaneActive),
169
+ "data-snippet-response-pane-id": `snippet-response-tab-${status}-${index}`,
170
+ children: /* @__PURE__ */ jsx(Docs.SnippetCode, {
171
+ content,
172
+ language: contentType === "application/json" || !contentType ? "json" : "none"
173
+ })
174
+ }, `snippet-response-${status}-${index}`) : null;
175
+ })]
176
+ })
177
+ });
178
+ }
179
+
180
+ //#endregion
181
+ export { SnippetContainer as a, SnippetResponse as c, SnippetCode as i, Snippet as n, SnippetFooter as o, SnippetButtons as r, SnippetRequestContainer as s, MultiSnippets as t };
package/dist/spec.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as Spec, d as Method, f as Model, i as DeclarationNode, m as Resource, v as SpecLanguage } from "./index-CwjGm9zX.js";
2
- import { t as DocsLanguage } from "./routing-utiR5mY3.js";
1
+ import { _ as Spec, d as Method, f as Model, i as DeclarationNode, m as Resource, v as SpecLanguage } from "./index-HDt5wRiR.js";
2
+ import { t as DocsLanguage } from "./routing-qJMPICGo.js";
3
3
 
4
4
  //#region src/spec.d.ts
5
5
  type SecurityScheme = Spec['security_schemes'][number];
@@ -36,13 +36,13 @@ declare function generateNavigation(resource: Partial<Resource>): {
36
36
  declare function generateSpecForResource(spec: Spec, name: string, lang: DocsLanguage, transforms: SpecTransforms): Partial<Spec>;
37
37
  declare function transform(spec: Spec, transforms: SpecTransforms): {
38
38
  name: string;
39
- lang: "cli" | "csharp" | "go" | "http" | "java" | "kotlin" | "node" | "php" | "python" | "ruby" | "terraform" | "typescript";
39
+ lang: "http" | "node" | "python" | "go" | "typescript" | "terraform" | "ruby" | "java" | "kotlin" | "csharp" | "php" | "cli";
40
40
  spec: Partial<Spec>;
41
41
  }[];
42
42
  declare function split(spec: Spec, transforms?: SpecTransforms): {
43
43
  resources: ReturnType<typeof transform>;
44
44
  navigation: {
45
- languages: ("go" | "http" | "java" | "kotlin" | "node" | "python" | "ruby" | "terraform" | "typescript")[] | undefined;
45
+ languages: ("http" | "node" | "python" | "go" | "typescript" | "terraform" | "ruby" | "java" | "kotlin" | "csharp" | "php" | "cli" | "sql" | "openapi")[] | undefined;
46
46
  resources: {
47
47
  [k: string]: {
48
48
  title: string | undefined;
package/dist/spec.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as Languages } from "./routing-C64k4fmX.js";
2
- import { i as isResourceEmpty } from "./utils-DPbkW1Tz.js";
1
+ import { n as Languages } from "./routing-GvhEMw6E.js";
2
+ import { i as isResourceEmpty } from "./utils-D6zJxUZ9.js";
3
3
 
4
4
  //#region src/spec.ts
5
5
  const defaultTransforms = {
@@ -99,7 +99,7 @@ function generateSpecForResource(spec, name, lang, transforms) {
99
99
  fn: (snippets) => mapEntries({
100
100
  input: snippets,
101
101
  filter: (name) => name.startsWith(resource.stainlessPath),
102
- fn: (snippet) => transforms.snippet(snippet, lang)
102
+ fn: (snippetObj) => Object.fromEntries(Object.entries(snippetObj).map(([key, snippet]) => [key, { content: transforms.snippet(snippet.content, lang) }]))
103
103
  }) ?? {}
104
104
  })
105
105
  };
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import * as react_jsx_runtime78 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/stl-sidebar.d.ts
5
5
  declare module 'react' {
@@ -53,6 +53,6 @@ type StlSidebarProps = {
53
53
  declare function StlSidebar({
54
54
  entries,
55
55
  withStarlightRestoration
56
- }: StlSidebarProps): react_jsx_runtime78.JSX.Element;
56
+ }: StlSidebarProps): react_jsx_runtime0.JSX.Element;
57
57
  //#endregion
58
58
  export { StlSidebarProps as a, StlSidebarLink as i, StlSidebarEntry as n, StlSidebarTarget as o, StlSidebarGroup as r, StlSidebar as t };
@@ -1,5 +1,5 @@
1
1
  import { t as useComponents } from "./use-components-BUz3GbO4.js";
2
- import { t as style_default } from "./style-HpXpcJ9v.js";
2
+ import { t as style_default } from "./style-DJIYkFhO.js";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import clsx from "clsx";
5
5
  import { ChevronRight } from "lucide-react";
@@ -64,6 +64,12 @@ var style_default = {
64
64
  SnippetResponseTabSingleReturn: "stldocs-snippet-response-tab-single-return",
65
65
  SnippetResponsePane: "stldocs-snippet-response-pane",
66
66
  SnippetResponsePaneActive: "stldocs-snippet-response-pane-active",
67
+ SnippetMulti: "stldocs-snippet-multi",
68
+ SnippetMultiTabs: "stldocs-snippet-multi-tabs",
69
+ SnippetMultiTab: "stldocs-snippet-multi-tab",
70
+ SnippetMultiContent: "stldocs-snippet-multi-content",
71
+ SnippetMultiPane: "stldocs-snippet-multi-pane",
72
+ SnippetMultiPaneActive: "stldocs-snippet-multi-pane-active",
67
73
  Method: "stldocs-method",
68
74
  MethodHeader: "stldocs-method-header",
69
75
  MethodBody: "stldocs-method-body",
package/dist/style.d.ts CHANGED
@@ -64,6 +64,12 @@ declare const _default: {
64
64
  readonly SnippetResponseTabSingleReturn: "stldocs-snippet-response-tab-single-return";
65
65
  readonly SnippetResponsePane: "stldocs-snippet-response-pane";
66
66
  readonly SnippetResponsePaneActive: "stldocs-snippet-response-pane-active";
67
+ readonly SnippetMulti: "stldocs-snippet-multi";
68
+ readonly SnippetMultiTabs: "stldocs-snippet-multi-tabs";
69
+ readonly SnippetMultiTab: "stldocs-snippet-multi-tab";
70
+ readonly SnippetMultiContent: "stldocs-snippet-multi-content";
71
+ readonly SnippetMultiPane: "stldocs-snippet-multi-pane";
72
+ readonly SnippetMultiPaneActive: "stldocs-snippet-multi-pane-active";
67
73
  readonly Method: "stldocs-method";
68
74
  readonly MethodHeader: "stldocs-method-header";
69
75
  readonly MethodBody: "stldocs-method-body";
package/dist/style.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as style_default } from "./style-HpXpcJ9v.js";
1
+ import { t as style_default } from "./style-DJIYkFhO.js";
2
2
 
3
3
  export { style_default as default };
@@ -551,16 +551,19 @@
551
551
  }
552
552
  }
553
553
 
554
- .stldocs-snippet {
554
+ .stldocs-snippet,
555
+ .stldocs-snippet-multi {
555
556
  top: calc(var(--sl-nav-height) + 1rem);
556
557
  position: sticky;
557
558
  z-index: 5;
559
+ }
558
560
 
561
+ .stldocs-snippet {
559
562
  font-size: var(--stl-typography-scale-sm);
560
563
  font-family: var(--stl-typography-font-mono);
561
564
 
562
- padding: 0.5rem;
563
- border-radius: calc(12px + 0.5rem);
565
+ padding: 0.25rem;
566
+ border-radius: calc(12px + 0.25rem);
564
567
  display: flex;
565
568
  flex-direction: column;
566
569
  background-color: var(--stl-color-faint-background);
@@ -732,6 +735,9 @@
732
735
  display: flex;
733
736
  gap: 0.5rem;
734
737
  overflow-x: auto;
738
+ border-bottom: 1px solid var(--stl-color-border-faint);
739
+ margin-inline: -0.5rem;
740
+ padding-inline: 0.5rem;
735
741
 
736
742
  .stldocs-snippet-response-tab-item {
737
743
  flex: 1;
@@ -790,6 +796,50 @@
790
796
  margin-top: 0;
791
797
  }
792
798
  }
799
+
800
+ .stldocs-snippet-multi {
801
+ .stldocs-snippet-multi-tabs {
802
+ background: var(--stl-color-faint-background);
803
+ border: 1px solid var(--stl-color-border-faint);
804
+ padding: 0.25rem;
805
+ border-radius: calc(var(--stl-ui-layout-border-radius) + 0.25rem);
806
+ display: flex;
807
+ flex-wrap: nowrap;
808
+ margin-bottom: 0.5rem;
809
+ overflow-x: scroll;
810
+ scrollbar-color: var(--stl-color-border) transparent;
811
+
812
+ font-size: var(--stl-typography-scale-sm);
813
+ line-height: 1;
814
+
815
+ max-width: max-content;
816
+
817
+ .stldocs-snippet-multi-tab {
818
+ border-radius: var(--stl-ui-layout-border-radius);
819
+ border: 1px solid transparent;
820
+ padding: 9px 14px;
821
+ font-weight: 400;
822
+ color: var(--stl-color-foreground-reduced);
823
+ flex: 0 0 auto;
824
+
825
+ & > input {
826
+ display: none;
827
+ }
828
+ &:has(> :checked) {
829
+ background-color: var(--stl-color-ui-background);
830
+ border-color: var(--stl-color-border);
831
+ font-weight: 500;
832
+ color: var(--stl-color-foreground);
833
+ }
834
+ }
835
+ }
836
+ .stldocs-snippet-multi-pane {
837
+ display: none;
838
+ &.stldocs-snippet-multi-pane-active {
839
+ display: block;
840
+ }
841
+ }
842
+ }
793
843
  }
794
844
 
795
845
  .stldocs-root .stldocs-language-block {
@@ -920,17 +970,6 @@
920
970
  position: relative;
921
971
  padding: 0;
922
972
  --shiki-background: transparent;
923
-
924
- &::before {
925
- content: '';
926
- flex: 0 0 1rem;
927
- width: calc(100% + 2rem);
928
- height: 1px;
929
- position: absolute;
930
- top: calc(-0.5rem);
931
- left: -1rem;
932
- background-color: var(--stl-color-border-faint);
933
- }
934
973
  }
935
974
 
936
975
  .stldocs-snippet-multi-response {
package/dist/styles.css CHANGED
@@ -2381,16 +2381,19 @@ a.stl-ui-button {
2381
2381
  }
2382
2382
  }
2383
2383
 
2384
- .stldocs-snippet {
2384
+ .stldocs-snippet,
2385
+ .stldocs-snippet-multi {
2385
2386
  top: calc(var(--sl-nav-height) + 1rem);
2386
2387
  position: sticky;
2387
2388
  z-index: 5;
2389
+ }
2388
2390
 
2391
+ .stldocs-snippet {
2389
2392
  font-size: var(--stl-typography-scale-sm);
2390
2393
  font-family: var(--stl-typography-font-mono);
2391
2394
 
2392
- padding: 0.5rem;
2393
- border-radius: calc(12px + 0.5rem);
2395
+ padding: 0.25rem;
2396
+ border-radius: calc(12px + 0.25rem);
2394
2397
  display: flex;
2395
2398
  flex-direction: column;
2396
2399
  background-color: var(--stl-color-faint-background);
@@ -2562,6 +2565,9 @@ a.stl-ui-button {
2562
2565
  display: flex;
2563
2566
  gap: 0.5rem;
2564
2567
  overflow-x: auto;
2568
+ border-bottom: 1px solid var(--stl-color-border-faint);
2569
+ margin-inline: -0.5rem;
2570
+ padding-inline: 0.5rem;
2565
2571
 
2566
2572
  .stldocs-snippet-response-tab-item {
2567
2573
  flex: 1;
@@ -2620,6 +2626,50 @@ a.stl-ui-button {
2620
2626
  margin-top: 0;
2621
2627
  }
2622
2628
  }
2629
+
2630
+ .stldocs-snippet-multi {
2631
+ .stldocs-snippet-multi-tabs {
2632
+ background: var(--stl-color-faint-background);
2633
+ border: 1px solid var(--stl-color-border-faint);
2634
+ padding: 0.25rem;
2635
+ border-radius: calc(var(--stl-ui-layout-border-radius) + 0.25rem);
2636
+ display: flex;
2637
+ flex-wrap: nowrap;
2638
+ margin-bottom: 0.5rem;
2639
+ overflow-x: scroll;
2640
+ scrollbar-color: var(--stl-color-border) transparent;
2641
+
2642
+ font-size: var(--stl-typography-scale-sm);
2643
+ line-height: 1;
2644
+
2645
+ max-width: max-content;
2646
+
2647
+ .stldocs-snippet-multi-tab {
2648
+ border-radius: var(--stl-ui-layout-border-radius);
2649
+ border: 1px solid transparent;
2650
+ padding: 9px 14px;
2651
+ font-weight: 400;
2652
+ color: var(--stl-color-foreground-reduced);
2653
+ flex: 0 0 auto;
2654
+
2655
+ & > input {
2656
+ display: none;
2657
+ }
2658
+ &:has(> :checked) {
2659
+ background-color: var(--stl-color-ui-background);
2660
+ border-color: var(--stl-color-border);
2661
+ font-weight: 500;
2662
+ color: var(--stl-color-foreground);
2663
+ }
2664
+ }
2665
+ }
2666
+ .stldocs-snippet-multi-pane {
2667
+ display: none;
2668
+ &.stldocs-snippet-multi-pane-active {
2669
+ display: block;
2670
+ }
2671
+ }
2672
+ }
2623
2673
  }
2624
2674
 
2625
2675
  .stldocs-root .stldocs-language-block {
@@ -2750,17 +2800,6 @@ a.stl-ui-button {
2750
2800
  position: relative;
2751
2801
  padding: 0;
2752
2802
  --shiki-background: transparent;
2753
-
2754
- &::before {
2755
- content: '';
2756
- flex: 0 0 1rem;
2757
- width: calc(100% + 2rem);
2758
- height: 1px;
2759
- position: absolute;
2760
- top: calc(-0.5rem);
2761
- left: -1rem;
2762
- background-color: var(--stl-color-border-faint);
2763
- }
2764
2803
  }
2765
2804
 
2766
2805
  .stldocs-snippet-multi-response {
@@ -1,8 +1,8 @@
1
1
  import { t as __exportAll } from "./chunk-BN_g-Awi.js";
2
- import { i as useDeclaration } from "./docs-BmOB2f-I.js";
3
- import { n as useLanguageComponents } from "./contexts-CVj20VV4.js";
2
+ import { i as useDeclaration } from "./docs-YgoQ3bzY.js";
3
+ import { n as useLanguageComponents } from "./contexts-_NNW5yqC.js";
4
4
  import { t as useComponents } from "./use-components-BUz3GbO4.js";
5
- import { t as style_default } from "./style-HpXpcJ9v.js";
5
+ import { t as style_default } from "./style-DJIYkFhO.js";
6
6
  import "react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
8
  import clsx from "clsx";
@@ -1,8 +1,8 @@
1
1
  import { t as __exportAll } from "./chunk-BN_g-Awi.js";
2
- import { d as useSpec, i as useDeclaration, s as useLanguage } from "./docs-BmOB2f-I.js";
3
- import { n as useLanguageComponents } from "./contexts-CVj20VV4.js";
2
+ import { i as useDeclaration, m as useSpec, s as useLanguage } from "./docs-YgoQ3bzY.js";
3
+ import { n as useLanguageComponents } from "./contexts-_NNW5yqC.js";
4
4
  import { t as useComponents } from "./use-components-BUz3GbO4.js";
5
- import { t as style_default } from "./style-HpXpcJ9v.js";
5
+ import { t as style_default } from "./style-DJIYkFhO.js";
6
6
  import * as React$1 from "react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
8
 
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./chunk-BN_g-Awi.js";
2
- import { p as parseStainlessPath } from "./routing-C64k4fmX.js";
2
+ import { p as parseStainlessPath } from "./routing-GvhEMw6E.js";
3
3
 
4
4
  //#region src/utils.ts
5
5
  var utils_exports = /* @__PURE__ */ __exportAll({
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as Spec, c as ID, m as Resource, s as HttpAST } from "./index-CwjGm9zX.js";
1
+ import { _ as Spec, c as ID, m as Resource, s as HttpAST } from "./index-HDt5wRiR.js";
2
2
 
3
3
  //#region src/utils.d.ts
4
4
  declare namespace utils_d_exports {
package/dist/utils.js CHANGED
@@ -1,3 +1,3 @@
1
- import { i as isResourceEmpty, n as getBodyParams, r as getResourceFromSpec, t as flatResources } from "./utils-DPbkW1Tz.js";
1
+ import { i as isResourceEmpty, n as getBodyParams, r as getResourceFromSpec, t as flatResources } from "./utils-D6zJxUZ9.js";
2
2
 
3
3
  export { flatResources, getBodyParams, getResourceFromSpec, isResourceEmpty };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stainless-api/docs-ui",
3
3
  "private": false,
4
- "version": "0.1.0-beta.71",
4
+ "version": "0.1.0-beta.73",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -30,7 +30,7 @@
30
30
  "tsdown": "^0.20.0",
31
31
  "typescript": "5.9.3",
32
32
  "@stainless/eslint-config": "0.1.0-beta.1",
33
- "@stainless/sdk-json": "^0.1.0-beta.4"
33
+ "@stainless/sdk-json": "^0.1.0-beta.6"
34
34
  },
35
35
  "exports": {
36
36
  ".": {
@@ -1,25 +0,0 @@
1
- import { _ as Spec } from "./index-CwjGm9zX.js";
2
- import * as react_jsx_runtime11 from "react/jsx-runtime";
3
-
4
- //#region src/components/breadcrumbs.d.ts
5
- type Breadcrumb = {
6
- title: string;
7
- href: string;
8
- };
9
- type BreadcrumbConfig = {
10
- includeCurrentPage?: boolean;
11
- };
12
- declare function generateApiBreadcrumbs(fullPath: string, spec: any, basePath: string): Breadcrumb[] | null;
13
- declare function SDKBreadcrumbs({
14
- spec,
15
- currentPath,
16
- basePath,
17
- config
18
- }: {
19
- spec: Spec;
20
- currentPath: string;
21
- basePath?: string;
22
- config?: BreadcrumbConfig | null;
23
- }): react_jsx_runtime11.JSX.Element | null;
24
- //#endregion
25
- export { generateApiBreadcrumbs as n, SDKBreadcrumbs as t };
@@ -1,30 +0,0 @@
1
- import * as React$1 from "react";
2
- import * as react_jsx_runtime79 from "react/jsx-runtime";
3
-
4
- //#region src/contexts/component-generics.d.ts
5
- type DeepPartialMap<L> = { [K in keyof L]?: Partial<L[K]> };
6
- type ComponentsContextType<C, L> = {
7
- components: C;
8
- language: L;
9
- };
10
- declare const useComponentContext: () => ComponentsContextType<any, any>;
11
- declare function useComponents<C = unknown>(): C;
12
- declare function customizeComponents<C, L>(defaults: {
13
- components: C;
14
- language: L;
15
- }, overrides?: {
16
- components?: Partial<C>;
17
- language?: DeepPartialMap<L>;
18
- }): {
19
- components: C;
20
- language: L;
21
- };
22
- declare function ComponentProvider<C, L>({
23
- value,
24
- children
25
- }: {
26
- value: ComponentsContextType<C, L>;
27
- children: React$1.ReactNode;
28
- }): react_jsx_runtime79.JSX.Element;
29
- //#endregion
30
- export { useComponents as a, useComponentContext as i, ComponentsContextType as n, customizeComponents as r, ComponentProvider as t };
@@ -1,48 +0,0 @@
1
- import { _ as Spec, m as Resource, u as LanguageDeclNodes, v as SpecLanguage } from "./index-CwjGm9zX.js";
2
- import * as React$1 from "react";
3
- import * as react_jsx_runtime23 from "react/jsx-runtime";
4
-
5
- //#region src/contexts/docs.d.ts
6
- type ContentPanelLayout = 'double-pane' | 'single-pane';
7
- type PropertySettingsType = {
8
- types?: 'simple' | 'rich';
9
- includeModelProperties?: boolean | 'method-page';
10
- collapseDescription?: boolean | 'show-first-line';
11
- showTitle?: boolean;
12
- expandDepth?: number;
13
- };
14
- type DocsContextType = {
15
- language: SpecLanguage;
16
- spec: Spec | null;
17
- settings?: {
18
- properties?: PropertySettingsType;
19
- contentPanelLayout?: ContentPanelLayout;
20
- virtualExpanders?: boolean;
21
- };
22
- };
23
- declare function useDocs(): DocsContextType;
24
- declare function useSpec(): Spec | null;
25
- declare function useSettings(): {
26
- properties?: PropertySettingsType;
27
- contentPanelLayout?: ContentPanelLayout;
28
- virtualExpanders?: boolean;
29
- } | undefined;
30
- declare function useSnippet(stainlessPath: string, language?: SpecLanguage, variant?: string): string | undefined;
31
- type Declaration = LanguageDeclNodes[SpecLanguage];
32
- declare function useDeclaration<Required extends boolean>(stainlessPath: string, required: Required, language?: SpecLanguage): (Required extends true ? never : undefined) | Declaration;
33
- declare function useAvailableLanguages(stainlessPath: string): SpecLanguage[];
34
- declare function useIgnoredResources(): string[];
35
- declare function useResource(name: string): Resource | undefined;
36
- declare function useLanguage(): "cli" | "csharp" | "go" | "http" | "java" | "kotlin" | "node" | "php" | "python" | "ruby" | "terraform" | "typescript";
37
- declare function useContentPanelLayout(): ContentPanelLayout;
38
- type DocsProviderProps = DocsContextType & {
39
- children: React$1.ReactNode;
40
- };
41
- declare function DocsProvider({
42
- spec,
43
- language,
44
- settings,
45
- children
46
- }: DocsProviderProps): react_jsx_runtime23.JSX.Element;
47
- //#endregion
48
- export { DocsProviderProps as a, useContentPanelLayout as c, useIgnoredResources as d, useLanguage as f, useSpec as g, useSnippet as h, DocsProvider as i, useDeclaration as l, useSettings as m, Declaration as n, PropertySettingsType as o, useResource as p, DocsContextType as r, useAvailableLanguages as s, ContentPanelLayout as t, useDocs as u };