* chore: add storybook * chore: unify FE codeabse * chore: update eslint rules * chore: harmonize the use of "subtle" color * chore: remove an extra sidebar rail * refactor: make panel items more consistent * chore: cleanups after merging new code from base * refactor: refine composables * fix: add lost import * chore: make icon style consistent * fix: don't show empty "supported" methods * refactor: solidify select items
57 lines
2.0 KiB
Vue
57 lines
2.0 KiB
Vue
<script setup lang="ts">
|
|
/**
|
|
* @component AppResizableHandle
|
|
* @description The interactive handle used to resize panels in a group.
|
|
*/
|
|
import { cn } from '@/utils/ui';
|
|
import { reactiveOmit } from '@vueuse/core';
|
|
import { GripVertical } from 'lucide-vue-next';
|
|
import {
|
|
SplitterResizeHandle,
|
|
type SplitterResizeHandleEmits,
|
|
type SplitterResizeHandleProps,
|
|
useForwardPropsEmits,
|
|
} from 'reka-ui';
|
|
import type { HTMLAttributes } from 'vue';
|
|
|
|
/*
|
|
* Types & Interfaces.
|
|
*/
|
|
|
|
export interface AppResizableHandleProps extends SplitterResizeHandleProps {
|
|
class?: HTMLAttributes['class'];
|
|
withHandle?: boolean;
|
|
}
|
|
|
|
/*
|
|
* Component Setup.
|
|
*/
|
|
|
|
const props = defineProps<AppResizableHandleProps>();
|
|
const emits = defineEmits<SplitterResizeHandleEmits>();
|
|
|
|
const delegatedProps = reactiveOmit(props, 'class', 'withHandle');
|
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
</script>
|
|
|
|
<template>
|
|
<SplitterResizeHandle
|
|
data-slot="resizable-handle"
|
|
v-bind="forwarded"
|
|
:class="
|
|
cn(
|
|
'relative flex w-px items-center justify-center bg-zinc-200 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-zinc-950 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:translate-x-0 data-[orientation=vertical]:after:-translate-y-1/2 dark:bg-zinc-800 dark:focus-visible:ring-zinc-300 [&[data-orientation=vertical]>div]:rotate-90',
|
|
props.class,
|
|
)
|
|
"
|
|
>
|
|
<template v-if="props.withHandle">
|
|
<div
|
|
class="z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-zinc-200 dark:bg-zinc-800"
|
|
>
|
|
<GripVertical class="size-2.5" />
|
|
</div>
|
|
</template>
|
|
</SplitterResizeHandle>
|
|
</template>
|