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,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { AgendaDemo, CodeBlock, ShowcaseShell } from "../_shared";
|
|
4
|
+
|
|
5
|
+
export default function AgendaPage() {
|
|
6
|
+
return (
|
|
7
|
+
<ShowcaseShell
|
|
8
|
+
title="Agenda"
|
|
9
|
+
subtitle="Mois, semaine et liste"
|
|
10
|
+
usage="Passez events, view et anchorDate. En vue Liste, un filtre de période (DateRangePicker) est intégré — contrôlable via listRange / onListRangeChange. La barre expose aussi la recherche et le slot filters. Cliquez un jour vide pour onCreateSlot, un événement pour onSelectEvent."
|
|
11
|
+
importCode={`import { Agenda, AGENDA_STATUS_OPTIONS } from "@modoock/components";`}
|
|
12
|
+
>
|
|
13
|
+
<div className="mb-section">
|
|
14
|
+
<p className="mb-inline text-label uppercase tracking-[0.12em] text-muted-foreground">
|
|
15
|
+
Exemple de base
|
|
16
|
+
</p>
|
|
17
|
+
<CodeBlock
|
|
18
|
+
code={`const [view, setView] = useState("month");
|
|
19
|
+
const [anchorDate, setAnchorDate] = useState(new Date());
|
|
20
|
+
const [listRange, setListRange] = useState({ from: null, to: null });
|
|
21
|
+
const [q, setQ] = useState("");
|
|
22
|
+
|
|
23
|
+
<Agenda
|
|
24
|
+
events={events}
|
|
25
|
+
view={view}
|
|
26
|
+
onViewChange={setView}
|
|
27
|
+
anchorDate={anchorDate}
|
|
28
|
+
onAnchorDateChange={setAnchorDate}
|
|
29
|
+
listRange={listRange}
|
|
30
|
+
onListRangeChange={setListRange}
|
|
31
|
+
searchQuery={q}
|
|
32
|
+
onSearchChange={setQ}
|
|
33
|
+
statusOptions={AGENDA_STATUS_OPTIONS}
|
|
34
|
+
onSelectEvent={handleSelect}
|
|
35
|
+
onCreateSlot={handleCreate}
|
|
36
|
+
filters={
|
|
37
|
+
<>
|
|
38
|
+
<Select options={kinds} value={kind} onChange={setKind} />
|
|
39
|
+
<SelectFilter options={statuses} values={status} onChange={setStatus} />
|
|
40
|
+
</>
|
|
41
|
+
}
|
|
42
|
+
/>`}
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
<AgendaDemo />
|
|
46
|
+
</ShowcaseShell>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Badge } from "@modoock/components";
|
|
4
|
+
import { DemoCard, ShowcaseShell } from "../_shared";
|
|
5
|
+
|
|
6
|
+
export default function BadgesPage() {
|
|
7
|
+
return (
|
|
8
|
+
<ShowcaseShell
|
|
9
|
+
title="Badges"
|
|
10
|
+
subtitle={
|
|
11
|
+
<>
|
|
12
|
+
Composant <code className="">Badge</code>
|
|
13
|
+
</>
|
|
14
|
+
}
|
|
15
|
+
usage="Utilisez Badge pour un statut ou une étiquette courte. Le variant porte la sémantique (succès, danger, info…)."
|
|
16
|
+
importCode={`import { Badge } from "@modoock/components";`}
|
|
17
|
+
>
|
|
18
|
+
<div className="grid gap-component md:grid-cols-2">
|
|
19
|
+
<DemoCard
|
|
20
|
+
title="Variants"
|
|
21
|
+
code={`<Badge>Default</Badge>
|
|
22
|
+
<Badge variant="primary">Primary</Badge>
|
|
23
|
+
<Badge variant="success">Success</Badge>
|
|
24
|
+
<Badge variant="warning">Warning</Badge>
|
|
25
|
+
<Badge variant="danger">Danger</Badge>
|
|
26
|
+
<Badge variant="info">Info</Badge>`}
|
|
27
|
+
>
|
|
28
|
+
<div className="flex flex-wrap gap-inline">
|
|
29
|
+
<Badge>Default</Badge>
|
|
30
|
+
<Badge variant="primary">Primary</Badge>
|
|
31
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
32
|
+
<Badge variant="success">Success</Badge>
|
|
33
|
+
<Badge variant="warning">Warning</Badge>
|
|
34
|
+
<Badge variant="danger">Danger</Badge>
|
|
35
|
+
<Badge variant="info">Info</Badge>
|
|
36
|
+
<Badge variant="accent">Accent</Badge>
|
|
37
|
+
</div>
|
|
38
|
+
</DemoCard>
|
|
39
|
+
</div>
|
|
40
|
+
</ShowcaseShell>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { MetricBar } from "@modoock/components";
|
|
4
|
+
import { DemoCard, ShowcaseShell } from "../_shared";
|
|
5
|
+
|
|
6
|
+
export default function BarresDeMetriquePage() {
|
|
7
|
+
return (
|
|
8
|
+
<ShowcaseShell
|
|
9
|
+
title="Barres de métrique"
|
|
10
|
+
subtitle={
|
|
11
|
+
<>
|
|
12
|
+
Composant <code className="">MetricBar</code>
|
|
13
|
+
</>
|
|
14
|
+
}
|
|
15
|
+
usage="Affichez une progression numérique (0–100) avec un ton sémantique. Idéal pour indicateurs compacts dans une fiche ou un résumé."
|
|
16
|
+
importCode={`import { MetricBar } from "@modoock/components";`}
|
|
17
|
+
>
|
|
18
|
+
<div className="grid gap-component md:grid-cols-2">
|
|
19
|
+
<DemoCard
|
|
20
|
+
title="Tons"
|
|
21
|
+
code={`<MetricBar value={72} tone="primary" />
|
|
22
|
+
<MetricBar value={45} tone="success" />
|
|
23
|
+
<MetricBar value={88} tone="warning" />
|
|
24
|
+
<MetricBar value={20} tone="danger" />
|
|
25
|
+
<MetricBar value={60} tone="info" />
|
|
26
|
+
<MetricBar value={35} tone="accent" />`}
|
|
27
|
+
>
|
|
28
|
+
<div className="flex flex-col gap-component">
|
|
29
|
+
<MetricBar value={72} tone="primary" />
|
|
30
|
+
<MetricBar value={45} tone="success" />
|
|
31
|
+
<MetricBar value={88} tone="warning" />
|
|
32
|
+
<MetricBar value={20} tone="danger" />
|
|
33
|
+
<MetricBar value={60} tone="info" />
|
|
34
|
+
<MetricBar value={35} tone="accent" />
|
|
35
|
+
</div>
|
|
36
|
+
</DemoCard>
|
|
37
|
+
</div>
|
|
38
|
+
</ShowcaseShell>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ClickableButton, Icon } from "@modoock/components";
|
|
4
|
+
import { DemoCard, ShowcaseShell } from "../_shared";
|
|
5
|
+
|
|
6
|
+
export default function BoutonsPage() {
|
|
7
|
+
return (
|
|
8
|
+
<ShowcaseShell
|
|
9
|
+
title="Boutons"
|
|
10
|
+
subtitle={
|
|
11
|
+
<>
|
|
12
|
+
Composant <code className="">ClickableButton</code>
|
|
13
|
+
</>
|
|
14
|
+
}
|
|
15
|
+
usage="Utilisez ClickableButton pour toute action déclenchée par l’utilisateur. Choisissez le variant selon l’importance (primaire, secondaire, danger…) et évitez un élément HTML button brut."
|
|
16
|
+
importCode={`import { ClickableButton, Icon } from "@modoock/components";`}
|
|
17
|
+
>
|
|
18
|
+
<div className="grid gap-component md:grid-cols-2">
|
|
19
|
+
<DemoCard
|
|
20
|
+
title="Variants"
|
|
21
|
+
code={`<ClickableButton>Primary</ClickableButton>
|
|
22
|
+
<ClickableButton variant="secondary">Secondary</ClickableButton>
|
|
23
|
+
<ClickableButton variant="ghost">Ghost</ClickableButton>
|
|
24
|
+
<ClickableButton variant="danger">Danger</ClickableButton>`}
|
|
25
|
+
>
|
|
26
|
+
<div className="flex flex-wrap gap-inline">
|
|
27
|
+
<ClickableButton>Primary</ClickableButton>
|
|
28
|
+
<ClickableButton variant="secondary">Secondary</ClickableButton>
|
|
29
|
+
<ClickableButton variant="ghost">Ghost</ClickableButton>
|
|
30
|
+
<ClickableButton variant="accent">Accent</ClickableButton>
|
|
31
|
+
<ClickableButton variant="success">Success</ClickableButton>
|
|
32
|
+
<ClickableButton variant="warning">Warning</ClickableButton>
|
|
33
|
+
<ClickableButton variant="danger">Danger</ClickableButton>
|
|
34
|
+
<ClickableButton variant="info">Info</ClickableButton>
|
|
35
|
+
</div>
|
|
36
|
+
</DemoCard>
|
|
37
|
+
<DemoCard
|
|
38
|
+
title="Tailles"
|
|
39
|
+
code={`<ClickableButton size="sm">Small</ClickableButton>
|
|
40
|
+
<ClickableButton size="md">Medium</ClickableButton>
|
|
41
|
+
<ClickableButton size="lg">Large</ClickableButton>
|
|
42
|
+
<ClickableButton size="icon" variant="secondary" aria-label="Actualiser">
|
|
43
|
+
<Icon name="RefreshCw" size="small" />
|
|
44
|
+
</ClickableButton>`}
|
|
45
|
+
>
|
|
46
|
+
<div className="flex flex-wrap items-center gap-inline">
|
|
47
|
+
<ClickableButton size="sm">Small</ClickableButton>
|
|
48
|
+
<ClickableButton size="md">Medium</ClickableButton>
|
|
49
|
+
<ClickableButton size="lg">Large</ClickableButton>
|
|
50
|
+
<ClickableButton
|
|
51
|
+
size="icon"
|
|
52
|
+
variant="secondary"
|
|
53
|
+
aria-label="Actualiser"
|
|
54
|
+
>
|
|
55
|
+
<Icon name="RefreshCw" size="small" aria-hidden="true" />
|
|
56
|
+
</ClickableButton>
|
|
57
|
+
</div>
|
|
58
|
+
</DemoCard>
|
|
59
|
+
<DemoCard
|
|
60
|
+
title="Chargement (loading)"
|
|
61
|
+
code={`<ClickableButton loading loadingText="Enregistrement…">
|
|
62
|
+
Enregistrer
|
|
63
|
+
</ClickableButton>`}
|
|
64
|
+
>
|
|
65
|
+
<div className="flex flex-wrap items-center gap-inline">
|
|
66
|
+
<ClickableButton loading loadingText="Enregistrement…">
|
|
67
|
+
Enregistrer
|
|
68
|
+
</ClickableButton>
|
|
69
|
+
<ClickableButton loading variant="secondary">
|
|
70
|
+
Traitement
|
|
71
|
+
</ClickableButton>
|
|
72
|
+
</div>
|
|
73
|
+
</DemoCard>
|
|
74
|
+
<DemoCard
|
|
75
|
+
title="Désactivé (disabled)"
|
|
76
|
+
code={`<ClickableButton disabled>Désactivé</ClickableButton>
|
|
77
|
+
<ClickableButton disabled variant="danger" leftIcon={<Icon name="Trash2" size="small" />}>
|
|
78
|
+
Supprimer
|
|
79
|
+
</ClickableButton>`}
|
|
80
|
+
>
|
|
81
|
+
<div className="flex flex-wrap gap-inline">
|
|
82
|
+
<ClickableButton disabled>Désactivé</ClickableButton>
|
|
83
|
+
<ClickableButton disabled variant="secondary">
|
|
84
|
+
Indisponible
|
|
85
|
+
</ClickableButton>
|
|
86
|
+
<ClickableButton
|
|
87
|
+
disabled
|
|
88
|
+
variant="danger"
|
|
89
|
+
leftIcon={<Icon name="Trash" size="small" />}
|
|
90
|
+
>
|
|
91
|
+
Supprimer
|
|
92
|
+
</ClickableButton>
|
|
93
|
+
</div>
|
|
94
|
+
</DemoCard>
|
|
95
|
+
<DemoCard
|
|
96
|
+
title="Icônes (gauche / droite)"
|
|
97
|
+
code={`<ClickableButton leftIcon={<Icon name="Plus" size="small" />}>
|
|
98
|
+
Créer
|
|
99
|
+
</ClickableButton>
|
|
100
|
+
<ClickableButton
|
|
101
|
+
rightIcon={<Icon name="ArrowRight" size="small" />}
|
|
102
|
+
variant="secondary"
|
|
103
|
+
>
|
|
104
|
+
Continuer
|
|
105
|
+
</ClickableButton>`}
|
|
106
|
+
>
|
|
107
|
+
<div className="flex flex-wrap items-center gap-inline">
|
|
108
|
+
<ClickableButton leftIcon={<Icon name="Plus" size="small" />}>
|
|
109
|
+
Créer
|
|
110
|
+
</ClickableButton>
|
|
111
|
+
<ClickableButton
|
|
112
|
+
rightIcon={<Icon name="ArrowRight" size="small" />}
|
|
113
|
+
variant="secondary"
|
|
114
|
+
>
|
|
115
|
+
Continuer
|
|
116
|
+
</ClickableButton>
|
|
117
|
+
<ClickableButton
|
|
118
|
+
leftIcon={<Icon name="Save" size="small" />}
|
|
119
|
+
rightIcon={<Icon name="Download" size="small" />}
|
|
120
|
+
variant="accent"
|
|
121
|
+
>
|
|
122
|
+
Exporter
|
|
123
|
+
</ClickableButton>
|
|
124
|
+
</div>
|
|
125
|
+
</DemoCard>
|
|
126
|
+
<DemoCard
|
|
127
|
+
title="Largeur pleine (fullWidth)"
|
|
128
|
+
code={`<ClickableButton fullWidth leftIcon={<Icon name="Plus" size="small" />}>
|
|
129
|
+
Créer un nouveau projet
|
|
130
|
+
</ClickableButton>`}
|
|
131
|
+
>
|
|
132
|
+
<ClickableButton
|
|
133
|
+
fullWidth
|
|
134
|
+
leftIcon={<Icon name="Plus" size="small" />}
|
|
135
|
+
>
|
|
136
|
+
Créer un nouveau projet
|
|
137
|
+
</ClickableButton>
|
|
138
|
+
</DemoCard>
|
|
139
|
+
</div>
|
|
140
|
+
</ShowcaseShell>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
@@ -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="">Input</code> et{" "}
|
|
13
|
+
<code className="">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,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { CodeBlock, DatePickersDemo, ShowcaseShell } from "../_shared";
|
|
4
|
+
|
|
5
|
+
export default function DatePickerPage() {
|
|
6
|
+
return (
|
|
7
|
+
<ShowcaseShell
|
|
8
|
+
title="Sélecteurs de date"
|
|
9
|
+
subtitle="Date, date et heure, plage"
|
|
10
|
+
usage="Utilisez DatePicker pour une date seule, DateTimePicker lorsqu’une heure est nécessaire, et DateRangePicker pour une période (début → fin). Passez value et onChange ; les textes d’interface sont en français."
|
|
11
|
+
importCode={`import {
|
|
12
|
+
DatePicker,
|
|
13
|
+
DateTimePicker,
|
|
14
|
+
DateRangePicker,
|
|
15
|
+
} from "@modoock/components";`}
|
|
16
|
+
>
|
|
17
|
+
<div className="mb-section">
|
|
18
|
+
<p className="mb-inline text-label uppercase tracking-[0.12em] text-muted-foreground">
|
|
19
|
+
Exemple de base
|
|
20
|
+
</p>
|
|
21
|
+
<CodeBlock
|
|
22
|
+
code={`const [date, setDate] = useState<Date | null>(null);
|
|
23
|
+
const [dateTime, setDateTime] = useState<Date | null>(null);
|
|
24
|
+
const [range, setRange] = useState({ from: null, to: null });
|
|
25
|
+
|
|
26
|
+
<DatePicker
|
|
27
|
+
label="Date"
|
|
28
|
+
value={date}
|
|
29
|
+
onChange={setDate}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
<DateTimePicker
|
|
33
|
+
label="Date et heure"
|
|
34
|
+
value={dateTime}
|
|
35
|
+
onChange={setDateTime}
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<DateRangePicker
|
|
39
|
+
label="Période"
|
|
40
|
+
value={range}
|
|
41
|
+
onChange={setRange}
|
|
42
|
+
/>`}
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
<DatePickersDemo />
|
|
46
|
+
</ShowcaseShell>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -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="">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
|
+
}
|