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

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 (135) hide show
  1. package/dist/{chunk-BN_g-Awi.js → chunk-BYypO7fO.js} +3 -3
  2. package/dist/components/MaskedInput.d.ts +1 -1
  3. package/dist/components/MaskedInput.js +1 -1
  4. package/dist/components/breadcrumbs.d.ts +24 -1
  5. package/dist/components/breadcrumbs.js +62 -7
  6. package/dist/components/icons.d.ts +12 -12
  7. package/dist/components/icons.js +883 -1
  8. package/dist/components/index.d.ts +16 -14
  9. package/dist/components/index.js +72 -18
  10. package/dist/components/method.d.ts +58 -1
  11. package/dist/components/method.js +95 -8
  12. package/dist/components/overview.d.ts +38 -1
  13. package/dist/components/overview.js +137 -9
  14. package/dist/components/primitives.d.ts +104 -1
  15. package/dist/components/primitives.js +250 -6
  16. package/dist/components/properties.d.ts +53 -1
  17. package/dist/components/properties.js +138 -7
  18. package/dist/components/sdk-sidebar.d.ts +14 -1
  19. package/dist/components/sdk-sidebar.js +50 -8
  20. package/dist/components/sdk.d.ts +121 -1
  21. package/dist/components/sdk.js +404 -8
  22. package/dist/components/snippets.d.ts +70 -13
  23. package/dist/components/snippets.js +182 -7
  24. package/dist/components/stl-sidebar.d.ts +57 -1
  25. package/dist/components/stl-sidebar.js +105 -3
  26. package/dist/contexts/component-generics.d.ts +29 -1
  27. package/dist/contexts/component-generics.js +31 -1
  28. package/dist/contexts/component-types.d.ts +4 -15
  29. package/dist/contexts/component.d.ts +7 -17
  30. package/dist/contexts/component.js +22 -28
  31. package/dist/contexts/docs.d.ts +61 -1
  32. package/dist/contexts/docs.js +89 -1
  33. package/dist/contexts/index.d.ts +13 -14
  34. package/dist/contexts/index.js +44 -6
  35. package/dist/contexts/markdown.d.ts +21 -1
  36. package/dist/contexts/markdown.js +47 -2
  37. package/dist/contexts/navigation.d.ts +28 -1
  38. package/dist/contexts/navigation.js +22 -1
  39. package/dist/contexts/use-components.d.ts +1 -13
  40. package/dist/contexts/use-components.js +6 -2
  41. package/dist/{index-W4Td2Hl7.d.ts → index-PdnFhQF9.d.ts} +1 -1
  42. package/dist/index.d.ts +4 -14
  43. package/dist/index.js +7 -30
  44. package/dist/languages/cli.d.ts +38 -14
  45. package/dist/languages/cli.js +166 -20
  46. package/dist/languages/csharp.d.ts +42 -14
  47. package/dist/languages/csharp.js +283 -8
  48. package/dist/languages/go.d.ts +40 -14
  49. package/dist/languages/go.js +303 -8
  50. package/dist/languages/http.d.ts +46 -14
  51. package/dist/languages/http.js +390 -19
  52. package/dist/languages/index.d.ts +50 -14
  53. package/dist/languages/index.js +30 -28
  54. package/dist/languages/java.d.ts +43 -14
  55. package/dist/languages/java.js +403 -8
  56. package/dist/languages/python.d.ts +40 -14
  57. package/dist/languages/python.js +269 -8
  58. package/dist/languages/ruby.d.ts +40 -14
  59. package/dist/languages/ruby.js +387 -8
  60. package/dist/languages/terraform.d.ts +48 -14
  61. package/dist/languages/terraform.js +243 -8
  62. package/dist/languages/typescript.d.ts +40 -14
  63. package/dist/languages/typescript.js +449 -8
  64. package/dist/markdown/index.d.ts +1 -2
  65. package/dist/markdown/index.js +1 -28
  66. package/dist/markdown/printer.d.ts +2 -2
  67. package/dist/markdown/printer.js +6 -30
  68. package/dist/markdown/utils.d.ts +3 -3
  69. package/dist/routing.d.ts +61 -2
  70. package/dist/routing.js +204 -2
  71. package/dist/spec.d.ts +4 -4
  72. package/dist/spec.js +2 -2
  73. package/dist/style.js +176 -1
  74. package/dist/use-strict-context-L0c8JKg4.js +16 -0
  75. package/dist/utils.d.ts +1 -1
  76. package/dist/utils.js +53 -2
  77. package/package.json +3 -3
  78. package/dist/breadcrumbs-46Qjx1Pd.d.ts +0 -25
  79. package/dist/breadcrumbs-BZ4wBC9-.d.ts +0 -25
  80. package/dist/breadcrumbs-BiBfNqBI.js +0 -63
  81. package/dist/cli-hduQ5XS1.js +0 -166
  82. package/dist/component-BU8BTbqz.js +0 -23
  83. package/dist/component-generics-Bw4ZOyEG.d.ts +0 -30
  84. package/dist/component-generics-D-WarFUb.d.ts +0 -30
  85. package/dist/component-generics-POFirVVb.js +0 -45
  86. package/dist/components-9NMl1791.js +0 -72
  87. package/dist/contexts-_NNW5yqC.js +0 -44
  88. package/dist/csharp-sn5CJu9t.js +0 -283
  89. package/dist/docs-Cu9Yl6-y.d.ts +0 -66
  90. package/dist/docs-YgoQ3bzY.js +0 -81
  91. package/dist/docs-xb5wYGjM.d.ts +0 -66
  92. package/dist/go-BoaAVmP0.js +0 -303
  93. package/dist/http-B3qTyMc3.js +0 -389
  94. package/dist/icons-BYKn5X8E.js +0 -885
  95. package/dist/index-BOmn7DHa.d.ts +0 -428
  96. package/dist/index-BvcPmB0r.d.ts +0 -428
  97. package/dist/java-BiLRuLuD.js +0 -403
  98. package/dist/languages-vUhD5Hu_.js +0 -30
  99. package/dist/markdown-BszOPZhh.d.ts +0 -22
  100. package/dist/markdown-Cq3XEhrR.js +0 -49
  101. package/dist/markdown-plMAoN22.d.ts +0 -22
  102. package/dist/method-C4PgTWAu.d.ts +0 -59
  103. package/dist/method-D6R_farj.d.ts +0 -59
  104. package/dist/method-DjzVBzZe.js +0 -96
  105. package/dist/navigation-HiZWRl34.d.ts +0 -29
  106. package/dist/navigation-MrP4Ubbg.d.ts +0 -29
  107. package/dist/navigation-aoYZ_tl4.js +0 -24
  108. package/dist/overview-CTeKhpQq.d.ts +0 -39
  109. package/dist/overview-Yf1PTJNi.d.ts +0 -39
  110. package/dist/overview-ocTARt-j.js +0 -138
  111. package/dist/primitives-CNG-fEhQ.js +0 -250
  112. package/dist/primitives-K7NijV36.d.ts +0 -105
  113. package/dist/primitives-WGxdBJDS.d.ts +0 -105
  114. package/dist/properties-Bu4nW9JD.d.ts +0 -54
  115. package/dist/properties-Bynmj9_H.d.ts +0 -54
  116. package/dist/properties-DQU0NBzb.js +0 -138
  117. package/dist/python-nqOBH7GS.js +0 -269
  118. package/dist/routing-C64k4fmX.js +0 -205
  119. package/dist/routing-pAL4V4hv.d.ts +0 -61
  120. package/dist/ruby-BBc8HdIt.js +0 -387
  121. package/dist/sdk-BSdgEEJw.js +0 -405
  122. package/dist/sdk-BVCk1ox2.d.ts +0 -122
  123. package/dist/sdk-Dm0S-XQE.d.ts +0 -122
  124. package/dist/sdk-sidebar-B1ehT_xI.d.ts +0 -15
  125. package/dist/sdk-sidebar-BDn8S1xS.js +0 -50
  126. package/dist/sdk-sidebar-Dqeu7C1-.d.ts +0 -15
  127. package/dist/snippets-CLpNVNlA.js +0 -181
  128. package/dist/stl-sidebar-BTTErIJs.d.ts +0 -58
  129. package/dist/stl-sidebar-C7GNALtk.d.ts +0 -58
  130. package/dist/stl-sidebar-DC5UOJiT.js +0 -106
  131. package/dist/style-DJIYkFhO.js +0 -178
  132. package/dist/terraform-DVx2ea2h.js +0 -243
  133. package/dist/typescript-Cmk-jBBw.js +0 -449
  134. package/dist/use-components-BUz3GbO4.js +0 -7
  135. package/dist/utils-DPbkW1Tz.js +0 -54
@@ -1,96 +0,0 @@
1
- import { t as useComponents } from "./use-components-BUz3GbO4.js";
2
- import { t as style_default } from "./style-DJIYkFhO.js";
3
- import { i as PropertyToggle } from "./properties-DQU0NBzb.js";
4
- import "react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- import clsx from "clsx";
7
- import { Badge, getHttpMethod } from "@stainless-api/ui-primitives";
8
- import { FunctionIcon } from "@stainless-api/ui-primitives/icons";
9
-
10
- //#region src/components/method.tsx
11
- function MethodHeader({ title, badges, signature, children, level }) {
12
- const Heading = level ?? "h5";
13
- return /* @__PURE__ */ jsxs("div", {
14
- className: style_default.MethodHeader,
15
- children: [
16
- /* @__PURE__ */ jsx(Heading, {
17
- className: style_default.MethodTitle,
18
- children: title
19
- }),
20
- badges && /* @__PURE__ */ jsx("div", {
21
- className: style_default.MethodBadges,
22
- children: badges
23
- }),
24
- signature,
25
- children
26
- ]
27
- });
28
- }
29
- function MethodRoute({ httpMethod, endpoint, iconOnly }) {
30
- const httpMethodTyped = getHttpMethod(httpMethod);
31
- return /* @__PURE__ */ jsxs("div", {
32
- className: style_default.MethodRoute,
33
- children: [httpMethod ? httpMethodTyped && /* @__PURE__ */ jsx(Badge.HTTP, {
34
- method: httpMethodTyped,
35
- iconOnly,
36
- size: "sm"
37
- }) : /* @__PURE__ */ jsx(Badge, {
38
- size: "sm",
39
- icon: /* @__PURE__ */ jsx(FunctionIcon, {}),
40
- intent: "info",
41
- children: !iconOnly && "Function"
42
- }), endpoint && /* @__PURE__ */ jsx("span", {
43
- className: style_default.MethodRouteEndpoint,
44
- children: endpoint
45
- })]
46
- });
47
- }
48
- function MethodDescription({ description }) {
49
- const { Markdown } = useComponents();
50
- if (description) return /* @__PURE__ */ jsx("div", {
51
- className: style_default.MethodDescription,
52
- children: /* @__PURE__ */ jsx(Markdown, { content: description })
53
- });
54
- }
55
- function MethodInfo({ children, parameters, returns }) {
56
- return /* @__PURE__ */ jsxs("div", {
57
- className: style_default.MethodInfo,
58
- children: [
59
- children && /* @__PURE__ */ jsx("div", {
60
- className: style_default.MethodContent,
61
- children
62
- }),
63
- parameters && /* @__PURE__ */ jsxs("div", {
64
- className: style_default.MethodInfoSection,
65
- children: [/* @__PURE__ */ jsxs("h5", { children: ["Parameters", /* @__PURE__ */ jsx(PropertyToggle, { target: "parameters" })] }), /* @__PURE__ */ jsx("div", {
66
- className: style_default.MethodParameters,
67
- "data-stldocs-property-group": "parameters",
68
- children: parameters
69
- })]
70
- }),
71
- returns && /* @__PURE__ */ jsxs("div", {
72
- className: style_default.MethodInfoSection,
73
- children: [/* @__PURE__ */ jsxs("h5", { children: ["Returns", /* @__PURE__ */ jsx(PropertyToggle, { target: "returns" })] }), /* @__PURE__ */ jsx("div", {
74
- className: style_default.MethodReturns,
75
- "data-stldocs-property-group": "returns",
76
- children: returns
77
- })]
78
- })
79
- ]
80
- });
81
- }
82
- function Method({ id, header, children, className, ...props }) {
83
- return /* @__PURE__ */ jsxs("div", {
84
- id,
85
- className: clsx(style_default.Method, className),
86
- tabIndex: 0,
87
- ...props,
88
- children: [header, /* @__PURE__ */ jsx("div", {
89
- className: style_default.MethodBody,
90
- children
91
- })]
92
- });
93
- }
94
-
95
- //#endregion
96
- export { MethodRoute as a, MethodInfo as i, MethodDescription as n, MethodHeader as r, Method as t };
@@ -1,29 +0,0 @@
1
- import { t as DocsLanguage } from "./routing-pAL4V4hv.js";
2
- import * as React$1 from "react";
3
- import * as react_jsx_runtime63 from "react/jsx-runtime";
4
-
5
- //#region src/contexts/navigation.d.ts
6
- type NavigationHandler = (ev: React$1.MouseEvent | null, opts: {
7
- href: string;
8
- language: DocsLanguage;
9
- stainlessPath: string;
10
- scroll: boolean;
11
- }) => void;
12
- type NavigationContextType = {
13
- basePath?: string;
14
- selectedPath?: string;
15
- navigationPath?: string[];
16
- onNavigate?: NavigationHandler;
17
- };
18
- declare function useNavigation(): NavigationContextType;
19
- type NavigationProviderProps = NavigationContextType & {
20
- children: React$1.ReactNode;
21
- };
22
- declare function NavigationProvider({
23
- basePath,
24
- selectedPath,
25
- onNavigate,
26
- children
27
- }: NavigationProviderProps): react_jsx_runtime63.JSX.Element;
28
- //#endregion
29
- export { useNavigation as a, NavigationProviderProps as i, NavigationHandler as n, NavigationProvider as r, NavigationContextType as t };
@@ -1,29 +0,0 @@
1
- import { t as DocsLanguage } from "./routing-pAL4V4hv.js";
2
- import * as React$1 from "react";
3
- import * as react_jsx_runtime66 from "react/jsx-runtime";
4
-
5
- //#region src/contexts/navigation.d.ts
6
- type NavigationHandler = (ev: React$1.MouseEvent | null, opts: {
7
- href: string;
8
- language: DocsLanguage;
9
- stainlessPath: string;
10
- scroll: boolean;
11
- }) => void;
12
- type NavigationContextType = {
13
- basePath?: string;
14
- selectedPath?: string;
15
- navigationPath?: string[];
16
- onNavigate?: NavigationHandler;
17
- };
18
- declare function useNavigation(): NavigationContextType;
19
- type NavigationProviderProps = NavigationContextType & {
20
- children: React$1.ReactNode;
21
- };
22
- declare function NavigationProvider({
23
- basePath,
24
- selectedPath,
25
- onNavigate,
26
- children
27
- }: NavigationProviderProps): react_jsx_runtime66.JSX.Element;
28
- //#endregion
29
- export { useNavigation as a, NavigationProviderProps as i, NavigationHandler as n, NavigationProvider as r, NavigationContextType as t };
@@ -1,24 +0,0 @@
1
- import * as React$1 from "react";
2
- import { jsx } from "react/jsx-runtime";
3
-
4
- //#region src/contexts/navigation.tsx
5
- const Defaults = { basePath: "/" };
6
- const NavigationContext = React$1.createContext(Defaults);
7
- function useNavigation() {
8
- return React$1.useContext(NavigationContext);
9
- }
10
- function NavigationProvider({ basePath, selectedPath, onNavigate, children }) {
11
- const value = {
12
- ...Defaults,
13
- onNavigate,
14
- basePath,
15
- selectedPath
16
- };
17
- return /* @__PURE__ */ jsx(NavigationContext.Provider, {
18
- value,
19
- children
20
- });
21
- }
22
-
23
- //#endregion
24
- export { useNavigation as n, NavigationProvider as t };
@@ -1,39 +0,0 @@
1
- import { d as Method, m as Resource } from "./index-W4Td2Hl7.js";
2
- import * as react_jsx_runtime18 from "react/jsx-runtime";
3
-
4
- //#region src/components/overview.d.ts
5
- type SDKResourceProps = {
6
- resource: Resource;
7
- parents?: Resource[];
8
- };
9
- declare function SDKResourceHeader({
10
- resource,
11
- parents
12
- }: SDKResourceProps): react_jsx_runtime18.JSX.Element | null;
13
- type SDKMethodSummaryProps = {
14
- method: Method;
15
- };
16
- declare function SDKMethodSummary({
17
- method
18
- }: SDKMethodSummaryProps): react_jsx_runtime18.JSX.Element;
19
- declare function SDKResource({
20
- resource,
21
- parents,
22
- showModels
23
- }: SDKResourceProps & {
24
- showModels?: boolean;
25
- }): react_jsx_runtime18.JSX.Element;
26
- type SDKOverviewProps = {
27
- resource: Resource;
28
- };
29
- declare function SDKOverview({
30
- resource
31
- }: SDKOverviewProps): react_jsx_runtime18.JSX.Element;
32
- type SDKRootProps = {
33
- stainlessPath: string;
34
- };
35
- declare function SDKRoot({
36
- stainlessPath
37
- }: SDKRootProps): react_jsx_runtime18.JSX.Element | null;
38
- //#endregion
39
- export { SDKResource as a, SDKRoot as c, SDKOverviewProps as i, SDKRootProps as l, SDKMethodSummaryProps as n, SDKResourceHeader as o, SDKOverview as r, SDKResourceProps as s, SDKMethodSummary as t };
@@ -1,39 +0,0 @@
1
- import { d as Method, m as Resource } from "./index-W4Td2Hl7.js";
2
- import * as react_jsx_runtime35 from "react/jsx-runtime";
3
-
4
- //#region src/components/overview.d.ts
5
- type SDKResourceProps = {
6
- resource: Resource;
7
- parents?: Resource[];
8
- };
9
- declare function SDKResourceHeader({
10
- resource,
11
- parents
12
- }: SDKResourceProps): react_jsx_runtime35.JSX.Element | null;
13
- type SDKMethodSummaryProps = {
14
- method: Method;
15
- };
16
- declare function SDKMethodSummary({
17
- method
18
- }: SDKMethodSummaryProps): react_jsx_runtime35.JSX.Element;
19
- declare function SDKResource({
20
- resource,
21
- parents,
22
- showModels
23
- }: SDKResourceProps & {
24
- showModels?: boolean;
25
- }): react_jsx_runtime35.JSX.Element;
26
- type SDKOverviewProps = {
27
- resource: Resource;
28
- };
29
- declare function SDKOverview({
30
- resource
31
- }: SDKOverviewProps): react_jsx_runtime35.JSX.Element;
32
- type SDKRootProps = {
33
- stainlessPath: string;
34
- };
35
- declare function SDKRoot({
36
- stainlessPath
37
- }: SDKRootProps): react_jsx_runtime35.JSX.Element | null;
38
- //#endregion
39
- export { SDKResource as a, SDKRoot as c, SDKOverviewProps as i, SDKRootProps as l, SDKMethodSummaryProps as n, SDKResourceHeader as o, SDKOverview as r, SDKResourceProps as s, SDKMethodSummary as t };
@@ -1,138 +0,0 @@
1
- import { i as useDeclaration, m as useSpec, s as useLanguage } from "./docs-YgoQ3bzY.js";
2
- import { n as useLanguageComponents } from "./contexts-_NNW5yqC.js";
3
- import { t as useComponents } from "./use-components-BUz3GbO4.js";
4
- import { t as style_default } from "./style-DJIYkFhO.js";
5
- import { i as PropertyToggle } from "./properties-DQU0NBzb.js";
6
- import { p as parseStainlessPath } from "./routing-C64k4fmX.js";
7
- import { s as Markdown } from "./primitives-CNG-fEhQ.js";
8
- import { r as getResourceFromSpec, t as flatResources } from "./utils-DPbkW1Tz.js";
9
- import * as React$1 from "react";
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
- import { ChevronRight } from "lucide-react";
12
-
13
- //#region src/components/overview.tsx
14
- function SDKResourceHeader({ resource, parents }) {
15
- const segments = parents?.map((parent, index) => /* @__PURE__ */ jsxs("span", {
16
- className: style_default.ResourceTitleSegment,
17
- children: [parent.title, index < parents.length && /* @__PURE__ */ jsx(ChevronRight, {
18
- size: 16,
19
- className: style_default.Icon
20
- })]
21
- }, parent.stainlessPath));
22
- if (!segments && !resource.description) return null;
23
- return /* @__PURE__ */ jsxs("div", {
24
- className: style_default.ResourceHeader,
25
- children: [segments && /* @__PURE__ */ jsxs("h4", {
26
- id: resource.stainlessPath,
27
- className: style_default.ResourceTitle,
28
- children: [segments, /* @__PURE__ */ jsx("span", {
29
- className: style_default.ResourceTitleSegment,
30
- children: resource.title
31
- })]
32
- }), resource.description && /* @__PURE__ */ jsx("div", {
33
- className: style_default.ResourceDescription,
34
- children: /* @__PURE__ */ jsx(Markdown, { content: resource.description })
35
- })]
36
- });
37
- }
38
- function SDKMethodSummary({ method }) {
39
- const Docs = useComponents();
40
- const Lang = useLanguageComponents();
41
- const decl = useDeclaration(method.stainlessPath, true);
42
- return /* @__PURE__ */ jsx(Docs.MethodHeader, {
43
- level: "h5",
44
- title: /* @__PURE__ */ jsx(Docs.Link, {
45
- stainlessPath: method.stainlessPath,
46
- children: method.summary || method.title
47
- }),
48
- signature: /* @__PURE__ */ jsx(Lang.MethodSignature, { decl }),
49
- badges: method.deprecated && /* @__PURE__ */ jsx(Docs.Badge, {
50
- id: "deprecated",
51
- children: "Deprecated"
52
- }),
53
- children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
54
- httpMethod: method.httpMethod,
55
- endpoint: method.endpoint.split(" ", 2).at(-1)
56
- })
57
- });
58
- }
59
- function SDKResource({ resource, parents, showModels }) {
60
- const Docs = useComponents();
61
- const Lang = useLanguageComponents();
62
- const language = useLanguage();
63
- const spec = useSpec();
64
- const methods = Object.values(resource.methods).filter((method) => spec?.decls?.[language]?.[method.stainlessPath]);
65
- const models = Object.values(resource.models).filter((model) => spec?.decls?.[language]?.[`${model.stainlessPath} > (schema)`]);
66
- return /* @__PURE__ */ jsx("div", {
67
- className: style_default.Resource,
68
- "data-stl-resource-language": language,
69
- children: /* @__PURE__ */ jsxs("div", {
70
- className: style_default.ResourceContent,
71
- children: [
72
- /* @__PURE__ */ jsx(Docs.SDKResourceHeader, {
73
- resource,
74
- parents
75
- }),
76
- Lang.Resource && /* @__PURE__ */ jsx(Lang.Resource, { resource }),
77
- methods.length > 0 && /* @__PURE__ */ jsx("div", {
78
- className: style_default.ResourceContentGroup,
79
- children: methods.map((method) => /* @__PURE__ */ jsx("div", {
80
- className: style_default.MethodSummary,
81
- children: /* @__PURE__ */ jsx(Docs.SDKMethodSummary, { method })
82
- }, method.stainlessPath))
83
- }),
84
- showModels !== false && models.length > 0 && /* @__PURE__ */ jsxs("div", {
85
- className: style_default.ResourceContentGroup,
86
- "data-stldocs-property-group": "models",
87
- children: [/* @__PURE__ */ jsxs("h5", {
88
- className: style_default.ResourceContentGroupModelTitle,
89
- children: ["Models", /* @__PURE__ */ jsx(PropertyToggle, { target: "models" })]
90
- }), models.map((model) => /* @__PURE__ */ jsx(Docs.SDKModel, { model }, model.stainlessPath))]
91
- })
92
- ]
93
- })
94
- });
95
- }
96
- function SDKOverview({ resource }) {
97
- const { SDKResource } = useComponents();
98
- const nested = React$1.useMemo(() => flatResources(resource.subresources, [resource]), [resource]);
99
- return /* @__PURE__ */ jsxs("div", {
100
- className: style_default.Overview,
101
- children: [
102
- /* @__PURE__ */ jsx("div", {
103
- className: style_default.OverviewHeader,
104
- children: /* @__PURE__ */ jsx("h1", { children: resource.title })
105
- }),
106
- /* @__PURE__ */ jsx(SDKResource, { resource }),
107
- nested.map((props, index) => /* @__PURE__ */ jsx(SDKResource, { ...props }, index))
108
- ]
109
- });
110
- }
111
- function SDKRoot({ stainlessPath }) {
112
- const spec = useSpec();
113
- const Docs = useComponents();
114
- const parsed = parseStainlessPath(stainlessPath);
115
- const resource = spec && getResourceFromSpec(stainlessPath, spec);
116
- if (!resource || !parsed) {
117
- console.warn(`Could not find resource or parsed path for '${stainlessPath}'`);
118
- return null;
119
- }
120
- if (parsed.method) {
121
- const method = resource.methods[parsed.method];
122
- if (!method) {
123
- console.warn(`Method '${parsed.method}' not found in resource '${resource.stainlessPath}'`);
124
- return null;
125
- }
126
- return /* @__PURE__ */ jsx("div", {
127
- className: style_default.Root,
128
- children: /* @__PURE__ */ jsx(Docs.SDKMethod, { method })
129
- });
130
- }
131
- return /* @__PURE__ */ jsx("div", {
132
- className: style_default.Root,
133
- children: /* @__PURE__ */ jsx(Docs.SDKOverview, { resource })
134
- });
135
- }
136
-
137
- //#endregion
138
- export { SDKRoot as a, SDKResourceHeader as i, SDKOverview as n, SDKResource as r, SDKMethodSummary as t };
@@ -1,250 +0,0 @@
1
- import { l as useSettings, s as useLanguage } from "./docs-YgoQ3bzY.js";
2
- import { n as useNavigation } from "./navigation-aoYZ_tl4.js";
3
- import { a as useRenderMarkdown } from "./markdown-Cq3XEhrR.js";
4
- import { t as style_default } from "./style-DJIYkFhO.js";
5
- import { s as generateRoute } from "./routing-C64k4fmX.js";
6
- import { Fragment, createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
7
- import { jsx, jsxs } from "react/jsx-runtime";
8
- import clsx from "clsx";
9
- import { MinusIcon, PlusIcon } from "lucide-react";
10
-
11
- //#region src/components/primitives.tsx
12
- function Join({ items, limit, children }) {
13
- return (limit && items.length > limit + 1 ? [...items.slice(0, limit), /* @__PURE__ */ jsxs("span", {
14
- className: style_default.Truncation,
15
- children: [items.length - limit, " more"]
16
- }, "truncation")] : items).map((item, index) => /* @__PURE__ */ jsxs(Fragment, { children: [!!index && children, item] }, `iterator:${index}`));
17
- }
18
- function Expander({ id, open, summary, virtual, muted, children }) {
19
- const virtualExpanders = useSettings()?.virtualExpanders;
20
- if (virtual || virtualExpanders) return /* @__PURE__ */ jsx(VirtualExpander, {
21
- summary,
22
- open,
23
- muted,
24
- id,
25
- children
26
- }, open ? "open" : "closed");
27
- return /* @__PURE__ */ jsxs("details", {
28
- className: style_default.Expander,
29
- open,
30
- "data-stldocs-expander-muted": muted,
31
- "data-stldocs-expander-initial-state": open,
32
- children: [/* @__PURE__ */ jsxs("summary", {
33
- className: style_default.ExpanderSummary,
34
- children: [/* @__PURE__ */ jsxs("div", {
35
- className: style_default.ExpanderSummaryIcon,
36
- children: [/* @__PURE__ */ jsx(PlusIcon, {
37
- size: 16,
38
- strokeWidth: 1,
39
- className: style_default.Icon
40
- }), /* @__PURE__ */ jsx(MinusIcon, {
41
- size: 16,
42
- strokeWidth: 1,
43
- className: style_default.Icon
44
- })]
45
- }), /* @__PURE__ */ jsx("div", {
46
- className: style_default.ExpanderSummaryContent,
47
- children: summary
48
- })]
49
- }), /* @__PURE__ */ jsx("div", {
50
- className: style_default.ExpanderContent,
51
- id,
52
- children
53
- })]
54
- });
55
- }
56
- function VirtualExpander({ id, open: isOpen, muted, summary, children }) {
57
- const [open, setOpen] = useState(isOpen ?? false);
58
- return /* @__PURE__ */ jsxs("div", {
59
- className: style_default.Expander,
60
- "data-open": open,
61
- "data-stldocs-expander-muted": muted,
62
- "data-stldocs-expander-initial-state": open,
63
- children: [/* @__PURE__ */ jsxs("div", {
64
- className: style_default.ExpanderSummary,
65
- onClick: () => setOpen(!open),
66
- children: [/* @__PURE__ */ jsxs("div", {
67
- className: style_default.ExpanderSummaryIcon,
68
- children: [/* @__PURE__ */ jsx(PlusIcon, {
69
- size: 16,
70
- className: style_default.Icon
71
- }), /* @__PURE__ */ jsx(MinusIcon, {
72
- size: 16,
73
- className: style_default.Icon
74
- })]
75
- }), /* @__PURE__ */ jsx("div", {
76
- className: style_default.ExpanderSummaryContent,
77
- children: summary
78
- })]
79
- }), open && /* @__PURE__ */ jsx("div", {
80
- className: style_default.ExpanderContent,
81
- id,
82
- children
83
- })]
84
- });
85
- }
86
- function Markdown({ content }) {
87
- const rendered = useRenderMarkdown(content);
88
- return rendered && /* @__PURE__ */ jsx("div", {
89
- className: clsx(style_default.Markdown, style_default.Content, "stl-ui-prose"),
90
- dangerouslySetInnerHTML: { __html: rendered }
91
- });
92
- }
93
- function Badge({ id, children }) {
94
- return /* @__PURE__ */ jsx("span", {
95
- className: style_default.Badge,
96
- "data-badge-id": id,
97
- children: children ?? id
98
- });
99
- }
100
- const TooltipNestingContext = createContext(false);
101
- function Tooltip({ content, children }) {
102
- if (useContext(TooltipNestingContext)) return children;
103
- return /* @__PURE__ */ jsxs("span", {
104
- className: style_default.Tooltip,
105
- children: [/* @__PURE__ */ jsx("span", {
106
- className: style_default.TooltipContent,
107
- children: /* @__PURE__ */ jsx(TooltipNestingContext.Provider, {
108
- value: true,
109
- children: content
110
- })
111
- }), /* @__PURE__ */ jsx("span", {
112
- className: style_default.TooltipHost,
113
- children
114
- })]
115
- });
116
- }
117
- function Link({ stainlessPath, scroll = true, children, ...props }) {
118
- const { basePath, onNavigate } = useNavigation();
119
- const language = useLanguage();
120
- const href = useMemo(() => {
121
- if (props.href) return props.href;
122
- if (stainlessPath && basePath) return generateRoute(basePath, language, stainlessPath);
123
- }, [
124
- basePath,
125
- language,
126
- stainlessPath,
127
- props.href
128
- ]);
129
- const handleClick = useCallback((e) => {
130
- if (props.onClick) props.onClick(e);
131
- if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
132
- if (href && stainlessPath) onNavigate?.(e, {
133
- href,
134
- language,
135
- stainlessPath,
136
- scroll
137
- });
138
- }, [
139
- href,
140
- scroll,
141
- onNavigate,
142
- language,
143
- props,
144
- stainlessPath
145
- ]);
146
- if (!href) return children;
147
- return /* @__PURE__ */ jsx("a", {
148
- href,
149
- onClick: handleClick,
150
- ...props,
151
- children
152
- });
153
- }
154
- function Input({ left, right, ref, className, ...props }) {
155
- return /* @__PURE__ */ jsxs("div", {
156
- className: clsx(style_default.Input, props.disabled && style_default.InputDisabled, className),
157
- children: [
158
- left,
159
- /* @__PURE__ */ jsx("input", {
160
- ...props,
161
- ref,
162
- className: style_default.InputTextField
163
- }),
164
- right
165
- ]
166
- });
167
- }
168
- function ToggleButton({ children, selected, ref, ...props }) {
169
- return /* @__PURE__ */ jsx("button", {
170
- ...props,
171
- ref,
172
- className: style_default.ToggleButton,
173
- "data-stldocs-toggle-selected": selected,
174
- children
175
- });
176
- }
177
- function ListView({ items, itemDelegate, onSelectListItem, ...rest }) {
178
- const [selectedIndex, setSelectedIndex] = useState(0);
179
- const [keyboardIndex, setKeyboardIndex] = useState(0);
180
- const listRef = useRef(null);
181
- const itemRef = useRef(null);
182
- const handleSelect = useCallback(() => {
183
- const item = items[selectedIndex];
184
- if (item) onSelectListItem?.(item);
185
- }, [
186
- items,
187
- selectedIndex,
188
- onSelectListItem
189
- ]);
190
- useEffect(() => {
191
- const ac = new AbortController();
192
- document.addEventListener("keydown", (ev) => {
193
- switch (ev.key) {
194
- case "ArrowUp": {
195
- ev.preventDefault();
196
- const value = Math.max(0, selectedIndex - 1);
197
- setSelectedIndex(value);
198
- setKeyboardIndex(value);
199
- break;
200
- }
201
- case "ArrowDown": {
202
- ev.preventDefault();
203
- const value = Math.min(items.length, selectedIndex + 1);
204
- setSelectedIndex(value);
205
- setKeyboardIndex(value);
206
- break;
207
- }
208
- case "Enter":
209
- ev.preventDefault();
210
- handleSelect();
211
- break;
212
- }
213
- }, { signal: ac.signal });
214
- return () => ac.abort();
215
- }, [
216
- items,
217
- selectedIndex,
218
- handleSelect
219
- ]);
220
- useEffect(() => {
221
- if (!keyboardIndex || !itemRef.current || !listRef.current) {
222
- listRef?.current?.scroll(0, 0);
223
- return;
224
- }
225
- const selectedBounds = itemRef.current.getBoundingClientRect();
226
- const listBounds = listRef.current.getBoundingClientRect();
227
- if (selectedBounds.top < listBounds.top || selectedBounds.bottom > listBounds.bottom) itemRef.current.scrollIntoView({ block: "nearest" });
228
- }, [
229
- keyboardIndex,
230
- items,
231
- listRef
232
- ]);
233
- return /* @__PURE__ */ jsx("div", {
234
- ref: listRef,
235
- className: style_default.ListView,
236
- tabIndex: 0,
237
- ...rest,
238
- children: items.map((item, index) => /* @__PURE__ */ jsx("div", {
239
- ref: index === selectedIndex ? itemRef : null,
240
- className: style_default.ListViewItem,
241
- "data-stldocs-listview-selected": index === selectedIndex,
242
- onClick: handleSelect,
243
- onMouseEnter: () => setSelectedIndex(index),
244
- children: itemDelegate(item, index === selectedIndex)
245
- }, index))
246
- });
247
- }
248
-
249
- //#endregion
250
- export { Link as a, ToggleButton as c, Join as i, Tooltip as l, Expander as n, ListView as o, Input as r, Markdown as s, Badge as t, VirtualExpander as u };