@farming-labs/theme 0.1.4 → 0.1.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/docs-api.mjs +1 -0
- package/dist/docs-command-search.mjs +17 -0
- package/package.json +2 -2
- package/styles/omni.css +2 -0
package/dist/docs-api.mjs
CHANGED
|
@@ -474,6 +474,7 @@ function createDocsAPI(options) {
|
|
|
474
474
|
relativeCandidates.add(path.join("app", entry));
|
|
475
475
|
relativeCandidates.add(path.join("src", "app", entry));
|
|
476
476
|
const rootCandidates = new Set([root]);
|
|
477
|
+
rootCandidates.add(process.cwd());
|
|
477
478
|
if (path.basename(root) === "server") rootCandidates.add(path.resolve(root, "..", ".."));
|
|
478
479
|
else {
|
|
479
480
|
rootCandidates.add(path.join(root, ".next", "server"));
|
|
@@ -405,6 +405,22 @@ function DocsCommandSearch({ api = "/api/docs", locale }) {
|
|
|
405
405
|
setActiveIndex(0);
|
|
406
406
|
}
|
|
407
407
|
}, [open]);
|
|
408
|
+
useEffect(() => {
|
|
409
|
+
if (!open) return;
|
|
410
|
+
const { body, documentElement } = document;
|
|
411
|
+
const previousBodyOverflow = body.style.overflow;
|
|
412
|
+
const previousBodyPaddingRight = body.style.paddingRight;
|
|
413
|
+
const previousHtmlOverflow = documentElement.style.overflow;
|
|
414
|
+
const scrollbarWidth = window.innerWidth - documentElement.clientWidth;
|
|
415
|
+
body.style.overflow = "hidden";
|
|
416
|
+
documentElement.style.overflow = "hidden";
|
|
417
|
+
if (scrollbarWidth > 0) body.style.paddingRight = `${scrollbarWidth}px`;
|
|
418
|
+
return () => {
|
|
419
|
+
body.style.overflow = previousBodyOverflow;
|
|
420
|
+
body.style.paddingRight = previousBodyPaddingRight;
|
|
421
|
+
documentElement.style.overflow = previousHtmlOverflow;
|
|
422
|
+
};
|
|
423
|
+
}, [open]);
|
|
408
424
|
useEffect(() => {
|
|
409
425
|
if (!open) return;
|
|
410
426
|
function handler(e) {
|
|
@@ -482,6 +498,7 @@ function DocsCommandSearch({ api = "/api/docs", locale }) {
|
|
|
482
498
|
}), /* @__PURE__ */ jsxs("div", {
|
|
483
499
|
className: "omni-content",
|
|
484
500
|
role: "dialog",
|
|
501
|
+
"aria-modal": "true",
|
|
485
502
|
"aria-label": "Search documentation",
|
|
486
503
|
children: [
|
|
487
504
|
/* @__PURE__ */ jsx("div", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/theme",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Theme package for @farming-labs/docs — layout, provider, MDX components, and styles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"tsdown": "^0.20.3",
|
|
128
128
|
"typescript": "^5.9.3",
|
|
129
129
|
"vitest": "^3.2.4",
|
|
130
|
-
"@farming-labs/docs": "0.1.
|
|
130
|
+
"@farming-labs/docs": "0.1.6"
|
|
131
131
|
},
|
|
132
132
|
"peerDependencies": {
|
|
133
133
|
"@farming-labs/docs": ">=0.0.1",
|
package/styles/omni.css
CHANGED
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
0 0 0 1px rgba(255, 255, 255, 0.04);
|
|
81
81
|
outline: none;
|
|
82
82
|
overflow: hidden;
|
|
83
|
+
overscroll-behavior: contain;
|
|
83
84
|
animation: omni-scale-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
84
85
|
}
|
|
85
86
|
|
|
@@ -148,6 +149,7 @@
|
|
|
148
149
|
.omni-body {
|
|
149
150
|
max-height: 60vh;
|
|
150
151
|
overflow: auto;
|
|
152
|
+
overscroll-behavior: contain;
|
|
151
153
|
padding: 0.25rem;
|
|
152
154
|
}
|
|
153
155
|
.omni-body::-webkit-scrollbar {
|