@stainless-api/docs-ui 0.1.0-beta.3 → 0.1.0-beta.31

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 (187) hide show
  1. package/dist/breadcrumbs-D2C-ipke.d.ts +20 -0
  2. package/dist/chunk-DsStOjWQ.js +13 -0
  3. package/dist/component-generics-CGwo6qAl.d.ts +30 -0
  4. package/dist/component-generics-D3ybuN5r.js +45 -0
  5. package/dist/components/breadcrumbs.d.ts +2 -0
  6. package/dist/components/breadcrumbs.js +15 -0
  7. package/dist/components/chat.d.ts +14 -0
  8. package/dist/components/chat.js +142 -0
  9. package/dist/components/icons.d.ts +50 -0
  10. package/dist/components/icons.js +3 -0
  11. package/dist/components/index.d.ts +11 -0
  12. package/dist/components/index.js +15 -0
  13. package/dist/components/method.d.ts +2 -0
  14. package/dist/components/method.js +15 -0
  15. package/dist/components/overview.d.ts +2 -0
  16. package/dist/components/overview.js +15 -0
  17. package/dist/components/primitives.d.ts +2 -0
  18. package/dist/components/primitives.js +15 -0
  19. package/dist/components/properties.d.ts +2 -0
  20. package/dist/components/properties.js +15 -0
  21. package/dist/components/sdk.d.ts +3 -0
  22. package/dist/components/sdk.js +15 -0
  23. package/dist/components/sidebar.d.ts +2 -0
  24. package/dist/components/sidebar.js +15 -0
  25. package/dist/components/snippets.d.ts +4 -0
  26. package/dist/components/snippets.js +15 -0
  27. package/dist/contexts/component-generics.d.ts +2 -0
  28. package/dist/contexts/component-generics.js +3 -0
  29. package/dist/contexts/component-types.d.ts +17 -0
  30. package/dist/contexts/component-types.js +0 -0
  31. package/dist/contexts/component.d.ts +30 -0
  32. package/dist/contexts/component.js +15 -0
  33. package/dist/contexts/docs.d.ts +2 -0
  34. package/dist/contexts/docs.js +3 -0
  35. package/dist/contexts/index.d.ts +19 -0
  36. package/dist/contexts/index.js +15 -0
  37. package/dist/contexts/markdown.d.ts +2 -0
  38. package/dist/contexts/markdown.js +4 -0
  39. package/dist/contexts/navigation.d.ts +3 -0
  40. package/dist/contexts/navigation.js +3 -0
  41. package/dist/contexts/search.d.ts +4 -0
  42. package/dist/contexts/search.js +15 -0
  43. package/dist/contexts/use-components.d.ts +15 -0
  44. package/dist/contexts/use-components.js +4 -0
  45. package/dist/contexts-Bpupku3r.js +3804 -0
  46. package/dist/docs-C5sBbvz9.d.ts +46 -0
  47. package/dist/docs-CopwX9a7.js +54 -0
  48. package/dist/icons-yb-Jhkmg.js +753 -0
  49. package/dist/index-BZvOzjGA.d.ts +15 -0
  50. package/dist/index-Cwjt4PqJ.d.ts +240 -0
  51. package/dist/index-Cx9sLoAB.d.ts +14 -0
  52. package/dist/index.d.ts +21 -0
  53. package/dist/index.js +15 -7542
  54. package/dist/languages/go.d.ts +12 -0
  55. package/dist/languages/go.js +15 -0
  56. package/dist/languages/http.d.ts +12 -0
  57. package/dist/languages/http.js +15 -0
  58. package/dist/languages/index.d.ts +12 -0
  59. package/dist/languages/index.js +15 -0
  60. package/dist/languages/java.d.ts +12 -0
  61. package/dist/languages/java.js +15 -0
  62. package/dist/languages/python.d.ts +12 -0
  63. package/dist/languages/python.js +15 -0
  64. package/dist/languages/ruby.d.ts +12 -0
  65. package/dist/languages/ruby.js +15 -0
  66. package/dist/languages/typescript.d.ts +12 -0
  67. package/dist/languages/typescript.js +15 -0
  68. package/dist/markdown/index.d.ts +12 -0
  69. package/dist/markdown/index.js +15 -0
  70. package/dist/markdown/md.d.ts +15 -0
  71. package/dist/markdown/md.js +3 -0
  72. package/dist/markdown/utils.d.ts +4 -0
  73. package/dist/markdown/utils.js +3 -0
  74. package/dist/markdown-CI4kbU64.js +44 -0
  75. package/dist/markdown-CswQW7Au.d.ts +22 -0
  76. package/dist/md-DxiV1_vy.js +41 -0
  77. package/dist/method-D0-gsw3H.d.ts +71 -0
  78. package/dist/navigation-Bc58Zt6l.d.ts +29 -0
  79. package/dist/navigation-CGr5_w6z.js +24 -0
  80. package/dist/overview-Ds69MW_g.d.ts +39 -0
  81. package/dist/pagefind-BaK1krMe.js +15 -0
  82. package/dist/primitives-DKSwbXPi.d.ts +99 -0
  83. package/dist/properties-4IkL0IVR.d.ts +46 -0
  84. package/dist/routing-8itEXLx6.js +189 -0
  85. package/dist/routing-ByeZ2P3d.d.ts +54 -0
  86. package/dist/routing.d.ts +2 -0
  87. package/dist/routing.js +3 -180
  88. package/dist/sdk-D1acaxlr.d.ts +119 -0
  89. package/dist/search/index.d.ts +26 -0
  90. package/dist/search/index.js +334 -0
  91. package/dist/search/providers/algolia.d.ts +24 -0
  92. package/dist/search/providers/algolia.js +15 -0
  93. package/dist/search/providers/fuse.d.ts +18 -0
  94. package/dist/search/providers/fuse.js +30 -0
  95. package/dist/search/providers/pagefind.d.ts +7 -0
  96. package/dist/search/providers/pagefind.js +3 -0
  97. package/dist/search/providers/walker.d.ts +9 -0
  98. package/dist/search/providers/walker.js +34 -0
  99. package/dist/search/types.d.ts +3 -0
  100. package/dist/search/types.js +3 -0
  101. package/dist/search-BwZ0UK72.d.ts +21 -0
  102. package/dist/sidebar-rqdLbjBO.d.ts +36 -0
  103. package/dist/snippets-Coq_j3S0.d.ts +46 -0
  104. package/dist/style-BEMLtSIK.d.ts +172 -0
  105. package/dist/style-CPgcT0Fw.js +173 -0
  106. package/dist/style.d.ts +2 -0
  107. package/dist/style.js +3 -0
  108. package/dist/styles/main.css +763 -736
  109. package/dist/styles/main.js +0 -0
  110. package/dist/styles/primitives.css +285 -464
  111. package/dist/styles/primitives.js +0 -0
  112. package/dist/styles/resets.css +31 -41
  113. package/dist/styles/resets.js +0 -0
  114. package/dist/styles/search.css +266 -248
  115. package/dist/styles/search.js +0 -0
  116. package/dist/styles/sidebar.css +59 -60
  117. package/dist/styles/sidebar.js +0 -0
  118. package/dist/styles/snippets.css +87 -88
  119. package/dist/styles/snippets.js +0 -0
  120. package/dist/styles/variables.css +87 -89
  121. package/dist/styles/variables.js +0 -0
  122. package/dist/types-BKUIuYYk.d.ts +83 -0
  123. package/dist/types-__XoFvJ_.js +34 -0
  124. package/dist/use-components-BHEwm0mE.js +7 -0
  125. package/dist/utils-2FmcHPHp.js +32 -0
  126. package/dist/utils-BCfb0F9R.js +30 -0
  127. package/dist/utils-D43p_yTd.d.ts +14 -0
  128. package/dist/utils-NYMx28lc.d.ts +21 -0
  129. package/dist/utils.d.ts +2 -0
  130. package/dist/utils.js +4 -0
  131. package/package.json +78 -16
  132. package/dist/mcp.js +0 -16003
  133. package/src/components/breadcrumbs.tsx +0 -94
  134. package/src/components/chat.tsx +0 -154
  135. package/src/components/dropdown.tsx +0 -91
  136. package/src/components/icons.tsx +0 -584
  137. package/src/components/index.ts +0 -9
  138. package/src/components/method.tsx +0 -144
  139. package/src/components/overview.tsx +0 -159
  140. package/src/components/primitives.tsx +0 -284
  141. package/src/components/properties.tsx +0 -130
  142. package/src/components/scripts/dropdown.ts +0 -78
  143. package/src/components/sdk.tsx +0 -402
  144. package/src/components/sidebar.tsx +0 -99
  145. package/src/components/snippets.tsx +0 -179
  146. package/src/contexts/component-generics.tsx +0 -48
  147. package/src/contexts/component-types.tsx +0 -5
  148. package/src/contexts/component.tsx +0 -32
  149. package/src/contexts/docs.tsx +0 -75
  150. package/src/contexts/index.tsx +0 -17
  151. package/src/contexts/markdown.tsx +0 -43
  152. package/src/contexts/navigation.tsx +0 -44
  153. package/src/contexts/search.tsx +0 -28
  154. package/src/contexts/use-components.tsx +0 -4
  155. package/src/index.ts +0 -6
  156. package/src/languages/go.tsx +0 -281
  157. package/src/languages/http.tsx +0 -321
  158. package/src/languages/index.ts +0 -26
  159. package/src/languages/java.tsx +0 -358
  160. package/src/languages/python.tsx +0 -255
  161. package/src/languages/ruby.tsx +0 -320
  162. package/src/languages/typescript.tsx +0 -393
  163. package/src/markdown/index.ts +0 -107
  164. package/src/markdown/md.ts +0 -45
  165. package/src/markdown/utils.ts +0 -49
  166. package/src/routing.ts +0 -238
  167. package/src/search/form.tsx +0 -127
  168. package/src/search/index.tsx +0 -1
  169. package/src/search/indexer.ts +0 -246
  170. package/src/search/mcp.ts +0 -61
  171. package/src/search/printer.tsx +0 -86
  172. package/src/search/providers/algolia.ts +0 -88
  173. package/src/search/providers/fuse.ts +0 -19
  174. package/src/search/providers/pagefind.ts +0 -17
  175. package/src/search/providers/walker.ts +0 -30
  176. package/src/search/results.tsx +0 -181
  177. package/src/search/state.ts +0 -64
  178. package/src/search/types.ts +0 -116
  179. package/src/style.ts +0 -197
  180. package/src/styles/main.css +0 -993
  181. package/src/styles/primitives.css +0 -572
  182. package/src/styles/resets.css +0 -47
  183. package/src/styles/search.css +0 -342
  184. package/src/styles/sidebar.css +0 -87
  185. package/src/styles/snippets.css +0 -132
  186. package/src/styles/variables.css +0 -90
  187. package/src/utils.ts +0 -41
@@ -0,0 +1,26 @@
1
+ import "../routing-ByeZ2P3d.js";
2
+ import { c as QueryKindsType, l as ResultData } from "../types-BKUIuYYk.js";
3
+ import * as react_jsx_runtime84 from "react/jsx-runtime";
4
+
5
+ //#region src/search/form.d.ts
6
+ declare function SearchForm(): react_jsx_runtime84.JSX.Element;
7
+ type SearchFilterProps = {
8
+ results: ResultData;
9
+ filterKind: QueryKindsType;
10
+ onChange: (filterKind: QueryKindsType) => void;
11
+ };
12
+ declare function SearchFilter({
13
+ results,
14
+ filterKind,
15
+ onChange
16
+ }: SearchFilterProps): react_jsx_runtime84.JSX.Element;
17
+ type SearchModalProps = {
18
+ id?: string;
19
+ open?: boolean;
20
+ };
21
+ declare function SearchModal({
22
+ id,
23
+ open: isOpen
24
+ }: SearchModalProps): react_jsx_runtime84.JSX.Element;
25
+ //#endregion
26
+ export { SearchFilter, SearchFilterProps, SearchForm, SearchModal, SearchModalProps };
@@ -0,0 +1,334 @@
1
+ import { a as useLanguage } from "../docs-CopwX9a7.js";
2
+ import "../component-generics-D3ybuN5r.js";
3
+ import "../navigation-CGr5_w6z.js";
4
+ import "../markdown-CI4kbU64.js";
5
+ import "../routing-8itEXLx6.js";
6
+ import { t as style_default } from "../style-CPgcT0Fw.js";
7
+ import { t as useComponents } from "../use-components-BHEwm0mE.js";
8
+ import { a as useSearchContext, i as useSearch } from "../contexts-Bpupku3r.js";
9
+ import "../icons-yb-Jhkmg.js";
10
+ import "../utils-2FmcHPHp.js";
11
+ import "../md-DxiV1_vy.js";
12
+ import "../utils-BCfb0F9R.js";
13
+ import { t as QueryKinds } from "../types-__XoFvJ_.js";
14
+ import { t as guideSearch } from "../pagefind-BaK1krMe.js";
15
+ import * as React$1 from "react";
16
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
17
+ import { BookOpenText, Box, Code, Folder, Search, Wrench, X } from "lucide-react";
18
+
19
+ //#region src/search/results.tsx
20
+ const QueryKindDisplay = {
21
+ all: {
22
+ name: "Results",
23
+ icon: Search
24
+ },
25
+ resource: {
26
+ name: "Resources",
27
+ icon: Folder
28
+ },
29
+ http_method: {
30
+ name: "Methods",
31
+ icon: Box
32
+ },
33
+ model: {
34
+ name: "Types",
35
+ icon: Code
36
+ },
37
+ property: {
38
+ name: "Properties",
39
+ icon: Wrench
40
+ },
41
+ guide: {
42
+ name: "Guide",
43
+ icon: BookOpenText
44
+ }
45
+ };
46
+ function Highlight({ result, name }) {
47
+ const value = result._highlightResult[name]?.value;
48
+ if (value) return /* @__PURE__ */ jsx("span", { dangerouslySetInnerHTML: { __html: value } });
49
+ }
50
+ function SearchResultBreadcrumb({ result }) {
51
+ const Docs = useComponents();
52
+ const Icon = QueryKindDisplay[result.kind].icon;
53
+ const items = result.crumbs?.map((crumb) => /* @__PURE__ */ jsx("span", {
54
+ className: style_default.SearchBreadcrumbItem,
55
+ children: crumb
56
+ }, crumb));
57
+ return /* @__PURE__ */ jsxs("div", {
58
+ className: style_default.SearchBreadcrumb,
59
+ children: [/* @__PURE__ */ jsx(Icon, {
60
+ className: style_default.Icon,
61
+ size: 14
62
+ }), Array.isArray(result.crumbs) && /* @__PURE__ */ jsx(Docs.Join, {
63
+ items,
64
+ children: /* @__PURE__ */ jsx("span", {
65
+ className: style_default.SearchBreadcrumbDivider,
66
+ children: "›"
67
+ })
68
+ })]
69
+ });
70
+ }
71
+ function SearchResult({ result }) {
72
+ return /* @__PURE__ */ jsxs("div", {
73
+ className: style_default.SearchResult,
74
+ "data-stldocs-search-result": result.kind,
75
+ children: [/* @__PURE__ */ jsx(SearchResultBreadcrumb, { result }), /* @__PURE__ */ jsx(SearchResultContent, { result })]
76
+ });
77
+ }
78
+ function GuideResult({ result }) {
79
+ const Docs = useComponents();
80
+ const Icon = QueryKindDisplay["guide"].icon;
81
+ const path = result.data.url.slice(1, -1).split("/").map((crumb) => /* @__PURE__ */ jsx("span", {
82
+ className: style_default.SearchBreadcrumbItem,
83
+ children: crumb
84
+ }, crumb));
85
+ const crumbs = path.length > 1 ? path : [/* @__PURE__ */ jsx("span", {
86
+ className: style_default.SearchBreadcrumbItem,
87
+ children: "Overview"
88
+ }, "overview")];
89
+ return /* @__PURE__ */ jsxs("div", {
90
+ className: style_default.SearchResult,
91
+ "data-stldocs-search-result": "guide",
92
+ children: [
93
+ /* @__PURE__ */ jsxs("div", {
94
+ className: style_default.SearchBreadcrumb,
95
+ children: [/* @__PURE__ */ jsx(Icon, {
96
+ className: style_default.Icon,
97
+ size: 14
98
+ }), /* @__PURE__ */ jsx(Docs.Join, {
99
+ items: crumbs,
100
+ children: /* @__PURE__ */ jsx("span", {
101
+ className: style_default.SearchBreadcrumbDivider,
102
+ children: "›"
103
+ })
104
+ })]
105
+ }),
106
+ /* @__PURE__ */ jsx("h3", {
107
+ className: style_default.SearchResultGuideTitle,
108
+ children: result.data.meta.title
109
+ }),
110
+ /* @__PURE__ */ jsx("div", {
111
+ className: style_default.SearchResultGuideExcerpt,
112
+ dangerouslySetInnerHTML: { __html: result.data.excerpt }
113
+ })
114
+ ]
115
+ });
116
+ }
117
+ function SearchResultContent({ result }) {
118
+ const Docs = useComponents();
119
+ const language = useLanguage();
120
+ switch (result.kind) {
121
+ case "http_method": return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Docs.MethodHeader, {
122
+ level: "h5",
123
+ title: /* @__PURE__ */ jsx(Highlight, {
124
+ result,
125
+ name: result.summary ? "summary" : "title"
126
+ }),
127
+ signature: result["qualified"] && /* @__PURE__ */ jsx(Highlight, {
128
+ result,
129
+ name: "qualified"
130
+ }),
131
+ children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
132
+ httpMethod: result.httpMethod,
133
+ endpoint: /* @__PURE__ */ jsx(Highlight, {
134
+ result,
135
+ name: "endpoint"
136
+ })
137
+ })
138
+ }), /* @__PURE__ */ jsx("div", {
139
+ className: `${style_default.MethodDescription} ${style_default.Content}`,
140
+ children: /* @__PURE__ */ jsx(Highlight, {
141
+ result,
142
+ name: "description"
143
+ })
144
+ })] });
145
+ case "model": {
146
+ const properties = result.children?.map((child, index) => /* @__PURE__ */ jsx("span", {
147
+ className: style_default.TextIdentifier,
148
+ children: child
149
+ }, index)) ?? [];
150
+ return /* @__PURE__ */ jsxs("div", {
151
+ className: style_default.Property,
152
+ "data-stldocs-language": language,
153
+ children: [/* @__PURE__ */ jsx("div", {
154
+ className: style_default.PropertyHeader,
155
+ children: /* @__PURE__ */ jsx("span", {
156
+ className: style_default.PropertyName,
157
+ children: /* @__PURE__ */ jsx(Highlight, {
158
+ result,
159
+ name: result.title ? "title" : "name"
160
+ })
161
+ })
162
+ }), /* @__PURE__ */ jsxs("span", {
163
+ className: style_default.PropertyDeclaration,
164
+ children: [
165
+ /* @__PURE__ */ jsx(Highlight, {
166
+ result,
167
+ name: "ident"
168
+ }),
169
+ ":",
170
+ " ",
171
+ /* @__PURE__ */ jsx(Docs.Join, {
172
+ items: properties,
173
+ limit: 3,
174
+ children: /* @__PURE__ */ jsx("span", {
175
+ className: style_default.TextPunctuation,
176
+ children: ", "
177
+ })
178
+ })
179
+ ]
180
+ })]
181
+ });
182
+ }
183
+ case "resource": return /* @__PURE__ */ jsxs("div", {
184
+ className: style_default.SearchResultResourceInfo,
185
+ children: [/* @__PURE__ */ jsx("span", {
186
+ className: style_default.SearchResultResourceTitle,
187
+ children: /* @__PURE__ */ jsx(Highlight, {
188
+ result,
189
+ name: "title"
190
+ })
191
+ }), /* @__PURE__ */ jsx("span", {
192
+ className: style_default.SearchResultResourcePath,
193
+ children: /* @__PURE__ */ jsx(Highlight, {
194
+ result,
195
+ name: "QualifiedName"
196
+ })
197
+ })]
198
+ });
199
+ case "property": return /* @__PURE__ */ jsxs("div", {
200
+ className: style_default.Property,
201
+ "data-stldocs-language": language,
202
+ children: [/* @__PURE__ */ jsxs("div", {
203
+ className: style_default.PropertyHeader,
204
+ children: [/* @__PURE__ */ jsx("span", {
205
+ className: style_default.PropertyName,
206
+ children: /* @__PURE__ */ jsx(Highlight, {
207
+ result,
208
+ name: "name"
209
+ })
210
+ }), /* @__PURE__ */ jsx("span", {
211
+ className: style_default.PropertyTypeName,
212
+ children: /* @__PURE__ */ jsx("span", { dangerouslySetInnerHTML: { __html: result.type ?? "" } })
213
+ })]
214
+ }), result.docstring && /* @__PURE__ */ jsx("span", {
215
+ className: style_default.PropertyDescription,
216
+ children: /* @__PURE__ */ jsx(Highlight, {
217
+ result,
218
+ name: "docstring"
219
+ })
220
+ })]
221
+ });
222
+ }
223
+ }
224
+
225
+ //#endregion
226
+ //#region src/search/form.tsx
227
+ function SearchForm() {
228
+ const Docs = useComponents();
229
+ const search = useSearch();
230
+ const language = useLanguage();
231
+ const { onSelect, pageFind } = useSearchContext();
232
+ const [results, setResults] = React$1.useState(null);
233
+ const [filterKind, setFilterKind] = React$1.useState("all");
234
+ const [searchQuery, setSearchQuery] = React$1.useState("");
235
+ const inputRef = React$1.useRef(null);
236
+ async function performSearch() {
237
+ const guideLimit = filterKind === "guide" ? 25 : 5;
238
+ const kind = ["all", "guide"].includes(filterKind) ? void 0 : filterKind;
239
+ const [guideResults, apiResults] = await Promise.all([pageFind ? guideSearch(pageFind, searchQuery, guideLimit) : [], search({
240
+ query: searchQuery,
241
+ kind,
242
+ language
243
+ })]);
244
+ setResults({
245
+ items: filterKind === "guide" ? guideResults : [...guideResults, ...apiResults?.hits ?? []],
246
+ counts: {
247
+ ...apiResults?.facets?.["kind"],
248
+ guide: guideResults.length,
249
+ all: apiResults?.nbHits
250
+ }
251
+ });
252
+ }
253
+ function clearInput() {
254
+ setSearchQuery("");
255
+ inputRef?.current?.focus();
256
+ }
257
+ React$1.useEffect(() => void performSearch(), [
258
+ searchQuery,
259
+ filterKind,
260
+ language
261
+ ]);
262
+ return /* @__PURE__ */ jsxs("div", {
263
+ className: style_default.SearchForm,
264
+ children: [
265
+ /* @__PURE__ */ jsx(Docs.Input, {
266
+ ref: inputRef,
267
+ autoFocus: true,
268
+ onChange: (ev) => setSearchQuery(ev.target.value),
269
+ left: /* @__PURE__ */ jsx(Search, {
270
+ size: 16,
271
+ className: style_default.Icon
272
+ }),
273
+ right: searchQuery && /* @__PURE__ */ jsx(X, {
274
+ cursor: "pointer",
275
+ onClick: () => clearInput(),
276
+ size: 16,
277
+ className: style_default.Icon
278
+ }),
279
+ value: searchQuery,
280
+ placeholder: "Search"
281
+ }),
282
+ /* @__PURE__ */ jsx(SearchFilter, {
283
+ results,
284
+ filterKind,
285
+ onChange: (filterKind$1) => setFilterKind(filterKind$1)
286
+ }),
287
+ /* @__PURE__ */ jsx(Docs.ListView, {
288
+ items: results?.items ?? [],
289
+ itemDelegate: (item) => "kind" in item ? /* @__PURE__ */ jsx(SearchResult, { result: item }) : /* @__PURE__ */ jsx(GuideResult, { result: item }),
290
+ onSelectListItem: (item) => onSelect?.(item["data"]?.["url"] ?? item["stainlessPath"])
291
+ })
292
+ ]
293
+ });
294
+ }
295
+ function SearchFilter({ results, filterKind, onChange }) {
296
+ const Docs = useComponents();
297
+ const { pageFind } = useSearchContext();
298
+ const toggles = pageFind ? QueryKinds : QueryKinds.slice(0, -1);
299
+ return /* @__PURE__ */ jsx("div", {
300
+ className: style_default.SearchFilter,
301
+ children: toggles.map((kind, index) => /* @__PURE__ */ jsxs(Docs.ToggleButton, {
302
+ selected: filterKind === kind,
303
+ onClick: () => onChange?.(kind),
304
+ children: [
305
+ React$1.createElement(QueryKindDisplay[kind].icon, {
306
+ size: 16,
307
+ className: style_default.Icon
308
+ }),
309
+ /* @__PURE__ */ jsx("span", {
310
+ className: style_default.SearchFilterLabel,
311
+ children: QueryKindDisplay[kind].name
312
+ }),
313
+ /* @__PURE__ */ jsx("span", {
314
+ className: style_default.SearchFilterCount,
315
+ children: results?.counts?.[kind] ?? 0
316
+ })
317
+ ]
318
+ }, index))
319
+ });
320
+ }
321
+ function SearchModal({ id, open: isOpen }) {
322
+ const [open, setOpen] = React$1.useState(isOpen ?? false);
323
+ return /* @__PURE__ */ jsx("div", {
324
+ id,
325
+ onToggle: (ev) => setOpen(ev.newState === "open"),
326
+ className: style_default.SearchModal,
327
+ popover: "auto",
328
+ "data-stldocs-modal-open": open,
329
+ children: open && /* @__PURE__ */ jsx(SearchForm, {})
330
+ });
331
+ }
332
+
333
+ //#endregion
334
+ export { SearchFilter, SearchForm, SearchModal };
@@ -0,0 +1,24 @@
1
+ import "../../routing-ByeZ2P3d.js";
2
+ import { d as ResultType, h as SearchSettings, m as SearchParams } from "../../types-BKUIuYYk.js";
3
+ import * as SDKJSON from "@stainless/sdk-json";
4
+
5
+ //#region src/search/providers/algolia.d.ts
6
+ declare function buildIndex(appId: string, indexName: string, writeKey: string, spec: SDKJSON.Spec, renderMarkdown: (_: string) => string | null): Promise<void>;
7
+ declare function buildChatIndex(appId: string, indexName: string, writeKey: string, spec: SDKJSON.Spec): Promise<void>;
8
+ declare function search({
9
+ settings: {
10
+ appId,
11
+ indexName,
12
+ searchKey
13
+ },
14
+ params: {
15
+ query,
16
+ language,
17
+ kind
18
+ }
19
+ }: {
20
+ params: SearchParams;
21
+ settings: SearchSettings;
22
+ }): Promise<ResultType | undefined>;
23
+ //#endregion
24
+ export { buildChatIndex, buildIndex, search };
@@ -0,0 +1,15 @@
1
+ import "../../docs-CopwX9a7.js";
2
+ import "../../component-generics-D3ybuN5r.js";
3
+ import "../../navigation-CGr5_w6z.js";
4
+ import "../../markdown-CI4kbU64.js";
5
+ import "../../routing-8itEXLx6.js";
6
+ import "../../style-CPgcT0Fw.js";
7
+ import "../../use-components-BHEwm0mE.js";
8
+ import { c as search, o as buildChatIndex, s as buildIndex } from "../../contexts-Bpupku3r.js";
9
+ import "../../icons-yb-Jhkmg.js";
10
+ import "../../utils-2FmcHPHp.js";
11
+ import "../../md-DxiV1_vy.js";
12
+ import "../../utils-BCfb0F9R.js";
13
+ import "../../types-__XoFvJ_.js";
14
+
15
+ export { buildChatIndex, buildIndex, search };
@@ -0,0 +1,18 @@
1
+ import { t as DocsLanguage } from "../../routing-ByeZ2P3d.js";
2
+ import { n as IndexEntry } from "../../types-BKUIuYYk.js";
3
+ import * as fuse_js0 from "fuse.js";
4
+ import { FuseIndex } from "fuse.js";
5
+ import * as SDKJSON from "@stainless/sdk-json";
6
+
7
+ //#region src/search/providers/fuse.d.ts
8
+ type FuseIndexData = {
9
+ content: IndexEntry[];
10
+ index: FuseIndex<IndexEntry>;
11
+ };
12
+ declare function buildIndex(spec: SDKJSON.Spec, language?: DocsLanguage): FuseIndexData;
13
+ declare function search({
14
+ content,
15
+ index
16
+ }: FuseIndexData, query: string, limit?: number): fuse_js0.FuseResult<IndexEntry>[];
17
+ //#endregion
18
+ export { FuseIndexData, buildIndex, search };
@@ -0,0 +1,30 @@
1
+ import "../../docs-CopwX9a7.js";
2
+ import "../../component-generics-D3ybuN5r.js";
3
+ import "../../navigation-CGr5_w6z.js";
4
+ import "../../markdown-CI4kbU64.js";
5
+ import "../../routing-8itEXLx6.js";
6
+ import "../../style-CPgcT0Fw.js";
7
+ import "../../use-components-BHEwm0mE.js";
8
+ import { l as generateIndex } from "../../contexts-Bpupku3r.js";
9
+ import "../../icons-yb-Jhkmg.js";
10
+ import "../../utils-2FmcHPHp.js";
11
+ import "../../md-DxiV1_vy.js";
12
+ import "../../utils-BCfb0F9R.js";
13
+ import { n as SearchableAttributes } from "../../types-__XoFvJ_.js";
14
+ import Fuse from "fuse.js";
15
+
16
+ //#region src/search/providers/fuse.ts
17
+ function buildIndex(spec, language) {
18
+ const idx = Array.from(generateIndex(spec, void 0, false));
19
+ const content = language ? idx.filter((entry) => entry.language === language) : idx;
20
+ return {
21
+ content,
22
+ index: Fuse.createIndex([...SearchableAttributes], content)
23
+ };
24
+ }
25
+ function search({ content, index }, query, limit = 100) {
26
+ return new Fuse(content, { keys: [...SearchableAttributes] }, index).search(query).slice(0, limit);
27
+ }
28
+
29
+ //#endregion
30
+ export { buildIndex, search };
@@ -0,0 +1,7 @@
1
+ import "../../routing-ByeZ2P3d.js";
2
+ import { t as GuideResultType } from "../../types-BKUIuYYk.js";
3
+
4
+ //#region src/search/providers/pagefind.d.ts
5
+ declare function guideSearch(loadPath: string, query: string, limit?: number): Promise<GuideResultType[]>;
6
+ //#endregion
7
+ export { guideSearch };
@@ -0,0 +1,3 @@
1
+ import { t as guideSearch } from "../../pagefind-BaK1krMe.js";
2
+
3
+ export { guideSearch };
@@ -0,0 +1,9 @@
1
+ import { t as DocsLanguage } from "../../routing-ByeZ2P3d.js";
2
+ import { n as IndexEntry } from "../../types-BKUIuYYk.js";
3
+ import * as SDKJSON from "@stainless/sdk-json";
4
+
5
+ //#region src/search/providers/walker.d.ts
6
+ declare function buildIndex(spec: SDKJSON.Spec): Generator<IndexEntry, any, any>;
7
+ declare function search(index: Generator<IndexEntry>, language: DocsLanguage, query: string, limit?: number): IndexEntry[];
8
+ //#endregion
9
+ export { buildIndex, search };
@@ -0,0 +1,34 @@
1
+ import "../../docs-CopwX9a7.js";
2
+ import "../../component-generics-D3ybuN5r.js";
3
+ import "../../navigation-CGr5_w6z.js";
4
+ import "../../markdown-CI4kbU64.js";
5
+ import "../../routing-8itEXLx6.js";
6
+ import "../../style-CPgcT0Fw.js";
7
+ import "../../use-components-BHEwm0mE.js";
8
+ import { l as generateIndex } from "../../contexts-Bpupku3r.js";
9
+ import "../../icons-yb-Jhkmg.js";
10
+ import "../../utils-2FmcHPHp.js";
11
+ import "../../md-DxiV1_vy.js";
12
+ import "../../utils-BCfb0F9R.js";
13
+ import { n as SearchableAttributes } from "../../types-__XoFvJ_.js";
14
+
15
+ //#region src/search/providers/walker.ts
16
+ function buildIndex(spec) {
17
+ return generateIndex(spec, void 0, false);
18
+ }
19
+ function* findEntryInIndex(index, language, query) {
20
+ for (const entry of index) {
21
+ if (entry.language !== language) continue;
22
+ for (const attr of SearchableAttributes) {
23
+ const attr_ = attr in entry ? attr : null;
24
+ if (attr_ && entry[attr_] && typeof entry[attr_] === "string" && entry[attr_].includes(query)) yield entry;
25
+ }
26
+ }
27
+ }
28
+ function search(index, language, query, limit = 100) {
29
+ const results = findEntryInIndex(index, language, query);
30
+ return Array.from(results).sort((a, b) => a.priority - b.priority).slice(0, limit);
31
+ }
32
+
33
+ //#endregion
34
+ export { buildIndex, search };
@@ -0,0 +1,3 @@
1
+ import "../routing-ByeZ2P3d.js";
2
+ import { _ as SearchableAttributesChat, a as IndexProperty, c as QueryKindsType, d as ResultType, f as RoutableJsonNode, g as SearchableAttributes, h as SearchSettings, i as IndexModel, l as ResultData, m as SearchParams, n as IndexEntry, o as IndexResource, p as SearchAttributeNames, r as IndexMethod, s as QueryKinds, t as GuideResultType, u as ResultRecordType } from "../types-BKUIuYYk.js";
3
+ export { GuideResultType, IndexEntry, IndexMethod, IndexModel, IndexProperty, IndexResource, QueryKinds, QueryKindsType, ResultData, ResultRecordType, ResultType, RoutableJsonNode, SearchAttributeNames, SearchParams, SearchSettings, SearchableAttributes, SearchableAttributesChat };
@@ -0,0 +1,3 @@
1
+ import { n as SearchableAttributes, r as SearchableAttributesChat, t as QueryKinds } from "../types-__XoFvJ_.js";
2
+
3
+ export { QueryKinds, SearchableAttributes, SearchableAttributesChat };
@@ -0,0 +1,21 @@
1
+ import { d as ResultType, h as SearchSettings, m as SearchParams } from "./types-BKUIuYYk.js";
2
+ import * as React$1 from "react";
3
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
4
+
5
+ //#region src/contexts/search.d.ts
6
+ type SearchContextType = {
7
+ settings: SearchSettings;
8
+ onSelect?: (stainlessPath: string) => void;
9
+ pageFind?: string;
10
+ };
11
+ declare const useSearchContext: () => SearchContextType;
12
+ declare function useSearch(): (params: SearchParams) => Promise<ResultType | undefined>;
13
+ type SearchProviderProps = SearchContextType & {
14
+ children: React$1.ReactNode;
15
+ };
16
+ declare function SearchProvider({
17
+ children,
18
+ ...props
19
+ }: SearchProviderProps): react_jsx_runtime11.JSX.Element;
20
+ //#endregion
21
+ export { useSearchContext as a, useSearch as i, SearchProvider as n, SearchProviderProps as r, SearchContextType as t };
@@ -0,0 +1,36 @@
1
+ import * as React$1 from "react";
2
+ import * as react_jsx_runtime45 from "react/jsx-runtime";
3
+ import * as SDKJSON from "@stainless/sdk-json";
4
+
5
+ //#region src/components/sidebar.d.ts
6
+ type SidebarExpanderProps = {
7
+ open?: boolean;
8
+ summary: React$1.ReactNode;
9
+ children?: React$1.ReactNode;
10
+ };
11
+ declare function SidebarExpander({
12
+ open,
13
+ summary,
14
+ children
15
+ }: SidebarExpanderProps): react_jsx_runtime45.JSX.Element;
16
+ type SidebarMethodProps = {
17
+ method: SDKJSON.Method;
18
+ };
19
+ declare function SidebarMethod({
20
+ method
21
+ }: SidebarMethodProps): react_jsx_runtime45.JSX.Element;
22
+ type SidebarResourceProps = {
23
+ resource: SDKJSON.Resource;
24
+ };
25
+ declare function SidebarResource({
26
+ resource
27
+ }: SidebarResourceProps): react_jsx_runtime45.JSX.Element;
28
+ type SidebarProps = {
29
+ resources: SDKJSON.Resource[];
30
+ selectedPath?: string;
31
+ };
32
+ declare function Sidebar({
33
+ resources
34
+ }: SidebarProps): react_jsx_runtime45.JSX.Element;
35
+ //#endregion
36
+ export { SidebarProps as a, SidebarMethodProps as i, SidebarExpander as n, SidebarResource as o, SidebarMethod as r, SidebarResourceProps as s, Sidebar as t };
@@ -0,0 +1,46 @@
1
+ import { C as TransformRequestSnippetFn } from "./sdk-D1acaxlr.js";
2
+ import * as React$1 from "react";
3
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
4
+ import * as SDKJSON from "@stainless/sdk-json";
5
+
6
+ //#region src/components/snippets.d.ts
7
+ type SnippetCodeProps = {
8
+ content: string;
9
+ signature?: string;
10
+ language?: string;
11
+ };
12
+ declare function SnippetCode({
13
+ content,
14
+ language
15
+ }: SnippetCodeProps): react_jsx_runtime1.JSX.Element;
16
+ type SnippetProps = {
17
+ method: SDKJSON.Method;
18
+ requestTitle?: React$1.ReactNode;
19
+ transformRequestSnippet?: TransformRequestSnippetFn;
20
+ };
21
+ type SnippetContainerProps = {
22
+ children: React$1.ReactNode;
23
+ signature?: string;
24
+ };
25
+ declare function SnippetContainer({
26
+ children
27
+ }: SnippetContainerProps): react_jsx_runtime1.JSX.Element;
28
+ type SnippetRequestContainerProps = {
29
+ children?: React$1.ReactNode;
30
+ signature?: string;
31
+ };
32
+ declare function SnippetRequestContainer({
33
+ children
34
+ }: SnippetRequestContainerProps): react_jsx_runtime1.JSX.Element;
35
+ declare function Snippet({
36
+ requestTitle,
37
+ method,
38
+ transformRequestSnippet
39
+ }: SnippetProps): react_jsx_runtime1.JSX.Element | null;
40
+ declare function SnippetResponse({
41
+ responses
42
+ }: {
43
+ responses: SDKJSON.Method['exampleResponses'];
44
+ }): react_jsx_runtime1.JSX.Element | null;
45
+ //#endregion
46
+ export { SnippetContainerProps as a, SnippetRequestContainerProps as c, SnippetContainer as i, SnippetResponse as l, SnippetCode as n, SnippetProps as o, SnippetCodeProps as r, SnippetRequestContainer as s, Snippet as t };