Fix a11y incomplete checks and glyph icons

This commit is contained in:
2026-03-20 14:11:12 +08:00
parent 91a0bac8dd
commit 6b160e1993
14 changed files with 213 additions and 29 deletions
+14 -1
View File
@@ -1,6 +1,19 @@
import { Button } from "@ai-ui/ui";
import type { Meta, StoryObj } from "@storybook/react";
function FavoriteIcon() {
return (
<svg aria-hidden="true" className="size-4" fill="none" viewBox="0 0 16 16">
<path
d="m8 2.4 1.67 3.4 3.76.55-2.72 2.64.64 3.73L8 10.98l-3.35 1.74.64-3.73L2.57 6.35l3.76-.55L8 2.4Z"
stroke="currentColor"
strokeLinejoin="round"
strokeWidth="1.35"
/>
</svg>
);
}
function getButtonFromCanvas(canvasElement: HTMLElement, name: string) {
const buttons = canvasElement.querySelectorAll("button, a");
@@ -104,7 +117,7 @@ export const Sizes: Story = {
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>
<Button aria-label="Favorite" size="icon">
<FavoriteIcon />
</Button>
</div>
)