feat: add core UI components and baseline tests

This commit is contained in:
2026-03-19 16:56:27 +08:00
parent 12642e0a92
commit 063179933c
73 changed files with 5756 additions and 2 deletions
@@ -0,0 +1,57 @@
import { Checkbox, Label } from "@ai-ui/ui";
import type { Meta, StoryObj } from "@storybook/react";
const meta = {
title: "Components/Checkbox",
component: Checkbox,
args: {
defaultChecked: true
},
argTypes: {
className: {
control: false
},
defaultChecked: {
control: "boolean"
},
disabled: {
control: "boolean"
},
invalid: {
control: "boolean"
}
},
parameters: {
layout: "centered"
},
tags: ["autodocs"]
} satisfies Meta<typeof Checkbox>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Playground: Story = {};
export const States: Story = {
render: () => (
<div className="grid gap-4">
<div className="flex items-center gap-3">
<Checkbox defaultChecked id="checkbox-default" />
<Label htmlFor="checkbox-default">Default checked</Label>
</div>
<div className="flex items-center gap-3">
<Checkbox id="checkbox-unchecked" />
<Label htmlFor="checkbox-unchecked">Unchecked</Label>
</div>
<div className="flex items-center gap-3">
<Checkbox disabled id="checkbox-disabled" />
<Label htmlFor="checkbox-disabled">Disabled</Label>
</div>
<div className="flex items-center gap-3">
<Checkbox id="checkbox-invalid" invalid />
<Label htmlFor="checkbox-invalid">Invalid state</Label>
</div>
</div>
)
};