From 9c6589938744b02de688dc6d001e8f377322dc94 Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Fri, 22 May 2026 23:51:34 -0700 Subject: [PATCH] feat(web/ui5): migrate auth pages and CreateWorkspaceModal to @bytelyst/ui primitives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sprint C / UI5 — migrate the highest-leverage user-facing forms off the legacy 'input-shell' / inline-style pattern onto the @bytelyst/ui Input, Textarea, and AlertBanner primitives via the local Primitives.tsx adapter. Adapter additions (web/src/components/ui/Primitives.tsx): - Re-export AlertBanner, FormSection, and FieldGrid from @bytelyst/ui so product code never imports from the underlying package directly. Migrated screens: - web/src/app/(auth)/login/page.tsx - web/src/app/(auth)/register/page.tsx - web/src/app/(auth)/forgot-password/page.tsx - web/src/components/CreateWorkspaceModal.tsx Each migration replaces the ad-hoc 'input-shell' inputs and manual label/error/success divs with the Input (label + hint props), Textarea, and AlertBanner (tone='error'|'success') primitives. Inline style blocks are replaced with Tailwind utility classes that read from the existing --nl-* CSS custom properties so the visual tokens remain unchanged. The 3 auth pages alone remove 9 input-shell call sites; the CreateWorkspaceModal removes 2 more. Verified: - pnpm --filter @notelett/web run typecheck: passes - pnpm --filter @notelett/web run test: 96/96 pass - pnpm run verify: end-to-end green (backend 380/380, web 96/96, mobile 97/97) --- web/src/app/(auth)/forgot-password/page.tsx | 63 ++++++++++---------- web/src/app/(auth)/login/page.tsx | 58 +++++++++--------- web/src/app/(auth)/register/page.tsx | 64 +++++++++----------- web/src/components/CreateWorkspaceModal.tsx | 65 ++++++++++++--------- web/src/components/ui/Primitives.tsx | 18 ++++++ 5 files changed, 145 insertions(+), 123 deletions(-) diff --git a/web/src/app/(auth)/forgot-password/page.tsx b/web/src/app/(auth)/forgot-password/page.tsx index c604f57..07d2aa2 100644 --- a/web/src/app/(auth)/forgot-password/page.tsx +++ b/web/src/app/(auth)/forgot-password/page.tsx @@ -2,7 +2,7 @@ import { useState, type FormEvent } from "react"; import Link from "next/link"; -import { Button, Card } from "@/components/ui/Primitives"; +import { AlertBanner, Button, Card, Input } from "@/components/ui/Primitives"; import { useAuth } from "@/lib/auth"; export default function ForgotPasswordPage() { @@ -17,48 +17,47 @@ export default function ForgotPasswordPage() { return ( -
-

Reset password

-

- Enter your email and we'll send a reset link if the account exists. -

+ +

Reset password

+

+ Enter your email and we'll send a reset link if the account exists. +

- {error && ( -
- {error} -
- )} + {error && ( + + {error} + + )} - {success && ( -
- {success} -
- )} + {success && ( + + {success} + + )} - - + -

- Back to sign in -

-
+

+ + Back to sign in + +

+
); } diff --git a/web/src/app/(auth)/login/page.tsx b/web/src/app/(auth)/login/page.tsx index ca17330..e75e691 100644 --- a/web/src/app/(auth)/login/page.tsx +++ b/web/src/app/(auth)/login/page.tsx @@ -3,7 +3,7 @@ import { useState, type FormEvent } from "react"; import Link from "next/link"; import { useRouter } from "next/navigation"; -import { Button, Card } from "@/components/ui/Primitives"; +import { AlertBanner, Button, Card, Input } from "@/components/ui/Primitives"; import { useAuth } from "@/lib/auth"; export default function LoginPage() { @@ -21,52 +21,50 @@ export default function LoginPage() { return ( -
-

Sign in

+ +

Sign in

- {error && ( -
- {error} -
- )} + {error && ( + + {error} + + )} - - - + -
- Forgot password? - Create account -
-
+
+ + Forgot password? + + + Create account + +
+
); } diff --git a/web/src/app/(auth)/register/page.tsx b/web/src/app/(auth)/register/page.tsx index fd71b1a..ea6ff60 100644 --- a/web/src/app/(auth)/register/page.tsx +++ b/web/src/app/(auth)/register/page.tsx @@ -3,7 +3,7 @@ import { useState, type FormEvent } from "react"; import Link from "next/link"; import { useRouter } from "next/navigation"; -import { Button, Card } from "@/components/ui/Primitives"; +import { AlertBanner, Button, Card, Input } from "@/components/ui/Primitives"; import { useAuth } from "@/lib/auth"; export default function RegisterPage() { @@ -22,65 +22,59 @@ export default function RegisterPage() { return ( -
-

Create account

+ +

Create account

- {error && ( -
- {error} -
- )} + {error && ( + + {error} + + )} - - - - + -

- Already have an account?{" "} - Sign in -

-
+

+ Already have an account?{" "} + + Sign in + +

+
); } diff --git a/web/src/components/CreateWorkspaceModal.tsx b/web/src/components/CreateWorkspaceModal.tsx index 534b6de..ef284c1 100644 --- a/web/src/components/CreateWorkspaceModal.tsx +++ b/web/src/components/CreateWorkspaceModal.tsx @@ -1,7 +1,7 @@ "use client"; import { useState, type FormEvent } from "react"; -import { Button, Card } from "@/components/ui/Primitives"; +import { AlertBanner, Button, Card, Input, Textarea } from "@/components/ui/Primitives"; import { createWorkspace } from "@/lib/notes-client"; interface Props { @@ -38,36 +38,49 @@ export function CreateWorkspaceModal({ onCreated, onClose }: Props) { return (
{ if (e.target === e.currentTarget) onClose(); }} + className="fixed inset-0 z-[1000] flex items-center justify-center bg-[color:var(--nl-overlay-scrim)]" + onClick={(e) => { + if (e.target === e.currentTarget) onClose(); + }} > - -
-
Create Workspace
+ + +
Create Workspace
- {error &&
{error}
} + {error && ( + + {error} + + )} - + setName(e.target.value)} + aria-label="Workspace name" + autoFocus + /> -