create-modoock-app 2.3.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -7
- package/package.json +1 -1
- package/template/app/(main)/components/_shared.tsx +602 -0
- package/template/app/(main)/components/agenda/page.tsx +48 -0
- package/template/app/(main)/components/badges/page.tsx +42 -0
- package/template/app/(main)/components/barres-de-metrique/page.tsx +40 -0
- package/template/app/(main)/components/boutons/page.tsx +142 -0
- package/template/app/(main)/components/champs/page.tsx +175 -0
- package/template/app/(main)/components/date-picker/page.tsx +48 -0
- package/template/app/(main)/components/icones/page.tsx +96 -0
- package/template/app/(main)/components/loader/page.tsx +81 -0
- package/template/app/(main)/components/modale/page.tsx +48 -0
- package/template/app/(main)/components/onglets/page.tsx +36 -0
- package/template/app/(main)/components/page.tsx +130 -825
- package/template/app/(main)/components/selecteurs/page.tsx +49 -0
- package/template/app/(main)/components/stepper/page.tsx +69 -0
- package/template/app/(main)/components/tableau/page.tsx +67 -0
- package/template/app/(main)/design-system/page.tsx +15 -3
- package/template/app/(main)/documentation/page.tsx +413 -0
- package/template/app/(main)/layout.tsx +2 -0
- package/template/app/globals.css +3 -3
- package/template/app/layout.tsx +1 -1
- package/template/components/layout/side-nav.tsx +118 -61
- package/template/lib/scroll-to-section.ts +38 -0
- package/template/next.config.ts +0 -17
- package/template/package-lock.json +459 -314
- package/template/package.json +2 -0
- package/template/sgconfig.yml +1 -1
- package/template/tsconfig.json +41 -71
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
import { Icon } from "@modoock/components";
|
|
3
|
+
import type { IconName, IconVariant } from "@modoock/components";
|
|
4
|
+
|
|
5
|
+
type Tone = "primary" | "success" | "info" | "accent";
|
|
6
|
+
|
|
7
|
+
const TONE: Record<Tone, { surface: string; icon: IconVariant }> = {
|
|
8
|
+
primary: {
|
|
9
|
+
surface: "bg-primary-light",
|
|
10
|
+
icon: "primary",
|
|
11
|
+
},
|
|
12
|
+
success: {
|
|
13
|
+
surface: "bg-success-light",
|
|
14
|
+
icon: "success",
|
|
15
|
+
},
|
|
16
|
+
info: {
|
|
17
|
+
surface: "bg-info-light",
|
|
18
|
+
icon: "default",
|
|
19
|
+
},
|
|
20
|
+
accent: {
|
|
21
|
+
surface: "bg-accent-light",
|
|
22
|
+
icon: "default",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function SectionHeader({
|
|
27
|
+
title,
|
|
28
|
+
description,
|
|
29
|
+
icon,
|
|
30
|
+
}: {
|
|
31
|
+
title: string;
|
|
32
|
+
description: string;
|
|
33
|
+
icon: IconName;
|
|
34
|
+
}) {
|
|
35
|
+
return (
|
|
36
|
+
<div className="mb-component">
|
|
37
|
+
<div className="flex items-center gap-inline">
|
|
38
|
+
<Icon name={icon} size="default" variant="primary" />
|
|
39
|
+
<h2 className="text-section-title text-foreground">{title}</h2>
|
|
40
|
+
</div>
|
|
41
|
+
<p className="mt-inline max-w-2xl text-body text-muted-foreground">
|
|
42
|
+
{description}
|
|
43
|
+
</p>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function PillarCard({
|
|
49
|
+
icon,
|
|
50
|
+
title,
|
|
51
|
+
description,
|
|
52
|
+
}: {
|
|
53
|
+
icon: IconName;
|
|
54
|
+
title: string;
|
|
55
|
+
description: string;
|
|
56
|
+
}) {
|
|
57
|
+
return (
|
|
58
|
+
<article className="flex h-full flex-col gap-inline rounded-large border border-border bg-surface p-component">
|
|
59
|
+
<div className="flex size-9 items-center justify-center rounded-medium bg-primary-light">
|
|
60
|
+
<Icon name={icon} size="small" variant="primary" />
|
|
61
|
+
</div>
|
|
62
|
+
<div>
|
|
63
|
+
<h3 className="text-component-title text-foreground">{title}</h3>
|
|
64
|
+
<p className="mt-micro text-small text-muted-foreground">{description}</p>
|
|
65
|
+
</div>
|
|
66
|
+
</article>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function JourneyStep({
|
|
71
|
+
step,
|
|
72
|
+
title,
|
|
73
|
+
description,
|
|
74
|
+
icon,
|
|
75
|
+
tone,
|
|
76
|
+
isLast,
|
|
77
|
+
}: {
|
|
78
|
+
step: string;
|
|
79
|
+
title: string;
|
|
80
|
+
description: string;
|
|
81
|
+
icon: IconName;
|
|
82
|
+
tone: Tone;
|
|
83
|
+
isLast?: boolean;
|
|
84
|
+
}) {
|
|
85
|
+
const t = TONE[tone];
|
|
86
|
+
return (
|
|
87
|
+
<li className="relative flex gap-component">
|
|
88
|
+
<div className="flex flex-col items-center">
|
|
89
|
+
<div
|
|
90
|
+
className={`flex size-10 shrink-0 items-center justify-center rounded-full ${t.surface}`}
|
|
91
|
+
>
|
|
92
|
+
<Icon name={icon} size="small" variant={t.icon} />
|
|
93
|
+
</div>
|
|
94
|
+
{!isLast && (
|
|
95
|
+
<div className="mt-inline w-px flex-1 bg-border" aria-hidden />
|
|
96
|
+
)}
|
|
97
|
+
</div>
|
|
98
|
+
<div className={isLast ? "" : "pb-component"}>
|
|
99
|
+
<p className="text-label uppercase tracking-[0.12em] text-muted-foreground">
|
|
100
|
+
Étape {step}
|
|
101
|
+
</p>
|
|
102
|
+
<h3 className="mt-micro text-component-title text-foreground">{title}</h3>
|
|
103
|
+
<p className="mt-micro max-w-xl text-body text-muted-foreground">
|
|
104
|
+
{description}
|
|
105
|
+
</p>
|
|
106
|
+
</div>
|
|
107
|
+
</li>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function PrincipleRow({
|
|
112
|
+
icon,
|
|
113
|
+
title,
|
|
114
|
+
description,
|
|
115
|
+
tone,
|
|
116
|
+
}: {
|
|
117
|
+
icon: IconName;
|
|
118
|
+
title: string;
|
|
119
|
+
description: string;
|
|
120
|
+
tone: Tone;
|
|
121
|
+
}) {
|
|
122
|
+
const t = TONE[tone];
|
|
123
|
+
return (
|
|
124
|
+
<div className="flex gap-component rounded-large border border-border bg-surface p-component">
|
|
125
|
+
<div
|
|
126
|
+
className={`flex size-9 shrink-0 items-center justify-center rounded-medium ${t.surface}`}
|
|
127
|
+
>
|
|
128
|
+
<Icon name={icon} size="small" variant={t.icon} />
|
|
129
|
+
</div>
|
|
130
|
+
<div className="min-w-0">
|
|
131
|
+
<h3 className="text-component-title text-foreground">{title}</h3>
|
|
132
|
+
<p className="mt-micro text-small text-muted-foreground">{description}</p>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const PILLARS = [
|
|
139
|
+
{
|
|
140
|
+
icon: "Palette" as const,
|
|
141
|
+
title: "Identité visuelle",
|
|
142
|
+
description:
|
|
143
|
+
"Couleurs, typographie et rythme partagés. Chaque écran parle la même voix.",
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
icon: "Puzzle" as const,
|
|
147
|
+
title: "Composants prêts",
|
|
148
|
+
description:
|
|
149
|
+
"Des blocs éprouvés. Composer plutôt que reconstruire.",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
icon: "LayoutDashboard" as const,
|
|
153
|
+
title: "Écrans clairs",
|
|
154
|
+
description:
|
|
155
|
+
"Un écran, un objectif. Le détail s’ouvre au moment utile.",
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
icon: "ShieldCheck" as const,
|
|
159
|
+
title: "Cadre partagé",
|
|
160
|
+
description:
|
|
161
|
+
"Des conventions communes. Moins d’interprétation, plus de qualité.",
|
|
162
|
+
},
|
|
163
|
+
];
|
|
164
|
+
|
|
165
|
+
const JOURNEY = [
|
|
166
|
+
{
|
|
167
|
+
step: "01",
|
|
168
|
+
title: "Créer votre espace",
|
|
169
|
+
description:
|
|
170
|
+
"Démarrez un projet Modoock. La base visuelle, les composants et le cadre sont déjà en place.",
|
|
171
|
+
icon: "Rocket" as const,
|
|
172
|
+
tone: "primary" as const,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
step: "02",
|
|
176
|
+
title: "Explorer le socle",
|
|
177
|
+
description:
|
|
178
|
+
"Parcourez le design system et le catalogue. Voyez ce qui existe avant d’inventer.",
|
|
179
|
+
icon: "Compass" as const,
|
|
180
|
+
tone: "info" as const,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
step: "03",
|
|
184
|
+
title: "Composer vos métiers",
|
|
185
|
+
description:
|
|
186
|
+
"Assemblez listes, fiches et parcours avec les mêmes briques.",
|
|
187
|
+
icon: "Layers" as const,
|
|
188
|
+
tone: "accent" as const,
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
step: "04",
|
|
192
|
+
title: "Livrer avec confiance",
|
|
193
|
+
description:
|
|
194
|
+
"Gardez le même niveau de clarté d’une page à l’autre.",
|
|
195
|
+
icon: "BadgeCheck" as const,
|
|
196
|
+
tone: "success" as const,
|
|
197
|
+
},
|
|
198
|
+
];
|
|
199
|
+
|
|
200
|
+
const PRINCIPLES = [
|
|
201
|
+
{
|
|
202
|
+
icon: "FolderTree" as const,
|
|
203
|
+
title: "Respecter l’organisation",
|
|
204
|
+
description:
|
|
205
|
+
"Interface générique, structure de l’app, blocs métier partagés — chaque chose a sa place.",
|
|
206
|
+
tone: "primary" as const,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
icon: "Recycle" as const,
|
|
210
|
+
title: "Réutiliser avant d’ajouter",
|
|
211
|
+
description:
|
|
212
|
+
"Chercher d’abord ce qui existe. Étendre un composant connu coûte moins cher.",
|
|
213
|
+
tone: "success" as const,
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
icon: "Focus" as const,
|
|
217
|
+
title: "Un écran, une intention",
|
|
218
|
+
description:
|
|
219
|
+
"Une liste pour une entité. Une fiche pour le détail. Pas de métiers mélangés.",
|
|
220
|
+
tone: "info" as const,
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
icon: "MessageSquareText" as const,
|
|
224
|
+
title: "Parler le langage de l’utilisateur",
|
|
225
|
+
description:
|
|
226
|
+
"Français, mots directs, actions claires. L’interface explique l’état, pas la technique.",
|
|
227
|
+
tone: "accent" as const,
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
icon: "CircleQuestionMark" as const,
|
|
231
|
+
title: "Demander plutôt qu’assumer",
|
|
232
|
+
description:
|
|
233
|
+
"Besoin non tranché → question. Une décision partagée vaut mieux qu’une invention.",
|
|
234
|
+
tone: "primary" as const,
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
icon: "Sparkles" as const,
|
|
238
|
+
title: "Garder la simplicité",
|
|
239
|
+
description:
|
|
240
|
+
"Pas de détail « au cas où ». Chaque élément justifie sa présence.",
|
|
241
|
+
tone: "success" as const,
|
|
242
|
+
},
|
|
243
|
+
];
|
|
244
|
+
|
|
245
|
+
const APPROACH = [
|
|
246
|
+
{
|
|
247
|
+
icon: "Lightbulb" as const,
|
|
248
|
+
label: "Intention",
|
|
249
|
+
title: "Clarifier le besoin",
|
|
250
|
+
description:
|
|
251
|
+
"Une demande précise délimite l’écran. On construit ce qui a été demandé.",
|
|
252
|
+
tone: "primary" as const,
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
icon: "Boxes" as const,
|
|
256
|
+
label: "Composition",
|
|
257
|
+
title: "Assembler les briques",
|
|
258
|
+
description:
|
|
259
|
+
"Listes, fiches et états s’appuient sur les mêmes composants.",
|
|
260
|
+
tone: "accent" as const,
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
icon: "CheckCheck" as const,
|
|
264
|
+
label: "Qualité",
|
|
265
|
+
title: "Vérifier la lecture",
|
|
266
|
+
description:
|
|
267
|
+
"Hiérarchie, libellés et états vides ou en erreur font partie du livrable.",
|
|
268
|
+
tone: "success" as const,
|
|
269
|
+
},
|
|
270
|
+
];
|
|
271
|
+
|
|
272
|
+
export default function DocumentationPage() {
|
|
273
|
+
return (
|
|
274
|
+
<main className="flex flex-col">
|
|
275
|
+
<div className="page-container">
|
|
276
|
+
<section className="border-b border-border py-section">
|
|
277
|
+
<h2 className="text-section-title text-foreground">
|
|
278
|
+
Qu'est-ce que le boilerplate Modoock ?
|
|
279
|
+
</h2>
|
|
280
|
+
<p className="mt-inline max-w-2xl text-body text-muted-foreground">
|
|
281
|
+
Le boilerplate Modoock est le socle commun des produits Modoock :
|
|
282
|
+
identité visuelle, composants prêts à composer et principes pour
|
|
283
|
+
des interfaces immédiatement lisibles.
|
|
284
|
+
</p>
|
|
285
|
+
</section>
|
|
286
|
+
|
|
287
|
+
<section
|
|
288
|
+
id="fondations"
|
|
289
|
+
className="scroll-mt-component border-b border-border py-section"
|
|
290
|
+
>
|
|
291
|
+
<SectionHeader
|
|
292
|
+
title="Pourquoi ce cadre existe"
|
|
293
|
+
description="Accélérer le démarrage sans sacrifier la qualité. Chaque projet commence au même niveau d’exigence."
|
|
294
|
+
icon="Target"
|
|
295
|
+
/>
|
|
296
|
+
<div className="grid gap-inline sm:grid-cols-2 xl:grid-cols-4">
|
|
297
|
+
{PILLARS.map((pillar) => (
|
|
298
|
+
<PillarCard key={pillar.title} {...pillar} />
|
|
299
|
+
))}
|
|
300
|
+
</div>
|
|
301
|
+
</section>
|
|
302
|
+
|
|
303
|
+
<section
|
|
304
|
+
id="approche"
|
|
305
|
+
className="scroll-mt-component border-b border-border bg-surface-muted/50 py-section"
|
|
306
|
+
>
|
|
307
|
+
<SectionHeader
|
|
308
|
+
title="Comment le cadre guide le travail"
|
|
309
|
+
description="De l’idée à l’écran : comprendre le besoin, composer avec l’existant, vérifier la clarté."
|
|
310
|
+
icon="Waypoints"
|
|
311
|
+
/>
|
|
312
|
+
<div className="grid gap-inline lg:grid-cols-3">
|
|
313
|
+
{APPROACH.map((item) => {
|
|
314
|
+
const t = TONE[item.tone];
|
|
315
|
+
return (
|
|
316
|
+
<article
|
|
317
|
+
key={item.title}
|
|
318
|
+
className="rounded-large border border-border bg-surface p-component"
|
|
319
|
+
>
|
|
320
|
+
<div
|
|
321
|
+
className={`mb-inline flex size-9 items-center justify-center rounded-medium ${t.surface}`}
|
|
322
|
+
>
|
|
323
|
+
<Icon name={item.icon} size="small" variant={t.icon} />
|
|
324
|
+
</div>
|
|
325
|
+
<p className="text-label uppercase tracking-[0.12em] text-muted-foreground">
|
|
326
|
+
{item.label}
|
|
327
|
+
</p>
|
|
328
|
+
<h3 className="mt-micro text-component-title text-foreground">
|
|
329
|
+
{item.title}
|
|
330
|
+
</h3>
|
|
331
|
+
<p className="mt-micro text-small text-muted-foreground">
|
|
332
|
+
{item.description}
|
|
333
|
+
</p>
|
|
334
|
+
</article>
|
|
335
|
+
);
|
|
336
|
+
})}
|
|
337
|
+
</div>
|
|
338
|
+
</section>
|
|
339
|
+
|
|
340
|
+
<section
|
|
341
|
+
id="parcours"
|
|
342
|
+
className="scroll-mt-component border-b border-border py-section"
|
|
343
|
+
>
|
|
344
|
+
<SectionHeader
|
|
345
|
+
title="Prendre en main le boilerplate"
|
|
346
|
+
description="Quatre étapes pour passer du socle à un module métier cohérent."
|
|
347
|
+
icon="Map"
|
|
348
|
+
/>
|
|
349
|
+
<ol className="max-w-2xl">
|
|
350
|
+
{JOURNEY.map((item, index) => (
|
|
351
|
+
<JourneyStep
|
|
352
|
+
key={item.step}
|
|
353
|
+
{...item}
|
|
354
|
+
isLast={index === JOURNEY.length - 1}
|
|
355
|
+
/>
|
|
356
|
+
))}
|
|
357
|
+
</ol>
|
|
358
|
+
</section>
|
|
359
|
+
|
|
360
|
+
<section
|
|
361
|
+
id="principes"
|
|
362
|
+
className="scroll-mt-component border-b border-border py-section"
|
|
363
|
+
>
|
|
364
|
+
<SectionHeader
|
|
365
|
+
title="Principes pour bien construire ensemble"
|
|
366
|
+
description="Des repères simples pour garder le produit lisible quand l’équipe grandit."
|
|
367
|
+
icon="Users"
|
|
368
|
+
/>
|
|
369
|
+
<div className="grid gap-inline md:grid-cols-2">
|
|
370
|
+
{PRINCIPLES.map((item) => (
|
|
371
|
+
<PrincipleRow key={item.title} {...item} />
|
|
372
|
+
))}
|
|
373
|
+
</div>
|
|
374
|
+
</section>
|
|
375
|
+
|
|
376
|
+
<section id="suite" className="scroll-mt-component py-section">
|
|
377
|
+
<div className="flex flex-col gap-component rounded-large border border-primary-muted bg-primary-light p-component sm:flex-row sm:items-center sm:justify-between sm:gap-section">
|
|
378
|
+
<div className="flex gap-component">
|
|
379
|
+
<div className="flex size-10 shrink-0 items-center justify-center rounded-medium bg-primary">
|
|
380
|
+
<Icon name="BookOpen" size="small" variant="white" />
|
|
381
|
+
</div>
|
|
382
|
+
<div>
|
|
383
|
+
<h2 className="text-component-title text-foreground">
|
|
384
|
+
Continuer l’exploration
|
|
385
|
+
</h2>
|
|
386
|
+
<p className="mt-micro max-w-xl text-small text-muted-foreground">
|
|
387
|
+
Le design system montre le langage visuel. Le catalogue montre
|
|
388
|
+
ce que vous pouvez assembler dès maintenant.
|
|
389
|
+
</p>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
<div className="flex flex-wrap gap-inline">
|
|
393
|
+
<Link
|
|
394
|
+
href="/design-system"
|
|
395
|
+
className="inline-flex items-center gap-micro rounded-large bg-primary px-component py-inline text-label text-primary-foreground transition-colors hover:bg-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
|
|
396
|
+
>
|
|
397
|
+
Design system
|
|
398
|
+
<Icon name="ArrowRight" size="small" variant="white" />
|
|
399
|
+
</Link>
|
|
400
|
+
<Link
|
|
401
|
+
href="/components"
|
|
402
|
+
className="inline-flex items-center gap-micro rounded-large border border-border bg-surface px-component py-inline text-label text-foreground transition-colors hover:bg-surface-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
|
|
403
|
+
>
|
|
404
|
+
Composants
|
|
405
|
+
<Icon name="ArrowRight" size="small" variant="muted" />
|
|
406
|
+
</Link>
|
|
407
|
+
</div>
|
|
408
|
+
</div>
|
|
409
|
+
</section>
|
|
410
|
+
</div>
|
|
411
|
+
</main>
|
|
412
|
+
);
|
|
413
|
+
}
|
package/template/app/globals.css
CHANGED
|
@@ -93,9 +93,9 @@
|
|
|
93
93
|
|
|
94
94
|
/* Radius */
|
|
95
95
|
|
|
96
|
-
--radius-small: 0.
|
|
97
|
-
--radius-medium: 0.
|
|
98
|
-
--radius-large:
|
|
96
|
+
--radius-small: 0.25rem; /* Used for compact UI elements. (Ex: small controls, tags and badges.) */
|
|
97
|
+
--radius-medium: 0.50rem; /* Used for standard interactive components. (Ex: buttons, inputs, selects and dropdowns.) */
|
|
98
|
+
--radius-large: 0.70rem; /* Used for larger containers and surfaces. (Ex: cards, panels and major content blocks.) */
|
|
99
99
|
--radius-full: 9999rem; /* Used for fully rounded elements. (Ex: pills, badges, avatars and circular buttons.) */
|
|
100
100
|
|
|
101
101
|
/* Layout */
|
package/template/app/layout.tsx
CHANGED
|
@@ -21,7 +21,7 @@ export default function RootLayout({ children }: LayoutProps<"/">) {
|
|
|
21
21
|
return (
|
|
22
22
|
<html lang="fr" className={`${montserrat.className} antialiased`}>
|
|
23
23
|
<body className="flex h-screen overflow-hidden bg-background">
|
|
24
|
-
|
|
24
|
+
{children}
|
|
25
25
|
</body>
|
|
26
26
|
</html>
|
|
27
27
|
);
|