@stainless-api/docs-search 0.1.0-beta.4 → 0.1.0-beta.6
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/index.js +11 -14
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -5,10 +5,11 @@ import { n as useSearch, r as useSearchContext } from "./context-CBTWkDal.js";
|
|
|
5
5
|
import { t as guideSearch } from "./pagefind-Dcn-gjDe.js";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { BookOpenText, Box, Code, Folder, Search, Wrench
|
|
8
|
+
import { BookOpenText, Box, Code, Folder, Search, Wrench } from "lucide-react";
|
|
9
9
|
import { useLanguage } from "@stainless-api/docs-ui/contexts";
|
|
10
10
|
import { useComponents } from "@stainless-api/docs-ui/contexts/use-components";
|
|
11
11
|
import style from "@stainless-api/docs-ui/style";
|
|
12
|
+
import { Button } from "@stainless-api/ui-primitives";
|
|
12
13
|
|
|
13
14
|
//#region src/results.tsx
|
|
14
15
|
const QueryKindDisplay = {
|
|
@@ -244,10 +245,6 @@ function SearchForm() {
|
|
|
244
245
|
}
|
|
245
246
|
});
|
|
246
247
|
}
|
|
247
|
-
function clearInput() {
|
|
248
|
-
setSearchQuery("");
|
|
249
|
-
inputRef?.current?.focus();
|
|
250
|
-
}
|
|
251
248
|
React.useEffect(() => void performSearch(), [
|
|
252
249
|
searchQuery,
|
|
253
250
|
filterKind,
|
|
@@ -264,12 +261,6 @@ function SearchForm() {
|
|
|
264
261
|
size: 16,
|
|
265
262
|
className: style.Icon
|
|
266
263
|
}),
|
|
267
|
-
right: searchQuery && /* @__PURE__ */ jsx(X, {
|
|
268
|
-
cursor: "pointer",
|
|
269
|
-
onClick: () => clearInput(),
|
|
270
|
-
size: 16,
|
|
271
|
-
className: style.Icon
|
|
272
|
-
}),
|
|
273
264
|
value: searchQuery,
|
|
274
265
|
placeholder: "Search"
|
|
275
266
|
}),
|
|
@@ -287,13 +278,12 @@ function SearchForm() {
|
|
|
287
278
|
});
|
|
288
279
|
}
|
|
289
280
|
function SearchFilter({ results, filterKind, onChange }) {
|
|
290
|
-
const Docs = useComponents();
|
|
291
281
|
const { pageFind } = useSearchContext();
|
|
292
282
|
const toggles = pageFind ? QueryKinds : QueryKinds.slice(0, -1);
|
|
293
283
|
return /* @__PURE__ */ jsx("div", {
|
|
294
284
|
className: style.SearchFilter,
|
|
295
|
-
children: toggles.map((kind, index) => /* @__PURE__ */ jsxs(
|
|
296
|
-
|
|
285
|
+
children: toggles.map((kind, index) => /* @__PURE__ */ jsxs(Button, {
|
|
286
|
+
variant: filterKind === kind ? "accent" : "outline",
|
|
297
287
|
onClick: () => onChange?.(kind),
|
|
298
288
|
children: [
|
|
299
289
|
React.createElement(QueryKindDisplay[kind].icon, {
|
|
@@ -314,6 +304,13 @@ function SearchFilter({ results, filterKind, onChange }) {
|
|
|
314
304
|
}
|
|
315
305
|
function SearchModal({ id, open: isOpen }) {
|
|
316
306
|
const [open, setOpen] = React.useState(isOpen ?? false);
|
|
307
|
+
React.useEffect(() => {
|
|
308
|
+
if (open) document.body.style.overflow = "hidden";
|
|
309
|
+
else document.body.style.overflow = "";
|
|
310
|
+
return () => {
|
|
311
|
+
document.body.style.overflow = "";
|
|
312
|
+
};
|
|
313
|
+
}, [open]);
|
|
317
314
|
return /* @__PURE__ */ jsx("div", {
|
|
318
315
|
id,
|
|
319
316
|
onToggle: (ev) => setOpen(ev.newState === "open"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainless-api/docs-search",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -13,22 +13,23 @@
|
|
|
13
13
|
"react-dom": ">=19.0.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@algolia/client-search": "^5.
|
|
16
|
+
"@algolia/client-search": "^5.46.1",
|
|
17
17
|
"@markdoc/markdoc": "^0.5.4",
|
|
18
18
|
"cheerio": "^1.1.2",
|
|
19
19
|
"fuse.js": "^7.1.0",
|
|
20
20
|
"htmlparser2": "^10.0.0",
|
|
21
|
-
"lucide-react": "^0.
|
|
22
|
-
"@stainless-api/docs-ui": "0.1.0-beta.
|
|
21
|
+
"lucide-react": "^0.562.0",
|
|
22
|
+
"@stainless-api/docs-ui": "0.1.0-beta.54",
|
|
23
|
+
"@stainless-api/ui-primitives": "0.1.0-beta.40"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
|
-
"@types/node": "24.10.
|
|
26
|
+
"@types/node": "24.10.4",
|
|
26
27
|
"@types/react": "19.2.7",
|
|
27
28
|
"@types/react-dom": "^19.2.3",
|
|
28
29
|
"dotenv": "17.2.3",
|
|
29
30
|
"react": "^19.2.3",
|
|
30
31
|
"react-dom": "^19.2.3",
|
|
31
|
-
"tsdown": "^0.
|
|
32
|
+
"tsdown": "^0.19.0-beta.3",
|
|
32
33
|
"typescript": "5.9.3",
|
|
33
34
|
"@stainless/eslint-config": "0.1.0-beta.1",
|
|
34
35
|
"@stainless/sdk-json": "^0.1.0-beta.2"
|