feat: migrate ScrollShadow and Tabs with docs and keyboard support

This commit is contained in:
maoyingjie
2026-10-23 00:25:45 +08:00
parent 2b4ac04df1
commit 99df0f1c91
55 changed files with 3290 additions and 5 deletions
@@ -0,0 +1,36 @@
<script setup lang="ts">
import { watch, onBeforeUnmount } from "vue";
import { TabsList as RekaList, useForwardExpose } from "reka-ui";
import { useTabs } from "./context";
defineOptions({ inheritAttrs: false });
withDefaults(defineProps<{ as?: string; loop?: boolean }>(), {
as: "div",
loop: true,
});
const ctx = useTabs();
const { forwardRef, currentElement } = useForwardExpose();
watch(
currentElement,
(el) => {
ctx.list.value = el;
ctx.measure();
},
{ flush: "post" },
);
onBeforeUnmount(() => {
ctx.list.value = undefined;
});
</script>
<template>
<RekaList
:ref="forwardRef"
v-bind="$attrs"
:as="as"
:loop="loop"
class="hv-tabs__list"
data-slot="tabs-list"
:data-orientation="ctx.orientation.value"
>
<slot />
</RekaList>
</template>