veza/apps/web/src/components/ui/Switch.stories.tsx
senke f597e8792a feat(storybook): expanded coverage for core UI components (batch 1)
- Added stories for: Button, Avatar, Switch, Slider, Alert, Progress
- Consolidated Button component to src/components/ui/button.tsx
- Removed legacy src/components/Button.tsx
2026-02-02 19:37:52 +01:00

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>
),
};