mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
feat(renderer): AppShell with resizable panes, sidebar/preview toggle, persisted sizes
This commit is contained in:
@@ -7,10 +7,10 @@ import * as ResizablePrimitive from "react-resizable-panels"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const ResizablePanelGroup = React.forwardRef<
|
||||
React.ElementRef<typeof ResizablePrimitive.PanelGroup>,
|
||||
React.ComponentPropsWithoutRef<typeof ResizablePrimitive.PanelGroup>
|
||||
React.ElementRef<typeof ResizablePrimitive.Group>,
|
||||
React.ComponentPropsWithoutRef<typeof ResizablePrimitive.Group>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<ResizablePrimitive.PanelGroup
|
||||
<ResizablePrimitive.Group
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
||||
@@ -19,7 +19,7 @@ const ResizablePanelGroup = React.forwardRef<
|
||||
{...props}
|
||||
/>
|
||||
))
|
||||
ResizablePanelGroup.displayName = ResizablePrimitive.PanelGroup.displayName
|
||||
ResizablePanelGroup.displayName = "ResizablePanelGroup"
|
||||
|
||||
const ResizablePanel = React.forwardRef<
|
||||
React.ElementRef<typeof ResizablePrimitive.Panel>,
|
||||
@@ -34,16 +34,16 @@ const ResizablePanel = React.forwardRef<
|
||||
{...props}
|
||||
/>
|
||||
))
|
||||
ResizablePanel.displayName = ResizablePrimitive.Panel.displayName
|
||||
ResizablePanel.displayName = "ResizablePanel"
|
||||
|
||||
const ResizableHandle = ({
|
||||
withHandle,
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentPropsWithoutRef<typeof ResizablePrimitive.PanelResizeHandle> & {
|
||||
}: React.ComponentPropsWithoutRef<typeof ResizablePrimitive.Separator> & {
|
||||
withHandle?: boolean
|
||||
}) => (
|
||||
<ResizablePrimitive.PanelResizeHandle
|
||||
<ResizablePrimitive.Separator
|
||||
className={cn(
|
||||
"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
||||
className
|
||||
@@ -55,7 +55,7 @@ const ResizableHandle = ({
|
||||
<GripVertical className="h-2.5 w-2.5" />
|
||||
</div>
|
||||
)}
|
||||
</ResizablePrimitive.PanelResizeHandle>
|
||||
</ResizablePrimitive.Separator>
|
||||
)
|
||||
ResizableHandle.displayName = "ResizableHandle"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user