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.
Files changed (29) hide show
  1. package/README.md +19 -7
  2. package/package.json +1 -1
  3. package/template/app/(main)/components/_shared.tsx +602 -0
  4. package/template/app/(main)/components/agenda/page.tsx +48 -0
  5. package/template/app/(main)/components/badges/page.tsx +42 -0
  6. package/template/app/(main)/components/barres-de-metrique/page.tsx +40 -0
  7. package/template/app/(main)/components/boutons/page.tsx +142 -0
  8. package/template/app/(main)/components/champs/page.tsx +175 -0
  9. package/template/app/(main)/components/date-picker/page.tsx +48 -0
  10. package/template/app/(main)/components/icones/page.tsx +96 -0
  11. package/template/app/(main)/components/loader/page.tsx +81 -0
  12. package/template/app/(main)/components/modale/page.tsx +48 -0
  13. package/template/app/(main)/components/onglets/page.tsx +36 -0
  14. package/template/app/(main)/components/page.tsx +130 -825
  15. package/template/app/(main)/components/selecteurs/page.tsx +49 -0
  16. package/template/app/(main)/components/stepper/page.tsx +69 -0
  17. package/template/app/(main)/components/tableau/page.tsx +67 -0
  18. package/template/app/(main)/design-system/page.tsx +15 -3
  19. package/template/app/(main)/documentation/page.tsx +413 -0
  20. package/template/app/(main)/layout.tsx +2 -0
  21. package/template/app/globals.css +3 -3
  22. package/template/app/layout.tsx +1 -1
  23. package/template/components/layout/side-nav.tsx +118 -61
  24. package/template/lib/scroll-to-section.ts +38 -0
  25. package/template/next.config.ts +0 -17
  26. package/template/package-lock.json +459 -314
  27. package/template/package.json +2 -0
  28. package/template/sgconfig.yml +1 -1
  29. package/template/tsconfig.json +41 -71
@@ -0,0 +1,49 @@
1
+ "use client";
2
+
3
+ import { CodeBlock, SelectorsDemo, ShowcaseShell } from "../_shared";
4
+
5
+ export default function SelecteursPage() {
6
+ return (
7
+ <ShowcaseShell
8
+ title="Sélecteurs"
9
+ subtitle="Select, MultiSelect, recherche et filtre"
10
+ usage="Préférez Select / MultiSelect (et variantes avec recherche) à un élément HTML select brut. Passez options, value(s) et onChange. SelectFilter sert aux filtres de colonne."
11
+ importCode={`import {
12
+ Select,
13
+ MultiSelect,
14
+ SelectWithSearch,
15
+ MultiSelectWithSearch,
16
+ SelectFilter,
17
+ } from "@modoock/components";`}
18
+ >
19
+ <div className="mb-section">
20
+ <p className="mb-inline text-label uppercase tracking-[0.12em] text-muted-foreground">
21
+ Exemple de base
22
+ </p>
23
+ <CodeBlock
24
+ code={`const options = [
25
+ { value: "admin", label: "Administrateur" },
26
+ { value: "manager", label: "Gestionnaire" },
27
+ ];
28
+
29
+ <Select
30
+ label="Rôle"
31
+ options={options}
32
+ value={role}
33
+ onChange={setRole}
34
+ placeholder="Choisir un rôle…"
35
+ />
36
+
37
+ <MultiSelect
38
+ label="Rôles"
39
+ options={options}
40
+ values={roles}
41
+ onChange={setRoles}
42
+ placeholder="Choisir des rôles…"
43
+ />`}
44
+ />
45
+ </div>
46
+ <SelectorsDemo />
47
+ </ShowcaseShell>
48
+ );
49
+ }
@@ -0,0 +1,69 @@
1
+ "use client";
2
+
3
+ import { Stepper } from "@modoock/components";
4
+ import { DemoCard, ShowcaseShell, STEPPER_STEPS } from "../_shared";
5
+
6
+ export default function StepperPage() {
7
+ return (
8
+ <ShowcaseShell
9
+ title="Stepper"
10
+ subtitle="Progression d'un cycle"
11
+ usage="Visualisez le cycle de vie d’un dossier (brouillon → … → publié). currentIndex pointe l’étape courante ; complete ou rejected finalisent le parcours."
12
+ importCode={`import { Stepper } from "@modoock/components";`}
13
+ >
14
+ <div className="grid gap-component">
15
+ <DemoCard
16
+ title="Étape en cours"
17
+ description="currentIndex = 1"
18
+ code={`const steps = ["Brouillon", "Revue", "Validation", "Publié"];
19
+
20
+ <Stepper
21
+ steps={steps}
22
+ currentIndex={1}
23
+ label="Progression du dossier"
24
+ />`}
25
+ >
26
+ <Stepper
27
+ steps={STEPPER_STEPS}
28
+ currentIndex={1}
29
+ label="Progression du dossier"
30
+ />
31
+ </DemoCard>
32
+ <DemoCard
33
+ title="Terminé"
34
+ description="complete = true"
35
+ code={`<Stepper
36
+ steps={steps}
37
+ currentIndex={3}
38
+ complete
39
+ label="Progression terminée"
40
+ />`}
41
+ >
42
+ <Stepper
43
+ steps={STEPPER_STEPS}
44
+ currentIndex={3}
45
+ complete
46
+ label="Progression terminée"
47
+ />
48
+ </DemoCard>
49
+ <DemoCard
50
+ title="Rejeté"
51
+ description="rejected = true"
52
+ code={`<Stepper
53
+ steps={steps}
54
+ currentIndex={2}
55
+ rejected
56
+ label="Progression rejetée"
57
+ />`}
58
+ >
59
+ <Stepper
60
+ steps={STEPPER_STEPS}
61
+ currentIndex={2}
62
+ rejected
63
+ label="Progression rejetée"
64
+ />
65
+ </DemoCard>
66
+ </div>
67
+ </ShowcaseShell>
68
+ );
69
+ }
@@ -0,0 +1,67 @@
1
+ "use client";
2
+
3
+ import { Table } from "@modoock/components";
4
+ import {
5
+ CodeBlock,
6
+ COLUMNS,
7
+ ShowcaseShell,
8
+ USERS,
9
+ noop,
10
+ userRowActions,
11
+ } from "../_shared";
12
+
13
+ export default function TableauPage() {
14
+ return (
15
+ <ShowcaseShell
16
+ title="Tableau"
17
+ subtitle={
18
+ <>
19
+ Composant <code className="">Table</code>
20
+ </>
21
+ }
22
+ usage="Une liste = une entité. Passez columns et data ; rowsPerPage active la pagination. Sur mobile, le tableau se transforme en cartes. Une seule table visible à la fois."
23
+ importCode={`import { Table } from "@modoock/components";
24
+ import type { Column } from "@modoock/components";`}
25
+ className="min-h-0"
26
+ >
27
+ <div className="mb-section">
28
+ <p className="mb-inline text-label uppercase tracking-[0.12em] text-muted-foreground">
29
+ Exemple de base
30
+ </p>
31
+ <CodeBlock
32
+ code={`const columns: Column<User>[] = [
33
+ { key: "fullName", label: "Nom", sortable: true },
34
+ { key: "email", label: "Adresse e-mail", sortable: true },
35
+ ];
36
+
37
+ <Table
38
+ columns={columns}
39
+ data={users}
40
+ rowsPerPage={8}
41
+ getRowKey={(user) => user.id}
42
+ cardActions={{
43
+ table: [{ label: "Exporter", icon: "Download", onSelect: onExport }],
44
+ row: (user) => [
45
+ { label: "Voir", icon: "Eye", onSelect: () => onView(user) },
46
+ ],
47
+ }}
48
+ />`}
49
+ />
50
+ </div>
51
+ <div className="flex h-[min(32rem,70dvh)] min-h-0 flex-col">
52
+ <div className="min-h-0 flex-1">
53
+ <Table
54
+ columns={COLUMNS}
55
+ data={USERS}
56
+ rowsPerPage={8}
57
+ getRowKey={(user) => user.id}
58
+ cardActions={{
59
+ table: [{ label: "Exporter", icon: "Download", onSelect: noop }],
60
+ row: userRowActions,
61
+ }}
62
+ />
63
+ </div>
64
+ </div>
65
+ </ShowcaseShell>
66
+ );
67
+ }
@@ -15,15 +15,17 @@ function Section({
15
15
  number,
16
16
  title,
17
17
  description,
18
+ id,
18
19
  children,
19
20
  }: {
20
21
  number: string;
21
22
  title: string;
22
23
  description?: string;
24
+ id: string;
23
25
  children: React.ReactNode;
24
26
  }) {
25
27
  return (
26
- <section className="border-b border-border">
28
+ <section id={id} className="scroll-mt-component border-b border-border">
27
29
  <div className="container-system py-major-section">
28
30
  <div className="mb-section">
29
31
  <p className="mb-inline text-label uppercase tracking-[0.12em] text-muted-foreground">
@@ -58,7 +60,7 @@ function TokenCard({
58
60
  {children}
59
61
  <div className="mt-component">
60
62
  <p className="text-component-title text-foreground">{title}</p>
61
- <p className="mt-micro font-mono text-small text-muted-foreground">
63
+ <p className="mt-micro text-small text-muted-foreground">
62
64
  {value}
63
65
  </p>
64
66
  {description && (
@@ -85,7 +87,7 @@ function ColorSwatch({
85
87
  <div className={`h-28 w-full ${className}`} />
86
88
  <div className="p-component">
87
89
  <p className="text-body-medium text-foreground">{name}</p>
88
- <p className="mt-micro font-mono text-small text-muted-foreground">
90
+ <p className="mt-micro text-small text-muted-foreground">
89
91
  {value}
90
92
  </p>
91
93
  </div>
@@ -99,6 +101,7 @@ export default function DesignSystemPage() {
99
101
  <section className="page-container">
100
102
  {/* 01 COLORS */}
101
103
  <Section
104
+ id="colors"
102
105
  number="01"
103
106
  title="Colors"
104
107
  description="Core visual palette used throughout the interface."
@@ -268,6 +271,7 @@ export default function DesignSystemPage() {
268
271
 
269
272
  {/* 02 TYPOGRAPHY */}
270
273
  <Section
274
+ id="typography"
271
275
  number="02"
272
276
  title="Typography"
273
277
  description="Role-based typography. Each style has a defined purpose within the interface."
@@ -368,6 +372,7 @@ export default function DesignSystemPage() {
368
372
 
369
373
  {/* 03 SPACING */}
370
374
  <Section
375
+ id="spacing"
371
376
  number="03"
372
377
  title="Spacing"
373
378
  description="Adopted spacing values used to establish consistent relationships between interface elements."
@@ -447,6 +452,7 @@ export default function DesignSystemPage() {
447
452
 
448
453
  {/* 04 RADIUS */}
449
454
  <Section
455
+ id="border-radius"
450
456
  number="04"
451
457
  title="Border Radius"
452
458
  description="A four-level radius scale used consistently across the interface."
@@ -498,6 +504,7 @@ export default function DesignSystemPage() {
498
504
 
499
505
  {/* 05 ICONOGRAPHY */}
500
506
  <Section
507
+ id="iconography"
501
508
  number="05"
502
509
  title="Iconography"
503
510
  description="Lucide Icons are the standard icon library across the interface."
@@ -725,6 +732,7 @@ export default function DesignSystemPage() {
725
732
 
726
733
  {/* 06 LAYOUT */}
727
734
  <Section
735
+ id="layout-rules"
728
736
  number="06"
729
737
  title="Layout Rules"
730
738
  description="Global rules that define how pages and sections are structured."
@@ -776,6 +784,7 @@ export default function DesignSystemPage() {
776
784
 
777
785
  {/* 07 SIZING */}
778
786
  <Section
787
+ id="sizing-principle"
779
788
  number="07"
780
789
  title="Sizing Principle"
781
790
  description="Interactive elements derive their dimensions from content and spacing rather than fixed heights."
@@ -888,6 +897,7 @@ export default function DesignSystemPage() {
888
897
 
889
898
  {/* 08 VISUAL HIERARCHY */}
890
899
  <Section
900
+ id="visual-hierarchy"
891
901
  number="08"
892
902
  title="Visual Hierarchy"
893
903
  description="Hierarchy is created through surface contrast, borders, spacing and typography — not shadows."
@@ -948,6 +958,7 @@ export default function DesignSystemPage() {
948
958
 
949
959
  {/* 09 SEMANTIC STATES */}
950
960
  <Section
961
+ id="semantic-states"
951
962
  number="09"
952
963
  title="Semantic States"
953
964
  description="Semantic colors communicate system states consistently across the interface."
@@ -1005,6 +1016,7 @@ export default function DesignSystemPage() {
1005
1016
 
1006
1017
  {/* 10 COMPLETE EXAMPLE */}
1007
1018
  <Section
1019
+ id="complete-example"
1008
1020
  number="10"
1009
1021
  title="Complete Example"
1010
1022
  description="A practical composition showing how the foundation tokens work together."