-
Notifications
You must be signed in to change notification settings - Fork 2
/
Switch.stories.ts
52 lines (44 loc) · 994 Bytes
/
Switch.stories.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import type { Meta, StoryObj } from '@storybook/react';
import Switch from '../renderer/components/papi-components/Switch';
const meta: Meta<typeof Switch> = {
title: 'MUI/Switch',
component: Switch,
tags: ['autodocs'],
argTypes: {
primary: { control: 'boolean' },
disabled: { control: 'boolean' },
error: { control: 'boolean' },
className: { control: 'text' },
},
};
export default meta;
type Story = StoryObj<typeof Switch>;
export const Default: Story = {
args: {},
};
export const Primary: Story = {
args: { primary: true },
};
export const Disabled: Story = {
args: { disabled: true },
};
export const ErrorState: Story = {
args: { error: true },
};
export const Paratext: Story = {
args: {
className: ['paratext'],
},
};
export const ParatextBright: Story = {
args: {
className: ['paratext', 'bright'],
},
};
export const OnChange: Story = {
args: {
onChange(event) {
console.log(event.target.checked);
},
},
};