feat: logo et favicon, confirmation modale, fil d'ariane, e-mails sombres (#4)
CD — Déploiement / deploy (push) Failing after 25s
CD — Déploiement / deploy (push) Failing after 25s
- logo embarque dans les e-mails (CID) et gabarit repense en mode sombre - favicon multi-tailles + icone PNG, logo a gauche du titre (app et auth) - modale de confirmation animee a la place de window.confirm - bouton retour et fil d'ariane dans l'explorateur --------- Co-authored-by: xEsiah <[email protected]> Reviewed-on: #4 Reviewed-by: Esiah <[email protected]> Co-authored-by: Gitea Actions <-[email protected]>
This commit was merged in pull request #4.
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
@import "tailwindcss";
|
||||
@import "@cohaise/ui/styles";
|
||||
|
||||
@source "../../../../frontend/shared/src";
|
||||
@@ -4,7 +4,11 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<meta name="theme-color" content="#b71c1c" />
|
||||
<title>CoHaiSe Cloud</title>
|
||||
<link rel="icon" href="/favicon.ico" sizes="any" />
|
||||
<link rel="icon" type="image/png" href="/icon.png" />
|
||||
<link rel="apple-touch-icon" href="/icon.png" />
|
||||
<script src="/theme.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -10,10 +10,11 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cohaise/ui": "*",
|
||||
"clsx": "^2.1.1",
|
||||
"react": "^19.3.0",
|
||||
"react-dom": "^19.3.0",
|
||||
"react-router-dom": "^7.18.4"
|
||||
"react-router-dom": "^7.18.4",
|
||||
"tailwind-merge": "^3.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.3.3",
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 138 KiB |
@@ -1,186 +0,0 @@
|
||||
# @cohaise/ui
|
||||
|
||||
Design system du Cloud. Point d'entrée unique des jetons de style
|
||||
utilisés par `frontend/cloud`, garantissant une identité visuelle
|
||||
homogène et la thématisation dynamique clair/sombre.
|
||||
|
||||
## Couche de jetons
|
||||
|
||||
Ce paquet expose une chaîne CSS en trois fichiers, du plus primitif au plus dérivé.
|
||||
|
||||
| Fichier | Rôle |
|
||||
|---|---|
|
||||
| `src/styles/tokens.css` | Variables CSS brutes (`--cohaise-*`). Échelle de gris en `oklch`, jetons sémantiques, ombres, typographie, rayons, courbes et durées de mouvement. |
|
||||
| `src/styles/theme.css` | Directive `@theme inline` mappant les variables brutes vers les utilitaires Tailwind (`bg-surface`, `text-muted-foreground`, `border-border`...). |
|
||||
| `src/styles/index.css` | Point d'entrée, importe les deux fichiers ci-dessus. |
|
||||
|
||||
### Mouvement
|
||||
|
||||
Tailwind v4 ne réserve pas de namespace de thème aux durées : `duration-*` est un
|
||||
utilitaire à valeur nue. Les trois durées sont donc exposées via `@utility` dans
|
||||
`theme.css`, adossées aux jetons `--cohaise-duration-*`.
|
||||
|
||||
`--default-transition-duration` et `--default-transition-timing-function` sont
|
||||
également déclarés, si bien que toute classe `transition-*` hérite du mouvement du
|
||||
design system sans avoir à le répéter :
|
||||
|
||||
```css
|
||||
.transition-colors {
|
||||
transition-timing-function: var(--tw-ease, var(--cohaise-ease-out-soft));
|
||||
transition-duration: var(--tw-duration, var(--cohaise-duration-base));
|
||||
}
|
||||
```
|
||||
|
||||
Les utilitaires `duration-fast`, `duration-base`, `duration-slow` et `ease-out-soft`
|
||||
surchargent ces valeurs au cas par cas.
|
||||
|
||||
### Chaîne de résolution
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A["tokens.css<br/>--cohaise-gray-*, --cohaise-crimson-*"] --> B["tokens.css<br/>--cohaise-background, --cohaise-border, ..."]
|
||||
B --> C["theme.css<br/>@theme inline"]
|
||||
C --> D["Tailwind CSS<br/>compile les utilitaires"]
|
||||
D --> E["frontend/cloud"]
|
||||
|
||||
F["Classe .dark sur <html>"] -.->|surcharge les jetons sémantiques| B
|
||||
```
|
||||
|
||||
L'échelle de gris et l'échelle carmin sont les seules sources de vérité des couleurs
|
||||
brutes. Les jetons sémantiques n'y font référence que par `var()`, jamais par une valeur
|
||||
littérale, sauf pour les statuts (`success`, `warning`, `info`) et l'ombre carmin, qui
|
||||
n'existent que dans le mode sombre.
|
||||
|
||||
La source de vérité du rouge est `--clr-accent` du site, soit `#b71c1c`, et non le
|
||||
carmin `#c3073f` qui apparaît davantage dans la feuille de style compilée. Les deux
|
||||
valeurs ont été retenues à un moment de la construction du thème : le carmin est plus
|
||||
vif, la valeur déclarée plus profonde et moins magenta. Sur un outil de gestion de
|
||||
fichiers, c'est la seconde qui tient le mieux sur de grandes surfaces.
|
||||
|
||||
## Couleurs
|
||||
|
||||
Les valeurs viennent de `esiah.dev`. Le fond sombre est un noir à dominante rouge
|
||||
(`#050000`), pas un gris neutre, et l'accent est le carmin `#b71c1c`.
|
||||
|
||||
| Rôle | Clair | Sombre |
|
||||
|---|---|---|
|
||||
| Fond | `#f7f5f4` | `#050000` |
|
||||
| Surface | `#ffffff` | `#1a0505` |
|
||||
| Surface surélevée | `#ffffff` | `#1e1e22` |
|
||||
| Texte | `#1a1a1a` | `#f4f4f2` |
|
||||
| Texte atténué | `#5c5656` | `#a8a0a0` |
|
||||
| Primaire | `#b71c1c` | `#b71c1c` |
|
||||
| Accent graphique | `#b71c1c` | `#c92a2a` |
|
||||
| Filet de séparation | `#e8dcdc` | `#2e1c1c` |
|
||||
|
||||
Un seul rouge de marque dans les deux modes, ce qui rend les captures et les
|
||||
comparaisons d'écran reproductibles. Il n'est appliqué qu'en aplat plein, avec du texte
|
||||
blanc dessus, où il atteint 6,57:1.
|
||||
|
||||
`accent-graphic` est un ton séparé, réservé aux **petits éléments posés sur** une
|
||||
surface : filet de carte, carré de liste, anneau de focus. Ces éléments sont lus comme
|
||||
interface et relèvent du seuil de 3:1, or le rouge de marque ne donne que 2,65:1 sur la
|
||||
surface sombre. Le même raisonnement impose une bordure de champ distincte, à 3,57:1 en
|
||||
sombre et 3,73:1 en clair.
|
||||
|
||||
**Le destructif est ambre, pas rouge.** C'est une décision de lisibilité, pas un goût :
|
||||
l'accent du site est un rouge, donc un bouton « supprimer » rouge serait confondu avec un
|
||||
bouton d'accent. `destructive` occupe donc le ton `oklch(0.768 0.188 70)`, déjà présent
|
||||
dans la palette, et `warning` garde le jaune plus clair. Le prix à payer est que
|
||||
« supprimer » et « attention » sont proches en teinte ; ils ne se croisent jamais dans le
|
||||
même écran, et c'est un choix à revoir si l'interface grossit.
|
||||
|
||||
**Les bordures de champs de formulaire ont leur propre jeton.** Les bordures
|
||||
décoratives restent très discrètes, `1.2:1` sur le fond en mode sombre, pour respecter le
|
||||
grain du site. Un champ de formulaire doit en revanche pouvoir être identifié sans le
|
||||
remplir ni le survoler, ce que la WCAG 1.4.11 chiffre à `3:1`. `border-control` est
|
||||
donc nettement plus clair, `3.5:1` en sombre et `3.7:1` en clair, et c'est lui que
|
||||
`Input` utilise. Les deux valeurs ont été retenues en mesurant le contraste réel plutôt
|
||||
qu'à l'œil.
|
||||
|
||||
## Polices
|
||||
|
||||
| Usage | Police | Variable |
|
||||
|---|---|---|
|
||||
| Titres, libellés, boutons | Orbitron | `--cohaise-font-display` |
|
||||
| Texte courant et paragraphes | Poppins | `--cohaise-font-sans` |
|
||||
| Marque | Orbitron | `--cohaise-font-logo` |
|
||||
| Accroche courte, registre éditorial | Cinzel | `--cohaise-font-serif` |
|
||||
| Code | JetBrains Mono et replis | `--cohaise-font-mono` |
|
||||
|
||||
Le partage vient du site, où `body` est en Orbitron. Orbitron a une chasse très large : à
|
||||
32 px, un titre paraît écrit à la main, et un mot-symbole doit être resserré pour ne pas
|
||||
s'éparpiller. D'où quatre jetons d'interlettrage dédiés, dont un négatif pour les titres.
|
||||
|
||||
Orbitron est donc cantonnée aux **chaînes courtes** — titres jusqu'à `h3`, libellés en
|
||||
capitales, boutons — avec `tracking-label` en positif. Au-delà de `h3`, la chasse est trop
|
||||
large pour la taille du texte. Le flux est en Poppins. C'est pourquoi `font-display` est
|
||||
appliqué dans la couche `base` plutôt que laissé au soin de chaque composant : c'est la
|
||||
seule façon d'éviter qu'un titre revienne en Poppins parce qu'un écran l'a oublié.
|
||||
|
||||
Cinzel est conservée en réserve. C'est un bon caractère, mais une serif d'inscription
|
||||
romaine sur des libellés d'interface ou un paragraphe devient vite illisible, et c'est
|
||||
précisément ce qui donnait au premier jet de ce thème son aspect de thème généré.
|
||||
|
||||
Les trois faces sont **auto-hébergées** dans `frontend/shared/fonts`, 53,6 Ko au total,
|
||||
soit 30 Ko de moins que Roboto seul. Un appel à Google Fonts aurait fait fuiter l'adresse
|
||||
IP de chaque visiteur de ton NAS vers un tiers, ce qui n'a pas sa place dans une
|
||||
application privée.
|
||||
|
||||
## Modes clair et sombre
|
||||
|
||||
Le mode est piloté par la classe `.dark` appliquée sur `<html>`. `:root` porte le mode
|
||||
clair, `.dark` surcharge l'ensemble des jetons sémantiques. `color-scheme` est défini
|
||||
sur les deux blocs pour aligner les contrôles natifs et les barres de défilement.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph Light["`:root` — mode clair"]
|
||||
LA["--cohaise-background<br/>#f7f5f4"]
|
||||
LB["--cohaise-foreground<br/>#1a1a1a"]
|
||||
LC["--cohaise-primary<br/>#b71c1c"]
|
||||
end
|
||||
subgraph Dark["`.dark` — mode sombre"]
|
||||
DA["--cohaise-background<br/>#050000"]
|
||||
DB["--cohaise-foreground<br/>#f4f4f2"]
|
||||
DC["--cohaise-primary<br/>#b71c1c"]
|
||||
end
|
||||
Light -->|bascule de classe| Dark
|
||||
```
|
||||
|
||||
Aucune règle `@media (prefers-color-scheme)` n'est déclarée : la bascule est
|
||||
explicite, ce qui garantit un comportement unique quelle que soit la préférence
|
||||
système.
|
||||
|
||||
## Forme
|
||||
|
||||
Les rayons sont quasi nuls, de 2 à 6 px, contre 4 à 12 px pour les valeurs par défaut de
|
||||
Tailwind. Les tuiles à coins arrondis sont la signature la plus immédiate d'une interface
|
||||
sans intention, et un registre d'instrument se lit dans l'angle autant que dans la
|
||||
couleur.
|
||||
|
||||
Trois marques complètent le registre : un filet carmin d'un pixel en tête de `Card`, un
|
||||
carré plein de 6 px devant chaque élément de liste au lieu d'une puce ronde, et des
|
||||
libellés en capitales espacées. Aucune n'est décorative au sens strict : elles servent à
|
||||
séparer des blocs sans ajouter de bordure lourde, et à rendre les métriques denses
|
||||
scannables.
|
||||
|
||||
## Consommation
|
||||
|
||||
```css
|
||||
@import "tailwindcss";
|
||||
@import "@cohaise/ui/styles";
|
||||
```
|
||||
|
||||
L'application conserve la main sur la directive `tailwindcss` et sur sa configuration ;
|
||||
ce paquet ne fournit que les jetons. Le build Vite résout l'entrée via le champ
|
||||
`exports` du `package.json`.
|
||||
|
||||
## Contraintes
|
||||
|
||||
- Aucune valeur de couleur littérale n'est autorisée dans les composants : uniquement
|
||||
des utilitaires derivés des jetons sémantiques, sinon la thématisation casse.
|
||||
- `@theme inline` est obligatoire plutôt que `@theme`, car les utilitaires doivent
|
||||
référencer la variable pour résoudre la valeur au changement de mode.
|
||||
- Aucune durée ne doit être écrite en dur dans un composant (`duration-150` est
|
||||
interdit) : passer par `duration-fast`, `duration-base` ou `duration-slow`.
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"name": "@cohaise/ui",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"sideEffects": ["**/*.css"],
|
||||
"style": "./src/styles/index.css",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
},
|
||||
"./styles": "./src/styles/index.css",
|
||||
"./styles/tokens": "./src/styles/tokens.css",
|
||||
"./styles/theme": "./src/styles/theme.css"
|
||||
},
|
||||
"files": ["dist", "src/styles"],
|
||||
"scripts": {
|
||||
"build": "tsc --build",
|
||||
"clean": "node --eval \"import('node:fs').then(fs => { fs.rmSync('dist', { recursive: true, force: true }); fs.rmSync('tsconfig.tsbuildinfo', { force: true }); })\"",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^19.3.0",
|
||||
"@types/react-dom": "^19.3.0",
|
||||
"react": "^19.3.0",
|
||||
"react-dom": "^19.3.0",
|
||||
"typescript": "^7.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"clsx": "^2.1.1",
|
||||
"tailwind-merge": "^3.7.0"
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"jsx": "react-jsx",
|
||||
"rootDir": "src",
|
||||
"outDir": "dist",
|
||||
"composite": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx"]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Navigate, Outlet, Route, Routes } from "react-router-dom";
|
||||
import { Spinner } from "@cohaise/ui";
|
||||
import { Spinner } from "./ui/index.js";
|
||||
import { useSession } from "./lib/session.js";
|
||||
import { AppShell } from "./components/AppShell.js";
|
||||
import { Login } from "./pages/Login.js";
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState } from "react";
|
||||
import { NavLink, Outlet } from "react-router-dom";
|
||||
import { Button, cn } from "@cohaise/ui";
|
||||
import { Button, cn } from "../ui/index.js";
|
||||
import { useSession } from "../lib/session.js";
|
||||
import {
|
||||
ActivityIcon,
|
||||
@@ -58,6 +58,11 @@ export const AppShell = () => {
|
||||
|
||||
const brand = (
|
||||
<NavLink to="/files" className="flex items-center gap-2" onClick={() => setMenuOpen(false)}>
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-7 w-7 shrink-0 rounded-md ring-1 ring-black/5"
|
||||
/>
|
||||
<span className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</span>
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { Spinner, cn } from "@cohaise/ui";
|
||||
import { Spinner, cn } from "../ui/index.js";
|
||||
|
||||
export const IconAction = ({
|
||||
label,
|
||||
@@ -0,0 +1,85 @@
|
||||
import {
|
||||
createContext,
|
||||
useCallback,
|
||||
useContext,
|
||||
useState,
|
||||
type ReactNode,
|
||||
} from "react";
|
||||
import { Button } from "../ui/index.js";
|
||||
import { Modal } from "./feedback.js";
|
||||
|
||||
export interface ConfirmOptions {
|
||||
/** Titre de la modale. */
|
||||
title?: string;
|
||||
/** Corps du message ; accepte du balisage pour mettre un nom en valeur. */
|
||||
message: ReactNode;
|
||||
confirmLabel?: string;
|
||||
cancelLabel?: string;
|
||||
/** `danger` reserve l'action a une operation destructive. */
|
||||
tone?: "default" | "danger";
|
||||
}
|
||||
|
||||
type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
|
||||
|
||||
interface PendingConfirm {
|
||||
options: ConfirmOptions;
|
||||
resolve: (value: boolean) => void;
|
||||
}
|
||||
|
||||
const ConfirmContext = createContext<ConfirmFn | null>(null);
|
||||
|
||||
/**
|
||||
* Remplace `window.confirm` par une modale maison aux couleurs de l'app.
|
||||
* `useConfirm()` renvoie une promesse resolue a `true` (confirme) ou `false`.
|
||||
*/
|
||||
export const ConfirmProvider = ({ children }: { children: ReactNode }) => {
|
||||
const [pending, setPending] = useState<PendingConfirm | null>(null);
|
||||
|
||||
const confirm = useCallback<ConfirmFn>(
|
||||
(options) => new Promise<boolean>((resolve) => setPending({ options, resolve })),
|
||||
[],
|
||||
);
|
||||
|
||||
const answer = (value: boolean) => {
|
||||
if (pending) pending.resolve(value);
|
||||
setPending(null);
|
||||
};
|
||||
|
||||
const tone = pending?.options.tone ?? "default";
|
||||
|
||||
return (
|
||||
<ConfirmContext.Provider value={confirm}>
|
||||
{children}
|
||||
<Modal
|
||||
open={pending !== null}
|
||||
title={pending?.options.title ?? "Confirmation"}
|
||||
onClose={() => answer(false)}
|
||||
>
|
||||
<div className="flex flex-col gap-5">
|
||||
<p className="text-sm leading-relaxed text-muted-foreground">
|
||||
{pending?.options.message}
|
||||
</p>
|
||||
<div className="flex justify-end gap-2">
|
||||
<Button variant="ghost" size="md" onClick={() => answer(false)}>
|
||||
{pending?.options.cancelLabel ?? "Annuler"}
|
||||
</Button>
|
||||
<Button
|
||||
variant={tone === "danger" ? "destructive" : "primary"}
|
||||
size="md"
|
||||
autoFocus
|
||||
onClick={() => answer(true)}
|
||||
>
|
||||
{pending?.options.confirmLabel ?? "Confirmer"}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</ConfirmContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export const useConfirm = (): ConfirmFn => {
|
||||
const context = useContext(ConfirmContext);
|
||||
if (!context) throw new Error("useConfirm doit etre utilise sous ConfirmProvider");
|
||||
return context;
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useState, type FormEvent } from "react";
|
||||
import { Button, Input, cn } from "@cohaise/ui";
|
||||
import { Button, Input, cn } from "../ui/index.js";
|
||||
import {
|
||||
ApiError,
|
||||
api,
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { cn } from "@cohaise/ui";
|
||||
import { useEffect, type ReactNode } from "react";
|
||||
import { cn } from "../ui/index.js";
|
||||
import { CloseIcon } from "./icons.js";
|
||||
|
||||
export const Modal = ({
|
||||
@@ -11,13 +11,27 @@ export const Modal = ({
|
||||
open: boolean;
|
||||
title: string;
|
||||
onClose: () => void;
|
||||
children: React.ReactNode;
|
||||
children: ReactNode;
|
||||
}) => {
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
const onKeyDown = (event: KeyboardEvent) => {
|
||||
if (event.key === "Escape") onClose();
|
||||
};
|
||||
window.addEventListener("keydown", onKeyDown);
|
||||
const previousOverflow = document.body.style.overflow;
|
||||
document.body.style.overflow = "hidden";
|
||||
return () => {
|
||||
window.removeEventListener("keydown", onKeyDown);
|
||||
document.body.style.overflow = previousOverflow;
|
||||
};
|
||||
}, [open, onClose]);
|
||||
|
||||
if (!open) return null;
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
|
||||
<div
|
||||
className="absolute inset-0 bg-black/40"
|
||||
className="animate-overlay-in absolute inset-0 bg-black/40 backdrop-blur-[2px]"
|
||||
onClick={onClose}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
@@ -25,7 +39,7 @@ export const Modal = ({
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label={title}
|
||||
className="relative w-full max-w-md rounded-lg border border-border bg-surface p-4 shadow-lg"
|
||||
className="animate-panel-in relative w-full max-w-md rounded-lg border border-border bg-surface p-4 shadow-lg"
|
||||
>
|
||||
<div className="mb-4 flex items-center justify-between gap-4">
|
||||
<h2 className="font-display text-xs font-semibold uppercase tracking-label text-foreground">
|
||||
@@ -35,7 +49,7 @@ export const Modal = ({
|
||||
type="button"
|
||||
onClick={onClose}
|
||||
aria-label="Fermer"
|
||||
className="text-muted-foreground transition-colors hover:text-foreground"
|
||||
className="rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none"
|
||||
>
|
||||
<CloseIcon className="h-5 w-5" />
|
||||
</button>
|
||||
@@ -145,6 +145,12 @@ export const CloseIcon = (props: IconProps) => (
|
||||
</svg>
|
||||
);
|
||||
|
||||
export const ArrowLeftIcon = (props: IconProps) => (
|
||||
<svg {...base(props)}>
|
||||
<path d="M19 12H5M11 18l-6-6 6-6" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
export const PenIcon = (props: IconProps) => (
|
||||
<svg {...base(props)}>
|
||||
<path d="M4 20h4L18.5 9.5a2.1 2.1 0 0 0-3-3L5 17v3Z" />
|
||||
@@ -3,6 +3,7 @@ import { createRoot } from "react-dom/client";
|
||||
import { BrowserRouter } from "react-router-dom";
|
||||
import { App } from "./App.js";
|
||||
import { SessionProvider } from "./lib/session.js";
|
||||
import { ConfirmProvider } from "./components/confirm.js";
|
||||
import "./styles/index.css";
|
||||
|
||||
const container = document.getElementById("root");
|
||||
@@ -15,7 +16,9 @@ createRoot(container).render(
|
||||
<StrictMode>
|
||||
<BrowserRouter>
|
||||
<SessionProvider>
|
||||
<App />
|
||||
<ConfirmProvider>
|
||||
<App />
|
||||
</ConfirmProvider>
|
||||
</SessionProvider>
|
||||
</BrowserRouter>
|
||||
</StrictMode>,
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useRef, useState, type FormEvent } from "react";
|
||||
import { Button, Input, Spinner } from "@cohaise/ui";
|
||||
import { Button, Input, Spinner } from "../ui/index.js";
|
||||
import {
|
||||
ApiError,
|
||||
api,
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
type StorageLocation,
|
||||
} from "../lib/api.js";
|
||||
import { Alert, Badge, EmptyState, Modal, PageHeader } from "../components/feedback.js";
|
||||
import { useConfirm } from "../components/confirm.js";
|
||||
import { IconAction } from "../components/IconAction.js";
|
||||
import {
|
||||
ActivityIcon,
|
||||
@@ -38,6 +39,7 @@ const StatCard = ({ label, value }: { label: string; value: string }) => (
|
||||
);
|
||||
|
||||
export const AdminUsers = () => {
|
||||
const confirm = useConfirm();
|
||||
const [users, setUsers] = useState<AdminUser[] | null>(null);
|
||||
const [stats, setStats] = useState<AdminStats | null>(null);
|
||||
const [q, setQ] = useState("");
|
||||
@@ -95,7 +97,18 @@ export const AdminUsers = () => {
|
||||
};
|
||||
|
||||
const removeUser = async (user: AdminUser) => {
|
||||
if (!window.confirm(`Supprimer définitivement ${user.email} ?`)) return;
|
||||
const ok = await confirm({
|
||||
title: "Supprimer le membre",
|
||||
message: (
|
||||
<>
|
||||
Supprimer définitivement <span className="font-semibold text-foreground">{user.email}</span>{" "}
|
||||
ainsi que ses fichiers ? Cette action est irréversible.
|
||||
</>
|
||||
),
|
||||
confirmLabel: "Supprimer",
|
||||
tone: "danger",
|
||||
});
|
||||
if (!ok) return;
|
||||
setBusy(user.id);
|
||||
setError(null);
|
||||
try {
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { Button, Card, Spinner } from "@cohaise/ui";
|
||||
import { Button, Card, Spinner } from "../ui/index.js";
|
||||
import {
|
||||
ApiError,
|
||||
api,
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
} from "../lib/api.js";
|
||||
import { useSession } from "../lib/session.js";
|
||||
import { Alert, Badge, EmptyState, PageHeader } from "../components/feedback.js";
|
||||
import { useConfirm } from "../components/confirm.js";
|
||||
import { IconAction } from "../components/IconAction.js";
|
||||
import {
|
||||
CreateFolderDialog,
|
||||
@@ -17,6 +18,7 @@ import {
|
||||
ShareDialog,
|
||||
} from "../components/dialogs.js";
|
||||
import {
|
||||
ArrowLeftIcon,
|
||||
DownloadIcon,
|
||||
FileIcon,
|
||||
FolderIcon,
|
||||
@@ -48,6 +50,7 @@ const isImage = (file: UploadedFile): boolean =>
|
||||
|
||||
export const Browser = () => {
|
||||
const { user, refresh } = useSession();
|
||||
const confirm = useConfirm();
|
||||
const [path, setPath] = useState<Crumb[]>([{ id: null, name: "Racine" }]);
|
||||
const [folders, setFolders] = useState<Folder[]>([]);
|
||||
const [files, setFiles] = useState<UploadedFile[]>([]);
|
||||
@@ -111,7 +114,18 @@ export const Browser = () => {
|
||||
|
||||
const removeTarget = async (target: Target) => {
|
||||
const label = target.type === "folder" ? "ce dossier" : "ce fichier";
|
||||
if (!window.confirm(`Placer ${label} dans la corbeille ?`)) return;
|
||||
const ok = await confirm({
|
||||
title: "Mettre à la corbeille",
|
||||
message: (
|
||||
<>
|
||||
Placer <span className="font-semibold text-foreground">{target.name}</span> ({label}) dans la
|
||||
corbeille ?
|
||||
</>
|
||||
),
|
||||
confirmLabel: "Corbeille",
|
||||
tone: "danger",
|
||||
});
|
||||
if (!ok) return;
|
||||
setRemoving(target.id);
|
||||
setError(null);
|
||||
try {
|
||||
@@ -153,32 +167,45 @@ export const Browser = () => {
|
||||
description="Vos dossiers et fichiers. Envoyez un fichier ou créez un dossier."
|
||||
/>
|
||||
|
||||
<nav aria-label="Fil d'Ariane">
|
||||
<ol className="flex flex-wrap items-center gap-1.5 text-xs">
|
||||
{path.map((crumb, index) => (
|
||||
<li key={`${crumb.id ?? "root"}-${index}`} className="flex items-center gap-1.5">
|
||||
{index > 0 ? (
|
||||
<span className="text-border" aria-hidden="true">
|
||||
/
|
||||
</span>
|
||||
) : null}
|
||||
{index === path.length - 1 ? (
|
||||
<span className="font-medium text-foreground" aria-current="page">
|
||||
{crumb.name}
|
||||
</span>
|
||||
) : (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => goTo(index)}
|
||||
className="text-muted-foreground underline-offset-2 transition-colors hover:text-foreground hover:underline"
|
||||
>
|
||||
{crumb.name}
|
||||
</button>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</nav>
|
||||
<div className="flex flex-wrap items-center gap-3">
|
||||
{path.length > 1 ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => goTo(path.length - 2)}
|
||||
className="inline-flex items-center gap-1.5 rounded-sm border border-border-control bg-surface px-2.5 py-1.5 font-display text-[0.6875rem] font-semibold uppercase tracking-label text-foreground transition-colors duration-fast hover:bg-surface-hover focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none"
|
||||
>
|
||||
<ArrowLeftIcon className="h-3.5 w-3.5" />
|
||||
Retour
|
||||
</button>
|
||||
) : null}
|
||||
|
||||
<nav aria-label="Fil d'Ariane" className="min-w-0">
|
||||
<ol className="flex flex-wrap items-center gap-1.5 text-xs">
|
||||
{path.map((crumb, index) => (
|
||||
<li key={`${crumb.id ?? "root"}-${index}`} className="flex items-center gap-1.5">
|
||||
{index > 0 ? (
|
||||
<span className="text-border" aria-hidden="true">
|
||||
/
|
||||
</span>
|
||||
) : null}
|
||||
{index === path.length - 1 ? (
|
||||
<span className="font-medium text-foreground" aria-current="page">
|
||||
{crumb.name}
|
||||
</span>
|
||||
) : (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => goTo(index)}
|
||||
className="text-muted-foreground underline-offset-2 transition-colors hover:text-foreground hover:underline"
|
||||
>
|
||||
{crumb.name}
|
||||
</button>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<Card>
|
||||
<div className="flex flex-col gap-3 p-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
+16
-7
@@ -1,6 +1,6 @@
|
||||
import { useState, type FormEvent } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input } from "@cohaise/ui";
|
||||
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input } from "../ui/index.js";
|
||||
import { Alert } from "../components/feedback.js";
|
||||
import { ApiError, api } from "../lib/api.js";
|
||||
import { useSession } from "../lib/session.js";
|
||||
@@ -37,12 +37,21 @@ export const ChangePassword = () => {
|
||||
<main className="flex min-h-dvh items-center justify-center bg-background px-4 py-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display mt-2 text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Nouveau mot de passe
|
||||
</h1>
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Nouveau mot de passe
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<p className="mt-2 text-sm leading-relaxed text-muted-foreground">
|
||||
Bienvenue {user?.first_name ?? ""}. Ce mot de passe a été défini par un
|
||||
administrateur : choisissez le vôtre.
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Link, useSearchParams } from "react-router-dom";
|
||||
import { Button, Card, CardContent, CardHeader, CardTitle, Spinner } from "@cohaise/ui";
|
||||
import { Button, Card, CardContent, CardHeader, CardTitle, Spinner } from "../ui/index.js";
|
||||
import { Alert } from "../components/feedback.js";
|
||||
import { ApiError, api } from "../lib/api.js";
|
||||
import { useSession } from "../lib/session.js";
|
||||
@@ -37,12 +37,21 @@ export const ConfirmEmail = () => {
|
||||
<main className="flex min-h-dvh items-center justify-center bg-background px-4 py-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display mt-2 text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Changement d'adresse
|
||||
</h1>
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Changement d'adresse
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<Card>
|
||||
+16
-7
@@ -1,6 +1,6 @@
|
||||
import { useState, type FormEvent } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input } from "@cohaise/ui";
|
||||
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input } from "../ui/index.js";
|
||||
import { Alert } from "../components/feedback.js";
|
||||
import { ApiError, api } from "../lib/api.js";
|
||||
|
||||
@@ -28,12 +28,21 @@ export const ForgotPassword = () => {
|
||||
<main className="flex min-h-dvh items-center justify-center bg-background px-4 py-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display mt-2 text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Mot de passe oublié
|
||||
</h1>
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Mot de passe oublié
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<Card>
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Button, Spinner, cn } from "@cohaise/ui";
|
||||
import { Button, Spinner, cn } from "../ui/index.js";
|
||||
import { ApiError, api, formatBytes, type MediaItem } from "../lib/api.js";
|
||||
import { Alert, EmptyState, PageHeader } from "../components/feedback.js";
|
||||
import { FileIcon, ImageIcon } from "../components/icons.js";
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, type FormEvent } from "react";
|
||||
import { Link, Navigate, useNavigate } from "react-router-dom";
|
||||
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input } from "@cohaise/ui";
|
||||
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input } from "../ui/index.js";
|
||||
import { ApiError, api } from "../lib/api.js";
|
||||
import { useSession } from "../lib/session.js";
|
||||
|
||||
@@ -33,12 +33,21 @@ export const Login = () => {
|
||||
<main className="flex min-h-dvh items-center justify-center bg-background px-4 py-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display mt-2 text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Cloud
|
||||
</h1>
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Cloud
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<p className="mt-2 text-sm leading-relaxed text-muted-foreground">
|
||||
Connectez-vous pour accéder à vos fichiers.
|
||||
</p>
|
||||
@@ -1,12 +1,14 @@
|
||||
import { useEffect, useRef, useState, type FormEvent } from "react";
|
||||
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Spinner } from "@cohaise/ui";
|
||||
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Spinner } from "../ui/index.js";
|
||||
import { ApiError, api, formatDate, type SessionInfo } from "../lib/api.js";
|
||||
import { useSession } from "../lib/session.js";
|
||||
import { Alert, Badge, PageHeader } from "../components/feedback.js";
|
||||
import { useConfirm } from "../components/confirm.js";
|
||||
import { TrashIcon } from "../components/icons.js";
|
||||
|
||||
export const Profile = () => {
|
||||
const { user, refresh } = useSession();
|
||||
const confirm = useConfirm();
|
||||
|
||||
const [firstName, setFirstName] = useState(user?.first_name ?? "");
|
||||
const [lastName, setLastName] = useState(user?.last_name ?? "");
|
||||
@@ -107,7 +109,14 @@ export const Profile = () => {
|
||||
};
|
||||
|
||||
const revokeSession = async (session: SessionInfo) => {
|
||||
if (session.current && !window.confirm("Fermer la session en cours ?")) return;
|
||||
if (session.current) {
|
||||
const ok = await confirm({
|
||||
title: "Fermer la session",
|
||||
message: "Fermer la session en cours vous déconnectera immédiatement.",
|
||||
confirmLabel: "Fermer",
|
||||
});
|
||||
if (!ok) return;
|
||||
}
|
||||
setRevoking(session.id);
|
||||
setSessionsError(null);
|
||||
try {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, type FormEvent } from "react";
|
||||
import { Link, useSearchParams } from "react-router-dom";
|
||||
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input } from "@cohaise/ui";
|
||||
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input } from "../ui/index.js";
|
||||
import { Alert } from "../components/feedback.js";
|
||||
import { ApiError, api } from "../lib/api.js";
|
||||
|
||||
@@ -35,12 +35,21 @@ export const ResetPassword = () => {
|
||||
<main className="flex min-h-dvh items-center justify-center bg-background px-4 py-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<header className="mb-6 text-center">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display mt-2 text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Nouveau mot de passe
|
||||
</h1>
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt=""
|
||||
className="h-12 w-12 rounded-xl ring-1 ring-black/5"
|
||||
/>
|
||||
<div className="text-left">
|
||||
<p className="font-display text-xs font-semibold uppercase tracking-logo text-accent">
|
||||
CoHaiSe
|
||||
</p>
|
||||
<h1 className="font-display text-lg font-semibold uppercase tracking-label text-foreground">
|
||||
Nouveau mot de passe
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<Card>
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, type FormEvent } from "react";
|
||||
import { Button, Input, Spinner } from "@cohaise/ui";
|
||||
import { Button, Input, Spinner } from "../ui/index.js";
|
||||
import { ApiError, api, formatBytes, type Folder, type UploadedFile } from "../lib/api.js";
|
||||
import { Alert, EmptyState, PageHeader } from "../components/feedback.js";
|
||||
import { DownloadIcon, FileIcon, FolderIcon, SearchIcon } from "../components/icons.js";
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Button, Spinner } from "@cohaise/ui";
|
||||
import { Button, Spinner } from "../ui/index.js";
|
||||
import {
|
||||
ApiError,
|
||||
api,
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
type TrashFolder,
|
||||
} from "../lib/api.js";
|
||||
import { Alert, EmptyState, PageHeader } from "../components/feedback.js";
|
||||
import { useConfirm } from "../components/confirm.js";
|
||||
import { IconAction } from "../components/IconAction.js";
|
||||
import { FileIcon, FolderIcon, RestoreIcon, TrashIcon } from "../components/icons.js";
|
||||
|
||||
@@ -19,6 +20,7 @@ interface TrashData {
|
||||
}
|
||||
|
||||
export const Trash = () => {
|
||||
const confirm = useConfirm();
|
||||
const [data, setData] = useState<TrashData | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
@@ -54,11 +56,33 @@ export const Trash = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const emptyTrash = () => {
|
||||
if (!window.confirm("Vider définitivement la corbeille ?")) return;
|
||||
const emptyTrash = async () => {
|
||||
const ok = await confirm({
|
||||
title: "Vider la corbeille",
|
||||
message: "Tous les éléments seront définitivement supprimés. Cette action est irréversible.",
|
||||
confirmLabel: "Vider",
|
||||
tone: "danger",
|
||||
});
|
||||
if (!ok) return;
|
||||
void run("empty", () => api.emptyTrash());
|
||||
};
|
||||
|
||||
const purge = async (key: string, name: string, action: () => Promise<unknown>) => {
|
||||
const ok = await confirm({
|
||||
title: "Supprimer définitivement",
|
||||
message: (
|
||||
<>
|
||||
Supprimer définitivement <span className="font-semibold text-foreground">{name}</span> ?
|
||||
Cette action est irréversible.
|
||||
</>
|
||||
),
|
||||
confirmLabel: "Supprimer",
|
||||
tone: "danger",
|
||||
});
|
||||
if (!ok) return;
|
||||
void run(key, action);
|
||||
};
|
||||
|
||||
const empty = data !== null && data.folders.length === 0 && data.files.length === 0;
|
||||
|
||||
return (
|
||||
@@ -125,11 +149,11 @@ export const Trash = () => {
|
||||
icon={<TrashIcon className="h-4 w-4" />}
|
||||
tone="danger"
|
||||
isLoading={busy === `purge-${folder.id}`}
|
||||
onClick={() => {
|
||||
if (window.confirm(`Supprimer définitivement « ${folder.name} » ?`)) {
|
||||
void run(`purge-${folder.id}`, () => api.purgeFolder(folder.id));
|
||||
}
|
||||
}}
|
||||
onClick={() =>
|
||||
void purge(`purge-${folder.id}`, folder.name, () =>
|
||||
api.purgeFolder(folder.id),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</li>
|
||||
))}
|
||||
@@ -170,7 +194,7 @@ export const Trash = () => {
|
||||
isLoading={busy === `purge-${file.id}`}
|
||||
tone="danger"
|
||||
onClick={() =>
|
||||
void run(`purge-${file.id}`, () => api.purgeFile(file.id))
|
||||
void purge(`purge-${file.id}`, file.name, () => api.purgeFile(file.id))
|
||||
}
|
||||
/>
|
||||
</li>
|
||||
@@ -10,7 +10,7 @@
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url("../../fonts/poppins-400.woff2") format("woff2");
|
||||
src: url("../fonts/poppins-400.woff2") format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
|
||||
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
|
||||
U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
@@ -21,7 +21,7 @@
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
font-display: swap;
|
||||
src: url("../../fonts/poppins-600.woff2") format("woff2");
|
||||
src: url("../fonts/poppins-600.woff2") format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
|
||||
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
|
||||
U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
@@ -32,7 +32,7 @@
|
||||
font-style: normal;
|
||||
font-weight: 400 700;
|
||||
font-display: swap;
|
||||
src: url("../../fonts/jetbrains-mono-latin.woff2") format("woff2");
|
||||
src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
|
||||
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
|
||||
U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
@@ -43,7 +43,7 @@
|
||||
font-style: normal;
|
||||
font-weight: 400 900;
|
||||
font-display: swap;
|
||||
src: url("../../fonts/orbitron-latin.woff2") format("woff2");
|
||||
src: url("../fonts/orbitron-latin.woff2") format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
|
||||
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
|
||||
U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
@@ -54,7 +54,7 @@
|
||||
font-style: normal;
|
||||
font-weight: 400 900;
|
||||
font-display: swap;
|
||||
src: url("../../fonts/cinzel-latin.woff2") format("woff2");
|
||||
src: url("../fonts/cinzel-latin.woff2") format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
|
||||
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
|
||||
U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "tailwindcss";
|
||||
@import "./fonts.css";
|
||||
@import "./tokens.css";
|
||||
@import "./theme.css";
|
||||
@@ -103,3 +103,42 @@
|
||||
@utility duration-slow {
|
||||
transition-duration: var(--cohaise-duration-slow);
|
||||
}
|
||||
|
||||
/* Entree des surfaces modales (overlay + panneau). */
|
||||
@keyframes cohaise-overlay-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes cohaise-panel-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(0.5rem) scale(0.98);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@utility animate-overlay-in {
|
||||
animation: cohaise-overlay-in var(--cohaise-duration-base) var(--cohaise-ease-out-soft) both;
|
||||
}
|
||||
|
||||
@utility animate-panel-in {
|
||||
animation: cohaise-panel-in var(--cohaise-duration-base) var(--cohaise-ease-out-soft) both;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"jsx": "react-jsx",
|
||||
Reference in New Issue
Block a user