63 lines
1.5 KiB
TypeScript
63 lines
1.5 KiB
TypeScript
import type { Meta, StoryObj } from "@storybook/react";
|
|
import { Badge } from "~/components/ui/badge";
|
|
|
|
const meta: Meta<typeof Badge> = {
|
|
title: "UI / Feedback / Badge",
|
|
component: Badge,
|
|
tags: ["autodocs"],
|
|
argTypes: {
|
|
variant: {
|
|
control: { type: "inline-radio" },
|
|
options: ["default", "secondary", "destructive", "outline"],
|
|
},
|
|
},
|
|
args: { variant: "default", children: "New" },
|
|
};
|
|
|
|
export default meta;
|
|
|
|
type Story = StoryObj<typeof Badge>;
|
|
|
|
export const Default: Story = {};
|
|
|
|
export const AllVariants: Story = {
|
|
render: () => (
|
|
<div style={{ display: "flex", gap: 8, alignItems: "center", flexWrap: "wrap" }}>
|
|
<Badge variant="default">Default</Badge>
|
|
<Badge variant="secondary">Secondary</Badge>
|
|
<Badge variant="destructive">Failed</Badge>
|
|
<Badge variant="outline">Draft</Badge>
|
|
</div>
|
|
),
|
|
};
|
|
|
|
export const SemanticColors: Story = {
|
|
render: () => (
|
|
<div style={{ display: "flex", gap: 8, alignItems: "center", flexWrap: "wrap" }}>
|
|
<Badge color="green" withColorDot>
|
|
Active
|
|
</Badge>
|
|
<Badge color="yellow" withColorDot>
|
|
Pending
|
|
</Badge>
|
|
<Badge color="red" withColorDot>
|
|
Failed
|
|
</Badge>
|
|
<Badge color="blue" withColorDot>
|
|
Info
|
|
</Badge>
|
|
<Badge color="gray" withColorDot>
|
|
Draft
|
|
</Badge>
|
|
</div>
|
|
),
|
|
};
|
|
|
|
export const InText: Story = {
|
|
render: () => (
|
|
<p style={{ fontSize: 14 }}>
|
|
Workspace status: <Badge color="green">healthy</Badge>. Latest deploy passed all gates.
|
|
</p>
|
|
),
|
|
};
|