SPB Git forge

spb/spb-cloud

Public
10commits 1branches 0releases
3.2 MBsize
maindefault branch
1 h agolast push
JavaScript 56.7% TypeScript 42.6%
1.5 KB · 38 lines typescript
Raw Blame History
1/**2 * Préférences d'apparence SPB Cloud v3 (persistées en localStorage).3 * Le script inline de app/layout.tsx applique ces valeurs AVANT le premier4 * rendu (pas de flash) — garder les clés/valeurs synchronisées avec lui.5 */67export type ThemePref = "light" | "dark" | "system";8export type AccentId = "aurore" | "ocean" | "glacier" | "foret" | "corail" | "ambre" | "amethyste";9export type DensityPref = "comfortable" | "compact";1011export const PREF_KEYS = {12  theme: "spb-theme",13  accent: "spb-accent",14  density: "spb-density",15  motion: "spb-motion",16  sidebar: "spb-sidebar",17} as const;1819export const ACCENTS: { id: AccentId; label: string; hex: string; hint: string }[] = [20  { id: "aurore", label: "Aurore", hex: "#6366f1", hint: "Indigo — défaut" },21  { id: "ocean", label: "Océan", hex: "#3b82f6", hint: "Bleu classique" },22  { id: "glacier", label: "Glacier", hex: "#06b6d4", hint: "Cyan" },23  { id: "foret", label: "Forêt", hex: "#10b981", hint: "Émeraude" },24  { id: "corail", label: "Corail", hex: "#f43f5e", hint: "Rose" },25  { id: "ambre", label: "Ambre", hex: "#f59e0b", hint: "Doré" },26  { id: "amethyste", label: "Améthyste", hex: "#8b5cf6", hint: "Violet" },27];2829export const DEFAULT_ACCENT: AccentId = "aurore";30export const DEFAULT_THEME: ThemePref = "light";3132/** Quota d'affichage du stockage (500 Go — pas de quota dur côté serveur). */33export const STORAGE_QUOTA_BYTES = 500 * 1024 * 1024 * 1024;3435export function isAccentId(v: unknown): v is AccentId {36  return typeof v === "string" && ACCENTS.some((a) => a.id === v);37}38