import type { Meta, StoryObj } from "@storybook/react-vite" import { CheckIcon } from "lucide-react" import { Badge } from "@hm-design/ui" import { StateBoard } from "@/components/story-board" import { STORY_KICKER, StoryPage, StoryPageHeader, StorySection } from "@/components/story-page" const variants = ["default", "secondary", "destructive", "outline"] as const const meta = { title: "Components/Data & Display/Badge", component: Badge, parameters: { layout: "padded", docs: { description: { component: "현재 HM 규격: 12/18/500, padding 2/8, radius 4, border 1px. variant는 현재 HM Theme에 의미가 있는 default(primary), secondary(neutral), destructive, outline만 둡니다. success·warning·information은 상태 색이 정해지지 않아 만들지 않았습니다. Button variant를 재사용하지 않는 별도 컴포넌트입니다.", }, }, }, argTypes: { variant: { control: "inline-radio", options: variants } }, } satisfies Meta export default meta type Story = StoryObj export const All: Story = { name: "Badge", parameters: { layout: "fullscreen", controls: { disable: true } }, render: () => ( Badge {variants.map((v) => ( {v} ))} ), }, { id: "icon", label: "With icon", children: (
{variants.map((v) => ( ))}
), }, ]} />
A very long badge label }, { id: "link", label: "asChild (link)", children: ( Link badge ), }, ]} />
), } export const Variants: Story = { tags: ["verification"], render: () => (
{variants.map((v) => ( {v} ))}
), } export const Playground: Story = { tags: ["verification"], args: { variant: "default", children: "Badge" } }