@arcote.tech/arc-ds 0.7.27 → 0.7.29
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/package.json +2 -2
- package/src/layout/layout.tsx +20 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcote.tech/arc-ds",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.29",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Przemysław Krasiński [arcote.tech]",
|
|
7
7
|
"description": "Design System for Arc framework — CVA-based components with display modes and variant overrides",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tailwind-merge": "^3.5.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@arcote.tech/arc": "^0.7.
|
|
33
|
+
"@arcote.tech/arc": "^0.7.29",
|
|
34
34
|
"framer-motion": "^12.0.0",
|
|
35
35
|
"lucide-react": ">=0.400.0",
|
|
36
36
|
"radix-ui": "^1.0.0",
|
package/src/layout/layout.tsx
CHANGED
|
@@ -310,6 +310,8 @@ function MobileToolbar() {
|
|
|
310
310
|
const toolbarRef = useRef<HTMLDivElement>(null);
|
|
311
311
|
const collapseRef = useRef(collapse);
|
|
312
312
|
collapseRef.current = collapse;
|
|
313
|
+
const isExpandedRef = useRef(isExpanded);
|
|
314
|
+
isExpandedRef.current = isExpanded;
|
|
313
315
|
|
|
314
316
|
useEffect(() => {
|
|
315
317
|
if (isExpanded) {
|
|
@@ -319,10 +321,27 @@ function MobileToolbar() {
|
|
|
319
321
|
}
|
|
320
322
|
}, [isExpanded, requestOverlay, releaseOverlay]);
|
|
321
323
|
|
|
324
|
+
// Blokada scrolla treści pod spodem gdy panel jest rozwinięty — panel nakłada
|
|
325
|
+
// się na stronę (overlay), więc scroll strony musi być zamrożony na miejscu.
|
|
326
|
+
useEffect(() => {
|
|
327
|
+
if (!isExpanded) return;
|
|
328
|
+
const prev = document.body.style.overflow;
|
|
329
|
+
document.body.style.overflow = "hidden";
|
|
330
|
+
return () => {
|
|
331
|
+
document.body.style.overflow = prev;
|
|
332
|
+
};
|
|
333
|
+
}, [isExpanded]);
|
|
334
|
+
|
|
322
335
|
useEffect(() => {
|
|
323
336
|
const el = toolbarRef.current;
|
|
324
337
|
if (!el) return;
|
|
325
|
-
|
|
338
|
+
// Mierzymy tylko wysokość ZWINIĘTEGO paska. Gdy panel jest rozwinięty,
|
|
339
|
+
// ignorujemy zmiany rozmiaru — rozwinięty panel ma się nakładać na treść,
|
|
340
|
+
// a nie wypychać jej w dół rosnącym spacerem.
|
|
341
|
+
const update = () => {
|
|
342
|
+
if (isExpandedRef.current) return;
|
|
343
|
+
setTopHeight(el.offsetHeight);
|
|
344
|
+
};
|
|
326
345
|
update();
|
|
327
346
|
const ro = new ResizeObserver(update);
|
|
328
347
|
ro.observe(el);
|