docs: complete handbook and prepare component verification tasks

This commit is contained in:
maoyingjie
2026-10-27 21:46:42 +08:00
parent 4da00943f1
commit 26df6e88a2
32 changed files with 2207 additions and 39 deletions
+72
View File
@@ -0,0 +1,72 @@
<script setup lang="ts">
import { ref } from "vue";
import {
Button,
Card,
Input,
Popover,
PopoverContent,
PopoverDialog,
PopoverHeading,
} from "@heroui-vue/components";
const theme = ref("light");
const target = ref<HTMLElement>();
</script>
<template>
<div class="handbook-theme-demo">
<label>
预览主题
<select v-model="theme">
<option value="light">浅色</option>
<option value="dark">深色</option>
</select>
</label>
<section
ref="target"
:class="theme"
class="theme-preview"
data-theme="ocean"
>
<Card>
<strong>自定义主题</strong>
<p>组件通过同一组语义变量更新外观。</p>
</Card>
<Input aria-label="主题预览邮箱" placeholder="输入你的邮箱" />
<Popover>
<Button>打开主题弹层</Button>
<PopoverContent :to="target">
<PopoverDialog>
<PopoverHeading>同一主题容器</PopoverHeading>
<p>to 指向局部容器,保留 CSS 变量继承。</p>
</PopoverDialog>
</PopoverContent>
</Popover>
</section>
</div>
</template>
<style scoped>
.handbook-theme-demo {
width: 100%;
display: grid;
gap: 16px;
}
.theme-preview {
display: grid;
gap: 16px;
padding: 20px;
border-radius: 16px;
background: var(--background);
color: var(--foreground);
}
[data-theme="ocean"] {
--accent: oklch(0.62 0.2 253.83);
--accent-foreground: var(--snow);
}
select {
background: var(--field-background);
color: var(--field-foreground);
border: 1px solid var(--border);
border-radius: 6px;
padding: 4px 8px;
}
</style>