@stainless-api/docs-ui 0.1.0-beta.6 → 0.1.0-beta.61

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 (206) hide show
  1. package/dist/breadcrumbs-BVskoBYz.d.ts +25 -0
  2. package/dist/breadcrumbs-C9LLJyuJ.d.ts +25 -0
  3. package/dist/breadcrumbs-CqA6kow2.js +63 -0
  4. package/dist/chunk-BN_g-Awi.js +18 -0
  5. package/dist/cli-0bJ66S1r.js +157 -0
  6. package/dist/component-CjJJYIxG.js +23 -0
  7. package/dist/component-generics-BC_P155r.d.ts +30 -0
  8. package/dist/component-generics-BkwbbxJF.d.ts +30 -0
  9. package/dist/component-generics-POFirVVb.js +45 -0
  10. package/dist/components/MaskedInput.d.ts +14 -0
  11. package/dist/components/MaskedInput.js +76 -0
  12. package/dist/components/breadcrumbs.d.ts +2 -0
  13. package/dist/components/breadcrumbs.js +9 -0
  14. package/dist/components/icons.d.ts +60 -0
  15. package/dist/components/icons.js +3 -0
  16. package/dist/components/index.d.ts +10 -0
  17. package/dist/components/index.js +18 -0
  18. package/dist/components/method.d.ts +2 -0
  19. package/dist/components/method.js +10 -0
  20. package/dist/components/overview.d.ts +2 -0
  21. package/dist/components/overview.js +11 -0
  22. package/dist/components/primitives.d.ts +2 -0
  23. package/dist/components/primitives.js +8 -0
  24. package/dist/components/properties.d.ts +2 -0
  25. package/dist/components/properties.js +9 -0
  26. package/dist/components/sdk.d.ts +2 -0
  27. package/dist/components/sdk.js +10 -0
  28. package/dist/components/sidebar.d.ts +2 -0
  29. package/dist/components/sidebar.js +9 -0
  30. package/dist/components/snippets.d.ts +3 -0
  31. package/dist/components/snippets.js +9 -0
  32. package/dist/components-FEHnQBJC.js +70 -0
  33. package/dist/contexts/component-generics.d.ts +2 -0
  34. package/dist/contexts/component-generics.js +3 -0
  35. package/dist/contexts/component-types.d.ts +16 -0
  36. package/dist/contexts/component-types.js +0 -0
  37. package/dist/contexts/component.d.ts +29 -0
  38. package/dist/contexts/component.js +28 -0
  39. package/dist/contexts/docs.d.ts +2 -0
  40. package/dist/contexts/docs.js +3 -0
  41. package/dist/contexts/index.d.ts +22 -0
  42. package/dist/contexts/index.js +7 -0
  43. package/dist/contexts/markdown.d.ts +2 -0
  44. package/dist/contexts/markdown.js +4 -0
  45. package/dist/contexts/navigation.d.ts +2 -0
  46. package/dist/contexts/navigation.js +3 -0
  47. package/dist/contexts/use-components.d.ts +14 -0
  48. package/dist/contexts/use-components.js +4 -0
  49. package/dist/contexts-CeV_L_Iy.js +39 -0
  50. package/dist/csharp-Dl2RIiYP.js +283 -0
  51. package/dist/docs--qWFuJCM.d.ts +46 -0
  52. package/dist/docs-DSFRsmbQ.d.ts +46 -0
  53. package/dist/docs-Di94viZV.js +54 -0
  54. package/dist/go-DuKdRGqU.js +303 -0
  55. package/dist/http-C7bu4oCl.js +331 -0
  56. package/dist/icons-BYKn5X8E.js +885 -0
  57. package/dist/index-C0qvL4yP.d.ts +15 -0
  58. package/dist/index-DE1vA8T2.d.ts +302 -0
  59. package/dist/index-DsFyACw9.d.ts +15 -0
  60. package/dist/index-FDM-j9s-.d.ts +302 -0
  61. package/dist/index-zNpvNvtN.d.ts +1691 -0
  62. package/dist/index.d.ts +19 -0
  63. package/dist/index.js +30 -7542
  64. package/dist/java-DSyzO-6F.js +403 -0
  65. package/dist/languages/cli.d.ts +11 -0
  66. package/dist/languages/cli.js +20 -0
  67. package/dist/languages/csharp.d.ts +11 -0
  68. package/dist/languages/csharp.js +9 -0
  69. package/dist/languages/go.d.ts +11 -0
  70. package/dist/languages/go.js +9 -0
  71. package/dist/languages/http.d.ts +11 -0
  72. package/dist/languages/http.js +19 -0
  73. package/dist/languages/index.d.ts +11 -0
  74. package/dist/languages/index.js +27 -0
  75. package/dist/languages/java.d.ts +11 -0
  76. package/dist/languages/java.js +9 -0
  77. package/dist/languages/python.d.ts +11 -0
  78. package/dist/languages/python.js +9 -0
  79. package/dist/languages/ruby.d.ts +11 -0
  80. package/dist/languages/ruby.js +9 -0
  81. package/dist/languages/typescript.d.ts +11 -0
  82. package/dist/languages/typescript.js +9 -0
  83. package/dist/languages-BO5YJ6cy.js +28 -0
  84. package/dist/markdown/index.d.ts +12 -0
  85. package/dist/markdown/index.js +105 -0
  86. package/dist/markdown/md.d.ts +15 -0
  87. package/dist/markdown/md.js +41 -0
  88. package/dist/markdown/printer.d.ts +13 -0
  89. package/dist/markdown/printer.js +98 -0
  90. package/dist/markdown/utils.d.ts +21 -0
  91. package/dist/markdown/utils.js +31 -0
  92. package/dist/markdown-B517MrZh.d.ts +22 -0
  93. package/dist/markdown-C7Tb41LZ.d.ts +22 -0
  94. package/dist/markdown-D2JWyRws.js +49 -0
  95. package/dist/method-BaQEZVlw.d.ts +59 -0
  96. package/dist/method-Dln4ZTIB.d.ts +59 -0
  97. package/dist/method-jTnA0G8m.js +90 -0
  98. package/dist/navigation-XhIgqXwM.d.ts +29 -0
  99. package/dist/navigation-aoYZ_tl4.js +24 -0
  100. package/dist/navigation-rKdts-BR.d.ts +29 -0
  101. package/dist/overview-B3kgyac2.d.ts +39 -0
  102. package/dist/overview-BnagZfH1.js +139 -0
  103. package/dist/overview-Dp-gGl3v.d.ts +39 -0
  104. package/dist/primitives-B6zu2rrx.d.ts +105 -0
  105. package/dist/primitives-DQLc9kN7.js +250 -0
  106. package/dist/primitives-VtUGoYwX.d.ts +105 -0
  107. package/dist/properties-Bun4nfUE.d.ts +54 -0
  108. package/dist/properties-DGL2J11L.js +131 -0
  109. package/dist/properties-ZOIqpkET.d.ts +54 -0
  110. package/dist/python-D8ABqtn1.js +269 -0
  111. package/dist/routing-Ce0_tBW6.js +197 -0
  112. package/dist/routing-CtbZJru_.d.ts +54 -0
  113. package/dist/routing.d.ts +2 -0
  114. package/dist/routing.js +3 -180
  115. package/dist/ruby-261jvCjl.js +387 -0
  116. package/dist/sdk-BebFnWYL.d.ts +118 -0
  117. package/dist/sdk-CIxaNoAs.d.ts +118 -0
  118. package/dist/sdk-GGpyGTao.js +338 -0
  119. package/dist/sidebar-BWno0E4w.js +85 -0
  120. package/dist/sidebar-CLsIJZZf.d.ts +36 -0
  121. package/dist/sidebar-D4m_pVpS.d.ts +36 -0
  122. package/dist/snippets-CwVjwsAo.d.ts +53 -0
  123. package/dist/snippets-Ym3mnHO3.d.ts +53 -0
  124. package/dist/snippets-kI8eNs1F.js +164 -0
  125. package/dist/spec.d.ts +65 -0
  126. package/dist/spec.js +167 -0
  127. package/dist/style-LwfvXElj.js +170 -0
  128. package/dist/style.d.ts +169 -0
  129. package/dist/style.js +3 -0
  130. package/dist/styles/main.css +722 -755
  131. package/dist/styles/main.js +0 -0
  132. package/dist/styles/primitives.css +322 -459
  133. package/dist/styles/primitives.js +0 -0
  134. package/dist/styles/resets.css +32 -41
  135. package/dist/styles/resets.js +0 -0
  136. package/dist/styles/search.css +192 -270
  137. package/dist/styles/search.js +0 -0
  138. package/dist/styles/sidebar.css +56 -61
  139. package/dist/styles/sidebar.js +0 -0
  140. package/dist/styles/variables.css +26 -89
  141. package/dist/styles/variables.js +0 -0
  142. package/dist/styles.css +3145 -0
  143. package/dist/styles.mjs +1 -0
  144. package/dist/typescript-D924WidI.js +449 -0
  145. package/dist/use-components-BUz3GbO4.js +7 -0
  146. package/dist/utils-D01mAUfQ.js +32 -0
  147. package/dist/utils.d.ts +14 -0
  148. package/dist/utils.js +3 -0
  149. package/package.json +73 -21
  150. package/dist/mcp.js +0 -16003
  151. package/dist/styles/snippets.css +0 -132
  152. package/src/components/breadcrumbs.tsx +0 -94
  153. package/src/components/chat.tsx +0 -154
  154. package/src/components/dropdown.tsx +0 -91
  155. package/src/components/icons.tsx +0 -584
  156. package/src/components/index.ts +0 -9
  157. package/src/components/method.tsx +0 -144
  158. package/src/components/overview.tsx +0 -159
  159. package/src/components/primitives.tsx +0 -284
  160. package/src/components/properties.tsx +0 -130
  161. package/src/components/scripts/dropdown.ts +0 -78
  162. package/src/components/sdk.tsx +0 -402
  163. package/src/components/sidebar.tsx +0 -99
  164. package/src/components/snippets.tsx +0 -179
  165. package/src/contexts/component-generics.tsx +0 -48
  166. package/src/contexts/component-types.tsx +0 -5
  167. package/src/contexts/component.tsx +0 -32
  168. package/src/contexts/docs.tsx +0 -75
  169. package/src/contexts/index.tsx +0 -17
  170. package/src/contexts/markdown.tsx +0 -43
  171. package/src/contexts/navigation.tsx +0 -44
  172. package/src/contexts/search.tsx +0 -28
  173. package/src/contexts/use-components.tsx +0 -4
  174. package/src/index.ts +0 -6
  175. package/src/languages/go.tsx +0 -281
  176. package/src/languages/http.tsx +0 -321
  177. package/src/languages/index.ts +0 -26
  178. package/src/languages/java.tsx +0 -358
  179. package/src/languages/python.tsx +0 -255
  180. package/src/languages/ruby.tsx +0 -320
  181. package/src/languages/typescript.tsx +0 -393
  182. package/src/markdown/index.ts +0 -107
  183. package/src/markdown/md.ts +0 -45
  184. package/src/markdown/utils.ts +0 -49
  185. package/src/routing.ts +0 -238
  186. package/src/search/form.tsx +0 -127
  187. package/src/search/index.tsx +0 -1
  188. package/src/search/indexer.ts +0 -246
  189. package/src/search/mcp.ts +0 -61
  190. package/src/search/printer.tsx +0 -86
  191. package/src/search/providers/algolia.ts +0 -88
  192. package/src/search/providers/fuse.ts +0 -19
  193. package/src/search/providers/pagefind.ts +0 -17
  194. package/src/search/providers/walker.ts +0 -30
  195. package/src/search/results.tsx +0 -181
  196. package/src/search/state.ts +0 -64
  197. package/src/search/types.ts +0 -116
  198. package/src/style.ts +0 -197
  199. package/src/styles/main.css +0 -993
  200. package/src/styles/primitives.css +0 -573
  201. package/src/styles/resets.css +0 -47
  202. package/src/styles/search.css +0 -342
  203. package/src/styles/sidebar.css +0 -87
  204. package/src/styles/snippets.css +0 -132
  205. package/src/styles/variables.css +0 -90
  206. package/src/utils.ts +0 -41
@@ -0,0 +1,105 @@
1
+ import * as react0 from "react";
2
+ import { ReactNode } from "react";
3
+ import * as react_jsx_runtime53 from "react/jsx-runtime";
4
+
5
+ //#region src/components/primitives.d.ts
6
+ type JoinProps = {
7
+ items: ReactNode[];
8
+ limit?: number;
9
+ children: ReactNode;
10
+ };
11
+ declare function Join({
12
+ items,
13
+ limit,
14
+ children
15
+ }: JoinProps): react_jsx_runtime53.JSX.Element[];
16
+ type ExpanderProps = {
17
+ id?: string;
18
+ open?: boolean;
19
+ summary: ReactNode;
20
+ virtual?: boolean;
21
+ muted?: boolean;
22
+ children?: ReactNode;
23
+ };
24
+ declare function Expander({
25
+ id,
26
+ open,
27
+ summary,
28
+ virtual,
29
+ muted,
30
+ children
31
+ }: ExpanderProps): react_jsx_runtime53.JSX.Element;
32
+ declare function VirtualExpander({
33
+ id,
34
+ open: isOpen,
35
+ muted,
36
+ summary,
37
+ children
38
+ }: Omit<ExpanderProps, 'virtual'>): react_jsx_runtime53.JSX.Element;
39
+ declare function Markdown({
40
+ content
41
+ }: {
42
+ content: string;
43
+ }): "" | react_jsx_runtime53.JSX.Element | undefined;
44
+ type BadgeProps = {
45
+ id: string;
46
+ children?: ReactNode;
47
+ };
48
+ declare function Badge({
49
+ id,
50
+ children
51
+ }: BadgeProps): react_jsx_runtime53.JSX.Element;
52
+ type TooltipProps = {
53
+ content: ReactNode;
54
+ children: ReactNode;
55
+ };
56
+ declare function Tooltip({
57
+ content,
58
+ children
59
+ }: TooltipProps): string | number | bigint | boolean | react_jsx_runtime53.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react0.ReactPortal | react0.ReactElement<unknown, string | react0.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
60
+ type LinkProps = {
61
+ stainlessPath: string;
62
+ scroll?: boolean;
63
+ children?: ReactNode;
64
+ } & React.HTMLProps<HTMLAnchorElement>;
65
+ declare function Link({
66
+ stainlessPath,
67
+ scroll,
68
+ children,
69
+ ...props
70
+ }: LinkProps): string | number | bigint | boolean | react_jsx_runtime53.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react0.ReactPortal | react0.ReactElement<unknown, string | react0.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
71
+ type InputProps = {
72
+ left?: ReactNode;
73
+ right?: ReactNode;
74
+ ref?: React.Ref<HTMLInputElement>;
75
+ } & React.InputHTMLAttributes<HTMLInputElement>;
76
+ declare function Input({
77
+ left,
78
+ right,
79
+ ref,
80
+ className,
81
+ ...props
82
+ }: InputProps): react_jsx_runtime53.JSX.Element;
83
+ type ToggleButtonProps = {
84
+ children?: ReactNode;
85
+ selected?: boolean;
86
+ } & React.ComponentProps<'button'>;
87
+ declare function ToggleButton({
88
+ children,
89
+ selected,
90
+ ref,
91
+ ...props
92
+ }: ToggleButtonProps): react_jsx_runtime53.JSX.Element;
93
+ type ListViewProps<TItem> = {
94
+ items: Array<TItem>;
95
+ itemDelegate: (item: TItem, selected: boolean) => React.ReactNode;
96
+ onSelectListItem?: (item: TItem) => void;
97
+ } & React.HTMLAttributes<HTMLDivElement>;
98
+ declare function ListView<TItem>({
99
+ items,
100
+ itemDelegate,
101
+ onSelectListItem,
102
+ ...rest
103
+ }: ListViewProps<TItem>): react_jsx_runtime53.JSX.Element;
104
+ //#endregion
105
+ export { Join as a, ListViewProps as c, ToggleButtonProps as d, Tooltip as f, InputProps as i, Markdown as l, Expander as n, Link as o, VirtualExpander as p, Input as r, ListView as s, Badge as t, ToggleButton as u };
@@ -0,0 +1,54 @@
1
+ import { ReactNode } from "react";
2
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
3
+
4
+ //#region src/components/properties.d.ts
5
+ type PropertyToggleProps = {
6
+ target: string;
7
+ };
8
+ declare function PropertyToggle({
9
+ target
10
+ }: PropertyToggleProps): react_jsx_runtime16.JSX.Element;
11
+ type PropertyDescriptionProps = {
12
+ description?: string;
13
+ };
14
+ declare function PropertyDescription({
15
+ description
16
+ }: PropertyDescriptionProps): react_jsx_runtime16.JSX.Element | undefined;
17
+ type PropertyTitleProps = {
18
+ title?: string;
19
+ };
20
+ declare function PropertyTitle({
21
+ title
22
+ }: PropertyTitleProps): react_jsx_runtime16.JSX.Element | undefined;
23
+ type PropertyProps = {
24
+ id?: string;
25
+ name?: ReactNode;
26
+ typeName?: ReactNode;
27
+ badges?: ReactNode;
28
+ type?: ReactNode;
29
+ description?: string;
30
+ title?: string;
31
+ expand?: boolean;
32
+ deprecated?: boolean | string;
33
+ additional?: ReactNode;
34
+ declaration?: ReactNode;
35
+ constraints?: ReactNode;
36
+ children?: ReactNode;
37
+ };
38
+ declare function Property({
39
+ id,
40
+ name,
41
+ typeName,
42
+ badges,
43
+ type,
44
+ declaration,
45
+ description,
46
+ title,
47
+ deprecated,
48
+ expand,
49
+ additional,
50
+ constraints,
51
+ children
52
+ }: PropertyProps): react_jsx_runtime16.JSX.Element;
53
+ //#endregion
54
+ export { PropertyTitle as a, PropertyToggleProps as c, PropertyProps as i, PropertyDescription as n, PropertyTitleProps as o, PropertyDescriptionProps as r, PropertyToggle as s, Property as t };
@@ -0,0 +1,131 @@
1
+ import { a as useLanguage, s as useSettings } from "./docs-Di94viZV.js";
2
+ import { t as useComponents } from "./use-components-BUz3GbO4.js";
3
+ import { t as style_default } from "./style-LwfvXElj.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { ArrowDownWideNarrowIcon, ArrowUpNarrowWideIcon } from "lucide-react";
6
+
7
+ //#region src/components/properties.tsx
8
+ function PropertyToggle({ target }) {
9
+ return /* @__PURE__ */ jsxs("span", {
10
+ className: style_default.ExpandToggle,
11
+ "data-stldocs-property-toggle-expanded": "false",
12
+ "data-stldocs-property-toggle-target": target,
13
+ children: [/* @__PURE__ */ jsxs("span", {
14
+ className: style_default.ExpandToggleContent,
15
+ children: ["Expand ", /* @__PURE__ */ jsx(ArrowDownWideNarrowIcon, {
16
+ className: style_default.Icon,
17
+ size: 16
18
+ })]
19
+ }), /* @__PURE__ */ jsxs("span", {
20
+ className: style_default.ExpandToggleContent,
21
+ children: ["Collapse ", /* @__PURE__ */ jsx(ArrowUpNarrowWideIcon, {
22
+ className: style_default.Icon,
23
+ size: 16
24
+ })]
25
+ })]
26
+ });
27
+ }
28
+ function PropertyDescription({ description }) {
29
+ const { Markdown } = useComponents();
30
+ if (description) return /* @__PURE__ */ jsx("div", {
31
+ className: style_default.PropertyDescription,
32
+ children: /* @__PURE__ */ jsx(Markdown, { content: description })
33
+ });
34
+ }
35
+ function PropertyTitle({ title }) {
36
+ const { Markdown } = useComponents();
37
+ if (title) return /* @__PURE__ */ jsx("div", {
38
+ className: style_default.PropertyTitle,
39
+ children: /* @__PURE__ */ jsx(Markdown, { content: title })
40
+ });
41
+ }
42
+ function Property({ id, name, typeName, badges, type, declaration, description, title, deprecated, expand, additional, constraints, children }) {
43
+ const Docs = useComponents();
44
+ const language = useLanguage();
45
+ const properties = useSettings()?.properties;
46
+ const { collapseDescription, showTitle } = properties ?? {};
47
+ const types = properties?.types;
48
+ const textContent = /* @__PURE__ */ jsxs(Fragment, { children: [
49
+ typeof deprecated === "string" && /* @__PURE__ */ jsx("div", {
50
+ className: style_default.PropertyDeprecatedMessage,
51
+ children: deprecated
52
+ }),
53
+ description && /* @__PURE__ */ jsx(Docs.PropertyDescription, { description }),
54
+ constraints && /* @__PURE__ */ jsx("div", {
55
+ className: style_default.PropertyContent,
56
+ children: constraints
57
+ })
58
+ ] });
59
+ const rich = /* @__PURE__ */ jsxs(Fragment, { children: [
60
+ /* @__PURE__ */ jsxs("div", {
61
+ className: style_default.PropertyDeclaration,
62
+ children: [
63
+ deprecated && /* @__PURE__ */ jsx("span", {
64
+ className: style_default.PropertyDeprecated,
65
+ children: "Deprecated"
66
+ }),
67
+ declaration,
68
+ badges && /* @__PURE__ */ jsx("span", {
69
+ className: style_default.PropertyBadges,
70
+ children: badges
71
+ })
72
+ ]
73
+ }),
74
+ title && showTitle && /* @__PURE__ */ jsx(Docs.PropertyTitle, { title }),
75
+ collapseDescription === false ? textContent : null
76
+ ] });
77
+ const simple = /* @__PURE__ */ jsxs(Fragment, { children: [
78
+ name && /* @__PURE__ */ jsxs("div", {
79
+ className: style_default.PropertyHeader,
80
+ children: [
81
+ deprecated && /* @__PURE__ */ jsx("span", {
82
+ className: style_default.PropertyDeprecated,
83
+ children: "Deprecated"
84
+ }),
85
+ name && /* @__PURE__ */ jsx("span", {
86
+ className: style_default.PropertyName,
87
+ children: name
88
+ }),
89
+ typeName && /* @__PURE__ */ jsx("span", {
90
+ className: style_default.PropertyTypeName,
91
+ children: typeName
92
+ }),
93
+ badges && /* @__PURE__ */ jsx("span", {
94
+ className: style_default.PropertyBadges,
95
+ children: badges
96
+ })
97
+ ]
98
+ }),
99
+ type && /* @__PURE__ */ jsx("div", {
100
+ className: style_default.PropertyType,
101
+ children: type
102
+ }),
103
+ title && showTitle && /* @__PURE__ */ jsx(Docs.PropertyTitle, { title }),
104
+ collapseDescription === false ? textContent : null
105
+ ] });
106
+ const content = /* @__PURE__ */ jsx("div", {
107
+ id,
108
+ className: style_default.PropertyInfo,
109
+ children: types === "simple" ? simple : rich
110
+ });
111
+ return /* @__PURE__ */ jsx("div", {
112
+ className: style_default.Property,
113
+ "data-stldocs-language": language,
114
+ children: children || collapseDescription !== false && description ? /* @__PURE__ */ jsxs(Docs.Expander, {
115
+ summary: content,
116
+ muted: !children,
117
+ open: expand,
118
+ children: [
119
+ collapseDescription !== false ? textContent : null,
120
+ additional,
121
+ children && /* @__PURE__ */ jsx("div", {
122
+ className: style_default.PropertyChildren,
123
+ children
124
+ })
125
+ ]
126
+ }) : content
127
+ });
128
+ }
129
+
130
+ //#endregion
131
+ export { PropertyToggle as i, PropertyDescription as n, PropertyTitle as r, Property as t };
@@ -0,0 +1,54 @@
1
+ import { ReactNode } from "react";
2
+ import * as react_jsx_runtime46 from "react/jsx-runtime";
3
+
4
+ //#region src/components/properties.d.ts
5
+ type PropertyToggleProps = {
6
+ target: string;
7
+ };
8
+ declare function PropertyToggle({
9
+ target
10
+ }: PropertyToggleProps): react_jsx_runtime46.JSX.Element;
11
+ type PropertyDescriptionProps = {
12
+ description?: string;
13
+ };
14
+ declare function PropertyDescription({
15
+ description
16
+ }: PropertyDescriptionProps): react_jsx_runtime46.JSX.Element | undefined;
17
+ type PropertyTitleProps = {
18
+ title?: string;
19
+ };
20
+ declare function PropertyTitle({
21
+ title
22
+ }: PropertyTitleProps): react_jsx_runtime46.JSX.Element | undefined;
23
+ type PropertyProps = {
24
+ id?: string;
25
+ name?: ReactNode;
26
+ typeName?: ReactNode;
27
+ badges?: ReactNode;
28
+ type?: ReactNode;
29
+ description?: string;
30
+ title?: string;
31
+ expand?: boolean;
32
+ deprecated?: boolean | string;
33
+ additional?: ReactNode;
34
+ declaration?: ReactNode;
35
+ constraints?: ReactNode;
36
+ children?: ReactNode;
37
+ };
38
+ declare function Property({
39
+ id,
40
+ name,
41
+ typeName,
42
+ badges,
43
+ type,
44
+ declaration,
45
+ description,
46
+ title,
47
+ deprecated,
48
+ expand,
49
+ additional,
50
+ constraints,
51
+ children
52
+ }: PropertyProps): react_jsx_runtime46.JSX.Element;
53
+ //#endregion
54
+ export { PropertyTitle as a, PropertyToggleProps as c, PropertyProps as i, PropertyDescription as n, PropertyTitleProps as o, PropertyDescriptionProps as r, PropertyToggle as s, Property as t };
@@ -0,0 +1,269 @@
1
+ import { t as __exportAll } from "./chunk-BN_g-Awi.js";
2
+ import { n as useLanguageComponents } from "./contexts-CeV_L_Iy.js";
3
+ import { t as useComponents } from "./use-components-BUz3GbO4.js";
4
+ import { t as style_default } from "./style-LwfvXElj.js";
5
+ import * as React$1 from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
+
8
+ //#region src/languages/python.tsx
9
+ var python_exports = /* @__PURE__ */ __exportAll({
10
+ Declaration: () => Declaration,
11
+ MethodSignature: () => MethodSignature,
12
+ Property: () => Property,
13
+ Type: () => Type,
14
+ TypeName: () => TypeName
15
+ });
16
+ const constStyle = {
17
+ string: style_default.LiteralString,
18
+ number: style_default.LiteralNumeric,
19
+ boolean: style_default.LiteralBoolean
20
+ };
21
+ function showFullType(type) {
22
+ if (type.kind !== "PythonTypeReference") return false;
23
+ return type.typeName === "Optional" ? showFullType(type.typeParameters[0]) : type.typeParameters.length > 0;
24
+ }
25
+ function TypeName({ type }) {
26
+ const Lang = useLanguageComponents();
27
+ if (type.kind === "PythonTypeReference") switch (type.typeName) {
28
+ case "Optional": return /* @__PURE__ */ jsx(Lang.TypeName, { type: type.typeParameters[0] });
29
+ case "List":
30
+ case "Iterable":
31
+ case "Literal":
32
+ case "Union": return type.typeName.toLowerCase();
33
+ }
34
+ return /* @__PURE__ */ jsx(Lang.Type, { type });
35
+ }
36
+ function Type({ type }) {
37
+ const Lang = useLanguageComponents();
38
+ const { Join, SDKReference } = useComponents();
39
+ switch (type.kind) {
40
+ case "PythonTypeAny":
41
+ case "PythonTypeUnknown":
42
+ case "PythonTypeInt":
43
+ case "PythonTypeFloat":
44
+ case "PythonTypeBool": return /* @__PURE__ */ jsx("span", {
45
+ className: style_default.Type,
46
+ children: /* @__PURE__ */ jsx("span", {
47
+ className: style_default.TypeKeyword,
48
+ children: type.kind.slice(10).toLowerCase()
49
+ })
50
+ });
51
+ case "PythonTypeString": return /* @__PURE__ */ jsx("span", {
52
+ className: style_default.Type,
53
+ children: /* @__PURE__ */ jsx("span", {
54
+ className: style_default.TypeString,
55
+ children: "str"
56
+ })
57
+ });
58
+ case "PythonTypeLiteral": return /* @__PURE__ */ jsx("span", {
59
+ className: style_default.Type,
60
+ children: /* @__PURE__ */ jsx("span", {
61
+ className: constStyle[typeof type.literal.value],
62
+ children: JSON.stringify(type.literal.value)
63
+ })
64
+ });
65
+ case "PythonTypeArray": return /* @__PURE__ */ jsxs("span", {
66
+ className: style_default.Type,
67
+ children: [
68
+ /* @__PURE__ */ jsx("span", {
69
+ className: style_default.TypeArray,
70
+ children: "Array<"
71
+ }),
72
+ /* @__PURE__ */ jsx(Lang.Type, { type: type.elementType }),
73
+ /* @__PURE__ */ jsx("span", {
74
+ className: style_default.TypeArray,
75
+ children: ">"
76
+ })
77
+ ]
78
+ });
79
+ case "PythonTypeClass": return /* @__PURE__ */ jsx("span", {
80
+ className: style_default.Type,
81
+ children: /* @__PURE__ */ jsx("span", {
82
+ className: style_default.TypeKeyword,
83
+ children: "class"
84
+ })
85
+ });
86
+ case "PythonTypeMap": return /* @__PURE__ */ jsx("span", {
87
+ className: style_default.Type,
88
+ children: /* @__PURE__ */ jsx("span", {
89
+ className: style_default.TypeKeyword,
90
+ children: "Dict"
91
+ })
92
+ });
93
+ case "PythonTypeReference": {
94
+ const params = type.typeParameters?.map((param, key) => /* @__PURE__ */ jsx(Lang.Type, { type: param }, key));
95
+ return /* @__PURE__ */ jsxs("span", {
96
+ className: style_default.Type,
97
+ children: [/* @__PURE__ */ jsx("span", {
98
+ className: type.typeName === "Optional" ? style_default.TypeArray : "",
99
+ children: /* @__PURE__ */ jsx(SDKReference, {
100
+ stainlessPath: type.$ref,
101
+ children: type.typeName
102
+ })
103
+ }), params && params.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
104
+ /* @__PURE__ */ jsx("span", {
105
+ className: style_default.TypeBracket,
106
+ children: "["
107
+ }),
108
+ /* @__PURE__ */ jsx(Join, {
109
+ items: params,
110
+ limit: 3,
111
+ children: /* @__PURE__ */ jsx("span", {
112
+ className: style_default.TextOperator,
113
+ children: ", "
114
+ })
115
+ }),
116
+ /* @__PURE__ */ jsx("span", {
117
+ className: style_default.TypeBracket,
118
+ children: "]"
119
+ })
120
+ ] })]
121
+ });
122
+ }
123
+ }
124
+ }
125
+ function MethodSignature({ decl }) {
126
+ const Lang = useLanguageComponents();
127
+ const { Join, Tooltip } = useComponents();
128
+ const params = decl.parameters.map((param, i) => /* @__PURE__ */ jsx(React$1.Fragment, { children: /* @__PURE__ */ jsx(Tooltip, {
129
+ content: /* @__PURE__ */ jsx(Lang.Type, { type: param.type }),
130
+ children: /* @__PURE__ */ jsx("span", {
131
+ className: style_default.TextIdentifier,
132
+ children: param.ident
133
+ })
134
+ }) }, i));
135
+ return /* @__PURE__ */ jsx("div", {
136
+ className: style_default.MethodSignature,
137
+ children: /* @__PURE__ */ jsxs("span", {
138
+ className: style_default.SignatureTitle,
139
+ children: [
140
+ decl.async && /* @__PURE__ */ jsx("span", {
141
+ className: style_default.TextKeyword,
142
+ children: "async "
143
+ }),
144
+ decl.qualified && /* @__PURE__ */ jsx("span", {
145
+ className: style_default.SignatureQualified,
146
+ children: /* @__PURE__ */ jsx("span", {
147
+ className: style_default.TextIdentifier,
148
+ children: decl.qualified?.slice(0, -decl.ident.length)
149
+ })
150
+ }),
151
+ /* @__PURE__ */ jsx("span", {
152
+ className: style_default.SignatureName,
153
+ children: /* @__PURE__ */ jsx("span", {
154
+ className: style_default.TextIdentifier,
155
+ children: decl.ident
156
+ })
157
+ }),
158
+ /* @__PURE__ */ jsxs("span", {
159
+ className: style_default.MethodSignature,
160
+ children: [
161
+ /* @__PURE__ */ jsx("span", {
162
+ className: style_default.SignatureParen,
163
+ children: "("
164
+ }),
165
+ /* @__PURE__ */ jsx("span", {
166
+ className: style_default.SignatureParams,
167
+ children: /* @__PURE__ */ jsx(Join, {
168
+ items: params,
169
+ children: /* @__PURE__ */ jsx("span", {
170
+ className: style_default.TextOperator,
171
+ children: ", "
172
+ })
173
+ })
174
+ }),
175
+ /* @__PURE__ */ jsxs("span", {
176
+ className: style_default.SignatureParen,
177
+ children: [")", " "]
178
+ }),
179
+ decl.returns && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
180
+ className: style_default.TextOperator,
181
+ children: " -> "
182
+ }), /* @__PURE__ */ jsx(Lang.Type, { type: decl.returns })] })
183
+ ]
184
+ })
185
+ ]
186
+ })
187
+ });
188
+ }
189
+ function Property({ decl, children }) {
190
+ const Lang = useLanguageComponents();
191
+ if (!decl) return;
192
+ switch (decl.kind) {
193
+ case "PythonDeclProperty": return children({
194
+ name: decl.ident,
195
+ typeName: /* @__PURE__ */ jsx(Lang.TypeName, { type: decl.type }),
196
+ type: showFullType(decl.type) && /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
197
+ });
198
+ case "PythonDeclClass": return children({
199
+ name: decl.ident,
200
+ typeName: "class"
201
+ });
202
+ case "PythonDeclType": return children({
203
+ name: decl.ident,
204
+ typeName: "type",
205
+ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
206
+ });
207
+ case "PythonDeclReference": return children({ type: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
208
+ }
209
+ }
210
+ function Declaration({ decl }) {
211
+ const Lang = useLanguageComponents();
212
+ if (!decl) return;
213
+ switch (decl.kind) {
214
+ case "PythonDeclProperty": {
215
+ const nullable = decl.type.kind === "PythonTypeReference" && decl.type.typeName === "Optional" && (decl.type.typeParameters ?? []).length > 0;
216
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
217
+ /* @__PURE__ */ jsx("span", {
218
+ className: style_default.TypePropertyName,
219
+ children: /* @__PURE__ */ jsx("span", {
220
+ className: style_default.TextIdentifier,
221
+ children: decl.ident
222
+ })
223
+ }),
224
+ /* @__PURE__ */ jsx("span", {
225
+ className: style_default.TextPunctuation,
226
+ children: ": "
227
+ }),
228
+ decl.optional && !nullable ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
229
+ /* @__PURE__ */ jsx("span", {
230
+ className: style_default.TypePlain,
231
+ children: "Optional"
232
+ }),
233
+ /* @__PURE__ */ jsx("span", {
234
+ className: style_default.TypeBracket,
235
+ children: "["
236
+ }),
237
+ /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }),
238
+ /* @__PURE__ */ jsx("span", {
239
+ className: style_default.TypeBrace,
240
+ children: "]"
241
+ })
242
+ ] }) : /* @__PURE__ */ jsx(Lang.Type, { type: decl.type })
243
+ ] });
244
+ }
245
+ case "PythonDeclClass": return /* @__PURE__ */ jsxs(Fragment$1, { children: [
246
+ /* @__PURE__ */ jsx("span", {
247
+ className: style_default.TextKeyword,
248
+ children: "class "
249
+ }),
250
+ /* @__PURE__ */ jsx("span", {
251
+ className: style_default.TextIdentifier,
252
+ children: decl.ident
253
+ }),
254
+ /* @__PURE__ */ jsx("span", {
255
+ className: style_default.TextPunctuation,
256
+ children: ": "
257
+ }),
258
+ /* @__PURE__ */ jsx("span", {
259
+ className: `${style_default.TypePreviewContent} ${style_default.TextPunctuation}`,
260
+ children: "…"
261
+ })
262
+ ] });
263
+ case "PythonDeclType": return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Lang.Type, { type: decl.type }) });
264
+ case "PythonDeclReference": return /* @__PURE__ */ jsx(Lang.Type, { type: decl.type });
265
+ }
266
+ }
267
+
268
+ //#endregion
269
+ export { TypeName as a, Type as i, MethodSignature as n, python_exports as o, Property as r, Declaration as t };