-
-
Notifications
You must be signed in to change notification settings - Fork 180
Expand file tree
/
Copy pathLoginForm.stories.tsx
More file actions
55 lines (47 loc) · 1.27 KB
/
LoginForm.stories.tsx
File metadata and controls
55 lines (47 loc) · 1.27 KB
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
53
54
55
import type { Meta, StoryObj } from '@storybook/react-native';
import { fn } from 'storybook/test';
import { LoginForm } from './LoginForm';
const meta = {
component: LoginForm,
tags: ['docs', 'forms', 'login'],
args: {
onSubmit: fn(),
emailLabel: 'Email Address',
emailPlaceholder: 'Enter your email',
passwordLabel: 'Password',
passwordPlaceholder: 'Enter your password',
submitButtonTitle: 'Sign In',
},
} satisfies Meta<typeof LoginForm>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {};
export const WithErrors: Story = {
args: {
emailError: 'Please enter a valid email',
passwordError: 'Password must be at least 8 characters',
},
};
export const Loading: Story = {
args: {
loading: true,
},
};
export const EmailErrorOnly: Story = {
args: {
emailError: 'This email is already registered',
},
};
export const PasswordErrorOnly: Story = {
args: {
passwordError: 'Password is incorrect',
},
};
export const LongErrors: Story = {
args: {
emailError:
'The email address you entered is not valid. Please check the format and try again.',
passwordError:
'Your password must be at least 8 characters long and contain both letters and numbers for security.',
},
};