-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Arthur Broudoux <[email protected]>
- Loading branch information
Showing
11 changed files
with
105 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,5 @@ README.md | |
.vscode | ||
.idea | ||
node_modules | ||
build | ||
package | ||
**/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ | |
"utils": "$lib/utils" | ||
}, | ||
"typescript": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Pane } from "paneforge"; | ||
import Handle from "./resizable-handle.svelte"; | ||
import PaneGroup from "./resizable-pane-group.svelte"; | ||
|
||
export { | ||
PaneGroup, | ||
Pane, | ||
Handle, | ||
// | ||
PaneGroup as ResizablePaneGroup, | ||
Pane as ResizablePane, | ||
Handle as ResizableHandle, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script lang="ts"> | ||
import GripVertical from "lucide-svelte/icons/grip-vertical"; | ||
import * as ResizablePrimitive from "paneforge"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = ResizablePrimitive.PaneResizerProps & { | ||
withHandle?: boolean; | ||
}; | ||
export let withHandle: $$Props["withHandle"] = false; | ||
export let el: $$Props["el"] = undefined; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<ResizablePrimitive.PaneResizer | ||
bind:el | ||
class={cn( | ||
"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center 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-offset-1 data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 data-[direction=vertical]:after:translate-x-0 [&[data-direction=vertical]>div]:rotate-90", | ||
className | ||
)} | ||
> | ||
{#if withHandle} | ||
<div class="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border"> | ||
<GripVertical class="h-2.5 w-2.5" /> | ||
</div> | ||
{/if} | ||
</ResizablePrimitive.PaneResizer> |
22 changes: 22 additions & 0 deletions
22
src/lib/components/ui/resizable/resizable-pane-group.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
import * as ResizablePrimitive from "paneforge"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = ResizablePrimitive.PaneGroupProps; | ||
let className: $$Props["class"] = undefined; | ||
export let direction: $$Props["direction"]; | ||
export let paneGroup: $$Props["paneGroup"] = undefined; | ||
export let el: $$Props["el"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<ResizablePrimitive.PaneGroup | ||
bind:el | ||
bind:paneGroup | ||
{direction} | ||
class={cn("flex h-full w-full data-[direction=vertical]:flex-col", className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</ResizablePrimitive.PaneGroup> |