init commit
This commit is contained in:
commit
c9d982669a
461 changed files with 30317 additions and 0 deletions
13
resources/js/components/ui/resizable/index.ts
Normal file
13
resources/js/components/ui/resizable/index.ts
Normal file
|
@ -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,
|
||||
};
|
30
resources/js/components/ui/resizable/resizable-handle.svelte
Normal file
30
resources/js/components/ui/resizable/resizable-handle.svelte
Normal file
|
@ -0,0 +1,30 @@
|
|||
<script lang="ts">
|
||||
import GripVerticalIcon from "@lucide/svelte/icons/grip-vertical";
|
||||
import * as ResizablePrimitive from "paneforge";
|
||||
import { cn, type WithoutChildrenOrChild } from "@/lib/utils.js";
|
||||
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
class: className,
|
||||
withHandle = false,
|
||||
...restProps
|
||||
}: WithoutChildrenOrChild<ResizablePrimitive.PaneResizerProps> & {
|
||||
withHandle?: boolean;
|
||||
} = $props();
|
||||
</script>
|
||||
|
||||
<ResizablePrimitive.PaneResizer
|
||||
bind:ref
|
||||
data-slot="resizable-handle"
|
||||
class={cn(
|
||||
"bg-border focus-visible:ring-ring focus-visible:outline-hidden 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: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
|
||||
)}
|
||||
{...restProps}
|
||||
>
|
||||
{#if withHandle}
|
||||
<div class="bg-border rounded-xs z-10 flex h-4 w-3 items-center justify-center border">
|
||||
<GripVerticalIcon class="size-2.5" />
|
||||
</div>
|
||||
{/if}
|
||||
</ResizablePrimitive.PaneResizer>
|
|
@ -0,0 +1,20 @@
|
|||
<script lang="ts">
|
||||
import * as ResizablePrimitive from "paneforge";
|
||||
import { cn } from "@/lib/utils.js";
|
||||
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
this: paneGroup = $bindable(),
|
||||
class: className,
|
||||
...restProps
|
||||
}: ResizablePrimitive.PaneGroupProps & {
|
||||
this?: ResizablePrimitive.PaneGroup;
|
||||
} = $props();
|
||||
</script>
|
||||
|
||||
<ResizablePrimitive.PaneGroup
|
||||
bind:this={paneGroup}
|
||||
data-slot="resizable-pane-group"
|
||||
class={cn("flex h-full w-full data-[direction=vertical]:flex-col", className)}
|
||||
{...restProps}
|
||||
/>
|
Loading…
Add table
Add a link
Reference in a new issue