clean all
This commit is contained in:
1 parent
f57d6ec3d3
commit
27afb719f5
101 files changed
+45
-14426
No files matched your search
@@ -1,26 +0,0 @@
|
||||
import { FR } from '@/i18n/fr';
|
||||
|
||||
export function Brand({ compact = false }: { compact?: boolean }) {
|
||||
return (
|
||||
<a href="/" className="inline-flex items-center gap-2 text-clinic-800 hover:text-clinic-900">
|
||||
<svg
|
||||
width={compact ? 24 : 32}
|
||||
height={compact ? 24 : 32}
|
||||
viewBox="0 0 64 64"
|
||||
aria-hidden
|
||||
>
|
||||
<circle cx="32" cy="32" r="30" fill="currentColor" opacity="0.12" />
|
||||
<circle cx="32" cy="32" r="22" fill="currentColor" opacity="0.18" />
|
||||
<path
|
||||
d="M22 28 Q32 18 42 28 Q42 38 32 46 Q22 38 22 28 Z"
|
||||
fill="currentColor"
|
||||
opacity="0.85"
|
||||
/>
|
||||
<circle cx="32" cy="34" r="3" fill="white" />
|
||||
</svg>
|
||||
<span className={compact ? 'font-display text-base' : 'font-display text-lg'}>
|
||||
{FR.app.name}
|
||||
</span>
|
||||
</a>
|
||||
);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import { FR } from '@/i18n/fr';
|
||||
|
||||
export function Footer() {
|
||||
const year = new Date().getFullYear();
|
||||
return (
|
||||
<footer className="border-t border-clinic-100 bg-white/60 px-6 py-4 text-xs text-clinic-700">
|
||||
<div className="mx-auto flex max-w-7xl items-center justify-between">
|
||||
<span>
|
||||
{FR.app.name} · {year} ·{' '}
|
||||
<a
|
||||
href="https://www.gnu.org/licenses/agpl-3.0.html"
|
||||
className="underline hover:text-clinic-900"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
AGPL-3.0
|
||||
</a>
|
||||
</span>
|
||||
<span>{FR.app.tagline}</span>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Brand } from './Brand';
|
||||
|
||||
export function Header() {
|
||||
return (
|
||||
<header className="border-b border-clinic-100 bg-white/80 px-6 py-4 backdrop-blur">
|
||||
<div className="mx-auto flex max-w-7xl items-center justify-between">
|
||||
<Brand />
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
import { Footer } from './Footer';
|
||||
import { Header } from './Header';
|
||||
|
||||
export function Shell({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col bg-surface text-ink">
|
||||
<Header />
|
||||
<main className="flex-1">{children}</main>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,33 +0,0 @@
|
||||
import type { HTMLAttributes, ReactNode } from 'react';
|
||||
|
||||
import { cn } from '@/lib/cn';
|
||||
|
||||
type Variant = 'neutral' | 'mild' | 'moderate' | 'severe' | 'soft';
|
||||
|
||||
const variants: Record<Variant, string> = {
|
||||
neutral: 'bg-clinic-100 text-clinic-800',
|
||||
mild: 'bg-clinic-200 text-clinic-800',
|
||||
moderate: 'bg-warm-300 text-clinic-900',
|
||||
severe: 'bg-warm-500 text-white',
|
||||
soft: 'bg-clinic-50 text-clinic-700 border border-clinic-100',
|
||||
};
|
||||
|
||||
export function Badge({
|
||||
variant = 'neutral',
|
||||
className,
|
||||
children,
|
||||
...rest
|
||||
}: HTMLAttributes<HTMLSpanElement> & { variant?: Variant; children?: ReactNode }) {
|
||||
return (
|
||||
<span
|
||||
className={cn(
|
||||
'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium',
|
||||
variants[variant],
|
||||
className,
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
||||
|
||||
import { cn } from '@/lib/cn';
|
||||
|
||||
type Variant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
||||
type Size = 'sm' | 'md' | 'lg';
|
||||
|
||||
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
variant?: Variant;
|
||||
size?: Size;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
const base =
|
||||
'inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors ' +
|
||||
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-clinic-500 focus-visible:ring-offset-2 ' +
|
||||
'disabled:pointer-events-none disabled:opacity-50';
|
||||
|
||||
const variants: Record<Variant, string> = {
|
||||
primary: 'bg-clinic-600 text-white hover:bg-clinic-700',
|
||||
secondary: 'bg-clinic-100 text-clinic-800 hover:bg-clinic-200',
|
||||
ghost: 'text-clinic-700 hover:bg-clinic-100',
|
||||
danger: 'bg-warm-500 text-white hover:bg-warm-400',
|
||||
};
|
||||
|
||||
const sizes: Record<Size, string> = {
|
||||
sm: 'h-8 px-3 text-sm',
|
||||
md: 'h-10 px-4 text-sm',
|
||||
lg: 'h-12 px-6 text-base',
|
||||
};
|
||||
|
||||
export function Button({
|
||||
variant = 'primary',
|
||||
size = 'md',
|
||||
className,
|
||||
children,
|
||||
type = 'button',
|
||||
...rest
|
||||
}: ButtonProps) {
|
||||
return (
|
||||
<button type={type} className={cn(base, variants[variant], sizes[size], className)} {...rest}>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
import type { HTMLAttributes, ReactNode } from 'react';
|
||||
|
||||
import { cn } from '@/lib/cn';
|
||||
|
||||
export function Card({
|
||||
className,
|
||||
children,
|
||||
...rest
|
||||
}: HTMLAttributes<HTMLDivElement> & { children?: ReactNode }) {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'rounded-lg border border-clinic-100 bg-white shadow-sm',
|
||||
className,
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function CardHeader({
|
||||
className,
|
||||
children,
|
||||
}: HTMLAttributes<HTMLDivElement> & { children?: ReactNode }) {
|
||||
return (
|
||||
<div className={cn('border-b border-clinic-100 p-5', className)}>{children}</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function CardBody({
|
||||
className,
|
||||
children,
|
||||
}: HTMLAttributes<HTMLDivElement> & { children?: ReactNode }) {
|
||||
return <div className={cn('p-5', className)}>{children}</div>;
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
import { AnimatePresence, motion } from 'motion/react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { SPRING } from '@/lib/motion';
|
||||
import { cn } from '@/lib/cn';
|
||||
|
||||
interface DialogProps {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
title?: string;
|
||||
children?: ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function Dialog({ open, onClose, title, children, className }: DialogProps) {
|
||||
useEffect(() => {
|
||||
if (!open) return undefined;
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') onClose();
|
||||
};
|
||||
document.addEventListener('keydown', onKey);
|
||||
return () => document.removeEventListener('keydown', onKey);
|
||||
}, [open, onClose]);
|
||||
|
||||
return (
|
||||
<AnimatePresence>
|
||||
{open && (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center">
|
||||
<motion.div
|
||||
className="absolute inset-0 bg-clinic-900/40"
|
||||
onClick={onClose}
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
transition={{ duration: 0.15 }}
|
||||
/>
|
||||
<motion.div
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label={title}
|
||||
className={cn(
|
||||
'relative z-10 max-h-[85vh] w-full max-w-3xl overflow-auto rounded-lg bg-white p-6 shadow-xl',
|
||||
className,
|
||||
)}
|
||||
initial={{ opacity: 0, y: 12, scale: 0.98 }}
|
||||
animate={{ opacity: 1, y: 0, scale: 1 }}
|
||||
exit={{ opacity: 0, y: 6, scale: 0.98 }}
|
||||
transition={SPRING}
|
||||
>
|
||||
{title && <h2 className="mb-4 font-display text-xl text-clinic-900">{title}</h2>}
|
||||
{children}
|
||||
</motion.div>
|
||||
</div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import type { InputHTMLAttributes } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
import { cn } from '@/lib/cn';
|
||||
|
||||
export const Input = forwardRef<HTMLInputElement, InputHTMLAttributes<HTMLInputElement>>(
|
||||
function Input({ className, ...rest }, ref) {
|
||||
return (
|
||||
<input
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'h-10 w-full rounded-md border border-clinic-200 bg-white px-3 text-sm',
|
||||
'placeholder:text-clinic-400 focus:border-clinic-500 focus:outline-none focus:ring-1 focus:ring-clinic-500',
|
||||
'disabled:bg-clinic-50 disabled:text-clinic-400',
|
||||
className,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -1,15 +0,0 @@
|
||||
import type { LabelHTMLAttributes, ReactNode } from 'react';
|
||||
|
||||
import { cn } from '@/lib/cn';
|
||||
|
||||
export function Label({
|
||||
className,
|
||||
children,
|
||||
...rest
|
||||
}: LabelHTMLAttributes<HTMLLabelElement> & { children?: ReactNode }) {
|
||||
return (
|
||||
<label className={cn('mb-1.5 block text-sm font-medium text-clinic-800', className)} {...rest}>
|
||||
{children}
|
||||
</label>
|
||||
);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import type { SelectHTMLAttributes } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
import { cn } from '@/lib/cn';
|
||||
|
||||
export const Select = forwardRef<HTMLSelectElement, SelectHTMLAttributes<HTMLSelectElement>>(
|
||||
function Select({ className, children, ...rest }, ref) {
|
||||
return (
|
||||
<select
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'h-10 w-full rounded-md border border-clinic-200 bg-white px-3 text-sm',
|
||||
'focus:border-clinic-500 focus:outline-none focus:ring-1 focus:ring-clinic-500',
|
||||
'disabled:bg-clinic-50 disabled:text-clinic-400',
|
||||
className,
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
{children}
|
||||
</select>
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -1,21 +0,0 @@
|
||||
import type { TextareaHTMLAttributes } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
import { cn } from '@/lib/cn';
|
||||
|
||||
export const Textarea = forwardRef<
|
||||
HTMLTextAreaElement,
|
||||
TextareaHTMLAttributes<HTMLTextAreaElement>
|
||||
>(function Textarea({ className, ...rest }, ref) {
|
||||
return (
|
||||
<textarea
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'min-h-[88px] w-full rounded-md border border-clinic-200 bg-white p-3 text-sm leading-relaxed',
|
||||
'placeholder:text-clinic-400 focus:border-clinic-500 focus:outline-none focus:ring-1 focus:ring-clinic-500',
|
||||
className,
|
||||
)}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user