@stainless-api/docs-ui 0.1.0-beta.9 → 0.1.0-beta.90

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 (162) hide show
  1. package/dist/breadcrumbs-DC2_z7nh.d.ts +25 -0
  2. package/dist/chunk-pbuEa-1d.js +13 -0
  3. package/dist/component-generics-DYxBWv1v.js +42 -0
  4. package/dist/component-generics-q-ujwX4P.d.ts +30 -0
  5. package/dist/components/MaskedInput.d.ts +14 -0
  6. package/dist/components/MaskedInput.js +74 -0
  7. package/dist/components/breadcrumbs.d.ts +2 -0
  8. package/dist/components/breadcrumbs.js +62 -0
  9. package/dist/components/icons.d.ts +72 -0
  10. package/dist/components/icons.js +953 -0
  11. package/dist/components/index.d.ts +10 -0
  12. package/dist/components/index.js +73 -0
  13. package/dist/components/method.d.ts +2 -0
  14. package/dist/components/method.js +95 -0
  15. package/dist/components/overview.d.ts +2 -0
  16. package/dist/components/overview.js +140 -0
  17. package/dist/components/primitives.d.ts +2 -0
  18. package/dist/components/primitives.js +251 -0
  19. package/dist/components/properties.d.ts +2 -0
  20. package/dist/components/properties.js +144 -0
  21. package/dist/components/sdk-sidebar.d.ts +2 -0
  22. package/dist/components/sdk-sidebar.js +50 -0
  23. package/dist/components/sdk.d.ts +2 -0
  24. package/dist/components/sdk.js +488 -0
  25. package/dist/components/snippets.d.ts +2 -0
  26. package/dist/components/snippets.js +184 -0
  27. package/dist/components/stl-sidebar.d.ts +2 -0
  28. package/dist/components/stl-sidebar.js +112 -0
  29. package/dist/contexts/component-generics.d.ts +2 -0
  30. package/dist/contexts/component-generics.js +2 -0
  31. package/dist/contexts/component-types.d.ts +6 -0
  32. package/dist/contexts/component-types.js +0 -0
  33. package/dist/contexts/component.d.ts +20 -0
  34. package/dist/contexts/component.js +21 -0
  35. package/dist/contexts/docs.d.ts +2 -0
  36. package/dist/contexts/docs.js +89 -0
  37. package/dist/contexts/index.d.ts +6 -0
  38. package/dist/contexts/index.js +43 -0
  39. package/dist/contexts/markdown.d.ts +2 -0
  40. package/dist/contexts/markdown.js +62 -0
  41. package/dist/contexts/navigation.d.ts +2 -0
  42. package/dist/contexts/navigation.js +21 -0
  43. package/dist/contexts/use-components.d.ts +5 -0
  44. package/dist/contexts/use-components.js +5 -0
  45. package/dist/docs-DSjdvCh5.d.ts +62 -0
  46. package/dist/index-DFr9Mesr.d.ts +1776 -0
  47. package/dist/index-gGDaf6FK.d.ts +464 -0
  48. package/dist/index.d.ts +5 -0
  49. package/dist/index.js +8 -7542
  50. package/dist/languages/cli.d.ts +2 -0
  51. package/dist/languages/cli.js +165 -0
  52. package/dist/languages/csharp.d.ts +2 -0
  53. package/dist/languages/csharp.js +282 -0
  54. package/dist/languages/go.d.ts +2 -0
  55. package/dist/languages/go.js +302 -0
  56. package/dist/languages/http.d.ts +2 -0
  57. package/dist/languages/http.js +385 -0
  58. package/dist/languages/index.d.ts +2 -0
  59. package/dist/languages/index.js +31 -0
  60. package/dist/languages/java.d.ts +2 -0
  61. package/dist/languages/java.js +402 -0
  62. package/dist/languages/php.d.ts +2 -0
  63. package/dist/languages/php.js +311 -0
  64. package/dist/languages/python.d.ts +2 -0
  65. package/dist/languages/python.js +268 -0
  66. package/dist/languages/ruby.d.ts +2 -0
  67. package/dist/languages/ruby.js +386 -0
  68. package/dist/languages/terraform.d.ts +2 -0
  69. package/dist/languages/terraform.js +259 -0
  70. package/dist/languages/typescript.d.ts +2 -0
  71. package/dist/languages/typescript.js +448 -0
  72. package/dist/markdown/index.d.ts +11 -0
  73. package/dist/markdown/index.js +87 -0
  74. package/dist/markdown/md.d.ts +15 -0
  75. package/dist/markdown/md.js +39 -0
  76. package/dist/markdown/printer.d.ts +13 -0
  77. package/dist/markdown/printer.js +74 -0
  78. package/dist/markdown/utils.d.ts +28 -0
  79. package/dist/markdown/utils.js +31 -0
  80. package/dist/markdown-Cwdboi_V.d.ts +33 -0
  81. package/dist/method-CNRMOUfn.d.ts +59 -0
  82. package/dist/navigation-C9ckAfpV.d.ts +29 -0
  83. package/dist/overview-CDvh184n.d.ts +39 -0
  84. package/dist/primitives-DFE_4MvV.d.ts +107 -0
  85. package/dist/properties-CVwrzWVa.d.ts +54 -0
  86. package/dist/routing-yTSG7nWM.d.ts +61 -0
  87. package/dist/routing.d.ts +2 -0
  88. package/dist/routing.js +174 -150
  89. package/dist/sdk-BkW3MDco.d.ts +128 -0
  90. package/dist/sdk-sidebar-BpDlOMat.d.ts +15 -0
  91. package/dist/spec.d.ts +65 -0
  92. package/dist/spec.js +165 -0
  93. package/dist/stl-sidebar-CKrR5ZGs.d.ts +58 -0
  94. package/dist/style.d.ts +178 -0
  95. package/dist/style.js +178 -0
  96. package/dist/styles/main.css +765 -755
  97. package/dist/styles/primitives.css +359 -442
  98. package/dist/styles/resets.css +25 -41
  99. package/dist/styles/search.css +187 -270
  100. package/dist/styles/sidebar.css +155 -69
  101. package/dist/styles/variables.css +23 -89
  102. package/dist/styles.css +3171 -0
  103. package/dist/utils.d.ts +20 -0
  104. package/dist/utils.js +52 -0
  105. package/package.json +75 -22
  106. package/dist/mcp.js +0 -16003
  107. package/dist/styles/snippets.css +0 -132
  108. package/src/components/breadcrumbs.tsx +0 -94
  109. package/src/components/chat.tsx +0 -154
  110. package/src/components/dropdown.tsx +0 -91
  111. package/src/components/icons.tsx +0 -584
  112. package/src/components/index.ts +0 -9
  113. package/src/components/method.tsx +0 -146
  114. package/src/components/overview.tsx +0 -160
  115. package/src/components/primitives.tsx +0 -284
  116. package/src/components/properties.tsx +0 -130
  117. package/src/components/scripts/dropdown.ts +0 -78
  118. package/src/components/sdk.tsx +0 -403
  119. package/src/components/sidebar.tsx +0 -99
  120. package/src/components/snippets.tsx +0 -180
  121. package/src/contexts/component-generics.tsx +0 -48
  122. package/src/contexts/component-types.tsx +0 -5
  123. package/src/contexts/component.tsx +0 -32
  124. package/src/contexts/docs.tsx +0 -75
  125. package/src/contexts/index.tsx +0 -17
  126. package/src/contexts/markdown.tsx +0 -43
  127. package/src/contexts/navigation.tsx +0 -44
  128. package/src/contexts/search.tsx +0 -28
  129. package/src/contexts/use-components.tsx +0 -4
  130. package/src/index.ts +0 -6
  131. package/src/languages/go.tsx +0 -281
  132. package/src/languages/http.tsx +0 -321
  133. package/src/languages/index.ts +0 -26
  134. package/src/languages/java.tsx +0 -358
  135. package/src/languages/python.tsx +0 -255
  136. package/src/languages/ruby.tsx +0 -320
  137. package/src/languages/typescript.tsx +0 -393
  138. package/src/markdown/index.ts +0 -107
  139. package/src/markdown/md.ts +0 -45
  140. package/src/markdown/utils.ts +0 -49
  141. package/src/routing.ts +0 -238
  142. package/src/search/form.tsx +0 -127
  143. package/src/search/index.tsx +0 -1
  144. package/src/search/indexer.ts +0 -246
  145. package/src/search/mcp.ts +0 -61
  146. package/src/search/printer.tsx +0 -86
  147. package/src/search/providers/algolia.ts +0 -88
  148. package/src/search/providers/fuse.ts +0 -19
  149. package/src/search/providers/pagefind.ts +0 -17
  150. package/src/search/providers/walker.ts +0 -30
  151. package/src/search/results.tsx +0 -182
  152. package/src/search/state.ts +0 -64
  153. package/src/search/types.ts +0 -116
  154. package/src/style.ts +0 -196
  155. package/src/styles/main.css +0 -986
  156. package/src/styles/primitives.css +0 -580
  157. package/src/styles/resets.css +0 -39
  158. package/src/styles/search.css +0 -341
  159. package/src/styles/sidebar.css +0 -85
  160. package/src/styles/snippets.css +0 -130
  161. package/src/styles/variables.css +0 -86
  162. package/src/utils.ts +0 -41
@@ -0,0 +1,25 @@
1
+ import { v as Spec } from "./index-DFr9Mesr.js";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/components/breadcrumbs.d.ts
5
+ type Breadcrumb = {
6
+ title: string;
7
+ href: string;
8
+ };
9
+ type BreadcrumbConfig = {
10
+ includeCurrentPage?: boolean;
11
+ };
12
+ declare function generateApiBreadcrumbs(fullPath: string, spec: any, basePath: string): Breadcrumb[] | null;
13
+ declare function SDKBreadcrumbs({
14
+ spec,
15
+ currentPath,
16
+ basePath,
17
+ config
18
+ }: {
19
+ spec: Spec;
20
+ currentPath: string;
21
+ basePath?: string;
22
+ config?: BreadcrumbConfig | null;
23
+ }): react_jsx_runtime0.JSX.Element | null;
24
+ //#endregion
25
+ export { generateApiBreadcrumbs as n, SDKBreadcrumbs as t };
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/hooks/use-strict-context.tsx
4
+ function createStrictContext(displayName) {
5
+ const Context = React.createContext(null);
6
+ Context.displayName = displayName;
7
+ function useStrictContext() {
8
+ const context = React.use(Context);
9
+ if (context === null) throw new Error(`use${displayName} must be used within a ${displayName}Provider`);
10
+ return context;
11
+ }
12
+ return [Context.Provider, useStrictContext];
13
+ }
14
+ //#endregion
15
+ //#region src/contexts/component-generics.tsx
16
+ const [Provider, useComponentContext] = createStrictContext("Component");
17
+ function useComponents() {
18
+ return useComponentContext().components;
19
+ }
20
+ function customizeComponents(defaults, overrides = {}) {
21
+ return {
22
+ components: {
23
+ ...defaults.components,
24
+ ...overrides.components ?? {}
25
+ },
26
+ language: Object.keys(defaults.language).reduce((acc, key) => {
27
+ acc[key] = {
28
+ ...defaults.language[key],
29
+ ...overrides.language?.[key] ?? {}
30
+ };
31
+ return acc;
32
+ }, {})
33
+ };
34
+ }
35
+ function ComponentProvider({ value, children }) {
36
+ return /* @__PURE__ */ jsx(Provider, {
37
+ value,
38
+ children
39
+ });
40
+ }
41
+ //#endregion
42
+ export { useComponents as i, customizeComponents as n, useComponentContext as r, ComponentProvider as t };
@@ -0,0 +1,30 @@
1
+ import * as React$1 from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/contexts/component-generics.d.ts
5
+ type DeepPartialMap<L> = { [K in keyof L]?: Partial<L[K]> };
6
+ type ComponentsContextType<C, L> = {
7
+ components: C;
8
+ language: L;
9
+ };
10
+ declare const useComponentContext: () => ComponentsContextType<any, any>;
11
+ declare function useComponents<C = unknown>(): C;
12
+ declare function customizeComponents<C, L>(defaults: {
13
+ components: C;
14
+ language: L;
15
+ }, overrides?: {
16
+ components?: Partial<C>;
17
+ language?: DeepPartialMap<L>;
18
+ }): {
19
+ components: C;
20
+ language: L;
21
+ };
22
+ declare function ComponentProvider<C, L>({
23
+ value,
24
+ children
25
+ }: {
26
+ value: ComponentsContextType<C, L>;
27
+ children: React$1.ReactNode;
28
+ }): react_jsx_runtime0.JSX.Element;
29
+ //#endregion
30
+ export { useComponents as a, useComponentContext as i, ComponentsContextType as n, customizeComponents as r, ComponentProvider as t };
@@ -0,0 +1,14 @@
1
+ import { i as InputProps } from "../primitives-DFE_4MvV.js";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/components/MaskedInput.d.ts
5
+ declare const MaskedInput: ({
6
+ left,
7
+ right,
8
+ defaultValue,
9
+ value,
10
+ ref,
11
+ ...props
12
+ }: InputProps) => react_jsx_runtime0.JSX.Element;
13
+ //#endregion
14
+ export { MaskedInput };
@@ -0,0 +1,74 @@
1
+ import style_default from "../style.js";
2
+ import * as React$1 from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/components/MaskedInput.tsx
5
+ const getMaskedParts = (text) => {
6
+ if (!text) return {
7
+ prefix: "",
8
+ maskedSecret: ""
9
+ };
10
+ const percentLength = Math.min(Math.floor(text.length * .3), 8);
11
+ const nonAlphaMatches = [...text.substring(0, percentLength).matchAll(/[^a-zA-Z0-9]/g)];
12
+ let prefixEnd;
13
+ if (nonAlphaMatches.length > 0) prefixEnd = nonAlphaMatches.at(-1).index + 1;
14
+ else prefixEnd = percentLength;
15
+ return {
16
+ prefix: text.substring(0, prefixEnd),
17
+ maskedSecret: "•".repeat(text.length - prefixEnd)
18
+ };
19
+ };
20
+ const MaskedInput = function Input({ left, right, defaultValue, value, ref, ...props }) {
21
+ const initialValue = (value ?? defaultValue ?? "").toString();
22
+ const [displayValue, setDisplayValue] = React$1.useState(initialValue);
23
+ const inputRef = React$1.useRef(null);
24
+ React$1.useImperativeHandle(ref, () => inputRef.current);
25
+ const updateDisplayValue = () => {
26
+ if (inputRef.current) setDisplayValue(inputRef.current.value);
27
+ };
28
+ const handleBlur = (e) => {
29
+ updateDisplayValue();
30
+ inputRef.current?.scrollTo({
31
+ behavior: "instant",
32
+ left: 0,
33
+ top: 0
34
+ });
35
+ props.onBlur?.(e);
36
+ };
37
+ const { prefix, maskedSecret } = getMaskedParts(displayValue);
38
+ return /* @__PURE__ */ jsxs("div", {
39
+ className: style_default.Input,
40
+ children: [
41
+ left,
42
+ /* @__PURE__ */ jsxs("div", {
43
+ className: style_default.MaskedInputWrapper,
44
+ children: [/* @__PURE__ */ jsx("input", {
45
+ ...props,
46
+ ref: inputRef,
47
+ defaultValue,
48
+ value,
49
+ onBlur: handleBlur,
50
+ onScroll: (e) => {
51
+ if (!e.currentTarget.matches(":focus")) {
52
+ e.preventDefault();
53
+ inputRef.current?.scrollTo({
54
+ behavior: "instant",
55
+ left: 0,
56
+ top: 0
57
+ });
58
+ }
59
+ }
60
+ }), /* @__PURE__ */ jsxs("div", {
61
+ className: style_default.MaskedInputDisplay,
62
+ "aria-hidden": "true",
63
+ children: [prefix, /* @__PURE__ */ jsx("span", {
64
+ className: style_default.MaskedInputObscured,
65
+ children: maskedSecret
66
+ })]
67
+ })]
68
+ }),
69
+ right
70
+ ]
71
+ });
72
+ };
73
+ //#endregion
74
+ export { MaskedInput };
@@ -0,0 +1,2 @@
1
+ import { n as generateApiBreadcrumbs, t as SDKBreadcrumbs } from "../breadcrumbs-DC2_z7nh.js";
2
+ export { SDKBreadcrumbs, generateApiBreadcrumbs };
@@ -0,0 +1,62 @@
1
+ import "../component-generics-DYxBWv1v.js";
2
+ import style_default from "../style.js";
3
+ import { Languages } from "../routing.js";
4
+ import { Join } from "./primitives.js";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { ChevronRight } from "lucide-react";
7
+ //#region src/components/breadcrumbs.tsx
8
+ function generateApiBreadcrumbs(fullPath, spec, basePath) {
9
+ const cleanBasePath = basePath.replace(/\/+$/, "");
10
+ const cleanPath = fullPath.replace(/\/+$/, "");
11
+ if (!cleanPath.startsWith(cleanBasePath)) return null;
12
+ const rest = cleanPath.slice(cleanBasePath.length).split("/").filter(Boolean);
13
+ const breadcrumbs = [];
14
+ let href = cleanBasePath;
15
+ let i = 0;
16
+ if (Languages.includes(rest[0])) {
17
+ href += `/${rest[0]}`;
18
+ i++;
19
+ }
20
+ breadcrumbs.push({
21
+ title: "API Reference",
22
+ href
23
+ });
24
+ let currentSpec = spec;
25
+ while (i < rest.length) {
26
+ const idType = rest[i];
27
+ const idValue = rest[i + 1];
28
+ if (!idType || !idValue || !currentSpec?.[idType]?.[idValue]) break;
29
+ currentSpec = currentSpec[idType][idValue];
30
+ href += `/${idType}/${idValue}`;
31
+ const title = (idType === "methods" ? currentSpec.summary : currentSpec.title) ?? idValue;
32
+ breadcrumbs.push({
33
+ title,
34
+ href
35
+ });
36
+ i += 2;
37
+ }
38
+ return breadcrumbs;
39
+ }
40
+ function SDKBreadcrumbs({ spec, currentPath, basePath = "/api", config = { includeCurrentPage: false } }) {
41
+ const breadcrumbs = generateApiBreadcrumbs(currentPath, spec, basePath);
42
+ if (!breadcrumbs || breadcrumbs.length === 0) return null;
43
+ if (!config?.includeCurrentPage && breadcrumbs.length > 1) breadcrumbs.pop();
44
+ const items = breadcrumbs.map((crumb, index) => /* @__PURE__ */ jsx("div", {
45
+ className: style_default.BreadcrumbsItem,
46
+ children: /* @__PURE__ */ jsx("a", {
47
+ href: crumb.href,
48
+ className: style_default.BreadcrumbsLink,
49
+ children: crumb.title
50
+ })
51
+ }, index));
52
+ return /* @__PURE__ */ jsx("div", {
53
+ className: style_default.Breadcrumbs,
54
+ children: /* @__PURE__ */ jsx(Join, {
55
+ limit: breadcrumbs.length,
56
+ items,
57
+ children: /* @__PURE__ */ jsx(ChevronRight, {})
58
+ })
59
+ });
60
+ }
61
+ //#endregion
62
+ export { SDKBreadcrumbs, generateApiBreadcrumbs };
@@ -0,0 +1,72 @@
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+
3
+ //#region src/components/icons.d.ts
4
+ declare function GithubIcon({
5
+ className,
6
+ size
7
+ }: {
8
+ className?: string;
9
+ size?: number;
10
+ }): react_jsx_runtime0.JSX.Element;
11
+ declare function CSharpIcon({
12
+ className
13
+ }: {
14
+ className?: string;
15
+ }): react_jsx_runtime0.JSX.Element;
16
+ declare function GoIcon({
17
+ className
18
+ }: {
19
+ className?: string;
20
+ }): react_jsx_runtime0.JSX.Element;
21
+ declare function JavaIcon({
22
+ className
23
+ }: {
24
+ className?: string;
25
+ }): react_jsx_runtime0.JSX.Element;
26
+ declare function KotlinIcon({
27
+ className
28
+ }: {
29
+ className?: string;
30
+ }): react_jsx_runtime0.JSX.Element;
31
+ declare function PythonIcon({
32
+ className
33
+ }: {
34
+ className?: string;
35
+ }): react_jsx_runtime0.JSX.Element;
36
+ declare function RubyIcon({
37
+ className
38
+ }: {
39
+ className?: string;
40
+ }): react_jsx_runtime0.JSX.Element;
41
+ declare function TerraformIcon({
42
+ className
43
+ }: {
44
+ className?: string;
45
+ }): react_jsx_runtime0.JSX.Element;
46
+ declare function TypescriptIcon({
47
+ className
48
+ }: {
49
+ className?: string;
50
+ }): react_jsx_runtime0.JSX.Element;
51
+ declare function CurlIcon({
52
+ className
53
+ }: {
54
+ className?: string;
55
+ }): react_jsx_runtime0.JSX.Element;
56
+ declare function PowershellIcon({
57
+ className
58
+ }: {
59
+ className?: string;
60
+ }): react_jsx_runtime0.JSX.Element;
61
+ declare function CLIIcon({
62
+ className
63
+ }: {
64
+ className?: string;
65
+ }): react_jsx_runtime0.JSX.Element;
66
+ declare function PHPIcon({
67
+ className
68
+ }: {
69
+ className?: string;
70
+ }): react_jsx_runtime0.JSX.Element;
71
+ //#endregion
72
+ export { CLIIcon, CSharpIcon, CurlIcon, GithubIcon, GoIcon, JavaIcon, KotlinIcon, PHPIcon, PowershellIcon, PythonIcon, RubyIcon, TerraformIcon, TypescriptIcon };