Admin : conception de la carte retravaillée
Étapes en pastilles numérotées (étapes passées cochées), six palettes de couleurs prêtes à l'emploi au contraste vérifié, idées de récompenses en un clic quand la liste est vide. Profite aussi à l'espace web du Dirigeant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
60c3a1d333
commit
0ec3827491
8 changed files with 78 additions and 30 deletions
|
|
@ -9,6 +9,19 @@ const STEPS = ['Identité', 'Couleurs', 'Règle de points', 'Récompenses', 'Ré
|
|||
|
||||
type Draft = Omit<CardDesign, 'logoUrl' | 'stripUrl'>;
|
||||
|
||||
/** Palettes prêtes à l'emploi : fond, texte, libellés. */
|
||||
const PALETTES: [string, string, string, string][] = [
|
||||
['Ardoise', '#1F2937', '#FFFFFF', '#D1D5DB'],
|
||||
['Émeraude', '#0E7A66', '#FFFFFF', '#CDEDE4'],
|
||||
['Brique', '#A64B17', '#FFF4E4', '#F7D58B'],
|
||||
['Marine', '#1E3A5F', '#FFFFFF', '#BFD3EA'],
|
||||
['Prune', '#5B2245', '#FFFFFF', '#E9C6DA'],
|
||||
['Crème', '#FFF8EC', '#3B2A1A', '#8A6A4A'],
|
||||
];
|
||||
|
||||
/** Récompenses courantes, pour démarrer vite. */
|
||||
const REWARD_IDEAS = ['Café offert', 'Viennoiserie offerte', 'Dessert offert', '-10 % sur le prochain achat'];
|
||||
|
||||
function defaults(store: Pick<StoreDetail, 'name'>): Draft {
|
||||
return {
|
||||
programName: `Fidélité ${store.name}`.slice(0, 40),
|
||||
|
|
@ -133,8 +146,9 @@ export function CardWizard({
|
|||
<ol className="steps" aria-label="Étapes">
|
||||
{STEPS.map((label, i) => (
|
||||
<li key={label}>
|
||||
<button type="button" aria-current={i === step ? 'step' : undefined} onClick={() => setStep(i)}>
|
||||
{i + 1} · {label}
|
||||
<button type="button" aria-current={i === step ? 'step' : undefined} className={i < step ? 'done' : undefined} onClick={() => setStep(i)}>
|
||||
<span className="n">{i < step ? '✓' : i + 1}</span>
|
||||
{label}
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
|
|
@ -178,6 +192,23 @@ export function CardWizard({
|
|||
{step === 1 && (
|
||||
<>
|
||||
<h2>Couleurs</h2>
|
||||
<div className="field">
|
||||
<span style={{ fontWeight: 600 }}>Palettes prêtes à l’emploi</span>
|
||||
<div className="palettes">
|
||||
{PALETTES.map(([name, bg, fg, lb]) => (
|
||||
<button
|
||||
key={name}
|
||||
type="button"
|
||||
className="palette"
|
||||
aria-pressed={draft.backgroundColor === bg && draft.foregroundColor === fg}
|
||||
onClick={() => setDraft({ ...draft, backgroundColor: bg, foregroundColor: fg, labelColor: lb })}
|
||||
>
|
||||
<span style={{ background: bg, color: fg }}>Aa</span>
|
||||
{name}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
{suggested && suggested !== draft.backgroundColor && (
|
||||
<div className="row" style={{ gap: 12 }}>
|
||||
<span style={{ width: 28, height: 28, borderRadius: 8, background: suggested, border: '1px solid var(--border)' }} />
|
||||
|
|
@ -311,7 +342,16 @@ function RewardsEditor({ rewards, unit, onChange }: { rewards: Reward[]; unit: s
|
|||
return (
|
||||
<>
|
||||
<h2>Récompenses</h2>
|
||||
{rewards.length === 0 && <p className="muted" style={{ margin: 0 }}>Aucune récompense. Exemple : « Café offert » pour 10 {unit}.</p>}
|
||||
{rewards.length === 0 && (
|
||||
<div className="field">
|
||||
<p className="muted" style={{ margin: 0 }}>Aucune récompense pour l’instant. Ajoutez-en une, ou partez d’une idée :</p>
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
{REWARD_IDEAS.map((label) => (
|
||||
<button key={label} type="button" className="chip" onClick={() => onChange([...rewards, { label, cost: 10 }])}>+ {label}</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{rewards.map((r, i) => (
|
||||
<div key={r.id ?? `new-${i}`} className="row" style={{ alignItems: 'flex-end', opacity: r.active === false ? 0.6 : 1 }}>
|
||||
<div className="field" style={{ flex: '1 1 240px' }}>
|
||||
|
|
|
|||
|
|
@ -160,13 +160,21 @@ dialog::backdrop { background: rgb(0 0 0 / 0.45); }
|
|||
|
||||
/* ── Assistant de carte ── */
|
||||
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
|
||||
@media (max-width: 1000px) { .wizard { grid-template-columns: 1fr; } }
|
||||
@media (max-width: 1000px) { .wizard { grid-template-columns: minmax(0, 1fr); } }
|
||||
.steps { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
|
||||
.steps button {
|
||||
height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
|
||||
color: var(--text-2); font: 600 14px 'Figtree', sans-serif; cursor: pointer;
|
||||
height: 42px; padding: 0 16px 0 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
|
||||
color: var(--text-2); font: 600 14px 'Figtree', sans-serif; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
|
||||
}
|
||||
.steps button .n { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; }
|
||||
.steps button.done { color: var(--ok); }
|
||||
.steps button.done .n { background: var(--ok-bg); color: var(--ok); }
|
||||
.steps button[aria-current='step'] { background: var(--primary); border-color: var(--primary); color: #fff; }
|
||||
.steps button[aria-current='step'] .n { background: rgb(255 255 255 / .2); color: #fff; }
|
||||
.palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
|
||||
.palette { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 6px 8px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text-2); font: 600 13px 'Figtree', sans-serif; cursor: pointer; }
|
||||
.palette span { height: 44px; border-radius: 8px; display: grid; place-items: center; font-size: 18px; font-weight: 800; }
|
||||
.palette[aria-pressed='true'] { border-color: var(--primary); }
|
||||
.preview-col { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; align-items: center; }
|
||||
.color-row { display: flex; align-items: center; gap: 12px; }
|
||||
.color-row input[type='color'] { width: 48px; height: 48px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 2px; background: var(--surface); }
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
site/assets/espace/index-Y3IqSL08.css
Normal file
1
site/assets/espace/index-Y3IqSL08.css
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -8,8 +8,8 @@
|
|||
<title>Affichette — MonEspacePro</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
|
||||
<script type="module" crossorigin src="/assets/espace/index-B2Kkb0_y.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-1qlvpGNx.css">
|
||||
<script type="module" crossorigin src="/assets/espace/index-C1V6PUCU.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-Y3IqSL08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
<title>Mon espace — MonEspacePro</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
|
||||
<script type="module" crossorigin src="/assets/espace/index-B2Kkb0_y.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-1qlvpGNx.css">
|
||||
<script type="module" crossorigin src="/assets/espace/index-C1V6PUCU.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-Y3IqSL08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
<title>Créer mon programme de fidélité — MonEspacePro</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
|
||||
<script type="module" crossorigin src="/assets/espace/index-B2Kkb0_y.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-1qlvpGNx.css">
|
||||
<script type="module" crossorigin src="/assets/espace/index-C1V6PUCU.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-Y3IqSL08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue