@stainless-api/docs-ui 0.1.0-beta.8 → 0.1.0-beta.81

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 (155) hide show
  1. package/dist/chunk-BYypO7fO.js +18 -0
  2. package/dist/components/MaskedInput.d.ts +14 -0
  3. package/dist/components/MaskedInput.js +76 -0
  4. package/dist/components/breadcrumbs.d.ts +25 -0
  5. package/dist/components/breadcrumbs.js +64 -0
  6. package/dist/components/icons.d.ts +65 -0
  7. package/dist/components/icons.js +941 -0
  8. package/dist/components/index.d.ts +16 -0
  9. package/dist/components/index.js +75 -0
  10. package/dist/components/method.d.ts +59 -0
  11. package/dist/components/method.js +97 -0
  12. package/dist/components/overview.d.ts +39 -0
  13. package/dist/components/overview.js +139 -0
  14. package/dist/components/primitives.d.ts +107 -0
  15. package/dist/components/primitives.js +253 -0
  16. package/dist/components/properties.d.ts +54 -0
  17. package/dist/components/properties.js +146 -0
  18. package/dist/components/sdk-sidebar.d.ts +15 -0
  19. package/dist/components/sdk-sidebar.js +52 -0
  20. package/dist/components/sdk.d.ts +128 -0
  21. package/dist/components/sdk.js +490 -0
  22. package/dist/components/snippets.d.ts +71 -0
  23. package/dist/components/snippets.js +184 -0
  24. package/dist/components/stl-sidebar.d.ts +58 -0
  25. package/dist/components/stl-sidebar.js +114 -0
  26. package/dist/contexts/component-generics.d.ts +30 -0
  27. package/dist/contexts/component-generics.js +33 -0
  28. package/dist/contexts/component-types.d.ts +8 -0
  29. package/dist/contexts/component-types.js +0 -0
  30. package/dist/contexts/component.d.ts +21 -0
  31. package/dist/contexts/component.js +24 -0
  32. package/dist/contexts/docs.d.ts +62 -0
  33. package/dist/contexts/docs.js +91 -0
  34. package/dist/contexts/index.d.ts +13 -0
  35. package/dist/contexts/index.js +45 -0
  36. package/dist/contexts/markdown.d.ts +22 -0
  37. package/dist/contexts/markdown.js +49 -0
  38. package/dist/contexts/navigation.d.ts +29 -0
  39. package/dist/contexts/navigation.js +24 -0
  40. package/dist/contexts/use-components.d.ts +6 -0
  41. package/dist/contexts/use-components.js +8 -0
  42. package/dist/index-pvh-w1xa.d.ts +1776 -0
  43. package/dist/index.d.ts +7 -0
  44. package/dist/index.js +9 -7542
  45. package/dist/languages/cli.d.ts +38 -0
  46. package/dist/languages/cli.js +167 -0
  47. package/dist/languages/csharp.d.ts +42 -0
  48. package/dist/languages/csharp.js +284 -0
  49. package/dist/languages/go.d.ts +40 -0
  50. package/dist/languages/go.js +304 -0
  51. package/dist/languages/http.d.ts +46 -0
  52. package/dist/languages/http.js +387 -0
  53. package/dist/languages/index.d.ts +51 -0
  54. package/dist/languages/index.js +33 -0
  55. package/dist/languages/java.d.ts +43 -0
  56. package/dist/languages/java.js +404 -0
  57. package/dist/languages/php.d.ts +40 -0
  58. package/dist/languages/php.js +313 -0
  59. package/dist/languages/python.d.ts +40 -0
  60. package/dist/languages/python.js +270 -0
  61. package/dist/languages/ruby.d.ts +40 -0
  62. package/dist/languages/ruby.js +388 -0
  63. package/dist/languages/terraform.d.ts +48 -0
  64. package/dist/languages/terraform.js +244 -0
  65. package/dist/languages/typescript.d.ts +40 -0
  66. package/dist/languages/typescript.js +450 -0
  67. package/dist/markdown/index.d.ts +11 -0
  68. package/dist/markdown/index.js +80 -0
  69. package/dist/markdown/md.d.ts +15 -0
  70. package/dist/markdown/md.js +41 -0
  71. package/dist/markdown/printer.d.ts +13 -0
  72. package/dist/markdown/printer.js +76 -0
  73. package/dist/markdown/utils.d.ts +21 -0
  74. package/dist/markdown/utils.js +31 -0
  75. package/dist/routing.d.ts +61 -0
  76. package/dist/routing.js +176 -150
  77. package/dist/spec.d.ts +65 -0
  78. package/dist/spec.js +167 -0
  79. package/dist/style.d.ts +178 -0
  80. package/dist/style.js +179 -0
  81. package/dist/styles/main.css +784 -752
  82. package/dist/styles/main.js +0 -0
  83. package/dist/styles/primitives.css +408 -446
  84. package/dist/styles/primitives.js +0 -0
  85. package/dist/styles/resets.css +32 -41
  86. package/dist/styles/resets.js +0 -0
  87. package/dist/styles/search.css +192 -270
  88. package/dist/styles/search.js +0 -0
  89. package/dist/styles/sidebar.css +182 -69
  90. package/dist/styles/sidebar.js +0 -0
  91. package/dist/styles/variables.css +28 -89
  92. package/dist/styles/variables.js +0 -0
  93. package/dist/styles.css +3423 -0
  94. package/dist/styles.mjs +1 -0
  95. package/dist/use-strict-context-L0c8JKg4.js +16 -0
  96. package/dist/utils.d.ts +20 -0
  97. package/dist/utils.js +54 -0
  98. package/package.json +74 -22
  99. package/dist/mcp.js +0 -16003
  100. package/dist/styles/snippets.css +0 -132
  101. package/src/components/breadcrumbs.tsx +0 -94
  102. package/src/components/chat.tsx +0 -154
  103. package/src/components/dropdown.tsx +0 -91
  104. package/src/components/icons.tsx +0 -584
  105. package/src/components/index.ts +0 -9
  106. package/src/components/method.tsx +0 -146
  107. package/src/components/overview.tsx +0 -160
  108. package/src/components/primitives.tsx +0 -284
  109. package/src/components/properties.tsx +0 -130
  110. package/src/components/scripts/dropdown.ts +0 -78
  111. package/src/components/sdk.tsx +0 -403
  112. package/src/components/sidebar.tsx +0 -99
  113. package/src/components/snippets.tsx +0 -180
  114. package/src/contexts/component-generics.tsx +0 -48
  115. package/src/contexts/component-types.tsx +0 -5
  116. package/src/contexts/component.tsx +0 -32
  117. package/src/contexts/docs.tsx +0 -75
  118. package/src/contexts/index.tsx +0 -17
  119. package/src/contexts/markdown.tsx +0 -43
  120. package/src/contexts/navigation.tsx +0 -44
  121. package/src/contexts/search.tsx +0 -28
  122. package/src/contexts/use-components.tsx +0 -4
  123. package/src/index.ts +0 -6
  124. package/src/languages/go.tsx +0 -281
  125. package/src/languages/http.tsx +0 -321
  126. package/src/languages/index.ts +0 -26
  127. package/src/languages/java.tsx +0 -358
  128. package/src/languages/python.tsx +0 -255
  129. package/src/languages/ruby.tsx +0 -320
  130. package/src/languages/typescript.tsx +0 -393
  131. package/src/markdown/index.ts +0 -107
  132. package/src/markdown/md.ts +0 -45
  133. package/src/markdown/utils.ts +0 -49
  134. package/src/routing.ts +0 -238
  135. package/src/search/form.tsx +0 -127
  136. package/src/search/index.tsx +0 -1
  137. package/src/search/indexer.ts +0 -246
  138. package/src/search/mcp.ts +0 -61
  139. package/src/search/printer.tsx +0 -86
  140. package/src/search/providers/algolia.ts +0 -88
  141. package/src/search/providers/fuse.ts +0 -19
  142. package/src/search/providers/pagefind.ts +0 -17
  143. package/src/search/providers/walker.ts +0 -30
  144. package/src/search/results.tsx +0 -182
  145. package/src/search/state.ts +0 -64
  146. package/src/search/types.ts +0 -116
  147. package/src/style.ts +0 -196
  148. package/src/styles/main.css +0 -986
  149. package/src/styles/primitives.css +0 -580
  150. package/src/styles/resets.css +0 -39
  151. package/src/styles/search.css +0 -341
  152. package/src/styles/sidebar.css +0 -85
  153. package/src/styles/snippets.css +0 -130
  154. package/src/styles/variables.css +0 -86
  155. package/src/utils.ts +0 -41
@@ -0,0 +1,18 @@
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) {
6
+ __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ }
11
+ if (!no_symbols) {
12
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
13
+ }
14
+ return target;
15
+ };
16
+
17
+ //#endregion
18
+ export { __exportAll as t };
@@ -0,0 +1,14 @@
1
+ import { InputProps } from "./primitives.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,76 @@
1
+ import style_default from "../style.js";
2
+ import * as React$1 from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+
5
+ //#region src/components/MaskedInput.tsx
6
+ const getMaskedParts = (text) => {
7
+ if (!text) return {
8
+ prefix: "",
9
+ maskedSecret: ""
10
+ };
11
+ const percentLength = Math.min(Math.floor(text.length * .3), 8);
12
+ const nonAlphaMatches = [...text.substring(0, percentLength).matchAll(/[^a-zA-Z0-9]/g)];
13
+ let prefixEnd = 0;
14
+ if (nonAlphaMatches.length > 0) prefixEnd = nonAlphaMatches.at(-1).index + 1;
15
+ else prefixEnd = percentLength;
16
+ return {
17
+ prefix: text.substring(0, prefixEnd),
18
+ maskedSecret: "•".repeat(text.length - prefixEnd)
19
+ };
20
+ };
21
+ const MaskedInput = function Input({ left, right, defaultValue, value, ref, ...props }) {
22
+ const initialValue = (value ?? defaultValue ?? "").toString();
23
+ const [displayValue, setDisplayValue] = React$1.useState(initialValue);
24
+ const inputRef = React$1.useRef(null);
25
+ React$1.useImperativeHandle(ref, () => inputRef.current);
26
+ const updateDisplayValue = () => {
27
+ if (inputRef.current) setDisplayValue(inputRef.current.value);
28
+ };
29
+ const handleBlur = (e) => {
30
+ updateDisplayValue();
31
+ inputRef.current?.scrollTo({
32
+ behavior: "instant",
33
+ left: 0,
34
+ top: 0
35
+ });
36
+ props.onBlur?.(e);
37
+ };
38
+ const { prefix, maskedSecret } = getMaskedParts(displayValue);
39
+ return /* @__PURE__ */ jsxs("div", {
40
+ className: style_default.Input,
41
+ children: [
42
+ left,
43
+ /* @__PURE__ */ jsxs("div", {
44
+ className: style_default.MaskedInputWrapper,
45
+ children: [/* @__PURE__ */ jsx("input", {
46
+ ...props,
47
+ ref: inputRef,
48
+ defaultValue,
49
+ value,
50
+ onBlur: handleBlur,
51
+ onScroll: (e) => {
52
+ if (!e.currentTarget.matches(":focus")) {
53
+ e.preventDefault();
54
+ inputRef.current?.scrollTo({
55
+ behavior: "instant",
56
+ left: 0,
57
+ top: 0
58
+ });
59
+ }
60
+ }
61
+ }), /* @__PURE__ */ jsxs("div", {
62
+ className: style_default.MaskedInputDisplay,
63
+ "aria-hidden": "true",
64
+ children: [prefix, /* @__PURE__ */ jsx("span", {
65
+ className: style_default.MaskedInputObscured,
66
+ children: maskedSecret
67
+ })]
68
+ })]
69
+ }),
70
+ right
71
+ ]
72
+ });
73
+ };
74
+
75
+ //#endregion
76
+ export { MaskedInput };
@@ -0,0 +1,25 @@
1
+ import { v as Spec } from "../index-pvh-w1xa.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 { SDKBreadcrumbs, generateApiBreadcrumbs };
@@ -0,0 +1,64 @@
1
+ import "../use-strict-context-L0c8JKg4.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
+
8
+ //#region src/components/breadcrumbs.tsx
9
+ function generateApiBreadcrumbs(fullPath, spec, basePath) {
10
+ const cleanBasePath = basePath.replace(/\/+$/, "");
11
+ const cleanPath = fullPath.replace(/\/+$/, "");
12
+ if (!cleanPath.startsWith(cleanBasePath)) return null;
13
+ const rest = cleanPath.slice(cleanBasePath.length).split("/").filter(Boolean);
14
+ const breadcrumbs = [];
15
+ let href = cleanBasePath;
16
+ let i = 0;
17
+ if (Languages.includes(rest[0])) {
18
+ href += `/${rest[0]}`;
19
+ i++;
20
+ }
21
+ breadcrumbs.push({
22
+ title: "API Reference",
23
+ href
24
+ });
25
+ let currentSpec = spec;
26
+ while (i < rest.length) {
27
+ const idType = rest[i];
28
+ const idValue = rest[i + 1];
29
+ if (!idType || !idValue || !currentSpec?.[idType]?.[idValue]) break;
30
+ currentSpec = currentSpec[idType][idValue];
31
+ href += `/${idType}/${idValue}`;
32
+ const title = (idType === "methods" ? currentSpec.summary : currentSpec.title) ?? idValue;
33
+ breadcrumbs.push({
34
+ title,
35
+ href
36
+ });
37
+ i += 2;
38
+ }
39
+ return breadcrumbs;
40
+ }
41
+ function SDKBreadcrumbs({ spec, currentPath, basePath = "/api", config = { includeCurrentPage: false } }) {
42
+ const breadcrumbs = generateApiBreadcrumbs(currentPath, spec, basePath);
43
+ if (!breadcrumbs || breadcrumbs.length === 0) return null;
44
+ if (!config?.includeCurrentPage && breadcrumbs.length > 1) breadcrumbs.pop();
45
+ const items = breadcrumbs.map((crumb, index) => /* @__PURE__ */ jsx("div", {
46
+ className: style_default.BreadcrumbsItem,
47
+ children: /* @__PURE__ */ jsx("a", {
48
+ href: crumb.href,
49
+ className: style_default.BreadcrumbsLink,
50
+ children: crumb.title
51
+ })
52
+ }, index));
53
+ return /* @__PURE__ */ jsx("div", {
54
+ className: style_default.Breadcrumbs,
55
+ children: /* @__PURE__ */ jsx(Join, {
56
+ limit: breadcrumbs.length,
57
+ items,
58
+ children: /* @__PURE__ */ jsx(ChevronRight, {})
59
+ })
60
+ });
61
+ }
62
+
63
+ //#endregion
64
+ export { SDKBreadcrumbs, generateApiBreadcrumbs };
@@ -0,0 +1,65 @@
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+
3
+ //#region src/components/icons.d.ts
4
+ declare function CSharpIcon({
5
+ className
6
+ }: {
7
+ className?: string;
8
+ }): react_jsx_runtime0.JSX.Element;
9
+ declare function GoIcon({
10
+ className
11
+ }: {
12
+ className?: string;
13
+ }): react_jsx_runtime0.JSX.Element;
14
+ declare function JavaIcon({
15
+ className
16
+ }: {
17
+ className?: string;
18
+ }): react_jsx_runtime0.JSX.Element;
19
+ declare function KotlinIcon({
20
+ className
21
+ }: {
22
+ className?: string;
23
+ }): react_jsx_runtime0.JSX.Element;
24
+ declare function PythonIcon({
25
+ className
26
+ }: {
27
+ className?: string;
28
+ }): react_jsx_runtime0.JSX.Element;
29
+ declare function RubyIcon({
30
+ className
31
+ }: {
32
+ className?: string;
33
+ }): react_jsx_runtime0.JSX.Element;
34
+ declare function TerraformIcon({
35
+ className
36
+ }: {
37
+ className?: string;
38
+ }): react_jsx_runtime0.JSX.Element;
39
+ declare function TypescriptIcon({
40
+ className
41
+ }: {
42
+ className?: string;
43
+ }): react_jsx_runtime0.JSX.Element;
44
+ declare function CurlIcon({
45
+ className
46
+ }: {
47
+ className?: string;
48
+ }): react_jsx_runtime0.JSX.Element;
49
+ declare function PowershellIcon({
50
+ className
51
+ }: {
52
+ className?: string;
53
+ }): react_jsx_runtime0.JSX.Element;
54
+ declare function CLIIcon({
55
+ className
56
+ }: {
57
+ className?: string;
58
+ }): react_jsx_runtime0.JSX.Element;
59
+ declare function PHPIcon({
60
+ className
61
+ }: {
62
+ className?: string;
63
+ }): react_jsx_runtime0.JSX.Element;
64
+ //#endregion
65
+ export { CLIIcon, CSharpIcon, CurlIcon, GoIcon, JavaIcon, KotlinIcon, PHPIcon, PowershellIcon, PythonIcon, RubyIcon, TerraformIcon, TypescriptIcon };