feat: auth, first-run setup, login
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d722c0034c
commit
23f3192cd0
28 files changed
+648
-160
No files matched your search
@@ -0,0 +1,8 @@
|
||||
export function Logo() {
|
||||
return (
|
||||
<div className="flex items-center gap-2 text-base font-bold">
|
||||
<span className="grid h-7 w-7 place-items-center rounded-lg bg-accent text-sm text-white">€</span>
|
||||
Finances
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import type { ButtonHTMLAttributes } from "react";
|
||||
|
||||
type Variant = "primary" | "ghost" | "danger" | "subtle";
|
||||
|
||||
const VARIANTS: Record<Variant, string> = {
|
||||
primary: "bg-accent text-white hover:bg-indigo-700",
|
||||
ghost: "border border-line bg-white text-ink hover:bg-gray-50",
|
||||
danger: "border border-red-200 bg-white text-neg hover:bg-neg-soft",
|
||||
subtle: "text-accent hover:bg-accent-soft",
|
||||
};
|
||||
|
||||
export function Button({
|
||||
variant = "primary",
|
||||
className = "",
|
||||
...props
|
||||
}: ButtonHTMLAttributes<HTMLButtonElement> & { variant?: Variant }) {
|
||||
return (
|
||||
<button
|
||||
className={`inline-flex items-center justify-center gap-2 rounded-[10px] px-4 py-2.5 text-sm font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${VARIANTS[variant]} ${className}`}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { HTMLAttributes } from "react";
|
||||
|
||||
export function Card({ className = "", ...props }: HTMLAttributes<HTMLDivElement>) {
|
||||
return <div className={`rounded-card border border-line bg-card p-[18px] ${className}`} {...props} />;
|
||||
}
|
||||
|
||||
export function CardLabel({ className = "", ...props }: HTMLAttributes<HTMLDivElement>) {
|
||||
return <div className={`text-xs font-semibold uppercase tracking-wide text-muted ${className}`} {...props} />;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import type { InputHTMLAttributes, ReactNode, SelectHTMLAttributes, TextareaHTMLAttributes } from "react";
|
||||
|
||||
/** Largeur pleine par défaut, sauf si l'appelant fixe une largeur. */
|
||||
const width = (className: string) => (/(^|\s)w-/.test(className) ? "" : "w-full");
|
||||
|
||||
const control =
|
||||
"rounded-[10px] border border-line bg-white px-3 py-2.5 text-sm text-ink outline-none transition focus:border-accent focus:ring-2 focus:ring-accent/20";
|
||||
|
||||
export function Field({ label, hint, children }: { label: string; hint?: string; children: ReactNode }) {
|
||||
return (
|
||||
<label className="block">
|
||||
<span className="mb-1.5 block text-xs font-semibold text-muted">{label}</span>
|
||||
{children}
|
||||
{hint && <span className="mt-1 block text-xs text-muted">{hint}</span>}
|
||||
</label>
|
||||
);
|
||||
}
|
||||
|
||||
export function Input({ className = "", ...props }: InputHTMLAttributes<HTMLInputElement>) {
|
||||
return <input className={`${control} ${width(className)} ${className}`} {...props} />;
|
||||
}
|
||||
|
||||
export function Select({ className = "", ...props }: SelectHTMLAttributes<HTMLSelectElement>) {
|
||||
return <select className={`${control} ${width(className)} ${className}`} {...props} />;
|
||||
}
|
||||
|
||||
export function Textarea({ className = "", ...props }: TextareaHTMLAttributes<HTMLTextAreaElement>) {
|
||||
return <textarea className={`${control} ${width(className)} ${className}`} {...props} />;
|
||||
}
|
||||
|
||||
export function FormError({ message }: { message?: string | null }) {
|
||||
if (!message) return null;
|
||||
return <p className="rounded-[10px] border border-red-200 bg-neg-soft px-3 py-2 text-sm text-neg">{message}</p>;
|
||||
}
|
||||
Reference in new issue
Block a user