diff --git a/web/app/login/page.tsx b/web/app/login/page.tsx index 4a67990..6226c24 100644 --- a/web/app/login/page.tsx +++ b/web/app/login/page.tsx @@ -1,4 +1,8 @@ import { login } from "./actions"; +import { Button } from "@/components/ui/Button"; +import { Card } from "@/components/ui/Card"; +import { Alert } from "@/components/ui/Alert"; +import { FormField, FIELD_CLASSES } from "@/components/ui/FormField"; export default async function LoginPage({ searchParams, @@ -8,20 +12,24 @@ export default async function LoginPage({ const { error } = await searchParams; return ( -
-

Anmelden

- {error &&

{error}

} -
-
- - -
-
- - -
- -
+
+ +

Anmelden

+ {error && ( +
+ {error} +
+ )} +
+ + + + + + + +
+
); } diff --git a/web/components/ui/Alert.tsx b/web/components/ui/Alert.tsx new file mode 100644 index 0000000..ac79d5f --- /dev/null +++ b/web/components/ui/Alert.tsx @@ -0,0 +1,7 @@ +export function Alert({ children }: { children: React.ReactNode }) { + return ( +

+ {children} +

+ ); +} diff --git a/web/components/ui/Button.tsx b/web/components/ui/Button.tsx new file mode 100644 index 0000000..58709f1 --- /dev/null +++ b/web/components/ui/Button.tsx @@ -0,0 +1,28 @@ +import type { ComponentProps } from "react"; + +export type ButtonVariant = "primary" | "secondary" | "destructive"; + +const VARIANT_CLASSES: Record = { + primary: "bg-performance-blue text-white hover:bg-night-blue", + secondary: "bg-white text-asphalt-grey border border-asphalt-grey hover:bg-aluminium-grey", + destructive: "bg-status-danger text-white hover:bg-red-700", +}; + +export function buttonClasses(variant: ButtonVariant = "primary", fullWidth = true): string { + return [ + "inline-flex min-h-11 items-center justify-center rounded-md px-4 py-2 text-center font-medium", + "transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2", + "focus-visible:outline-performance-blue disabled:cursor-not-allowed disabled:opacity-50", + VARIANT_CLASSES[variant], + fullWidth ? "w-full" : "", + ].join(" "); +} + +export function Button({ + variant = "primary", + fullWidth = true, + className = "", + ...props +}: ComponentProps<"button"> & { variant?: ButtonVariant; fullWidth?: boolean }) { + return