create-modoock-app 2.3.1 → 2.4.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 +386 -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 +135 -0
- package/template/app/(main)/components/champs/page.tsx +175 -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 +118 -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 +13 -1
- package/template/app/(main)/documentation/page.tsx +413 -0
- package/template/app/(main)/layout.tsx +2 -0
- package/template/app/layout.tsx +1 -1
- package/template/components/layout/side-nav.tsx +116 -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,175 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Icon, Input, Textarea } from "@modoock/components";
|
|
4
|
+
import { DemoCard, ShowcaseShell } from "../_shared";
|
|
5
|
+
|
|
6
|
+
export default function ChampsPage() {
|
|
7
|
+
return (
|
|
8
|
+
<ShowcaseShell
|
|
9
|
+
title="Champs de saisie"
|
|
10
|
+
subtitle={
|
|
11
|
+
<>
|
|
12
|
+
Composants <code className="font-mono">Input</code> et{" "}
|
|
13
|
+
<code className="font-mono">Textarea</code>
|
|
14
|
+
</>
|
|
15
|
+
}
|
|
16
|
+
usage="Utilisez Input pour une saisie courte et Textarea pour un texte long. Préférez ces composants à un champ HTML brut : libellé, aide, erreur et compteur sont déjà prévus."
|
|
17
|
+
importCode={`import { Input, Textarea } from "@modoock/components";`}
|
|
18
|
+
>
|
|
19
|
+
<div className="grid gap-component md:grid-cols-2">
|
|
20
|
+
<DemoCard
|
|
21
|
+
title="Par défaut"
|
|
22
|
+
code={`<Input placeholder="Saisissez du texte…" />`}
|
|
23
|
+
>
|
|
24
|
+
<Input placeholder="Saisissez du texte…" />
|
|
25
|
+
</DemoCard>
|
|
26
|
+
<DemoCard
|
|
27
|
+
title="Avec libellé & requis"
|
|
28
|
+
code={`<Input
|
|
29
|
+
label="Adresse e-mail"
|
|
30
|
+
required
|
|
31
|
+
placeholder="vous@exemple.com"
|
|
32
|
+
/>`}
|
|
33
|
+
>
|
|
34
|
+
<Input label="Adresse e-mail" required placeholder="vous@exemple.com" />
|
|
35
|
+
</DemoCard>
|
|
36
|
+
<DemoCard
|
|
37
|
+
title="Icone à gauche"
|
|
38
|
+
code={`<Input
|
|
39
|
+
icon={<Icon name="Search" size="small" />}
|
|
40
|
+
placeholder="Rechercher…"
|
|
41
|
+
/>`}
|
|
42
|
+
>
|
|
43
|
+
<Input icon={<Icon name="Search" size="small" />} placeholder="Rechercher…" />
|
|
44
|
+
</DemoCard>
|
|
45
|
+
<DemoCard
|
|
46
|
+
title="Champ désactivé"
|
|
47
|
+
code={`<Input
|
|
48
|
+
label="Nom d'utilisateur"
|
|
49
|
+
disabled
|
|
50
|
+
defaultValue="imane.mbarek"
|
|
51
|
+
/>`}
|
|
52
|
+
>
|
|
53
|
+
<Input label="Nom d'utilisateur" disabled defaultValue="imane.mbarek" />
|
|
54
|
+
</DemoCard>
|
|
55
|
+
<DemoCard
|
|
56
|
+
title="Champ valide"
|
|
57
|
+
code={`<Input
|
|
58
|
+
label="E-mail renseigné"
|
|
59
|
+
state="valid"
|
|
60
|
+
defaultValue="imane@modoock.com"
|
|
61
|
+
helper="Adresse vérifiée avec succès."
|
|
62
|
+
/>`}
|
|
63
|
+
>
|
|
64
|
+
<Input
|
|
65
|
+
label="E-mail renseigné"
|
|
66
|
+
state="valid"
|
|
67
|
+
defaultValue="imane@modoock.com"
|
|
68
|
+
helper="Adresse vérifiée avec succès."
|
|
69
|
+
/>
|
|
70
|
+
</DemoCard>
|
|
71
|
+
<DemoCard
|
|
72
|
+
title="Champ invalide avec erreur"
|
|
73
|
+
code={`<Input
|
|
74
|
+
label="Mot de passe"
|
|
75
|
+
required
|
|
76
|
+
state="invalid"
|
|
77
|
+
error="Le mot de passe doit contenir au moins 8 caractères."
|
|
78
|
+
defaultValue="1234"
|
|
79
|
+
/>`}
|
|
80
|
+
>
|
|
81
|
+
<Input
|
|
82
|
+
label="Mot de passe"
|
|
83
|
+
required
|
|
84
|
+
state="invalid"
|
|
85
|
+
error="Le mot de passe doit contenir au moins 8 caractères."
|
|
86
|
+
defaultValue="1234"
|
|
87
|
+
/>
|
|
88
|
+
</DemoCard>
|
|
89
|
+
<DemoCard
|
|
90
|
+
title="Mot de passe (afficher / masquer)"
|
|
91
|
+
code={`<Input
|
|
92
|
+
label="Mot de passe"
|
|
93
|
+
type="password"
|
|
94
|
+
icon={<Icon name="Lock" size="small" />}
|
|
95
|
+
placeholder="••••••••"
|
|
96
|
+
/>`}
|
|
97
|
+
>
|
|
98
|
+
<Input
|
|
99
|
+
label="Mot de passe"
|
|
100
|
+
type="password"
|
|
101
|
+
icon={<Icon name="Lock" size="small" />}
|
|
102
|
+
placeholder="••••••••"
|
|
103
|
+
helper="L'icône permet de révéler ou masquer la saisie."
|
|
104
|
+
/>
|
|
105
|
+
</DemoCard>
|
|
106
|
+
<DemoCard
|
|
107
|
+
title="Effaçable + compteur"
|
|
108
|
+
code={`<Input
|
|
109
|
+
label="Nom complet"
|
|
110
|
+
clearable
|
|
111
|
+
counter
|
|
112
|
+
maxLength={50}
|
|
113
|
+
defaultValue="Imane Ait Mbarek"
|
|
114
|
+
/>`}
|
|
115
|
+
>
|
|
116
|
+
<Input
|
|
117
|
+
label="Nom complet"
|
|
118
|
+
clearable
|
|
119
|
+
counter
|
|
120
|
+
maxLength={50}
|
|
121
|
+
defaultValue="Imane Ait Mbarek"
|
|
122
|
+
helper="Utiliser la croix pour vider le champ."
|
|
123
|
+
/>
|
|
124
|
+
</DemoCard>
|
|
125
|
+
<DemoCard
|
|
126
|
+
title="Suffixe (unité)"
|
|
127
|
+
code={`<Input
|
|
128
|
+
label="Montant"
|
|
129
|
+
defaultValue="1280"
|
|
130
|
+
trailingIcon={<Icon name="Euro" size="small" />}
|
|
131
|
+
/>`}
|
|
132
|
+
>
|
|
133
|
+
<Input
|
|
134
|
+
label="Montant"
|
|
135
|
+
defaultValue="1280"
|
|
136
|
+
trailingIcon={<Icon name="Euro" size="small" />}
|
|
137
|
+
/>
|
|
138
|
+
</DemoCard>
|
|
139
|
+
<DemoCard
|
|
140
|
+
title="Aide contextuelle"
|
|
141
|
+
code={`<Input
|
|
142
|
+
label="Numéro de téléphone"
|
|
143
|
+
placeholder="+212 6 00 00 00 00"
|
|
144
|
+
helper="Format national ou international accepté."
|
|
145
|
+
/>`}
|
|
146
|
+
>
|
|
147
|
+
<Input
|
|
148
|
+
label="Numéro de téléphone"
|
|
149
|
+
placeholder="+212 6 00 00 00 00"
|
|
150
|
+
helper="Format national ou international accepté."
|
|
151
|
+
/>
|
|
152
|
+
</DemoCard>
|
|
153
|
+
<DemoCard
|
|
154
|
+
title="Zone de texte (Textarea)"
|
|
155
|
+
code={`<Textarea
|
|
156
|
+
label="Description"
|
|
157
|
+
required
|
|
158
|
+
counter
|
|
159
|
+
maxLength={200}
|
|
160
|
+
placeholder="Décrivez brièvement…"
|
|
161
|
+
/>`}
|
|
162
|
+
>
|
|
163
|
+
<Textarea
|
|
164
|
+
label="Description"
|
|
165
|
+
required
|
|
166
|
+
counter
|
|
167
|
+
maxLength={200}
|
|
168
|
+
placeholder="Décrivez brièvement…"
|
|
169
|
+
helper="200 caractères maximum."
|
|
170
|
+
/>
|
|
171
|
+
</DemoCard>
|
|
172
|
+
</div>
|
|
173
|
+
</ShowcaseShell>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Icon } from "@modoock/components";
|
|
4
|
+
import { DemoCard, ShowcaseShell } from "../_shared";
|
|
5
|
+
|
|
6
|
+
export default function IconesPage() {
|
|
7
|
+
return (
|
|
8
|
+
<ShowcaseShell
|
|
9
|
+
title="Icônes"
|
|
10
|
+
subtitle={
|
|
11
|
+
<>
|
|
12
|
+
Composant <code className="font-mono">Icon</code>
|
|
13
|
+
</>
|
|
14
|
+
}
|
|
15
|
+
usage="Passez toujours par Icon (noms Lucide). Choisissez size et variant du Design System — ne pas importer lucide-react directement dans les pages."
|
|
16
|
+
importCode={`import { Icon } from "@modoock/components";`}
|
|
17
|
+
>
|
|
18
|
+
<div className="grid gap-component md:grid-cols-2">
|
|
19
|
+
<DemoCard
|
|
20
|
+
title="Défaut"
|
|
21
|
+
description='variant="default"'
|
|
22
|
+
code={`<Icon name="Search" size="large" />`}
|
|
23
|
+
>
|
|
24
|
+
<div className="flex h-20 items-center justify-center rounded-large bg-surface-muted">
|
|
25
|
+
<Icon name="Search" size="large" />
|
|
26
|
+
</div>
|
|
27
|
+
</DemoCard>
|
|
28
|
+
<DemoCard
|
|
29
|
+
title="Muté"
|
|
30
|
+
description='variant="muted"'
|
|
31
|
+
code={`<Icon name="Info" size="large" variant="muted" />`}
|
|
32
|
+
>
|
|
33
|
+
<div className="flex h-20 items-center justify-center rounded-large bg-surface-muted">
|
|
34
|
+
<Icon name="Info" size="large" variant="muted" />
|
|
35
|
+
</div>
|
|
36
|
+
</DemoCard>
|
|
37
|
+
<DemoCard
|
|
38
|
+
title="Primaire"
|
|
39
|
+
description='variant="primary"'
|
|
40
|
+
code={`<Icon name="ArrowRight" size="large" variant="primary" />`}
|
|
41
|
+
>
|
|
42
|
+
<div className="flex h-20 items-center justify-center rounded-large bg-primary-light">
|
|
43
|
+
<Icon name="ArrowRight" size="large" variant="primary" />
|
|
44
|
+
</div>
|
|
45
|
+
</DemoCard>
|
|
46
|
+
<DemoCard
|
|
47
|
+
title="Succès"
|
|
48
|
+
code={`<Icon name="Check" size="large" variant="success" />`}
|
|
49
|
+
>
|
|
50
|
+
<div className="flex h-20 items-center justify-center rounded-large bg-surface-muted">
|
|
51
|
+
<Icon name="Check" size="large" variant="success" />
|
|
52
|
+
</div>
|
|
53
|
+
</DemoCard>
|
|
54
|
+
<DemoCard
|
|
55
|
+
title="Avertissement"
|
|
56
|
+
code={`<Icon name="Info" size="large" variant="warning" />`}
|
|
57
|
+
>
|
|
58
|
+
<div className="flex h-20 items-center justify-center rounded-large bg-surface-muted">
|
|
59
|
+
<Icon name="Info" size="large" variant="warning" />
|
|
60
|
+
</div>
|
|
61
|
+
</DemoCard>
|
|
62
|
+
<DemoCard
|
|
63
|
+
title="Danger"
|
|
64
|
+
code={`<Icon name="X" size="large" variant="danger" />`}
|
|
65
|
+
>
|
|
66
|
+
<div className="flex h-20 items-center justify-center rounded-large bg-surface-muted">
|
|
67
|
+
<Icon name="X" size="large" variant="danger" />
|
|
68
|
+
</div>
|
|
69
|
+
</DemoCard>
|
|
70
|
+
<DemoCard
|
|
71
|
+
title="Sur fond coloré"
|
|
72
|
+
description='variant="white"'
|
|
73
|
+
code={`<Icon name="Plus" size="large" variant="white" />`}
|
|
74
|
+
>
|
|
75
|
+
<div className="flex h-20 items-center justify-center rounded-large bg-primary">
|
|
76
|
+
<Icon name="Plus" size="large" variant="white" />
|
|
77
|
+
</div>
|
|
78
|
+
</DemoCard>
|
|
79
|
+
<DemoCard
|
|
80
|
+
title="Tailles"
|
|
81
|
+
code={`<Icon name="Search" size="small" />
|
|
82
|
+
<Icon name="Search" size="default" />
|
|
83
|
+
<Icon name="Search" size="large" />
|
|
84
|
+
<Icon name="Search" size="display" />`}
|
|
85
|
+
>
|
|
86
|
+
<div className="flex h-20 items-end justify-center gap-inline">
|
|
87
|
+
<Icon name="Search" size="small" />
|
|
88
|
+
<Icon name="Search" size="default" />
|
|
89
|
+
<Icon name="Search" size="large" />
|
|
90
|
+
<Icon name="Search" size="display" />
|
|
91
|
+
</div>
|
|
92
|
+
</DemoCard>
|
|
93
|
+
</div>
|
|
94
|
+
</ShowcaseShell>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Loader } from "@modoock/components";
|
|
4
|
+
import {
|
|
5
|
+
CardLoaderDemo,
|
|
6
|
+
DemoCard,
|
|
7
|
+
FullScreenLoaderDemo,
|
|
8
|
+
ModalLoaderDemo,
|
|
9
|
+
ShowcaseShell,
|
|
10
|
+
} from "../_shared";
|
|
11
|
+
|
|
12
|
+
export default function LoaderPage() {
|
|
13
|
+
return (
|
|
14
|
+
<ShowcaseShell
|
|
15
|
+
title="Loader"
|
|
16
|
+
subtitle="Chargement réutilisable — plein écran, overlay ou inline"
|
|
17
|
+
usage="Affichez Loader pendant un chargement. fullScreen pour la page entière, overlay (défaut) dans un parent relative, inline pour un bloc dans le flux."
|
|
18
|
+
importCode={`import { Loader } from "@modoock/components";`}
|
|
19
|
+
>
|
|
20
|
+
<div className="grid gap-component md:grid-cols-2">
|
|
21
|
+
<DemoCard
|
|
22
|
+
title="Inline"
|
|
23
|
+
code={`<Loader variant="inline" message="Chargement de l'historique…" />`}
|
|
24
|
+
>
|
|
25
|
+
<div className="flex h-24 items-center justify-center rounded-large bg-surface-muted">
|
|
26
|
+
<Loader variant="inline" message="Chargement de l'historique…" />
|
|
27
|
+
</div>
|
|
28
|
+
</DemoCard>
|
|
29
|
+
<DemoCard
|
|
30
|
+
title="Overlay"
|
|
31
|
+
description="Parent positionné en relative."
|
|
32
|
+
code={`<div className="relative">
|
|
33
|
+
<Loader message="Enregistrement en cours…" />
|
|
34
|
+
</div>`}
|
|
35
|
+
>
|
|
36
|
+
<div className="relative h-24 overflow-hidden rounded-large bg-surface-muted">
|
|
37
|
+
<div className="space-y-component opacity-40" aria-hidden="true">
|
|
38
|
+
<div className="h-3 w-2/3 rounded bg-background" />
|
|
39
|
+
<div className="h-3 w-1/2 rounded bg-background" />
|
|
40
|
+
<div className="h-3 w-3/4 rounded bg-background" />
|
|
41
|
+
</div>
|
|
42
|
+
<Loader message="Enregistrement en cours…" />
|
|
43
|
+
</div>
|
|
44
|
+
</DemoCard>
|
|
45
|
+
<DemoCard
|
|
46
|
+
title="Plein écran"
|
|
47
|
+
code={`<Loader fullScreen message="Chargement des données…" />`}
|
|
48
|
+
>
|
|
49
|
+
<div className="flex h-24 items-center justify-center rounded-large bg-surface-muted">
|
|
50
|
+
<FullScreenLoaderDemo />
|
|
51
|
+
</div>
|
|
52
|
+
</DemoCard>
|
|
53
|
+
<DemoCard title="Dans une carte" code={`{loading && <Loader message="Rechargement…" />}`}>
|
|
54
|
+
<CardLoaderDemo />
|
|
55
|
+
</DemoCard>
|
|
56
|
+
<DemoCard
|
|
57
|
+
title="Dans une modale"
|
|
58
|
+
code={`<Modal open={open} title="…" onClose={…}>
|
|
59
|
+
{loading ? <Loader message="…" /> : /* contenu */}
|
|
60
|
+
</Modal>`}
|
|
61
|
+
>
|
|
62
|
+
<ModalLoaderDemo />
|
|
63
|
+
</DemoCard>
|
|
64
|
+
<DemoCard
|
|
65
|
+
title="Tailles"
|
|
66
|
+
code={`<Loader size="small" variant="inline" />
|
|
67
|
+
<Loader size="default" variant="inline" />
|
|
68
|
+
<Loader size="large" variant="inline" />
|
|
69
|
+
<Loader size="display" variant="inline" />`}
|
|
70
|
+
>
|
|
71
|
+
<div className="flex h-24 items-end justify-center gap-component">
|
|
72
|
+
<Loader size="small" variant="inline" />
|
|
73
|
+
<Loader size="default" variant="inline" />
|
|
74
|
+
<Loader size="large" variant="inline" />
|
|
75
|
+
<Loader size="display" variant="inline" />
|
|
76
|
+
</div>
|
|
77
|
+
</DemoCard>
|
|
78
|
+
</div>
|
|
79
|
+
</ShowcaseShell>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { DemoCard, ModalDemo, ShowcaseShell } from "../_shared";
|
|
4
|
+
|
|
5
|
+
export default function ModalePage() {
|
|
6
|
+
return (
|
|
7
|
+
<ShowcaseShell
|
|
8
|
+
title="Modale"
|
|
9
|
+
subtitle={
|
|
10
|
+
<>
|
|
11
|
+
Composant <code className="font-mono">Modal</code>
|
|
12
|
+
</>
|
|
13
|
+
}
|
|
14
|
+
usage="Ouvrez une modale pour une confirmation ou un formulaire court. Contrôlez open / onClose ; primaryAction et secondaryAction construisent le pied de page."
|
|
15
|
+
importCode={`import { Modal, ClickableButton } from "@modoock/components";`}
|
|
16
|
+
>
|
|
17
|
+
<div className="grid gap-component md:grid-cols-2">
|
|
18
|
+
<DemoCard
|
|
19
|
+
title="Actions primaire / secondaire"
|
|
20
|
+
description="Focus piégé, fermeture Escape, scroll verrouillé."
|
|
21
|
+
code={`const [open, setOpen] = useState(false);
|
|
22
|
+
|
|
23
|
+
<ClickableButton onClick={() => setOpen(true)}>
|
|
24
|
+
Ouvrir la modale
|
|
25
|
+
</ClickableButton>
|
|
26
|
+
|
|
27
|
+
<Modal
|
|
28
|
+
open={open}
|
|
29
|
+
title="Confirmation"
|
|
30
|
+
onClose={() => setOpen(false)}
|
|
31
|
+
primaryAction={{
|
|
32
|
+
label: "Confirmer",
|
|
33
|
+
onClick: () => setOpen(false),
|
|
34
|
+
}}
|
|
35
|
+
secondaryAction={{
|
|
36
|
+
label: "Annuler",
|
|
37
|
+
onClick: () => setOpen(false),
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<p>Cette action enregistrera les modifications.</p>
|
|
41
|
+
</Modal>`}
|
|
42
|
+
>
|
|
43
|
+
<ModalDemo />
|
|
44
|
+
</DemoCard>
|
|
45
|
+
</div>
|
|
46
|
+
</ShowcaseShell>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { DemoCard, ShowcaseShell, TabsDemo } from "../_shared";
|
|
4
|
+
|
|
5
|
+
export default function OngletsPage() {
|
|
6
|
+
return (
|
|
7
|
+
<ShowcaseShell
|
|
8
|
+
title="Onglets"
|
|
9
|
+
subtitle={
|
|
10
|
+
<>
|
|
11
|
+
Composant <code className="font-mono">Tabs</code>
|
|
12
|
+
</>
|
|
13
|
+
}
|
|
14
|
+
usage="Organisez un contenu en panneaux exclusifs. Un seul onglet actif à la fois ; le rendu enfant reçoit la valeur active."
|
|
15
|
+
importCode={`import { Tabs } from "@modoock/components";`}
|
|
16
|
+
>
|
|
17
|
+
<div className="grid gap-component md:grid-cols-2">
|
|
18
|
+
<DemoCard
|
|
19
|
+
title="Navigation par onglets"
|
|
20
|
+
code={`<Tabs
|
|
21
|
+
tabs={[
|
|
22
|
+
{ value: "general", label: "Général" },
|
|
23
|
+
{ value: "security", label: "Sécurité" },
|
|
24
|
+
{ value: "notifications", label: "Notifications" },
|
|
25
|
+
]}
|
|
26
|
+
defaultValue="general"
|
|
27
|
+
>
|
|
28
|
+
{(active) => <p>Contenu de l’onglet « {active} ».</p>}
|
|
29
|
+
</Tabs>`}
|
|
30
|
+
>
|
|
31
|
+
<TabsDemo />
|
|
32
|
+
</DemoCard>
|
|
33
|
+
</div>
|
|
34
|
+
</ShowcaseShell>
|
|
35
|
+
);
|
|
36
|
+
}
|