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

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 (134) hide show
  1. package/dist/{breadcrumbs-Cvm5Ifm7.d.ts → breadcrumbs-46Qjx1Pd.d.ts} +3 -3
  2. package/dist/{breadcrumbs-BhYwbXkc.d.ts → breadcrumbs-BZ4wBC9-.d.ts} +3 -3
  3. package/dist/{breadcrumbs-DA4WgDhR.js → breadcrumbs-BiBfNqBI.js} +2 -2
  4. package/dist/{cli-F3kMmeoJ.js → cli-hduQ5XS1.js} +3 -3
  5. package/dist/{component-P9sn5yyG.js → component-BU8BTbqz.js} +2 -2
  6. package/dist/{component-generics-zU0Pqx8m.d.ts → component-generics-Bw4ZOyEG.d.ts} +2 -2
  7. package/dist/{component-generics-ByGsYTc8.d.ts → component-generics-D-WarFUb.d.ts} +2 -2
  8. package/dist/components/MaskedInput.d.ts +3 -3
  9. package/dist/components/MaskedInput.js +1 -1
  10. package/dist/components/breadcrumbs.d.ts +1 -1
  11. package/dist/components/breadcrumbs.js +5 -5
  12. package/dist/components/icons.d.ts +12 -12
  13. package/dist/components/index.d.ts +14 -11
  14. package/dist/components/index.js +14 -14
  15. package/dist/components/method.d.ts +1 -1
  16. package/dist/components/method.js +5 -5
  17. package/dist/components/overview.d.ts +1 -1
  18. package/dist/components/overview.js +6 -6
  19. package/dist/components/primitives.d.ts +1 -1
  20. package/dist/components/primitives.js +4 -4
  21. package/dist/components/properties.d.ts +1 -1
  22. package/dist/components/properties.js +4 -4
  23. package/dist/components/sdk-sidebar.d.ts +1 -1
  24. package/dist/components/sdk-sidebar.js +5 -5
  25. package/dist/components/sdk.d.ts +1 -1
  26. package/dist/components/sdk.js +4 -4
  27. package/dist/components/snippets.d.ts +14 -3
  28. package/dist/components/snippets.js +5 -5
  29. package/dist/components/stl-sidebar.d.ts +1 -1
  30. package/dist/components/stl-sidebar.js +1 -1
  31. package/dist/{components-w1JmIrB0.js → components-9NMl1791.js} +10 -9
  32. package/dist/contexts/component-generics.d.ts +1 -1
  33. package/dist/contexts/component-types.d.ts +13 -11
  34. package/dist/contexts/component.d.ts +15 -14
  35. package/dist/contexts/component.js +24 -24
  36. package/dist/contexts/docs.d.ts +2 -2
  37. package/dist/contexts/docs.js +2 -2
  38. package/dist/contexts/index.d.ts +14 -23
  39. package/dist/contexts/index.js +4 -4
  40. package/dist/contexts/markdown.d.ts +1 -1
  41. package/dist/contexts/markdown.js +2 -2
  42. package/dist/contexts/navigation.d.ts +1 -1
  43. package/dist/contexts/use-components.d.ts +13 -10
  44. package/dist/{contexts-CVj20VV4.js → contexts-_NNW5yqC.js} +5 -2
  45. package/dist/{csharp-D6_jlynY.js → csharp-sn5CJu9t.js} +2 -2
  46. package/dist/{docs-g4IPmtZr.d.ts → docs-Cu9Yl6-y.d.ts} +24 -6
  47. package/dist/docs-YgoQ3bzY.js +81 -0
  48. package/dist/{docs-z3fl2eW-.d.ts → docs-xb5wYGjM.d.ts} +25 -7
  49. package/dist/{go-COaHV3Hc.js → go-BoaAVmP0.js} +2 -2
  50. package/dist/{http-fOPCX17A.js → http-B3qTyMc3.js} +5 -5
  51. package/dist/index-BOmn7DHa.d.ts +428 -0
  52. package/dist/index-BvcPmB0r.d.ts +428 -0
  53. package/dist/{index-CwjGm9zX.d.ts → index-W4Td2Hl7.d.ts} +46 -31
  54. package/dist/index.d.ts +14 -17
  55. package/dist/index.js +24 -24
  56. package/dist/{java-CxGSJVvv.js → java-BiLRuLuD.js} +3 -3
  57. package/dist/languages/cli.d.ts +13 -11
  58. package/dist/languages/cli.js +15 -15
  59. package/dist/languages/csharp.d.ts +13 -11
  60. package/dist/languages/csharp.js +4 -4
  61. package/dist/languages/go.d.ts +13 -11
  62. package/dist/languages/go.js +4 -4
  63. package/dist/languages/http.d.ts +13 -11
  64. package/dist/languages/http.js +14 -14
  65. package/dist/languages/index.d.ts +13 -11
  66. package/dist/languages/index.js +23 -23
  67. package/dist/languages/java.d.ts +13 -11
  68. package/dist/languages/java.js +4 -4
  69. package/dist/languages/python.d.ts +13 -11
  70. package/dist/languages/python.js +4 -4
  71. package/dist/languages/ruby.d.ts +13 -11
  72. package/dist/languages/ruby.js +4 -4
  73. package/dist/languages/terraform.d.ts +13 -11
  74. package/dist/languages/terraform.js +4 -4
  75. package/dist/languages/typescript.d.ts +13 -11
  76. package/dist/languages/typescript.js +4 -4
  77. package/dist/languages-vUhD5Hu_.js +30 -0
  78. package/dist/markdown/index.d.ts +2 -2
  79. package/dist/markdown/index.js +24 -24
  80. package/dist/markdown/printer.d.ts +2 -2
  81. package/dist/markdown/printer.js +25 -25
  82. package/dist/markdown/utils.d.ts +4 -4
  83. package/dist/markdown/utils.js +3 -3
  84. package/dist/{markdown-Cibv9fDR.d.ts → markdown-BszOPZhh.d.ts} +2 -2
  85. package/dist/{markdown-CTKHMLVr.js → markdown-Cq3XEhrR.js} +1 -1
  86. package/dist/{markdown-Cdh0TSHp.d.ts → markdown-plMAoN22.d.ts} +2 -2
  87. package/dist/{method-630cPKDl.d.ts → method-C4PgTWAu.d.ts} +6 -6
  88. package/dist/{method-BzkPRXGL.d.ts → method-D6R_farj.d.ts} +6 -6
  89. package/dist/{method-BPDUyBlD.js → method-DjzVBzZe.js} +2 -2
  90. package/dist/{navigation-BW-SBvb4.d.ts → navigation-HiZWRl34.d.ts} +3 -3
  91. package/dist/{navigation-DWYqC_HX.d.ts → navigation-MrP4Ubbg.d.ts} +3 -3
  92. package/dist/{overview-Cui1XtuC.d.ts → overview-CTeKhpQq.d.ts} +7 -7
  93. package/dist/{overview-RXc9iPzz.d.ts → overview-Yf1PTJNi.d.ts} +7 -7
  94. package/dist/{overview-DFwfIK6k.js → overview-ocTARt-j.js} +5 -5
  95. package/dist/{primitives-DJEqe_r1.js → primitives-CNG-fEhQ.js} +3 -3
  96. package/dist/{primitives-DhGxFYx6.d.ts → primitives-K7NijV36.d.ts} +11 -11
  97. package/dist/{primitives-MsH-h0bU.d.ts → primitives-WGxdBJDS.d.ts} +11 -11
  98. package/dist/{properties-C9W4QJ_F.d.ts → properties-Bu4nW9JD.d.ts} +5 -5
  99. package/dist/{properties-BnbBKd5a.js → properties-DQU0NBzb.js} +11 -5
  100. package/dist/{python-DsTuWCKE.js → python-nqOBH7GS.js} +2 -2
  101. package/dist/{routing-Cm_9XJiQ.d.ts → routing-pAL4V4hv.d.ts} +1 -1
  102. package/dist/routing.d.ts +1 -1
  103. package/dist/{ruby-BncKp6hd.js → ruby-BBc8HdIt.js} +3 -3
  104. package/dist/{sdk-Bw99eXxA.js → sdk-BSdgEEJw.js} +13 -7
  105. package/dist/{sdk-GMOw94wL.d.ts → sdk-BVCk1ox2.d.ts} +17 -17
  106. package/dist/{sdk-BvZeXpsj.d.ts → sdk-Dm0S-XQE.d.ts} +17 -17
  107. package/dist/{sdk-sidebar-VNY2-O1Y.d.ts → sdk-sidebar-B1ehT_xI.d.ts} +3 -3
  108. package/dist/{sdk-sidebar-V_MTkVw8.js → sdk-sidebar-BDn8S1xS.js} +1 -1
  109. package/dist/{sdk-sidebar-NCBSWuUW.d.ts → sdk-sidebar-Dqeu7C1-.d.ts} +3 -3
  110. package/dist/snippets-CLpNVNlA.js +181 -0
  111. package/dist/spec.d.ts +2 -2
  112. package/dist/spec.js +1 -1
  113. package/dist/{stl-sidebar-CXzs_shz.d.ts → stl-sidebar-BTTErIJs.d.ts} +2 -2
  114. package/dist/{stl-sidebar-DSkUHwcU.d.ts → stl-sidebar-C7GNALtk.d.ts} +2 -2
  115. package/dist/{stl-sidebar-WtimNrk1.js → stl-sidebar-DC5UOJiT.js} +1 -1
  116. package/dist/{style-HpXpcJ9v.js → style-DJIYkFhO.js} +6 -0
  117. package/dist/style.d.ts +6 -0
  118. package/dist/style.js +1 -1
  119. package/dist/styles/main.css +59 -14
  120. package/dist/styles.css +59 -14
  121. package/dist/{terraform-B95X4rNK.js → terraform-DVx2ea2h.js} +3 -3
  122. package/dist/{typescript-n46M9OtL.js → typescript-Cmk-jBBw.js} +3 -3
  123. package/dist/utils.d.ts +1 -1
  124. package/package.json +2 -2
  125. package/dist/docs-BmOB2f-I.js +0 -61
  126. package/dist/index-B8Zys1C2.d.ts +0 -347
  127. package/dist/index-C5Zmb2CI.d.ts +0 -16
  128. package/dist/index-D7PkxNgB.d.ts +0 -16
  129. package/dist/index-DIaM6Ync.d.ts +0 -347
  130. package/dist/languages-B6eap2M6.js +0 -30
  131. package/dist/routing-utiR5mY3.d.ts +0 -61
  132. package/dist/snippets-BehbU3rt.js +0 -164
  133. package/dist/snippets-Bj7Ey56K.d.ts +0 -53
  134. package/dist/snippets-CQQSDvg2.d.ts +0 -53
@@ -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-Cm_9XJiQ.js";
1
+ import { _ as Spec, d as Method, f as Model, i as DeclarationNode, m as Resource, v as SpecLanguage } from "./index-W4Td2Hl7.js";
2
+ import { t as DocsLanguage } from "./routing-pAL4V4hv.js";
3
3
 
4
4
  //#region src/spec.d.ts
5
5
  type SecurityScheme = Spec['security_schemes'][number];
package/dist/spec.js CHANGED
@@ -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_runtime43 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime52 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_runtime43.JSX.Element;
56
+ }: StlSidebarProps): react_jsx_runtime52.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 { ReactNode } from "react";
2
- import * as react_jsx_runtime56 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime57 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_runtime56.JSX.Element;
56
+ }: StlSidebarProps): react_jsx_runtime57.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 };
@@ -169,6 +169,12 @@
169
169
  padding: 0.5rem 0;
170
170
  font-size: var(--stl-typography-scale-sm);
171
171
 
172
+ &:has(.stldocs-expander-summary-content .stldocs-property-description)
173
+ .stldocs-expander-content
174
+ > .stldocs-property-description {
175
+ padding-top: 0.75rem;
176
+ }
177
+
172
178
  .stldocs-expander-summary-content {
173
179
  width: 100%;
174
180
  }
@@ -545,16 +551,19 @@
545
551
  }
546
552
  }
547
553
 
548
- .stldocs-snippet {
554
+ .stldocs-snippet,
555
+ .stldocs-snippet-multi {
549
556
  top: calc(var(--sl-nav-height) + 1rem);
550
557
  position: sticky;
551
558
  z-index: 5;
559
+ }
552
560
 
561
+ .stldocs-snippet {
553
562
  font-size: var(--stl-typography-scale-sm);
554
563
  font-family: var(--stl-typography-font-mono);
555
564
 
556
- padding: 0.5rem;
557
- border-radius: calc(12px + 0.5rem);
565
+ padding: 0.25rem;
566
+ border-radius: calc(12px + 0.25rem);
558
567
  display: flex;
559
568
  flex-direction: column;
560
569
  background-color: var(--stl-color-faint-background);
@@ -726,6 +735,9 @@
726
735
  display: flex;
727
736
  gap: 0.5rem;
728
737
  overflow-x: auto;
738
+ border-bottom: 1px solid var(--stl-color-border-faint);
739
+ margin-inline: -0.5rem;
740
+ padding-inline: 0.5rem;
729
741
 
730
742
  .stldocs-snippet-response-tab-item {
731
743
  flex: 1;
@@ -784,6 +796,50 @@
784
796
  margin-top: 0;
785
797
  }
786
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
+ }
787
843
  }
788
844
 
789
845
  .stldocs-root .stldocs-language-block {
@@ -914,17 +970,6 @@
914
970
  position: relative;
915
971
  padding: 0;
916
972
  --shiki-background: transparent;
917
-
918
- &::before {
919
- content: '';
920
- flex: 0 0 1rem;
921
- width: calc(100% + 2rem);
922
- height: 1px;
923
- position: absolute;
924
- top: calc(-0.5rem);
925
- left: -1rem;
926
- background-color: var(--stl-color-border-faint);
927
- }
928
973
  }
929
974
 
930
975
  .stldocs-snippet-multi-response {
package/dist/styles.css CHANGED
@@ -1999,6 +1999,12 @@ a.stl-ui-button {
1999
1999
  padding: 0.5rem 0;
2000
2000
  font-size: var(--stl-typography-scale-sm);
2001
2001
 
2002
+ &:has(.stldocs-expander-summary-content .stldocs-property-description)
2003
+ .stldocs-expander-content
2004
+ > .stldocs-property-description {
2005
+ padding-top: 0.75rem;
2006
+ }
2007
+
2002
2008
  .stldocs-expander-summary-content {
2003
2009
  width: 100%;
2004
2010
  }
@@ -2375,16 +2381,19 @@ a.stl-ui-button {
2375
2381
  }
2376
2382
  }
2377
2383
 
2378
- .stldocs-snippet {
2384
+ .stldocs-snippet,
2385
+ .stldocs-snippet-multi {
2379
2386
  top: calc(var(--sl-nav-height) + 1rem);
2380
2387
  position: sticky;
2381
2388
  z-index: 5;
2389
+ }
2382
2390
 
2391
+ .stldocs-snippet {
2383
2392
  font-size: var(--stl-typography-scale-sm);
2384
2393
  font-family: var(--stl-typography-font-mono);
2385
2394
 
2386
- padding: 0.5rem;
2387
- border-radius: calc(12px + 0.5rem);
2395
+ padding: 0.25rem;
2396
+ border-radius: calc(12px + 0.25rem);
2388
2397
  display: flex;
2389
2398
  flex-direction: column;
2390
2399
  background-color: var(--stl-color-faint-background);
@@ -2556,6 +2565,9 @@ a.stl-ui-button {
2556
2565
  display: flex;
2557
2566
  gap: 0.5rem;
2558
2567
  overflow-x: auto;
2568
+ border-bottom: 1px solid var(--stl-color-border-faint);
2569
+ margin-inline: -0.5rem;
2570
+ padding-inline: 0.5rem;
2559
2571
 
2560
2572
  .stldocs-snippet-response-tab-item {
2561
2573
  flex: 1;
@@ -2614,6 +2626,50 @@ a.stl-ui-button {
2614
2626
  margin-top: 0;
2615
2627
  }
2616
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
+ }
2617
2673
  }
2618
2674
 
2619
2675
  .stldocs-root .stldocs-language-block {
@@ -2744,17 +2800,6 @@ a.stl-ui-button {
2744
2800
  position: relative;
2745
2801
  padding: 0;
2746
2802
  --shiki-background: transparent;
2747
-
2748
- &::before {
2749
- content: '';
2750
- flex: 0 0 1rem;
2751
- width: calc(100% + 2rem);
2752
- height: 1px;
2753
- position: absolute;
2754
- top: calc(-0.5rem);
2755
- left: -1rem;
2756
- background-color: var(--stl-color-border-faint);
2757
- }
2758
2803
  }
2759
2804
 
2760
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
 
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-W4Td2Hl7.js";
2
2
 
3
3
  //#region src/utils.d.ts
4
4
  declare namespace utils_d_exports {
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.70",
4
+ "version": "0.1.0-beta.72",
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.5"
34
34
  },
35
35
  "exports": {
36
36
  ".": {
@@ -1,61 +0,0 @@
1
- import * as React$1 from "react";
2
- import { jsx } from "react/jsx-runtime";
3
-
4
- //#region src/contexts/docs.tsx
5
- const DocsContextDefaults = {
6
- settings: {},
7
- language: "node",
8
- spec: null
9
- };
10
- const DocsContext = React$1.createContext(DocsContextDefaults);
11
- function useDocs() {
12
- return React$1.useContext(DocsContext);
13
- }
14
- function useSpec() {
15
- return useDocs().spec;
16
- }
17
- function useSettings() {
18
- return useDocs().settings;
19
- }
20
- function useSnippet(stainlessPath, language, variant) {
21
- const defaultLanguage = useLanguage();
22
- const snippetLanguage = [language ?? defaultLanguage, variant ?? "default"].join(".");
23
- return useSpec()?.snippets?.[snippetLanguage]?.[stainlessPath];
24
- }
25
- function useDeclaration(stainlessPath, required, language) {
26
- const defaultLanguage = useLanguage();
27
- const decl = useSpec()?.decls?.[language ?? defaultLanguage]?.[stainlessPath];
28
- if (required && !decl) throw new Error(`Declaration not found for '${stainlessPath}'`);
29
- return decl;
30
- }
31
- function useAvailableLanguages(stainlessPath) {
32
- const spec = useSpec();
33
- return Object.keys(spec?.decls ?? {}).filter((lang) => spec?.decls?.[lang]?.[stainlessPath] !== void 0);
34
- }
35
- function useIgnoredResources() {
36
- return ["(resource) webhooks > (model) unwrap_webhook_event > (schema)"];
37
- }
38
- function useResource(name) {
39
- return useSpec()?.resources?.[name];
40
- }
41
- function useLanguage() {
42
- return useDocs().language;
43
- }
44
- function useContentPanelLayout() {
45
- return useDocs().settings?.contentPanelLayout ?? "double-pane";
46
- }
47
- function DocsProvider({ spec, language, settings, children }) {
48
- const value = {
49
- ...DocsContextDefaults,
50
- spec,
51
- settings: settings ?? DocsContextDefaults.settings,
52
- language: language ?? DocsContextDefaults.language
53
- };
54
- return /* @__PURE__ */ jsx(DocsContext.Provider, {
55
- value,
56
- children
57
- });
58
- }
59
-
60
- //#endregion
61
- export { useDocs as a, useResource as c, useSpec as d, useDeclaration as i, useSettings as l, useAvailableLanguages as n, useIgnoredResources as o, useContentPanelLayout as r, useLanguage as s, DocsProvider as t, useSnippet as u };