@stainless-api/docs-ui 0.1.0-beta.20 → 0.1.0-beta.21
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.
- package/dist/breadcrumbs-Z-hEqjcp.d.ts +19 -0
- package/dist/chunk-Bp6m_JJh.js +13 -0
- package/dist/component-generics-DzI21jRn.js +35 -0
- package/dist/component-generics-q5Dqiu2D.d.ts +30 -0
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +16 -0
- package/dist/components/chat.d.ts +14 -0
- package/dist/components/chat.js +144 -0
- package/dist/components/dropdown.d.ts +2 -0
- package/dist/components/dropdown.js +4 -0
- package/dist/components/icons.d.ts +50 -0
- package/dist/components/icons.js +3 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.js +16 -0
- package/dist/components/method.d.ts +2 -0
- package/dist/components/method.js +16 -0
- package/dist/components/overview.d.ts +2 -0
- package/dist/components/overview.js +16 -0
- package/dist/components/primitives.d.ts +2 -0
- package/dist/components/primitives.js +16 -0
- package/dist/components/properties.d.ts +2 -0
- package/dist/components/properties.js +16 -0
- package/dist/components/scripts/dropdown.d.ts +12 -0
- package/dist/components/scripts/dropdown.js +50 -0
- package/dist/components/sdk.d.ts +3 -0
- package/dist/components/sdk.js +16 -0
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +16 -0
- package/dist/components/snippets.d.ts +4 -0
- package/dist/components/snippets.js +16 -0
- package/dist/contexts/component-generics.d.ts +2 -0
- package/dist/contexts/component-generics.js +3 -0
- package/dist/contexts/component-types.d.ts +18 -0
- package/dist/contexts/component-types.js +1 -0
- package/dist/contexts/component.d.ts +31 -0
- package/dist/contexts/component.js +16 -0
- package/dist/contexts/docs.d.ts +2 -0
- package/dist/contexts/docs.js +3 -0
- package/dist/contexts/index.d.ts +20 -0
- package/dist/contexts/index.js +16 -0
- package/dist/contexts/markdown.d.ts +2 -0
- package/dist/contexts/markdown.js +4 -0
- package/dist/contexts/navigation.d.ts +3 -0
- package/dist/contexts/navigation.js +3 -0
- package/dist/contexts/search.d.ts +4 -0
- package/dist/contexts/search.js +16 -0
- package/dist/contexts/use-components.d.ts +16 -0
- package/dist/contexts/use-components.js +4 -0
- package/dist/contexts-DRxRO-xO.js +3747 -0
- package/dist/docs-Dh8kE1va.js +50 -0
- package/dist/docs-EUy-wfbA.d.ts +43 -0
- package/dist/dropdown-B7VyGMOw.d.ts +43 -0
- package/dist/dropdown-DtgAi6lb.js +62 -0
- package/dist/icons-DdKM-01E.js +753 -0
- package/dist/index-AicgPYKB.d.ts +239 -0
- package/dist/index-BhwLhiWk.d.ts +14 -0
- package/dist/index-YnpUtXLB.d.ts +16 -0
- package/dist/index.d.ts +22 -0
- package/dist/languages/go.d.ts +13 -0
- package/dist/languages/go.js +16 -0
- package/dist/languages/http.d.ts +13 -0
- package/dist/languages/http.js +16 -0
- package/dist/languages/index.d.ts +13 -0
- package/dist/languages/index.js +16 -0
- package/dist/languages/java.d.ts +13 -0
- package/dist/languages/java.js +16 -0
- package/dist/languages/python.d.ts +13 -0
- package/dist/languages/python.js +16 -0
- package/dist/languages/ruby.d.ts +13 -0
- package/dist/languages/ruby.js +16 -0
- package/dist/languages/typescript.d.ts +13 -0
- package/dist/languages/typescript.js +16 -0
- package/dist/markdown/index.d.ts +11 -0
- package/dist/markdown/index.js +16 -0
- package/dist/markdown/md.d.ts +15 -0
- package/dist/markdown/md.js +3 -0
- package/dist/markdown/utils.d.ts +4 -0
- package/dist/markdown/utils.js +3 -0
- package/dist/markdown-BXfX1D7C.js +42 -0
- package/dist/markdown-nFyAEX_K.d.ts +22 -0
- package/dist/mcp.js +983441 -0
- package/dist/md-Dg8aOyMA.js +41 -0
- package/dist/method-DpsVuzZW.d.ts +71 -0
- package/dist/navigation-aoYZ_tl4.js +24 -0
- package/dist/navigation-nyXBY-75.d.ts +29 -0
- package/dist/overview-C8e-6jGr.d.ts +38 -0
- package/dist/pagefind-ChrPfuVv.js +15 -0
- package/dist/primitives-DWz23_Ub.d.ts +99 -0
- package/dist/properties-CF71V58d.d.ts +46 -0
- package/dist/routing-DQjbRxdJ.js +189 -0
- package/dist/routing-qc0V00-j.d.ts +51 -0
- package/dist/routing.d.ts +2 -0
- package/dist/sdk-Zg3Rggk3.d.ts +118 -0
- package/dist/search/index.d.ts +26 -0
- package/dist/search/index.js +332 -0
- package/dist/search/providers/algolia.d.ts +23 -0
- package/dist/search/providers/algolia.js +16 -0
- package/dist/search/providers/fuse.d.ts +17 -0
- package/dist/search/providers/fuse.js +31 -0
- package/dist/search/providers/pagefind.d.ts +7 -0
- package/dist/search/providers/pagefind.js +3 -0
- package/dist/search/providers/walker.d.ts +8 -0
- package/dist/search/providers/walker.js +32 -0
- package/dist/search/types.d.ts +3 -0
- package/dist/search/types.js +3 -0
- package/dist/search-B6loAGmB.d.ts +21 -0
- package/dist/sidebar-C8KirYjg.d.ts +35 -0
- package/dist/snippets-EUzM4fRO.d.ts +45 -0
- package/dist/style-pN9hCoec.d.ts +181 -0
- package/dist/style-rYbbxIR_.js +182 -0
- package/dist/style.d.ts +2 -0
- package/dist/style.js +3 -0
- package/dist/types-CTBDtD34.d.ts +82 -0
- package/dist/types-DFN4M1Sp.js +34 -0
- package/dist/use-components-D9E85p5x.js +7 -0
- package/dist/utils-BHwvUDKn.js +30 -0
- package/dist/utils-CJfFBNgT.js +32 -0
- package/dist/utils-DQhEbvUC.d.ts +20 -0
- package/dist/utils-nDazhti8.d.ts +11 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/contexts/docs.tsx
|
|
5
|
+
const DocsContextDefaults = {
|
|
6
|
+
settings: {},
|
|
7
|
+
language: "node",
|
|
8
|
+
spec: null
|
|
9
|
+
};
|
|
10
|
+
const DocsContext = React$1.createContext(DocsContextDefaults);
|
|
11
|
+
function useDocs() {
|
|
12
|
+
return React$1.useContext(DocsContext);
|
|
13
|
+
}
|
|
14
|
+
function useSpec() {
|
|
15
|
+
return useDocs().spec;
|
|
16
|
+
}
|
|
17
|
+
function useSettings() {
|
|
18
|
+
return useDocs().settings;
|
|
19
|
+
}
|
|
20
|
+
function useSnippet(stainlessPath, language, variant) {
|
|
21
|
+
const snippetLanguage = [language ?? useLanguage(), variant ?? "default"].join(".");
|
|
22
|
+
return useSpec()?.snippets?.[snippetLanguage]?.[stainlessPath];
|
|
23
|
+
}
|
|
24
|
+
function useDeclaration(stainlessPath, language) {
|
|
25
|
+
return useSpec()?.decls?.[language ?? useLanguage()]?.[stainlessPath];
|
|
26
|
+
}
|
|
27
|
+
function useResource(name) {
|
|
28
|
+
return useSpec()?.resources?.[name];
|
|
29
|
+
}
|
|
30
|
+
function useLanguage() {
|
|
31
|
+
return useDocs().language;
|
|
32
|
+
}
|
|
33
|
+
function useContentPanelLayout() {
|
|
34
|
+
return useDocs().settings?.contentPanelLayout ?? "double-pane";
|
|
35
|
+
}
|
|
36
|
+
function DocsProvider({ spec, language, settings, children }) {
|
|
37
|
+
const value = {
|
|
38
|
+
...DocsContextDefaults,
|
|
39
|
+
spec,
|
|
40
|
+
settings: settings ?? DocsContextDefaults.settings,
|
|
41
|
+
language: language ?? DocsContextDefaults.language
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ jsx(DocsContext.Provider, {
|
|
44
|
+
value,
|
|
45
|
+
children
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { useLanguage as a, useSnippet as c, useDocs as i, useSpec as l, useContentPanelLayout as n, useResource as o, useDeclaration as r, useSettings as s, DocsProvider as t };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as react_jsx_runtime40 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/contexts/docs.d.ts
|
|
5
|
+
type ContentPanelLayout = 'double-pane' | 'single-pane';
|
|
6
|
+
type PropertySettingsType = {
|
|
7
|
+
types?: 'simple' | 'rich';
|
|
8
|
+
includeModelProperties?: boolean;
|
|
9
|
+
collapseDescription?: boolean;
|
|
10
|
+
expandDepth?: number;
|
|
11
|
+
};
|
|
12
|
+
type DocsContextType = {
|
|
13
|
+
language: SDKJSON.SpecLanguage;
|
|
14
|
+
spec: SDKJSON.Spec | null;
|
|
15
|
+
settings?: {
|
|
16
|
+
properties?: PropertySettingsType;
|
|
17
|
+
contentPanelLayout?: ContentPanelLayout;
|
|
18
|
+
virtualExpanders?: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
declare function useDocs(): DocsContextType;
|
|
22
|
+
declare function useSpec(): SDKJSON.Spec | null;
|
|
23
|
+
declare function useSettings(): {
|
|
24
|
+
properties?: PropertySettingsType;
|
|
25
|
+
contentPanelLayout?: ContentPanelLayout;
|
|
26
|
+
virtualExpanders?: boolean;
|
|
27
|
+
} | undefined;
|
|
28
|
+
declare function useSnippet(stainlessPath: string, language?: SDKJSON.SpecLanguage, variant?: string): any;
|
|
29
|
+
declare function useDeclaration(stainlessPath: string, language?: SDKJSON.SpecLanguage): any;
|
|
30
|
+
declare function useResource(name: string): SDKJSON.Resource | undefined;
|
|
31
|
+
declare function useLanguage(): "node" | "go" | "python" | "terraform" | "http" | "typescript" | "ruby" | "java" | "kotlin";
|
|
32
|
+
declare function useContentPanelLayout(): ContentPanelLayout;
|
|
33
|
+
type DocsProviderProps = DocsContextType & {
|
|
34
|
+
children: React$1.ReactNode;
|
|
35
|
+
};
|
|
36
|
+
declare function DocsProvider({
|
|
37
|
+
spec,
|
|
38
|
+
language,
|
|
39
|
+
settings,
|
|
40
|
+
children
|
|
41
|
+
}: DocsProviderProps): react_jsx_runtime40.JSX.Element;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { PropertySettingsType as a, useDocs as c, useSettings as d, useSnippet as f, DocsProviderProps as i, useLanguage as l, DocsContextType as n, useContentPanelLayout as o, useSpec as p, DocsProvider as r, useDeclaration as s, ContentPanelLayout as t, useResource as u };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as react_jsx_runtime31 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/dropdown.d.ts
|
|
5
|
+
declare const Dropdown: ({
|
|
6
|
+
className,
|
|
7
|
+
children,
|
|
8
|
+
...rest
|
|
9
|
+
}: React$1.HTMLProps<HTMLDivElement>) => react_jsx_runtime31.JSX.Element;
|
|
10
|
+
declare const DropdownTrigger: ({
|
|
11
|
+
children,
|
|
12
|
+
withChevron,
|
|
13
|
+
className,
|
|
14
|
+
isIcon,
|
|
15
|
+
...rest
|
|
16
|
+
}: {
|
|
17
|
+
children: React$1.ReactNode;
|
|
18
|
+
withChevron?: boolean;
|
|
19
|
+
isIcon?: boolean;
|
|
20
|
+
} & (React$1.HTMLProps<HTMLButtonElement> & {
|
|
21
|
+
type?: "submit" | "reset" | "button";
|
|
22
|
+
})) => react_jsx_runtime31.JSX.Element;
|
|
23
|
+
declare const DropdownMenu: ({
|
|
24
|
+
position,
|
|
25
|
+
className,
|
|
26
|
+
children,
|
|
27
|
+
...rest
|
|
28
|
+
}: {
|
|
29
|
+
position?: "below";
|
|
30
|
+
} & React$1.HTMLProps<HTMLUListElement>) => react_jsx_runtime31.JSX.Element;
|
|
31
|
+
declare const DropdownItem: ({
|
|
32
|
+
children,
|
|
33
|
+
className,
|
|
34
|
+
value,
|
|
35
|
+
selected,
|
|
36
|
+
href
|
|
37
|
+
}: React$1.HTMLProps<HTMLLIElement> & {
|
|
38
|
+
value?: string;
|
|
39
|
+
selected?: boolean;
|
|
40
|
+
href?: string;
|
|
41
|
+
}) => react_jsx_runtime31.JSX.Element;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { DropdownTrigger as i, DropdownItem as n, DropdownMenu as r, Dropdown as t };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { t as style_default } from "./style-rYbbxIR_.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { ChevronsUpDown } from "lucide-react";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
|
|
7
|
+
//#region src/components/dropdown.tsx
|
|
8
|
+
const Dropdown = ({ className, children,...rest }) => {
|
|
9
|
+
return /* @__PURE__ */ jsx("div", {
|
|
10
|
+
...rest,
|
|
11
|
+
className: `${style_default.Dropdown} ${className ?? ""}`,
|
|
12
|
+
children
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
const DropdownTrigger = ({ children, withChevron, className, isIcon,...rest }) => {
|
|
16
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
17
|
+
className: `${style_default.Button} ${style_default.ButtonSecondary} ${style_default.DropdownTrigger} ${isIcon ? style_default.ButtonIcon : ""} ${className ?? ""}`,
|
|
18
|
+
"aria-haspopup": "listbox",
|
|
19
|
+
...rest,
|
|
20
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: style_default.DropdownTriggerContent,
|
|
22
|
+
children
|
|
23
|
+
}), withChevron && /* @__PURE__ */ jsx("span", {
|
|
24
|
+
className: style_default.DropdownChevron,
|
|
25
|
+
children: /* @__PURE__ */ jsx(ChevronsUpDown, { size: 16 })
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const DropdownMenu = ({ position, className, children,...rest }) => {
|
|
30
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
31
|
+
className: `${style_default.DropdownMenu} ${position ?? ""} ${className ?? ""}`,
|
|
32
|
+
...rest,
|
|
33
|
+
children
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
const DropdownItem = ({ children, className, value, selected, href }) => {
|
|
37
|
+
const inner = /* @__PURE__ */ jsxs(Fragment$1, { children: [children, /* @__PURE__ */ jsx("svg", {
|
|
38
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
39
|
+
width: "24",
|
|
40
|
+
height: "24",
|
|
41
|
+
viewBox: "0 0 24 24",
|
|
42
|
+
fill: "none",
|
|
43
|
+
stroke: "currentColor",
|
|
44
|
+
strokeWidth: "2",
|
|
45
|
+
strokeLinecap: "round",
|
|
46
|
+
strokeLinejoin: "round",
|
|
47
|
+
className: "lucide lucide-check-icon lucide-check",
|
|
48
|
+
children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" })
|
|
49
|
+
})] });
|
|
50
|
+
return /* @__PURE__ */ jsx("li", {
|
|
51
|
+
className: clsx(style_default.DropdownItem, className, selected && "selected", href && style_default.DropdownItemLink),
|
|
52
|
+
role: "option",
|
|
53
|
+
"data-dropdown-value": value,
|
|
54
|
+
children: href ? /* @__PURE__ */ jsx("a", {
|
|
55
|
+
href,
|
|
56
|
+
children: inner
|
|
57
|
+
}) : inner
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
export { DropdownTrigger as i, DropdownItem as n, DropdownMenu as r, Dropdown as t };
|