-
-
Notifications
You must be signed in to change notification settings - Fork 183
Expand file tree
/
Copy pathTextInput.stories.tsx
More file actions
78 lines (67 loc) 路 1.53 KB
/
Copy pathTextInput.stories.tsx
File metadata and controls
78 lines (67 loc) 路 1.53 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import type { Meta, StoryObj } from '@storybook/react-native';
import { TextInput } from './TextInput';
const meta = {
component: TextInput,
tags: ['docs', 'forms', 'input'],
args: {
placeholder: 'Enter text...',
},
} satisfies Meta<typeof TextInput>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {};
export const WithLabel: Story = {
args: {
label: 'Email Address',
placeholder: 'Enter your email',
},
};
export const Password: Story = {
args: {
label: 'Password',
placeholder: 'Enter your password',
secureTextEntry: true,
},
};
export const WithError: Story = {
args: {
label: 'Email Address',
placeholder: 'Enter your email',
value: 'invalid-email',
error: 'Please enter a valid email address',
},
};
export const Filled: Story = {
args: {
label: 'Email Address',
placeholder: 'Enter your email',
value: 'user@example.com',
},
};
export const Playground: Story = {
args: {
label: 'Email Address',
placeholder: 'Enter your email',
value: '',
error: '',
},
};
export const LongLabel: Story = {
args: {
label: 'This is a very long label that might wrap to multiple lines and affect layout',
placeholder: 'Enter text',
},
};
export const LongErrorMessage: Story = {
args: {
label: 'Email',
error:
'This is a very long error message that explains in detail what went wrong and how to fix it',
},
};
export const EmptyState: Story = {
args: {
label: '',
placeholder: '',
},
};