896bac2cd7
- 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
211 lines
6.1 KiB
Vue
211 lines
6.1 KiB
Vue
<script setup lang="ts">
|
||
import {
|
||
Button,
|
||
ButtonGroup,
|
||
ButtonGroupSeparator,
|
||
Chip,
|
||
Description,
|
||
DropdownItem,
|
||
DropdownMenu,
|
||
DropdownPopover,
|
||
DropdownRoot,
|
||
DropdownTrigger,
|
||
Label,
|
||
} from "@heroui-vue/components";
|
||
import {
|
||
IconChevronDown,
|
||
IconChevronLeft,
|
||
IconChevronRight,
|
||
IconDots,
|
||
IconGitFork,
|
||
IconPhoto,
|
||
IconPin,
|
||
IconQrcode,
|
||
IconStar,
|
||
IconAlignCenter,
|
||
IconAlignJustified,
|
||
IconAlignLeft,
|
||
IconAlignRight,
|
||
IconThumbDown,
|
||
IconThumbUp,
|
||
IconVideo,
|
||
} from "@tabler/icons-vue";
|
||
</script>
|
||
|
||
<template>
|
||
<div class="flex flex-col items-start gap-6">
|
||
<!-- 单个按钮与下拉菜单 -->
|
||
<div class="flex flex-col gap-2">
|
||
<ButtonGroup>
|
||
<Button>合并拉取请求</Button>
|
||
<DropdownRoot>
|
||
<DropdownTrigger>
|
||
<Button is-icon-only aria-label="更多选项">
|
||
<ButtonGroupSeparator />
|
||
<IconChevronDown aria-hidden="true" />
|
||
</Button>
|
||
</DropdownTrigger>
|
||
<DropdownPopover class="max-w-[290px]" placement="bottom end">
|
||
<DropdownMenu>
|
||
<DropdownItem
|
||
id="merge"
|
||
class="flex flex-col items-start gap-1"
|
||
text-value="创建合并提交"
|
||
>
|
||
<Label>创建合并提交</Label>
|
||
<Description>此分支上的所有提交都将加入基础分支</Description>
|
||
</DropdownItem>
|
||
<DropdownItem
|
||
id="squash-and-merge"
|
||
class="flex flex-col items-start gap-1"
|
||
text-value="压缩并合并"
|
||
>
|
||
<Label>压缩并合并</Label>
|
||
<Description>
|
||
此分支上的 14 个提交将合并为一次提交并加入基础分支
|
||
</Description>
|
||
</DropdownItem>
|
||
<DropdownItem
|
||
id="rebase-and-merge"
|
||
class="flex flex-col items-start gap-1"
|
||
text-value="变基并合并"
|
||
>
|
||
<Label>变基并合并</Label>
|
||
<Description>
|
||
此分支上的 14 个提交将变基后加入基础分支
|
||
</Description>
|
||
</DropdownItem>
|
||
</DropdownMenu>
|
||
</DropdownPopover>
|
||
</DropdownRoot>
|
||
</ButtonGroup>
|
||
</div>
|
||
|
||
<!-- 独立按钮 -->
|
||
<div class="flex flex-col gap-2">
|
||
<div class="flex flex-wrap gap-x-2 gap-y-4">
|
||
<ButtonGroup variant="tertiary">
|
||
<Button>
|
||
<IconGitFork class="size-3.5" aria-hidden="true" />
|
||
复刻
|
||
<Chip color="accent" size="sm" variant="soft">24</Chip>
|
||
</Button>
|
||
<Button is-icon-only aria-label="更多复刻选项">
|
||
<ButtonGroupSeparator />
|
||
<IconChevronDown aria-hidden="true" />
|
||
</Button>
|
||
</ButtonGroup>
|
||
<ButtonGroup variant="tertiary">
|
||
<Button is-icon-only aria-label="显示二维码">
|
||
<IconQrcode aria-hidden="true" />
|
||
</Button>
|
||
<Button>
|
||
<ButtonGroupSeparator />
|
||
扫码支付
|
||
</Button>
|
||
</ButtonGroup>
|
||
<ButtonGroup variant="tertiary">
|
||
<Button>
|
||
<IconThumbUp aria-hidden="true" />
|
||
<span class="text-xs font-semibold">2.4K</span>
|
||
</Button>
|
||
<Button is-icon-only aria-label="点踩">
|
||
<ButtonGroupSeparator />
|
||
<IconThumbDown aria-hidden="true" />
|
||
</Button>
|
||
</ButtonGroup>
|
||
<ButtonGroup variant="tertiary">
|
||
<Button>
|
||
<IconStar class="size-3.5" aria-hidden="true" />
|
||
星标
|
||
</Button>
|
||
<Button class="px-2">
|
||
<ButtonGroupSeparator />
|
||
<Chip color="accent" size="sm" variant="soft">104</Chip>
|
||
</Button>
|
||
</ButtonGroup>
|
||
<ButtonGroup variant="tertiary">
|
||
<Button>
|
||
<IconPin aria-hidden="true" />
|
||
已置顶
|
||
</Button>
|
||
<Button is-icon-only aria-label="更多置顶选项">
|
||
<ButtonGroupSeparator />
|
||
<IconChevronDown aria-hidden="true" />
|
||
</Button>
|
||
</ButtonGroup>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 上一页 / 下一页 -->
|
||
<div class="flex flex-col gap-2">
|
||
<ButtonGroup variant="tertiary">
|
||
<Button>
|
||
<IconChevronLeft aria-hidden="true" />
|
||
上一页
|
||
</Button>
|
||
<Button>
|
||
<ButtonGroupSeparator />
|
||
下一页
|
||
<IconChevronRight aria-hidden="true" />
|
||
</Button>
|
||
</ButtonGroup>
|
||
</div>
|
||
|
||
<!-- 内容类型选择 -->
|
||
<div class="flex flex-col gap-2">
|
||
<ButtonGroup variant="tertiary">
|
||
<Button>
|
||
<IconPhoto aria-hidden="true" />
|
||
照片
|
||
</Button>
|
||
<Button>
|
||
<ButtonGroupSeparator />
|
||
<IconVideo aria-hidden="true" />
|
||
视频
|
||
</Button>
|
||
<Button is-icon-only aria-label="更多选项">
|
||
<ButtonGroupSeparator />
|
||
<IconDots aria-hidden="true" />
|
||
</Button>
|
||
</ButtonGroup>
|
||
</div>
|
||
|
||
<!-- 文本对齐 -->
|
||
<div class="flex flex-col gap-2">
|
||
<ButtonGroup variant="tertiary">
|
||
<Button>左对齐</Button>
|
||
<Button>
|
||
<ButtonGroupSeparator />
|
||
居中
|
||
</Button>
|
||
<Button>
|
||
<ButtonGroupSeparator />
|
||
右对齐
|
||
</Button>
|
||
</ButtonGroup>
|
||
</div>
|
||
|
||
<!-- 仅图标:对齐 -->
|
||
<div class="flex flex-col gap-2">
|
||
<ButtonGroup variant="tertiary">
|
||
<Button is-icon-only aria-label="左对齐">
|
||
<IconAlignLeft aria-hidden="true" />
|
||
</Button>
|
||
<Button is-icon-only aria-label="居中对齐">
|
||
<ButtonGroupSeparator />
|
||
<IconAlignCenter aria-hidden="true" />
|
||
</Button>
|
||
<Button is-icon-only aria-label="右对齐">
|
||
<ButtonGroupSeparator />
|
||
<IconAlignRight aria-hidden="true" />
|
||
</Button>
|
||
<Button is-icon-only aria-label="两端对齐">
|
||
<ButtonGroupSeparator />
|
||
<IconAlignJustified aria-hidden="true" />
|
||
</Button>
|
||
</ButtonGroup>
|
||
</div>
|
||
</div>
|
||
</template>
|