mtxuilib 0.1.314 → 0.1.315
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "mtxuilib/lib/utils";
|
|
4
|
-
import { useEffect, useRef } from "react";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
5
|
import { ResizableHandle, ResizablePanel, ResizablePanelGroup, } from "../../ui/resizable";
|
|
6
6
|
import { TooltipProvider } from "../../ui/tooltip";
|
|
7
7
|
import { Dash5LayoutProvider, useDash5Store, } from "./dash5.store";
|
|
@@ -30,12 +30,13 @@ const DashLayoutInner = (props) => {
|
|
|
30
30
|
navPanelRef.current?.expand();
|
|
31
31
|
}
|
|
32
32
|
}, [asideIsCollapsed]);
|
|
33
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
33
34
|
return (_jsx(TooltipProvider, { delayDuration: 0, children: _jsxs(ResizablePanelGroup, { direction: "horizontal", onLayout: (sizes) => {
|
|
34
35
|
document.cookie = `${layoutStoreKey}=${JSON.stringify(sizes)}`;
|
|
35
|
-
}, className: "h-full items-stretch", children: [_jsx(ResizablePanel, { ref: navPanelRef, defaultSize: asideDefaultSize, collapsedSize: asideCollapsedSize, collapsible: asideCollapsible, minSize: asideMinSize, maxSize: asideMaxSize, onCollapse: () => {
|
|
36
|
+
}, className: "h-full items-stretch", children: [_jsx(ResizablePanel, { ref: navPanelRef, defaultSize: asideDefaultSize, collapsedSize: asideCollapsedSize, collapsible: asideCollapsible, minSize: asideMinSize, maxSize: asideMaxSize, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onCollapse: () => {
|
|
36
37
|
setIsSideCollapsed(true);
|
|
37
38
|
}, onExpand: () => {
|
|
38
39
|
setIsSideCollapsed(false);
|
|
39
40
|
}, className: cn(asideIsCollapsed &&
|
|
40
|
-
"min-w-[60px] transition-all duration-300 ease-in-out", "hidden sm:flex sm:flex-col"), children: _jsx(_Fragment, { children: aSiderRender?.({ isCollapsed: !!asideIsCollapsed }) }) }), _jsx(ResizableHandle, { withHandle: true, className: "hidden md:flex hover:cursor-col-resize hover:bg-gray-400" }), _jsx(ResizablePanel, { defaultSize: mainPanelDefaultSize, minSize: mainPanelMinSize, maxSize: mainPanelMaxSize, children: _jsx("div", { className: "bg-muted/40 flex min-h-screen w-full flex-col", children: _jsxs("div", { className: cn("flex min-h-dvh flex-col"), children: [_jsx("main", { className: cn("flex h-full min-h-full flex-1 p-1 flex-col px-1"), children: _jsx("div", { className: "min-h-full w-full flex-1 flex flex-col", children: props.children }) }), _jsx("div", { className: "bg-slate-50" })] }) }) })] }) }));
|
|
41
|
+
"min-w-[60px] transition-all duration-300 ease-in-out", "hidden sm:flex sm:flex-col", "relative"), children: _jsx(_Fragment, { children: aSiderRender?.({ isCollapsed: !!asideIsCollapsed }) }) }), _jsx(ResizableHandle, { withHandle: true, className: "hidden md:flex hover:cursor-col-resize hover:bg-gray-400" }), _jsx(ResizablePanel, { defaultSize: mainPanelDefaultSize, minSize: mainPanelMinSize, maxSize: mainPanelMaxSize, children: _jsx("div", { className: "bg-muted/40 flex min-h-screen w-full flex-col", children: _jsxs("div", { className: cn("flex min-h-dvh flex-col"), children: [_jsx("main", { className: cn("flex h-full min-h-full flex-1 p-1 flex-col px-1"), children: _jsx("div", { className: "min-h-full w-full flex-1 flex flex-col", children: props.children }) }), _jsx("div", { className: "bg-slate-50" })] }) }) })] }) }));
|
|
41
42
|
};
|