mirror of
https://github.com/modrinth/code.git
synced 2026-09-05 06:19:11 +00:00
devex: storybook for UI Package (#4984)
* add storybook * clean up stories * small fix * add stories for all components * add vintl * default to dark mode * fix teleport * add theme addon * add new modal story * delete broken stories * move all stories to central stories folder * fix paths * add pnpm run storybook * remove chromatic * add add-stories.md * fix types * fix unncessary args field * cover more addordion states * pt2 * remove old vintl * fix: missing style + ctx --------- Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
||||
|
||||
import Badge from '../../components/base/Badge.vue'
|
||||
|
||||
const meta = {
|
||||
title: 'Base/Badge',
|
||||
component: Badge,
|
||||
} satisfies Meta<typeof Badge>
|
||||
|
||||
export default meta
|
||||
type Story = StoryObj<typeof meta>
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
type: 'approved',
|
||||
},
|
||||
}
|
||||
|
||||
export const ProjectStatuses: StoryObj = {
|
||||
render: () => ({
|
||||
components: { Badge },
|
||||
template: /*html*/ `
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem;">
|
||||
<Badge type="approved" />
|
||||
<Badge type="unlisted" />
|
||||
<Badge type="private" />
|
||||
<Badge type="draft" />
|
||||
<Badge type="archived" />
|
||||
<Badge type="rejected" />
|
||||
<Badge type="processing" />
|
||||
</div>
|
||||
`,
|
||||
}),
|
||||
}
|
||||
|
||||
export const UserRoles: StoryObj = {
|
||||
render: () => ({
|
||||
components: { Badge },
|
||||
template: /*html*/ `
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem;">
|
||||
<Badge type="admin" />
|
||||
<Badge type="moderator" />
|
||||
<Badge type="creator" />
|
||||
</div>
|
||||
`,
|
||||
}),
|
||||
}
|
||||
|
||||
export const WithColor: Story = {
|
||||
args: {
|
||||
type: 'release',
|
||||
color: 'green',
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user