- Added stories for: Button, Avatar, Switch, Slider, Alert, Progress - Consolidated Button component to src/components/ui/button.tsx - Removed legacy src/components/Button.tsx
55 lines
1.2 KiB
TypeScript
55 lines
1.2 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react';
|
|
import { Switch } from './switch';
|
|
|
|
const meta = {
|
|
title: 'UI/Switch',
|
|
component: Switch,
|
|
tags: ['autodocs'],
|
|
argTypes: {
|
|
checked: { control: 'boolean' },
|
|
disabled: { control: 'boolean' },
|
|
},
|
|
args: {
|
|
onCheckedChange: () => { },
|
|
}
|
|
} satisfies Meta<typeof Switch>;
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
checked: false,
|
|
},
|
|
};
|
|
|
|
export const Checked: Story = {
|
|
args: {
|
|
checked: true,
|
|
},
|
|
};
|
|
|
|
export const Disabled: Story = {
|
|
args: {
|
|
disabled: true,
|
|
checked: false,
|
|
},
|
|
};
|
|
|
|
export const DisabledChecked: Story = {
|
|
args: {
|
|
disabled: true,
|
|
checked: true,
|
|
},
|
|
};
|
|
|
|
export const WithLabel: Story = {
|
|
render: (args) => (
|
|
<div className="flex items-center space-x-2">
|
|
<Switch id="airplane-mode" {...args} />
|
|
<label htmlFor="airplane-mode" className="text-sm font-medium leading-none text-white peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
|
|
Airplane Mode
|
|
</label>
|
|
</div>
|
|
),
|
|
};
|