import type { Meta, StoryObj } from '@storybook/nextjs-vite' import { useState } from 'react' import { AuthShell, type AuthSsoProvider, LoginForm, type LoginFormProps } from '../../components/features/auth' import { TabSelector } from '../../components/ui/tab-selector' const meta = { title: 'Auth/Login', component: LoginForm, parameters: { layout: 'fullscreen', docs: { description: { component: 'Login tab from the auth redesign. Presentational + controlled. Shown inside the full responsive AuthShell (desktop two-column, tablet/mobile stacked). Use the viewport toolbar to check breakpoints.', }, }, }, tags: ['autodocs'], } satisfies Meta export default meta type Story = StoryObj /** Full page: Sign Up / Login tabs + Login form + marketing panel. */ function LoginPage(initial: Partial) { const [tab, setTab] = useState('login') const [email, setEmail] = useState(initial.email ?? '') const isValid = !!email.trim() const tabs = ( ) return ( {tab === 'login' ? ( {}} onForgotPassword={() => {}} /> ) : (
Sign Up — see Auth/Create Organization
)}
) } /** Empty email, submit disabled. */ export const Empty: Story = { render: () => , } /** Valid email entered, Continue enabled (accent). */ export const Filled: Story = { render: () => , } const SSO_PROVIDERS: AuthSsoProvider[] = ['openframe', 'google', 'microsoft', 'apple'] /** SSO configured: email filled, submit replaced by provider buttons. */ export const SSO: Story = { render: () => , }