diff --git a/packages/frontend/src/components/shared/Badge/index.ts b/packages/frontend/src/components/shared/Badge/index.ts index 9c8edca2..0c6caa07 100644 --- a/packages/frontend/src/components/shared/Badge/index.ts +++ b/packages/frontend/src/components/shared/Badge/index.ts @@ -1 +1,2 @@ export * from './Badge'; +export * from './Badge.theme'; diff --git a/packages/frontend/src/stories/Components/Badge.stories.tsx b/packages/frontend/src/stories/Components/Badge.stories.tsx new file mode 100644 index 00000000..36cdb617 --- /dev/null +++ b/packages/frontend/src/stories/Components/Badge.stories.tsx @@ -0,0 +1,76 @@ +import { Meta, StoryObj } from '@storybook/react'; + +import { Badge, BadgeTheme } from 'components/shared/Badge'; + +const badgeVariants: BadgeTheme['variant'][] = [ + 'primary', + 'secondary', + 'tertiary', + 'inset', +]; +const badgeSizes: BadgeTheme['size'][] = ['xs', 'sm']; + +const meta: Meta = { + title: 'Components/Badge', + component: Badge, + tags: ['autodocs'], + argTypes: { + variant: { + control: 'select', + options: badgeVariants, + }, + size: { + control: 'select', + options: badgeSizes, + }, + children: { + control: 'object', + }, + }, + args: { + variant: 'primary', + size: 'sm', + children: '1', + }, +} as Meta; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + render: ({ variant, size, children, ...args }) => ( + + {children} + + ), + args: { + variant: 'primary', + size: 'sm', + children: '1', + }, +}; + +export const Primary: Story = { + args: { + ...Default.args, + children: '1', + }, +}; + +export const All: Story = { + render: () => ( + <> + {badgeVariants.map((variant, index) => ( +
+ {badgeSizes.map((size) => ( + + {size} + + ))} + {variant} +
+ ))} + + ), +};