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:
56
packages/ui/src/stories/base/Checkbox.stories.ts
Normal file
56
packages/ui/src/stories/base/Checkbox.stories.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
||||
|
||||
import Checkbox from '../../components/base/Checkbox.vue'
|
||||
|
||||
const meta = {
|
||||
title: 'Base/Checkbox',
|
||||
component: Checkbox,
|
||||
} satisfies Meta<typeof Checkbox>
|
||||
|
||||
export default meta
|
||||
type Story = StoryObj<typeof meta>
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
label: 'Accept terms and conditions',
|
||||
modelValue: false,
|
||||
},
|
||||
}
|
||||
|
||||
export const Checked: Story = {
|
||||
args: {
|
||||
label: 'Accept terms and conditions',
|
||||
modelValue: true,
|
||||
},
|
||||
}
|
||||
|
||||
export const Disabled: Story = {
|
||||
args: {
|
||||
label: 'Disabled checkbox',
|
||||
modelValue: false,
|
||||
disabled: true,
|
||||
},
|
||||
}
|
||||
|
||||
export const Indeterminate: Story = {
|
||||
args: {
|
||||
label: 'Indeterminate state',
|
||||
modelValue: false,
|
||||
indeterminate: true,
|
||||
},
|
||||
}
|
||||
|
||||
export const AllStates: StoryObj = {
|
||||
render: () => ({
|
||||
components: { Checkbox },
|
||||
template: /*html*/ `
|
||||
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
||||
<Checkbox label="Unchecked" :model-value="false" />
|
||||
<Checkbox label="Checked" :model-value="true" />
|
||||
<Checkbox label="Indeterminate" :model-value="false" :indeterminate="true" />
|
||||
<Checkbox label="Disabled unchecked" :model-value="false" :disabled="true" />
|
||||
<Checkbox label="Disabled checked" :model-value="true" :disabled="true" />
|
||||
</div>
|
||||
`,
|
||||
}),
|
||||
}
|
||||
Reference in New Issue
Block a user