fix(docs): restore button, toggle and nav demos to the pinned cn baseline
- button-group: restore all 9 cn demos incl. merge dropdown menu copy, custom-styles merge dropdown, sizes variant=secondary, orientation icon groups, full-width second group and the disabled child override - toggle-button / toggle-button-group: restore cn copy, structure, button counts, theme custom-styles classes and aria-labels - accordion-custom-styles: restore the 3-item collectibles scenario with the original 3dicons images, surface variant, selectors and hover motion - disclosure-group-controlled: restore HeroUI Native / Expo copy and image semantics (Expo brand icon adapted to Tabler IconBrandReactNative) - button-basic / button-loading-state: converge to baseline (console report, no added status paragraph) keeping the duplicate-trigger guard - restore per-demo root gap/alignment/wrap classes instead of demo-row - icon semantics per task card: search glyph kept on 搜索 buttons, rotate-back glyph restored (IconRefresh), person-search glyph restored (IconUserSearch); accordion item icons sized to the baseline 16px
This commit is contained in:
@@ -8,34 +8,66 @@ import {
|
||||
AccordionPanel,
|
||||
AccordionTrigger,
|
||||
} from "@heroui-vue/components";
|
||||
import { IconChevronDown } from "@tabler/icons-vue";
|
||||
|
||||
const items = [
|
||||
{
|
||||
content: "通过实时通知及时了解账户动态。",
|
||||
iconUrl:
|
||||
"https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/3dicons/bell-small.png",
|
||||
subtitle: "接收账户活动更新",
|
||||
title: "开启通知",
|
||||
},
|
||||
{
|
||||
content: "安装我们的官方浏览器扩展,获得更顺畅的浏览体验。",
|
||||
iconUrl:
|
||||
"https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/3dicons/compass-small.png",
|
||||
subtitle: "将浏览器连接到你的账户",
|
||||
title: "安装浏览器扩展",
|
||||
},
|
||||
{
|
||||
content: "创建你的第一件数字藏品,开启数字收藏之旅。",
|
||||
iconUrl:
|
||||
"https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/3dicons/mint-collective-small.png",
|
||||
subtitle: "创建你的第一件收藏品",
|
||||
title: "铸造收藏品",
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Accordion class="w-full max-w-md rounded-xl bg-gray-50 dark:bg-neutral-900">
|
||||
<AccordionItem>
|
||||
<Accordion
|
||||
class="bg-surface-1/10 w-full max-w-md rounded-2xl"
|
||||
variant="surface"
|
||||
>
|
||||
<AccordionItem
|
||||
v-for="(item, index) in items"
|
||||
:key="index"
|
||||
class="group/item first:**:data-[slot=accordion-trigger]:rounded-t-2xl last:[&:not(:has([data-slot=accordion-trigger][aria-expanded='true']))_[data-slot=accordion-trigger]]:rounded-b-2xl"
|
||||
>
|
||||
<AccordionHeading>
|
||||
<AccordionTrigger class="text-lg font-semibold">
|
||||
自定义标题字号
|
||||
<AccordionIndicator />
|
||||
<AccordionTrigger
|
||||
class="group flex items-center gap-2 transition-none hover:bg-surface"
|
||||
>
|
||||
<img
|
||||
v-if="item.iconUrl"
|
||||
:alt="item.title"
|
||||
class="h-11 w-11 transition-[scale,rotate] duration-300 ease-out group-hover/item:scale-120 group-hover/item:-rotate-10 group-hover/item:drop-shadow-lg"
|
||||
:src="item.iconUrl"
|
||||
/>
|
||||
<div class="flex flex-col gap-0">
|
||||
<span class="leading-5 font-medium">{{ item.title }}</span>
|
||||
<span class="leading-6 font-normal text-muted/80">
|
||||
{{ item.subtitle }}
|
||||
</span>
|
||||
</div>
|
||||
<AccordionIndicator class="text-muted/50 [&>svg]:size-4">
|
||||
<IconChevronDown />
|
||||
</AccordionIndicator>
|
||||
</AccordionTrigger>
|
||||
</AccordionHeading>
|
||||
<AccordionPanel>
|
||||
<AccordionBody class="text-base text-foreground">
|
||||
通过覆盖 trigger 与 body 的 class,可以快速调整字号与颜色。
|
||||
</AccordionBody>
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
<AccordionItem>
|
||||
<AccordionHeading>
|
||||
<AccordionTrigger class="text-lg font-semibold">
|
||||
描边容器
|
||||
<AccordionIndicator />
|
||||
</AccordionTrigger>
|
||||
</AccordionHeading>
|
||||
<AccordionPanel>
|
||||
<AccordionBody class="rounded-lg border-2 border-border p-4 shadow-lg">
|
||||
给根容器加边框与阴影,得到描边变体的观感。
|
||||
</AccordionBody>
|
||||
<AccordionBody class="text-muted/80">{{ item.content }}</AccordionBody>
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
|
||||
Reference in New Issue
Block a user