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
+51
View File
@@ -0,0 +1,51 @@
<script setup lang="ts">
import {
Tabs,
TabsIndicator,
TabsList,
TabsListContainer,
TabsPanel,
TabsTab,
} from "@heroui-vue/components";
const listClassName = [
"rounded-xl border border-accent/10 bg-accent-soft/30 p-1",
"**:data-[slot=tabs-tab]:rounded-lg",
"**:data-[slot=tabs-tab]:bg-transparent",
"**:data-[slot=tabs-tab]:text-muted",
"**:data-[slot=tabs-tab]:opacity-100",
"**:data-[slot=tabs-tab]:transition-colors",
"**:data-[slot=tabs-tab]:data-[hovered=true]:not-data-[selected=true]:bg-accent-soft",
"**:data-[slot=tabs-tab]:data-[hovered=true]:not-data-[selected=true]:text-accent-soft-foreground",
"**:data-[slot=tabs-tab]:data-[pressed=true]:not-data-[selected=true]:bg-accent-soft-hover",
"**:data-[slot=tabs-tab]:data-[focus-visible=true]:ring-2",
"**:data-[slot=tabs-tab]:data-[focus-visible=true]:ring-accent/15",
"**:data-[slot=tabs-tab]:data-[selected=true]:font-medium",
"**:data-[slot=tabs-tab]:data-[selected=true]:text-accent-foreground",
"**:data-[slot=tabs-tab]:shadow-none",
"**:data-[slot=tabs-indicator]:rounded-lg",
"**:data-[slot=tabs-indicator]:bg-accent",
"**:data-[slot=tabs-indicator]:shadow-none",
].join(" ");
</script>
<template>
<Tabs class="w-full max-w-sm">
<TabsListContainer class="rounded-none bg-transparent">
<TabsList aria-label="计费周期" :class="listClassName">
<TabsTab value="monthly">
按月
<TabsIndicator></TabsIndicator>
</TabsTab>
<TabsTab value="yearly">
按年
<TabsIndicator></TabsIndicator>
</TabsTab>
</TabsList>
</TabsListContainer>
<TabsPanel class="pt-3 text-sm text-muted" value="monthly">
按月计费,随时可取消。
</TabsPanel>
<TabsPanel class="pt-3 text-sm text-muted" value="yearly">
年付可节省 20%。
</TabsPanel>
</Tabs>
</template>