buster/web/src/components/ui/switch/AppSwitch.stories.tsx

48 lines
884 B
TypeScript
Raw Normal View History

2025-02-22 05:13:15 +08:00
import type { Meta, StoryObj } from '@storybook/react';
2025-02-22 06:05:21 +08:00
import { AppSwitch } from './AppSwitch';
2025-02-22 05:13:15 +08:00
2025-02-22 06:05:21 +08:00
const meta: Meta<typeof AppSwitch> = {
2025-02-27 23:40:07 +08:00
title: 'UI/Inputs/Switch',
2025-02-22 06:05:21 +08:00
component: AppSwitch,
2025-02-22 05:29:15 +08:00
tags: ['autodocs'],
2025-02-22 05:13:15 +08:00
argTypes: {
className: { control: 'text' },
defaultChecked: { control: 'boolean' },
disabled: { control: 'boolean' },
checked: { control: 'boolean' }
}
};
export default meta;
2025-02-22 06:05:21 +08:00
type Story = StoryObj<typeof AppSwitch>;
2025-02-22 05:13:15 +08:00
export const Default: Story = {
args: {}
};
export const Checked: Story = {
args: {
defaultChecked: true
}
};
export const Disabled: Story = {
args: {
disabled: true
}
};
export const DisabledChecked: Story = {
args: {
disabled: true,
defaultChecked: true
}
};
export const WithCustomClassName: Story = {
args: {
2025-02-22 06:05:21 +08:00
className: 'data-[state=checked]:bg-green-500',
defaultChecked: true
2025-02-22 05:13:15 +08:00
}
};