@stainless-api/docs-ui 0.1.0-beta.71 → 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 (133) hide show
  1. package/dist/{breadcrumbs-Cvm5Ifm7.d.ts → breadcrumbs-46Qjx1Pd.d.ts} +3 -3
  2. package/dist/{breadcrumbs-7G1MoVzo.d.ts → breadcrumbs-BZ4wBC9-.d.ts} +3 -3
  3. package/dist/{breadcrumbs-DA4WgDhR.js → breadcrumbs-BiBfNqBI.js} +2 -2
  4. package/dist/{cli-DhMMZoiU.js → cli-hduQ5XS1.js} +3 -3
  5. package/dist/{component-Drp93QK-.js → component-BU8BTbqz.js} +2 -2
  6. package/dist/{component-generics-t_S0Wc9i.d.ts → component-generics-Bw4ZOyEG.d.ts} +2 -2
  7. package/dist/{component-generics-5cSjFCLn.d.ts → component-generics-D-WarFUb.d.ts} +2 -2
  8. package/dist/components/MaskedInput.d.ts +1 -1
  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-BbJAAdUU.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-CceV-0oK.d.ts → docs-Cu9Yl6-y.d.ts} +24 -6
  47. package/dist/docs-YgoQ3bzY.js +81 -0
  48. package/dist/{docs---kdT2w-.d.ts → docs-xb5wYGjM.d.ts} +24 -6
  49. package/dist/{go-COaHV3Hc.js → go-BoaAVmP0.js} +2 -2
  50. package/dist/{http-DVyJ-D6t.js → http-B3qTyMc3.js} +5 -5
  51. package/dist/index-BOmn7DHa.d.ts +428 -0
  52. package/dist/{index-Bc1tYWPC.d.ts → index-BvcPmB0r.d.ts} +85 -4
  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-HJXGh2Yn.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-DPnfsySL.d.ts → method-C4PgTWAu.d.ts} +6 -6
  88. package/dist/{method-R97dH39J.d.ts → method-D6R_farj.d.ts} +6 -6
  89. package/dist/{method-iAV6cZjF.js → method-DjzVBzZe.js} +2 -2
  90. package/dist/{navigation-QXH2ufM3.d.ts → navigation-HiZWRl34.d.ts} +3 -3
  91. package/dist/{navigation-dh0gX_lm.d.ts → navigation-MrP4Ubbg.d.ts} +3 -3
  92. package/dist/{overview-Ddh84S6_.d.ts → overview-CTeKhpQq.d.ts} +7 -7
  93. package/dist/{overview-BR3WhCoz.d.ts → overview-Yf1PTJNi.d.ts} +7 -7
  94. package/dist/{overview-DQIrvYJr.js → overview-ocTARt-j.js} +5 -5
  95. package/dist/{primitives-DJEqe_r1.js → primitives-CNG-fEhQ.js} +3 -3
  96. package/dist/{primitives-D0h4FgbU.d.ts → primitives-K7NijV36.d.ts} +11 -11
  97. package/dist/{primitives-xbTKYFgQ.d.ts → primitives-WGxdBJDS.d.ts} +11 -11
  98. package/dist/{properties-CjUi1Cjx.d.ts → properties-Bu4nW9JD.d.ts} +5 -5
  99. package/dist/{properties-q3XaAaRo.d.ts → properties-Bynmj9_H.d.ts} +5 -5
  100. package/dist/{properties-PNuJPLqP.js → properties-DQU0NBzb.js} +2 -2
  101. package/dist/{python-DsTuWCKE.js → python-nqOBH7GS.js} +2 -2
  102. package/dist/{routing-utiR5mY3.d.ts → routing-pAL4V4hv.d.ts} +2 -2
  103. package/dist/routing.d.ts +1 -1
  104. package/dist/{ruby-BncKp6hd.js → ruby-BBc8HdIt.js} +3 -3
  105. package/dist/{sdk-Bw99eXxA.js → sdk-BSdgEEJw.js} +13 -7
  106. package/dist/{sdk-CSKStkB5.d.ts → sdk-BVCk1ox2.d.ts} +17 -17
  107. package/dist/{sdk-D3U444dU.d.ts → sdk-Dm0S-XQE.d.ts} +17 -17
  108. package/dist/{sdk-sidebar-f7SS4xxq.d.ts → sdk-sidebar-B1ehT_xI.d.ts} +3 -3
  109. package/dist/{sdk-sidebar-V_MTkVw8.js → sdk-sidebar-BDn8S1xS.js} +1 -1
  110. package/dist/{sdk-sidebar-Cf04O8rR.d.ts → sdk-sidebar-Dqeu7C1-.d.ts} +3 -3
  111. package/dist/snippets-CLpNVNlA.js +181 -0
  112. package/dist/spec.d.ts +4 -4
  113. package/dist/spec.js +1 -1
  114. package/dist/{stl-sidebar-CItXFC3n.d.ts → stl-sidebar-BTTErIJs.d.ts} +2 -2
  115. package/dist/{stl-sidebar-DpnXVa_V.d.ts → stl-sidebar-C7GNALtk.d.ts} +2 -2
  116. package/dist/{stl-sidebar-WtimNrk1.js → stl-sidebar-DC5UOJiT.js} +1 -1
  117. package/dist/{style-HpXpcJ9v.js → style-DJIYkFhO.js} +6 -0
  118. package/dist/style.d.ts +6 -0
  119. package/dist/style.js +1 -1
  120. package/dist/styles/main.css +53 -14
  121. package/dist/styles.css +53 -14
  122. package/dist/{terraform-B95X4rNK.js → terraform-DVx2ea2h.js} +3 -3
  123. package/dist/{typescript-n46M9OtL.js → typescript-Cmk-jBBw.js} +3 -3
  124. package/dist/utils.d.ts +1 -1
  125. package/package.json +2 -2
  126. package/dist/docs-BmOB2f-I.js +0 -61
  127. package/dist/index-Cuw1pZs8.d.ts +0 -16
  128. package/dist/index-DIchpgQZ.d.ts +0 -16
  129. package/dist/index-DSeLOs29.d.ts +0 -347
  130. package/dist/languages-C8iNdbjN.js +0 -30
  131. package/dist/snippets-BehbU3rt.js +0 -164
  132. package/dist/snippets-CMtWGDSE.d.ts +0 -53
  133. package/dist/snippets-DZAozdda.d.ts +0 -53
@@ -1,7 +1,7 @@
1
- import { c as ID, d as Method, f as Model, g as SnippetLanguage, o as HasStainlessPath, t as BaseDeclaration } from "./index-CwjGm9zX.js";
2
- import { t as DocsLanguage } from "./routing-utiR5mY3.js";
1
+ import { c as ID, d as Method, f as Model, g as SnippetLanguage, o as HasStainlessPath, t as BaseDeclaration } from "./index-W4Td2Hl7.js";
2
+ import { t as DocsLanguage } from "./routing-pAL4V4hv.js";
3
3
  import * as React$1 from "react";
4
- import * as react_jsx_runtime59 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime38 from "react/jsx-runtime";
5
5
 
6
6
  //#region src/components/sdk.d.ts
7
7
  type PropertyModelContextType = {
@@ -33,7 +33,7 @@ declare function SDKChildren({
33
33
  paths,
34
34
  expand,
35
35
  depth
36
- }: SDKChildrenProps): react_jsx_runtime59.JSX.Element;
36
+ }: SDKChildrenProps): react_jsx_runtime38.JSX.Element;
37
37
  type SDKDeclarationProps = {
38
38
  path: string;
39
39
  expand?: boolean;
@@ -43,26 +43,26 @@ declare function SDKDeclaration({
43
43
  path,
44
44
  expand,
45
45
  depth
46
- }: SDKDeclarationProps): react_jsx_runtime59.JSX.Element;
46
+ }: SDKDeclarationProps): react_jsx_runtime38.JSX.Element;
47
47
  type SDKConstraintsProps = {
48
- constraints?: Record<string, any>;
48
+ constraints?: Record<string, unknown>;
49
49
  };
50
50
  declare function SDKConstraints({
51
51
  constraints
52
- }: SDKConstraintsProps): react_jsx_runtime59.JSX.Element | undefined;
52
+ }: SDKConstraintsProps): react_jsx_runtime38.JSX.Element | undefined;
53
53
  type SDKIconProps = {
54
54
  language: SnippetLanguage;
55
55
  size?: number;
56
56
  };
57
57
  declare function SDKIcon({
58
58
  language
59
- }: SDKIconProps): react_jsx_runtime59.JSX.Element | null;
59
+ }: SDKIconProps): react_jsx_runtime38.JSX.Element | null;
60
60
  type SDKRequestTitleProps = {
61
61
  snippetLanguage: SnippetLanguage;
62
62
  };
63
63
  declare function SDKRequestTitle({
64
64
  snippetLanguage
65
- }: SDKRequestTitleProps): react_jsx_runtime59.JSX.Element;
65
+ }: SDKRequestTitleProps): react_jsx_runtime38.JSX.Element;
66
66
  type SDKExampleProps = {
67
67
  method: Partial<Method> & HasStainlessPath;
68
68
  transformRequestSnippet?: TransformRequestSnippetFn;
@@ -70,31 +70,31 @@ type SDKExampleProps = {
70
70
  declare function SDKExample({
71
71
  method,
72
72
  transformRequestSnippet
73
- }: SDKExampleProps): react_jsx_runtime59.JSX.Element;
73
+ }: SDKExampleProps): react_jsx_runtime38.JSX.Element;
74
74
  type SDKMethodProps = {
75
75
  method: Method;
76
76
  transformRequestSnippet?: TransformRequestSnippetFn;
77
77
  };
78
78
  declare function SDKMethodHeader({
79
79
  method
80
- }: SDKMethodProps): react_jsx_runtime59.JSX.Element;
80
+ }: SDKMethodProps): react_jsx_runtime38.JSX.Element;
81
81
  declare function useStreamingResponse(method: BaseDeclaration): ID | undefined;
82
82
  declare function SDKMethodInfo({
83
83
  method
84
- }: SDKMethodProps): react_jsx_runtime59.JSX.Element;
84
+ }: SDKMethodProps): react_jsx_runtime38.JSX.Element;
85
85
  declare function SDKMethodNotImplemented({
86
86
  method
87
- }: SDKMethodProps): react_jsx_runtime59.JSX.Element;
87
+ }: SDKMethodProps): react_jsx_runtime38.JSX.Element;
88
88
  declare function SDKMethod({
89
89
  method,
90
90
  transformRequestSnippet
91
- }: SDKMethodProps): react_jsx_runtime59.JSX.Element;
91
+ }: SDKMethodProps): react_jsx_runtime38.JSX.Element;
92
92
  type SDKModelProps = {
93
93
  model: Model;
94
94
  };
95
95
  declare function SDKModel({
96
96
  model
97
- }: SDKModelProps): react_jsx_runtime59.JSX.Element | null;
97
+ }: SDKModelProps): react_jsx_runtime38.JSX.Element | null;
98
98
  type SDKReferenceProps = {
99
99
  stainlessPath: string;
100
100
  children?: React$1.ReactNode;
@@ -102,7 +102,7 @@ type SDKReferenceProps = {
102
102
  declare function SDKReference({
103
103
  stainlessPath,
104
104
  children
105
- }: SDKReferenceProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | react_jsx_runtime59.JSX.Element | null | undefined;
105
+ }: SDKReferenceProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | react_jsx_runtime38.JSX.Element | null | undefined;
106
106
  type SDKLanguageBlockProps = {
107
107
  language: DocsLanguage;
108
108
  version: string;
@@ -117,6 +117,6 @@ declare function SDKLanguageBlock({
117
117
  version,
118
118
  install,
119
119
  links
120
- }: SDKLanguageBlockProps): react_jsx_runtime59.JSX.Element;
120
+ }: SDKLanguageBlockProps): react_jsx_runtime38.JSX.Element;
121
121
  //#endregion
122
122
  export { SDKSnippetLanguagesType as C, useStreamingResponse as D, useReferenceNesting as E, SDKSnippetLanguages as S, usePropertyModel as T, SDKModel as _, SDKChildren as a, SDKRequestTitle as b, SDKDeclaration as c, SDKLanguageBlock as d, SDKMethod as f, SDKMethodProps as g, SDKMethodNotImplemented as h, ReferenceNestingContextType as i, SDKExample as l, SDKMethodInfo as m, PropertyModelContextType as n, SDKConstraints as o, SDKMethodHeader as p, ReferenceNestingContext as r, SDKConstraintsProps as s, PropertyModelContext as t, SDKIcon as u, SDKModelProps as v, TransformRequestSnippetFn as w, SDKRequestTitleProps as x, SDKReference as y };
@@ -1,5 +1,5 @@
1
- import { m as Resource } from "./index-CwjGm9zX.js";
2
- import * as react_jsx_runtime43 from "react/jsx-runtime";
1
+ import { m as Resource } from "./index-W4Td2Hl7.js";
2
+ import * as react_jsx_runtime34 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/sdk-sidebar.d.ts
5
5
  type SDKSidebarProps = {
@@ -10,6 +10,6 @@ type SDKSidebarProps = {
10
10
  */
11
11
  declare function SDKSidebar({
12
12
  resources
13
- }: SDKSidebarProps): react_jsx_runtime43.JSX.Element;
13
+ }: SDKSidebarProps): react_jsx_runtime34.JSX.Element;
14
14
  //#endregion
15
15
  export { SDKSidebarProps as n, SDKSidebar as t };
@@ -1,6 +1,6 @@
1
1
  import { n as useNavigation } from "./navigation-aoYZ_tl4.js";
2
2
  import { i as isResourceEmpty } from "./utils-DPbkW1Tz.js";
3
- import { t as StlSidebar } from "./stl-sidebar-WtimNrk1.js";
3
+ import { t as StlSidebar } from "./stl-sidebar-DC5UOJiT.js";
4
4
  import * as React$1 from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { Badge, getHttpMethod } from "@stainless-api/ui-primitives";
@@ -1,5 +1,5 @@
1
- import { m as Resource } from "./index-CwjGm9zX.js";
2
- import * as react_jsx_runtime58 from "react/jsx-runtime";
1
+ import { m as Resource } from "./index-W4Td2Hl7.js";
2
+ import * as react_jsx_runtime37 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/sdk-sidebar.d.ts
5
5
  type SDKSidebarProps = {
@@ -10,6 +10,6 @@ type SDKSidebarProps = {
10
10
  */
11
11
  declare function SDKSidebar({
12
12
  resources
13
- }: SDKSidebarProps): react_jsx_runtime58.JSX.Element;
13
+ }: SDKSidebarProps): react_jsx_runtime37.JSX.Element;
14
14
  //#endregion
15
15
  export { SDKSidebarProps as n, SDKSidebar as t };
@@ -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-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];
@@ -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")[] | undefined;
46
46
  resources: {
47
47
  [k: string]: {
48
48
  title: string | undefined;
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_runtime78 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_runtime78.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_runtime67 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_runtime67.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 };
@@ -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