create-modoock-app 2.7.1 → 2.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-modoock-app",
3
- "version": "2.7.1",
3
+ "version": "2.8.0",
4
4
  "description": "Official Modoock project starter and boilerplate generator.",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -0,0 +1,102 @@
1
+ "use client";
2
+
3
+ import { useState } from "react";
4
+ import { Radio, RadioGroup } from "@modoock/components";
5
+ import { DemoCard, ShowcaseShell } from "../_shared";
6
+
7
+ export default function BoutonsRadioPage() {
8
+ const [status, setStatus] = useState("actif");
9
+ const [priority, setPriority] = useState("normale");
10
+ const [compact, setCompact] = useState("md");
11
+
12
+ return (
13
+ <ShowcaseShell
14
+ title="Boutons radio"
15
+ subtitle={
16
+ <>
17
+ Composants <code className="font-mono">RadioGroup</code> et{" "}
18
+ <code className="font-mono">Radio</code>
19
+ </>
20
+ }
21
+ usage="Utilisez RadioGroup pour un seul choix parmi plusieurs. Chaque Radio a un label obligatoire. Contrôlez value et onValueChange."
22
+ importCode={`import { Radio, RadioGroup } from "@modoock/components";
23
+
24
+ const [status, setStatus] = useState("actif");
25
+
26
+ <RadioGroup
27
+ label="Statut"
28
+ value={status}
29
+ onValueChange={setStatus}
30
+ >
31
+ <Radio value="actif" label="Actif" />
32
+ <Radio value="inactif" label="Inactif" />
33
+ </RadioGroup>`}
34
+ >
35
+ <div className="grid gap-component md:grid-cols-2">
36
+ <DemoCard
37
+ title="États"
38
+ description="Sélection unique, avec option verrouillée."
39
+ code={`<RadioGroup label="Statut" value={status} onValueChange={setStatus}>
40
+ <Radio value="actif" label="Actif" description="Visible dans les listes." />
41
+ <Radio value="inactif" label="Inactif" />
42
+ </RadioGroup>`}
43
+ >
44
+ <RadioGroup
45
+ label="Statut"
46
+ value={status}
47
+ onValueChange={setStatus}
48
+ >
49
+ <Radio
50
+ value="actif"
51
+ label="Actif"
52
+ description="Visible dans les listes."
53
+ />
54
+ <Radio
55
+ value="archive"
56
+ label="Archivé"
57
+ description="Conservé, hors des listes courantes."
58
+ />
59
+ <Radio
60
+ value="inactif"
61
+ label="Inactif"
62
+ description="Non modifiable pour le moment."
63
+ disabled
64
+ />
65
+ </RadioGroup>
66
+ </DemoCard>
67
+
68
+ <DemoCard
69
+ title="Groupe désactivé"
70
+ code={`<RadioGroup label="Priorité" disabled … />`}
71
+ >
72
+ <RadioGroup
73
+ label="Priorité"
74
+ value={priority}
75
+ onValueChange={setPriority}
76
+ disabled
77
+ >
78
+ <Radio value="basse" label="Basse" />
79
+ <Radio value="normale" label="Normale" />
80
+ <Radio value="haute" label="Haute" />
81
+ </RadioGroup>
82
+ </DemoCard>
83
+
84
+ <DemoCard
85
+ title="Tailles"
86
+ code={`<RadioGroup size="sm" … />
87
+ <RadioGroup size="md" … />`}
88
+ >
89
+ <RadioGroup
90
+ label="Taille"
91
+ size={compact === "sm" ? "sm" : "md"}
92
+ value={compact}
93
+ onValueChange={setCompact}
94
+ >
95
+ <Radio value="sm" label="Compact" description="Taille sm." />
96
+ <Radio value="md" label="Standard" description="Taille md (défaut)." />
97
+ </RadioGroup>
98
+ </DemoCard>
99
+ </div>
100
+ </ShowcaseShell>
101
+ );
102
+ }
@@ -0,0 +1,134 @@
1
+ "use client";
2
+
3
+ import { useState } from "react";
4
+ import { Checkbox } from "@modoock/components";
5
+ import { DemoCard, ShowcaseShell } from "../_shared";
6
+
7
+ export default function CasesACocherPage() {
8
+ const [notifications, setNotifications] = useState(true);
9
+ const [newsletter, setNewsletter] = useState(false);
10
+ const [compact, setCompact] = useState(true);
11
+ const [reads, setReads] = useState(true);
12
+ const [writes, setWrites] = useState(false);
13
+ const allAccess = reads && writes;
14
+ const someAccess = reads || writes;
15
+
16
+ return (
17
+ <ShowcaseShell
18
+ title="Cases à cocher"
19
+ subtitle={
20
+ <>
21
+ Composant <code className="font-mono">Checkbox</code>
22
+ </>
23
+ }
24
+ usage="Utilisez Checkbox pour une option à cocher. Le label est obligatoire. Contrôlez checked et onCheckedChange. L’état mixte (indeterminate) sert à « tout sélectionner »."
25
+ importCode={`import { Checkbox } from "@modoock/components";
26
+
27
+ const [on, setOn] = useState(false);
28
+
29
+ <Checkbox
30
+ checked={on}
31
+ onCheckedChange={setOn}
32
+ label="Notifications e-mail"
33
+ description="Recevoir un résumé quotidien."
34
+ />`}
35
+ >
36
+ <div className="grid gap-component md:grid-cols-2">
37
+ <DemoCard
38
+ title="États"
39
+ description="Coché, décoché et verrouillé."
40
+ code={`<Checkbox
41
+ checked={notifications}
42
+ onCheckedChange={setNotifications}
43
+ label="Notifications e-mail"
44
+ description="Recevoir un résumé quotidien."
45
+ />`}
46
+ >
47
+ <div className="flex flex-col gap-component">
48
+ <Checkbox
49
+ checked={notifications}
50
+ onCheckedChange={setNotifications}
51
+ label="Notifications e-mail"
52
+ description="Recevoir un résumé quotidien."
53
+ />
54
+ <Checkbox
55
+ checked={newsletter}
56
+ onCheckedChange={setNewsletter}
57
+ label="Newsletter"
58
+ description="Actualités produit une fois par mois."
59
+ />
60
+ <Checkbox
61
+ checked
62
+ onCheckedChange={() => undefined}
63
+ label="Option verrouillée"
64
+ description="Non modifiable pour le moment."
65
+ disabled
66
+ />
67
+ </div>
68
+ </DemoCard>
69
+
70
+ <DemoCard
71
+ title="Tailles"
72
+ code={`<Checkbox size="sm" … />
73
+ <Checkbox size="md" … />`}
74
+ >
75
+ <div className="flex flex-col gap-component">
76
+ <Checkbox
77
+ size="sm"
78
+ checked={compact}
79
+ onCheckedChange={setCompact}
80
+ label="Compact"
81
+ description="Taille sm."
82
+ />
83
+ <Checkbox
84
+ size="md"
85
+ checked={compact}
86
+ onCheckedChange={setCompact}
87
+ label="Standard"
88
+ description="Taille md (défaut)."
89
+ />
90
+ </div>
91
+ </DemoCard>
92
+
93
+ <DemoCard
94
+ title="État mixte"
95
+ description="La case parent reflète la sélection partielle."
96
+ code={`<Checkbox
97
+ checked={allAccess}
98
+ indeterminate={someAccess && !allAccess}
99
+ onCheckedChange={(next) => {
100
+ setReads(next);
101
+ setWrites(next);
102
+ }}
103
+ label="Tous les accès"
104
+ />`}
105
+ >
106
+ <div className="flex flex-col gap-component">
107
+ <Checkbox
108
+ checked={allAccess}
109
+ indeterminate={someAccess && !allAccess}
110
+ onCheckedChange={(next) => {
111
+ setReads(next);
112
+ setWrites(next);
113
+ }}
114
+ label="Tous les accès"
115
+ description="Lecture et écriture."
116
+ />
117
+ <div className="ml-section flex flex-col gap-control">
118
+ <Checkbox
119
+ checked={reads}
120
+ onCheckedChange={setReads}
121
+ label="Lecture"
122
+ />
123
+ <Checkbox
124
+ checked={writes}
125
+ onCheckedChange={setWrites}
126
+ label="Écriture"
127
+ />
128
+ </div>
129
+ </div>
130
+ </DemoCard>
131
+ </div>
132
+ </ShowcaseShell>
133
+ );
134
+ }
@@ -7,7 +7,7 @@ export default function DatePickerPage() {
7
7
  <ShowcaseShell
8
8
  title="Sélecteurs de date"
9
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."
10
+ usage="Utilisez DatePicker pour une date seule, DateTimePicker lorsqu’une heure est nécessaire, et DateRangePicker pour une période (début → fin). Cliquez le mois pour choisir l’année puis le mois. Des raccourcis (hier, cette semaine, ce mois…) sont proposés dans le panneau."
11
11
  importCode={`import {
12
12
  DatePicker,
13
13
  DateTimePicker,
@@ -26,6 +26,18 @@ const CATALOG: {
26
26
  description: "Bascule activé / désactivé.",
27
27
  icon: "ToggleRight",
28
28
  },
29
+ {
30
+ href: "/components/cases-a-cocher",
31
+ title: "Cases à cocher",
32
+ description: "Option à cocher, y compris l’état mixte.",
33
+ icon: "SquareCheck",
34
+ },
35
+ {
36
+ href: "/components/boutons-radio",
37
+ title: "Boutons radio",
38
+ description: "Un seul choix parmi plusieurs.",
39
+ icon: "CircleDot",
40
+ },
29
41
  {
30
42
  href: "/components/infobulle",
31
43
  title: "Infobulle",
@@ -44,6 +56,12 @@ const CATALOG: {
44
56
  description: "Inline, overlay et plein écran.",
45
57
  icon: "LoaderCircle",
46
58
  },
59
+ {
60
+ href: "/components/squelette",
61
+ title: "Squelette",
62
+ description: "Placeholder de chargement.",
63
+ icon: "Layers",
64
+ },
47
65
  {
48
66
  href: "/components/badges",
49
67
  title: "Badges",
@@ -122,6 +140,12 @@ const CATALOG: {
122
140
  description: "Liste triable avec actions.",
123
141
  icon: "Table",
124
142
  },
143
+ {
144
+ href: "/components/pagination",
145
+ title: "Pagination",
146
+ description: "Pages numérotées et résumé d’éléments.",
147
+ icon: "ChevronsLeftRight",
148
+ },
125
149
  ];
126
150
 
127
151
  export default function ComponentsHubPage() {
@@ -0,0 +1,71 @@
1
+ "use client";
2
+
3
+ import { useState } from "react";
4
+ import { Pagination } from "@modoock/components";
5
+ import { DemoCard, ShowcaseShell } from "../_shared";
6
+
7
+ export default function PaginationPage() {
8
+ const [page, setPage] = useState(1);
9
+ const [compactPage, setCompactPage] = useState(2);
10
+
11
+ return (
12
+ <ShowcaseShell
13
+ title="Pagination"
14
+ subtitle={
15
+ <>
16
+ Composant <code className="font-mono">Pagination</code>
17
+ </>
18
+ }
19
+ usage="Utilisez Pagination pour parcourir une liste paginée. Contrôlez page, pageCount et onPageChange. Passez totalItems et pageSize pour afficher « 1–8 sur 48 »."
20
+ importCode={`import { Pagination } from "@modoock/components";
21
+
22
+ const [page, setPage] = useState(1);
23
+
24
+ <Pagination
25
+ page={page}
26
+ pageCount={12}
27
+ onPageChange={setPage}
28
+ totalItems={90}
29
+ pageSize={8}
30
+ />`}
31
+ >
32
+ <div className="grid gap-component">
33
+ <DemoCard
34
+ title="Liste paginée"
35
+ description="Résumé d’éléments et pages numérotées."
36
+ code={`<Pagination
37
+ page={page}
38
+ pageCount={12}
39
+ onPageChange={setPage}
40
+ totalItems={90}
41
+ pageSize={8}
42
+ />`}
43
+ >
44
+ <Pagination
45
+ page={page}
46
+ pageCount={12}
47
+ onPageChange={setPage}
48
+ totalItems={90}
49
+ pageSize={8}
50
+ />
51
+ </DemoCard>
52
+
53
+ <DemoCard
54
+ title="Pages seules"
55
+ description="Sans total d’éléments : « Page 2 sur 4 »."
56
+ code={`<Pagination
57
+ page={compactPage}
58
+ pageCount={4}
59
+ onPageChange={setCompactPage}
60
+ />`}
61
+ >
62
+ <Pagination
63
+ page={compactPage}
64
+ pageCount={4}
65
+ onPageChange={setCompactPage}
66
+ />
67
+ </DemoCard>
68
+ </div>
69
+ </ShowcaseShell>
70
+ );
71
+ }
@@ -0,0 +1,61 @@
1
+ import { Skeleton } from "@modoock/components";
2
+ import { DemoCard, ShowcaseShell } from "../_shared";
3
+
4
+ export default function SquelettePage() {
5
+ return (
6
+ <ShowcaseShell
7
+ title="Squelette"
8
+ subtitle={
9
+ <>
10
+ Composant <code className="font-mono">Skeleton</code>
11
+ </>
12
+ }
13
+ usage="Utilisez Skeleton pour un chargement de contenu, pas pour une action en cours (préférez Loader). Posez aria-busy sur le conteneur."
14
+ importCode={`import { Skeleton } from "@modoock/components";
15
+
16
+ <div aria-busy="true">
17
+ <Skeleton />
18
+ <Skeleton className="w-2/3" />
19
+ </div>`}
20
+ >
21
+ <div className="grid gap-component md:grid-cols-2">
22
+ <DemoCard
23
+ title="Lignes"
24
+ code={`<Skeleton />
25
+ <Skeleton className="w-2/3" />
26
+ <Skeleton className="w-1/2" />`}
27
+ >
28
+ <div className="flex flex-col gap-control" aria-busy="true">
29
+ <Skeleton />
30
+ <Skeleton className="w-2/3" />
31
+ <Skeleton className="w-1/2" />
32
+ </div>
33
+ </DemoCard>
34
+
35
+ <DemoCard
36
+ title="Avatar et texte"
37
+ code={`<Skeleton shape="circle" />
38
+ <Skeleton />
39
+ <Skeleton className="w-3/4" />`}
40
+ >
41
+ <div className="flex items-start gap-control" aria-busy="true">
42
+ <Skeleton shape="circle" />
43
+ <div className="flex min-w-0 flex-1 flex-col gap-control">
44
+ <Skeleton />
45
+ <Skeleton className="w-3/4" />
46
+ </div>
47
+ </div>
48
+ </DemoCard>
49
+
50
+ <DemoCard
51
+ title="Bloc"
52
+ code={`<Skeleton shape="block" />`}
53
+ >
54
+ <div aria-busy="true">
55
+ <Skeleton shape="block" />
56
+ </div>
57
+ </DemoCard>
58
+ </div>
59
+ </ShowcaseShell>
60
+ );
61
+ }
@@ -70,9 +70,12 @@ const NAV_ITEMS: NavItem[] = [
70
70
  { label: "Champs de saisie", href: "/components/champs" },
71
71
  { label: "Boutons", href: "/components/boutons" },
72
72
  { label: "Interrupteur", href: "/components/interrupteur" },
73
+ { label: "Cases à cocher", href: "/components/cases-a-cocher" },
74
+ { label: "Boutons radio", href: "/components/boutons-radio" },
73
75
  { label: "Infobulle", href: "/components/infobulle" },
74
76
  { label: "Icônes", href: "/components/icones" },
75
77
  { label: "Loader", href: "/components/loader" },
78
+ { label: "Squelette", href: "/components/squelette" },
76
79
  { label: "Badges", href: "/components/badges" },
77
80
  { label: "Avatar", href: "/components/avatar" },
78
81
  { label: "Sélecteurs", href: "/components/selecteurs" },
@@ -86,6 +89,7 @@ const NAV_ITEMS: NavItem[] = [
86
89
  { label: "Graphiques", href: "/components/graphiques" },
87
90
  { label: "Stepper", href: "/components/stepper" },
88
91
  { label: "Tableau", href: "/components/tableau" },
92
+ { label: "Pagination", href: "/components/pagination" },
89
93
  ],
90
94
  },
91
95
  ];