Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | import type { Meta, StoryObj } from '@storybook/react';
import GuestLayout from './GuestLayout';
import { Button } from './ui/Button';
import { Input } from './ui/Input';
import { FormField } from './molecules/FormField';
const meta = {
title: 'Layout/GuestLayout',
component: GuestLayout,
parameters: {
layout: 'fullscreen',
},
tags: ['autodocs'],
argTypes: {
header: {
control: 'text',
},
subheader: {
control: 'text',
},
},
} satisfies Meta<typeof GuestLayout>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
children: (
<div className="p-4 bg-white rounded-lg">
<p className="text-gray-600">
This is the guest layout with default content.
</p>
</div>
),
},
};
export const WithHeader: Story = {
args: {
header: 'Welcome Back',
children: (
<div className="p-4 bg-white rounded-lg">
<p className="text-gray-600">
This is the guest layout with a header.
</p>
</div>
),
},
};
export const WithHeaderAndSubheader: Story = {
args: {
header: 'Welcome Back',
subheader: 'Sign in to your account to continue',
children: (
<div className="p-4 bg-white rounded-lg">
<p className="text-gray-600">
This is the guest layout with both header and subheader.
</p>
</div>
),
},
};
export const LoginForm: Story = {
args: {
header: 'Sign in to your account',
subheader: 'Welcome back! Please enter your details.',
children: (
<div className="space-y-4">
<FormField label="Email" required>
<Input type="email" placeholder="Enter your email" />
</FormField>
<FormField label="Password" required>
<Input type="password" placeholder="Enter your password" />
</FormField>
<div className="flex items-center justify-between">
<label className="flex items-center">
<input type="checkbox" className="mr-2" />
<span className="text-sm text-gray-600">Remember me</span>
</label>
<a href="#" className="text-sm text-blue-600 hover:text-blue-500">
Forgot password?
</a>
</div>
<Button className="w-full">Sign In</Button>
<p className="text-center text-sm text-gray-600">
Don't have an account?{' '}
<a href="#" className="text-blue-600 hover:text-blue-500">
Sign up
</a>
</p>
</div>
),
},
};
export const SignUpForm: Story = {
args: {
header: 'Create your account',
subheader: 'Get started with your free account today.',
children: (
<div className="space-y-4">
<FormField label="Full Name" required>
<Input type="text" placeholder="Enter your full name" />
</FormField>
<FormField label="Email" required>
<Input type="email" placeholder="Enter your email" />
</FormField>
<FormField label="Password" required>
<Input type="password" placeholder="Create a password" />
</FormField>
<FormField label="Confirm Password" required>
<Input type="password" placeholder="Confirm your password" />
</FormField>
<div className="flex items-center">
<input type="checkbox" className="mr-2" />
<span className="text-sm text-gray-600">
I agree to the{' '}
<a href="#" className="text-blue-600 hover:text-blue-500">
Terms of Service
</a>{' '}
and{' '}
<a href="#" className="text-blue-600 hover:text-blue-500">
Privacy Policy
</a>
</span>
</div>
<Button className="w-full">Create Account</Button>
<p className="text-center text-sm text-gray-600">
Already have an account?{' '}
<a href="#" className="text-blue-600 hover:text-blue-500">
Sign in
</a>
</p>
</div>
),
},
};
export const ForgotPassword: Story = {
args: {
header: 'Forgot your password?',
subheader: 'Enter your email address and we\'ll send you a link to reset your password.',
children: (
<div className="space-y-4">
<FormField label="Email" required>
<Input type="email" placeholder="Enter your email" />
</FormField>
<Button className="w-full">Send Reset Link</Button>
<p className="text-center text-sm text-gray-600">
Remember your password?{' '}
<a href="#" className="text-blue-600 hover:text-blue-500">
Back to login
</a>
</p>
</div>
),
},
};
export const VerifyEmail: Story = {
args: {
header: 'Verify your email',
subheader: 'We\'ve sent a verification link to your email address.',
children: (
<div className="space-y-4 text-center">
<div className="mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center">
<svg className="w-8 h-8 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
</svg>
</div>
<p className="text-sm text-gray-600">
Please check your email and click the verification link to continue.
</p>
<Button className="w-full">Resend Verification Email</Button>
<p className="text-center text-sm text-gray-600">
<a href="#" className="text-blue-600 hover:text-blue-500">
Change email address
</a>
</p>
</div>
),
},
};
export const TwoFactorAuth: Story = {
args: {
header: 'Two-Factor Authentication',
subheader: 'Enter the 6-digit code from your authenticator app.',
children: (
<div className="space-y-4">
<FormField label="Authentication Code" required>
<Input
type="text"
placeholder="000000"
className="text-center text-lg tracking-widest"
maxLength={6}
/>
</FormField>
<Button className="w-full">Verify Code</Button>
<div className="text-center space-y-2">
<p className="text-sm text-gray-600">
Don't have access to your authenticator?
</p>
<a href="#" className="text-sm text-blue-600 hover:text-blue-500">
Use recovery code
</a>
</div>
</div>
),
},
};
export const MaintenanceMode: Story = {
args: {
header: 'We\'ll be right back',
subheader: 'We\'re performing some maintenance. Please check back soon.',
children: (
<div className="space-y-4 text-center">
<div className="mx-auto w-16 h-16 bg-yellow-100 rounded-full flex items-center justify-center">
<svg className="w-8 h-8 text-yellow-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.996-.833-2.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z" />
</svg>
</div>
<p className="text-sm text-gray-600">
Expected downtime: 30 minutes
</p>
<Button className="w-full" variant="outline">
Get Notified When We're Back
</Button>
</div>
),
},
}; |