create-modoock-app 1.0.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/dist/cli.js +52 -0
- package/package.json +21 -0
- package/template/.cursor/agents/code-reviewer.md +25 -0
- package/template/.cursor/rules/agents.mdc +9 -0
- package/template/.cursor/rules/honey.mdc +226 -0
- package/template/.cursor/rules/ui.mdc +18 -0
- package/template/.cursor/skills/debug/SKILL.md +29 -0
- package/template/.dcdignore +3 -0
- package/template/AGENTS.md +89 -0
- package/template/CLAUDE.md +2 -0
- package/template/README.md +339 -0
- package/template/app/(local)/components/page.tsx +886 -0
- package/template/app/(local)/design-system/page.tsx +1140 -0
- package/template/app/(local)/layout.tsx +5 -0
- package/template/app/(local)/page.tsx +59 -0
- package/template/app/auth/layout.tsx +7 -0
- package/template/app/auth/login/page.tsx +76 -0
- package/template/app/favicon.ico +0 -0
- package/template/app/globals.css +365 -0
- package/template/app/layout.tsx +28 -0
- package/template/components/layout/app-layout.tsx +30 -0
- package/template/components/layout/header.tsx +72 -0
- package/template/components/layout/index.ts +3 -0
- package/template/components/layout/side-nav.tsx +163 -0
- package/template/components/shared/detail-header.tsx +39 -0
- package/template/components/shared/index.ts +8 -0
- package/template/components/shared/info-card.tsx +75 -0
- package/template/components/shared/summary-card.tsx +31 -0
- package/template/components/shared/table-section.tsx +38 -0
- package/template/components/shared/timeline-list.tsx +31 -0
- package/template/components/ui/action-stack.tsx +42 -0
- package/template/components/ui/badge.tsx +43 -0
- package/template/components/ui/button.tsx +104 -0
- package/template/components/ui/icon.tsx +78 -0
- package/template/components/ui/index.ts +28 -0
- package/template/components/ui/input.tsx +376 -0
- package/template/components/ui/loader.tsx +78 -0
- package/template/components/ui/metric-bar.tsx +49 -0
- package/template/components/ui/modal.tsx +177 -0
- package/template/components/ui/select.tsx +458 -0
- package/template/components/ui/stepper.tsx +96 -0
- package/template/components/ui/tab.tsx +85 -0
- package/template/components/ui/user-table.tsx +806 -0
- package/template/eslint.config.mjs +18 -0
- package/template/knowledge-base/design-system/components/action-stack.mdc +17 -0
- package/template/knowledge-base/design-system/components/badges.mdc +16 -0
- package/template/knowledge-base/design-system/components/buttons.mdc +21 -0
- package/template/knowledge-base/design-system/components/detail-header.mdc +17 -0
- package/template/knowledge-base/design-system/components/dropdowns.mdc +12 -0
- package/template/knowledge-base/design-system/components/info-list.mdc +17 -0
- package/template/knowledge-base/design-system/components/inputs.mdc +23 -0
- package/template/knowledge-base/design-system/components/menu.mdc +20 -0
- package/template/knowledge-base/design-system/components/modals.mdc +24 -0
- package/template/knowledge-base/design-system/components/selects.mdc +39 -0
- package/template/knowledge-base/design-system/components/stepper.mdc +18 -0
- package/template/knowledge-base/design-system/components/tables.mdc +59 -0
- package/template/knowledge-base/design-system/components/tabs.mdc +17 -0
- package/template/knowledge-base/design-system/components.mdc +91 -0
- package/template/knowledge-base/design-system/tokens.mdc +24 -0
- package/template/knowledge-base/examples/bad/README.md +8 -0
- package/template/knowledge-base/examples/good/README.md +13 -0
- package/template/knowledge-base/metadata/catalog.yaml +245 -0
- package/template/knowledge-base/patterns/components/reuse-existing.mdc +26 -0
- package/template/knowledge-base/patterns/data-fetching/local-data.mdc +20 -0
- package/template/knowledge-base/patterns/layouts/app-shell.mdc +20 -0
- package/template/knowledge-base/patterns/pages/data-table-page.mdc +31 -0
- package/template/knowledge-base/patterns/pages/workflow-page.mdc +27 -0
- package/template/knowledge-base/rules/accessibility/responsive.mdc +31 -0
- package/template/knowledge-base/rules/architecture/layout.mdc +52 -0
- package/template/knowledge-base/rules/architecture/single-screen.mdc +62 -0
- package/template/knowledge-base/rules/code-quality/jsx.mdc +19 -0
- package/template/knowledge-base/rules/global/naming.mdc +12 -0
- package/template/knowledge-base/rules/global/technology.mdc +19 -0
- package/template/knowledge-base/rules/global/ui-copy.mdc +20 -0
- package/template/knowledge-base/rules/performance/client.mdc +20 -0
- package/template/knowledge-base/rules/ui/information-density.mdc +36 -0
- package/template/knowledge-base/rules/ui/interaction.mdc +47 -0
- package/template/knowledge-base/rules/ui/simple-ui.mdc +58 -0
- package/template/knowledge-base/validation/accessibility.mdc +13 -0
- package/template/knowledge-base/validation/architecture.mdc +10 -0
- package/template/knowledge-base/validation/ast-grep/do-what-brooooooklyn-said.yml +15 -0
- package/template/knowledge-base/validation/ast-grep/no-nested-links.yml +12 -0
- package/template/knowledge-base/validation/ast-grep/rewrite-svg-attribute.yml +19 -0
- package/template/knowledge-base/validation/code-quality.mdc +18 -0
- package/template/knowledge-base/validation/performance.mdc +11 -0
- package/template/knowledge-base/validation/ui.mdc +26 -0
- package/template/next.config.ts +21 -0
- package/template/package-lock.json +6938 -0
- package/template/package.json +30 -0
- package/template/postcss.config.mjs +7 -0
- package/template/public/identity/full_logo_black.svg +27 -0
- package/template/public/identity/full_logo_color.svg +38 -0
- package/template/public/identity/full_logo_white.svg +34 -0
- package/template/public/identity/logo_icon_black.svg +6 -0
- package/template/public/identity/logo_icon_color.svg +13 -0
- package/template/public/identity/logo_icon_white.svg +13 -0
- package/template/public/login-hero.png +0 -0
- package/template/sgconfig.yml +11 -0
- package/template/tsconfig.json +43 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
import { Icon } from "@/components/ui";
|
|
3
|
+
|
|
4
|
+
const DESTINATIONS = [
|
|
5
|
+
{
|
|
6
|
+
href: "/components",
|
|
7
|
+
title: "Composants",
|
|
8
|
+
description: "Catalogue interactif des composants UI.",
|
|
9
|
+
icon: "LayoutGrid" as const,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
href: "/design-system",
|
|
13
|
+
title: "Design System",
|
|
14
|
+
description: "Tokens, couleurs, typographie et règles visuelles.",
|
|
15
|
+
icon: "Palette" as const,
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export default function HomePage() {
|
|
20
|
+
return (
|
|
21
|
+
<div className="flex h-full flex-col items-center justify-center gap-major-section px-8">
|
|
22
|
+
<div className="max-w-5xl text-center">
|
|
23
|
+
<h1 className="text-5xl font-extrabold uppercase leading-12 text-primary">
|
|
24
|
+
<span className="text-4xl">Bienvenue sur le</span>
|
|
25
|
+
<br />
|
|
26
|
+
Boilerplate Modoock
|
|
27
|
+
</h1>
|
|
28
|
+
<p className="mt-component text-section-title font-normal text-muted-foreground">
|
|
29
|
+
Fondation prête pour la production — architecture structurée,
|
|
30
|
+
composants réutilisables et design system cohérent.
|
|
31
|
+
</p>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div className="flex w-full max-w-6xl flex-col items-center gap-section sm:flex-row sm:justify-center sm:gap-major-section">
|
|
35
|
+
{DESTINATIONS.map((item) => (
|
|
36
|
+
<Link
|
|
37
|
+
key={item.href}
|
|
38
|
+
href={item.href}
|
|
39
|
+
className="group flex max-w-xs flex-col items-center gap-inline text-center transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
|
|
40
|
+
>
|
|
41
|
+
<Icon name={item.icon} variant="primary" size="large" />
|
|
42
|
+
<span className="flex items-center gap-micro text-component-title text-foreground group-hover:text-primary">
|
|
43
|
+
{item.title}
|
|
44
|
+
<Icon
|
|
45
|
+
name="ArrowRight"
|
|
46
|
+
size="small"
|
|
47
|
+
variant="muted"
|
|
48
|
+
className="transition-transform group-hover:translate-x-0.5 group-hover:text-primary"
|
|
49
|
+
/>
|
|
50
|
+
</span>
|
|
51
|
+
<span className="text-small text-muted-foreground">
|
|
52
|
+
{item.description}
|
|
53
|
+
</span>
|
|
54
|
+
</Link>
|
|
55
|
+
))}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import Image from "next/image";
|
|
4
|
+
import { FormEvent, useState } from "react";
|
|
5
|
+
import { ClickableButton, Icon, Input } from "@/components/ui";
|
|
6
|
+
|
|
7
|
+
export default function LoginPage() {
|
|
8
|
+
const [loading, setLoading] = useState(false);
|
|
9
|
+
|
|
10
|
+
const handleSubmit = (event: FormEvent<HTMLFormElement>) => {
|
|
11
|
+
event.preventDefault();
|
|
12
|
+
setLoading(true);
|
|
13
|
+
// Démo — brancher l'auth réelle plus tard.
|
|
14
|
+
window.setTimeout(() => setLoading(false), 800);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div className="flex min-h-full w-full flex-1">
|
|
19
|
+
{/* Left — image */}
|
|
20
|
+
<aside className="relative hidden min-h-full w-1/2 overflow-hidden bg-primary md:block">
|
|
21
|
+
<Image
|
|
22
|
+
src="/login-hero.png"
|
|
23
|
+
alt=""
|
|
24
|
+
fill
|
|
25
|
+
priority
|
|
26
|
+
className="object-cover"
|
|
27
|
+
sizes="70vw"
|
|
28
|
+
/>
|
|
29
|
+
</aside>
|
|
30
|
+
|
|
31
|
+
{/* Right — form */}
|
|
32
|
+
<div className="flex w-full flex-col justify-center px-8 py-section md:w-1/2 md:px-16 lg:px-24">
|
|
33
|
+
<div className="mx-auto w-full max-w-md">
|
|
34
|
+
<Image
|
|
35
|
+
src="/identity/full_logo_color.svg"
|
|
36
|
+
alt="Modoock"
|
|
37
|
+
width={240}
|
|
38
|
+
height={60}
|
|
39
|
+
className="h-14 w-auto"
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
<h1 className="mt-section text-page-title text-foreground">Connexion</h1>
|
|
43
|
+
<p className="mt-inline text-body text-muted-foreground">
|
|
44
|
+
Accédez à votre espace Modoock.
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
<form className="mt-section flex flex-col gap-component" onSubmit={handleSubmit}>
|
|
48
|
+
<Input
|
|
49
|
+
label="Adresse e-mail"
|
|
50
|
+
type="email"
|
|
51
|
+
name="email"
|
|
52
|
+
autoComplete="email"
|
|
53
|
+
required
|
|
54
|
+
placeholder="vous@exemple.com"
|
|
55
|
+
icon={<Icon name="Mail" size="small" />}
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
<Input
|
|
59
|
+
label="Mot de passe"
|
|
60
|
+
type="password"
|
|
61
|
+
name="password"
|
|
62
|
+
autoComplete="current-password"
|
|
63
|
+
required
|
|
64
|
+
placeholder="••••••••"
|
|
65
|
+
icon={<Icon name="Lock" size="small" />}
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
<ClickableButton type="submit" fullWidth loading={loading} loadingText="Connexion…">
|
|
69
|
+
Se connecter
|
|
70
|
+
</ClickableButton>
|
|
71
|
+
</form>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
/* ================================
|
|
4
|
+
DESIGN TOKENS
|
|
5
|
+
================================ */
|
|
6
|
+
|
|
7
|
+
@theme {
|
|
8
|
+
/* Colors */
|
|
9
|
+
|
|
10
|
+
--color-primary: #264dbf;
|
|
11
|
+
--color-primary-hover: #1f41a8;
|
|
12
|
+
--color-primary-active: #19378f;
|
|
13
|
+
--color-primary-light: #e8edff;
|
|
14
|
+
--color-primary-muted: #c9d4ff;
|
|
15
|
+
--color-primary-foreground: #ffffff;
|
|
16
|
+
|
|
17
|
+
--color-background: #f8f9fc;
|
|
18
|
+
--color-foreground: #171a24;
|
|
19
|
+
|
|
20
|
+
--color-surface: #ffffff;
|
|
21
|
+
--color-surface-muted: #f1f3f8;
|
|
22
|
+
|
|
23
|
+
--color-muted: #e7eaf1;
|
|
24
|
+
--color-muted-foreground: #687086;
|
|
25
|
+
|
|
26
|
+
--color-border: #dde1ea;
|
|
27
|
+
--color-border-strong: #c7ccda;
|
|
28
|
+
|
|
29
|
+
--color-input: #ffffff;
|
|
30
|
+
--color-placeholder: #9299aa;
|
|
31
|
+
|
|
32
|
+
--color-success: #15966c;
|
|
33
|
+
--color-success-light: #e5f7f0;
|
|
34
|
+
--color-success-foreground: #087052;
|
|
35
|
+
|
|
36
|
+
--color-warning: #d99016;
|
|
37
|
+
--color-warning-light: #fff4db;
|
|
38
|
+
--color-warning-foreground: #9a6200;
|
|
39
|
+
|
|
40
|
+
--color-danger: #d9364f;
|
|
41
|
+
--color-danger-light: #fde9ed;
|
|
42
|
+
--color-danger-foreground: #b51f38;
|
|
43
|
+
|
|
44
|
+
--color-info: #267cc7;
|
|
45
|
+
--color-info-light: #e7f2fc;
|
|
46
|
+
--color-info-foreground: #185d99;
|
|
47
|
+
|
|
48
|
+
--color-accent: #7047d9;
|
|
49
|
+
--color-accent-hover: #5e39bd;
|
|
50
|
+
--color-accent-light: #f0ebff;
|
|
51
|
+
--color-accent-foreground: #ffffff;
|
|
52
|
+
|
|
53
|
+
/* Typography */
|
|
54
|
+
|
|
55
|
+
--text-page-title: 2rem;
|
|
56
|
+
--text-page-title--line-height: 2.5rem;
|
|
57
|
+
--text-page-title--font-weight: 700;
|
|
58
|
+
|
|
59
|
+
--text-section-title: 1.5rem;
|
|
60
|
+
--text-section-title--line-height: 2rem;
|
|
61
|
+
--text-section-title--font-weight: 700;
|
|
62
|
+
|
|
63
|
+
--text-component-title: 1rem;
|
|
64
|
+
--text-component-title--line-height: 1.5rem;
|
|
65
|
+
--text-component-title--font-weight: 600;
|
|
66
|
+
|
|
67
|
+
--text-body: 0.875rem;
|
|
68
|
+
--text-body--line-height: 1.25rem;
|
|
69
|
+
--text-body--font-weight: 400;
|
|
70
|
+
|
|
71
|
+
--text-body-medium: 0.875rem;
|
|
72
|
+
--text-body-medium--line-height: 1.25rem;
|
|
73
|
+
--text-body-medium--font-weight: 500;
|
|
74
|
+
|
|
75
|
+
--text-small: 0.75rem;
|
|
76
|
+
--text-small--line-height: 1rem;
|
|
77
|
+
--text-small--font-weight: 400;
|
|
78
|
+
|
|
79
|
+
--text-label: 0.75rem;
|
|
80
|
+
--text-label--line-height: 1rem;
|
|
81
|
+
--text-label--font-weight: 600;
|
|
82
|
+
|
|
83
|
+
/* Spacing */
|
|
84
|
+
|
|
85
|
+
--spacing-micro: 0.25rem; /* Icon/text adjustments and compact internal spacing. */
|
|
86
|
+
--spacing-inline: 0.5rem; /* Spacing between closely related elements. */
|
|
87
|
+
--spacing-control: 0.75rem; /* Control padding and label/control relationships. */
|
|
88
|
+
--spacing-component: 1rem; /* Default spacing between related UI elements. */
|
|
89
|
+
--spacing-card: 1.5rem; /* Internal spacing for cards and larger containers. */
|
|
90
|
+
--spacing-section: 2rem; /* Separation between groups within a page. */
|
|
91
|
+
--spacing-major-section: 3rem; /* Major page-level section separation. */
|
|
92
|
+
|
|
93
|
+
/* Radius */
|
|
94
|
+
|
|
95
|
+
--radius-small: 0.75rem; /* Used for compact UI elements. (Ex: small controls, tags and badges.) */
|
|
96
|
+
--radius-medium: 0.875rem; /* Used for standard interactive components. (Ex: buttons, inputs, selects and dropdowns.) */
|
|
97
|
+
--radius-large: 1rem; /* Used for larger containers and surfaces. (Ex: cards, panels and major content blocks.) */
|
|
98
|
+
--radius-full: 9999rem; /* Used for fully rounded elements. (Ex: pills, badges, avatars and circular buttons.) */
|
|
99
|
+
|
|
100
|
+
/* Layout */
|
|
101
|
+
|
|
102
|
+
--container-content: 80rem;
|
|
103
|
+
|
|
104
|
+
/* Icons */
|
|
105
|
+
|
|
106
|
+
--icon-small: 1rem;
|
|
107
|
+
--icon-default: 1.25rem;
|
|
108
|
+
--icon-large: 1.5rem;
|
|
109
|
+
--icon-display: 2rem;
|
|
110
|
+
|
|
111
|
+
/* Breakpoints */
|
|
112
|
+
|
|
113
|
+
--breakpoint-md: 56rem; /* 896px — md passe de 768 à 896 (lg reste 1024). */
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
/* ================================
|
|
118
|
+
ROOT
|
|
119
|
+
================================ */
|
|
120
|
+
|
|
121
|
+
:root {
|
|
122
|
+
color-scheme: light;
|
|
123
|
+
|
|
124
|
+
--page-padding-mobile: 1.5rem;
|
|
125
|
+
--page-padding-desktop: 2.5rem;
|
|
126
|
+
|
|
127
|
+
--grid-gap: 1rem;
|
|
128
|
+
--section-gap: 2rem;
|
|
129
|
+
--major-section-gap: 3rem;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
/* ================================
|
|
134
|
+
BASE
|
|
135
|
+
================================ */
|
|
136
|
+
|
|
137
|
+
@layer base {
|
|
138
|
+
*,
|
|
139
|
+
::before,
|
|
140
|
+
::after {
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
html {
|
|
145
|
+
scroll-behavior: smooth;
|
|
146
|
+
scrollbar-width: thin;
|
|
147
|
+
scrollbar-color: #1a3380 transparent;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
body {
|
|
151
|
+
margin: 0;
|
|
152
|
+
background: var(--color-background);
|
|
153
|
+
color: var(--color-foreground);
|
|
154
|
+
font-size: 0.875rem;
|
|
155
|
+
line-height: 1.25rem;
|
|
156
|
+
-webkit-font-smoothing: antialiased;
|
|
157
|
+
-moz-osx-font-smoothing: grayscale;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
button,
|
|
161
|
+
input,
|
|
162
|
+
textarea,
|
|
163
|
+
select {
|
|
164
|
+
font: inherit;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
button {
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
button:disabled {
|
|
172
|
+
cursor: not-allowed;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
img,
|
|
176
|
+
svg,
|
|
177
|
+
video {
|
|
178
|
+
display: block;
|
|
179
|
+
max-width: 100%;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
a {
|
|
183
|
+
color: inherit;
|
|
184
|
+
text-decoration: none;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
::selection {
|
|
188
|
+
background: var(--color-primary-light);
|
|
189
|
+
color: var(--color-primary-active);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
:focus-visible {
|
|
193
|
+
outline: 2px solid var(--color-border-strong);
|
|
194
|
+
outline-offset: 2px;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
/* ================================
|
|
200
|
+
TYPOGRAPHY
|
|
201
|
+
================================ */
|
|
202
|
+
|
|
203
|
+
@utility text-page-title {
|
|
204
|
+
font-size: 2rem;
|
|
205
|
+
line-height: 2.5rem;
|
|
206
|
+
font-weight: 700;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@utility text-section-title {
|
|
210
|
+
font-size: 1.5rem;
|
|
211
|
+
line-height: 2rem;
|
|
212
|
+
font-weight: 700;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@utility text-component-title {
|
|
216
|
+
font-size: 1rem;
|
|
217
|
+
line-height: 1.5rem;
|
|
218
|
+
font-weight: 600;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@utility text-body {
|
|
222
|
+
font-size: 0.875rem;
|
|
223
|
+
line-height: 1.25rem;
|
|
224
|
+
font-weight: 400;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@utility text-body-medium {
|
|
228
|
+
font-size: 0.875rem;
|
|
229
|
+
line-height: 1.25rem;
|
|
230
|
+
font-weight: 500;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
@utility text-small {
|
|
234
|
+
font-size: 0.75rem;
|
|
235
|
+
line-height: 1rem;
|
|
236
|
+
font-weight: 400;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@utility text-label {
|
|
240
|
+
font-size: 0.75rem;
|
|
241
|
+
line-height: 1rem;
|
|
242
|
+
font-weight: 600;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
/* ================================
|
|
247
|
+
LAYOUT
|
|
248
|
+
================================ */
|
|
249
|
+
|
|
250
|
+
@utility page-container {
|
|
251
|
+
width: 100%;
|
|
252
|
+
max-width: var(--container-content);
|
|
253
|
+
margin-inline: auto;
|
|
254
|
+
padding-inline: var(--page-padding-mobile);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
@utility section-gap {
|
|
258
|
+
margin-block: var(--section-gap);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@utility major-section-gap {
|
|
262
|
+
margin-block: var(--major-section-gap);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* Scrollbar du SideNav — fine et dans le thème du nav (fond primaire) ;
|
|
266
|
+
n'apparaît que lorsque le contenu déborde (couplée à overflow-y-auto). */
|
|
267
|
+
@utility nav-scrollbar {
|
|
268
|
+
scrollbar-width: thin;
|
|
269
|
+
scrollbar-color: rgb(255 255 255 / 0.35) transparent;
|
|
270
|
+
|
|
271
|
+
&::-webkit-scrollbar {
|
|
272
|
+
width: 6px;
|
|
273
|
+
}
|
|
274
|
+
&::-webkit-scrollbar-track {
|
|
275
|
+
background: transparent;
|
|
276
|
+
}
|
|
277
|
+
&::-webkit-scrollbar-thumb {
|
|
278
|
+
border-radius: 9999px;
|
|
279
|
+
background: rgb(255 255 255 / 0.35);
|
|
280
|
+
}
|
|
281
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
282
|
+
background: rgb(255 255 255 / 0.55);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
@media (min-width: 896px) {
|
|
287
|
+
.page-container {
|
|
288
|
+
padding-inline: var(--page-padding-desktop);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
/* ================================
|
|
294
|
+
FORM
|
|
295
|
+
================================ */
|
|
296
|
+
|
|
297
|
+
@layer components {
|
|
298
|
+
.ds-input {
|
|
299
|
+
width: 100%;
|
|
300
|
+
border: 1px solid var(--color-border);
|
|
301
|
+
border-radius: var(--radius-medium);
|
|
302
|
+
background: var(--color-input);
|
|
303
|
+
color: var(--color-foreground);
|
|
304
|
+
padding-inline: var(--spacing-control);
|
|
305
|
+
padding-block: var(--spacing-control);
|
|
306
|
+
outline: none;
|
|
307
|
+
transition:
|
|
308
|
+
border-color 150ms ease,
|
|
309
|
+
background-color 150ms ease;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.ds-input::placeholder {
|
|
313
|
+
color: var(--color-placeholder);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.ds-input:hover {
|
|
317
|
+
border-color: var(--color-border-strong);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.ds-input:focus {
|
|
321
|
+
border-color: var(--color-border-strong);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.ds-input:disabled {
|
|
325
|
+
cursor: not-allowed;
|
|
326
|
+
background: var(--color-surface-muted);
|
|
327
|
+
color: var(--color-muted-foreground);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
/* ================================
|
|
333
|
+
ACCESSIBILITY
|
|
334
|
+
================================ */
|
|
335
|
+
|
|
336
|
+
@media (prefers-reduced-motion: reduce) {
|
|
337
|
+
*,
|
|
338
|
+
*::before,
|
|
339
|
+
*::after {
|
|
340
|
+
scroll-behavior: auto !important;
|
|
341
|
+
transition-duration: 0.01ms !important;
|
|
342
|
+
animation-duration: 0.01ms !important;
|
|
343
|
+
animation-iteration-count: 1 !important;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
/* ===============================
|
|
349
|
+
NAVIGATION
|
|
350
|
+
================================== */
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
*::-webkit-scrollbar {
|
|
354
|
+
width: 2px !important;
|
|
355
|
+
height: 6px !important;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
*::-webkit-scrollbar-track {
|
|
359
|
+
background: transparent !important;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
*::-webkit-scrollbar-thumb {
|
|
363
|
+
background-color: #1a3380 !important;
|
|
364
|
+
border-radius: 9999px !important;
|
|
365
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "./globals.css";
|
|
2
|
+
import type { Metadata, Viewport } from "next";
|
|
3
|
+
import { Montserrat } from "next/font/google";
|
|
4
|
+
|
|
5
|
+
const montserrat = Montserrat({
|
|
6
|
+
variable: "--font-montserrat",
|
|
7
|
+
subsets: ["latin"],
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const metadata: Metadata = {
|
|
11
|
+
title: "Modoock",
|
|
12
|
+
description: "Boilerplate Modoock",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const viewport: Viewport = {
|
|
16
|
+
width: "device-width",
|
|
17
|
+
initialScale: 1,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default function RootLayout({ children }: LayoutProps<"/">) {
|
|
21
|
+
return (
|
|
22
|
+
<html lang="fr" className={`${montserrat.className} antialiased`}>
|
|
23
|
+
<body className="flex h-screen overflow-hidden bg-background">
|
|
24
|
+
{children}
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Header from "./header";
|
|
3
|
+
import SideNav from "./side-nav";
|
|
4
|
+
|
|
5
|
+
export default function AppLayout({ children }: { children: React.ReactNode }) {
|
|
6
|
+
return (
|
|
7
|
+
<div className="flex h-full min-h-0 w-full">
|
|
8
|
+
{/* SideNav */}
|
|
9
|
+
<SideNav />
|
|
10
|
+
|
|
11
|
+
{/* Main application area — vertical page scroll (overflow-y-auto),
|
|
12
|
+
allowed at every breakpoint. Per `knowledge-base/rules/architecture/layout.mdc`:
|
|
13
|
+
Dashboard, list and compact-detail pages (/, equipment, infrastructure, incidents
|
|
14
|
+
and their [id] detail pages, plus /interventions, /projects, /patients, /research) MUST NOT create page-level vertical
|
|
15
|
+
scrolling at md+: their `flex min-h-0 flex-1` roots plus internally
|
|
16
|
+
scrolling components (UserTable, InfoCard with `scrollable`) keep
|
|
17
|
+
them fitting the viewport. Workflow / dossier pages (/change-request) and other pages
|
|
18
|
+
(/tables, /design-system) use this scroll when their
|
|
19
|
+
content is taller than the visible area.
|
|
20
|
+
Below md, page-level vertical scrolling is allowed on ALL pages so
|
|
21
|
+
reflowed content stays reachable (no internal component scrolling).
|
|
22
|
+
The bottom padding (component scale — pages carry their own section
|
|
23
|
+
padding) keeps content detached from the viewport bottom. */}
|
|
24
|
+
<main className="block min-h-0 flex-1 overflow-y-auto overflow-x-hidden pb-component md:flex md:flex-col">
|
|
25
|
+
<Header />
|
|
26
|
+
{children}
|
|
27
|
+
</main>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { usePathname, useRouter } from "next/navigation";
|
|
4
|
+
import { ClickableButton, Icon } from "@/components/ui";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Titre (et sous-titre optionnel) affiché dans le header pour chaque route.
|
|
8
|
+
* Source unique du titre de page : les pages ne redéfinissent pas le leur.
|
|
9
|
+
*/
|
|
10
|
+
const HEADER_META: Record<string, { title: string; description?: string }> = {
|
|
11
|
+
"/": { title: "Beginning" },
|
|
12
|
+
"/components": { title: "Components" },
|
|
13
|
+
"/patients": {
|
|
14
|
+
title: "Patients",
|
|
15
|
+
description: "Registre des patients.",
|
|
16
|
+
},
|
|
17
|
+
"/design-system": {
|
|
18
|
+
title: "Design System",
|
|
19
|
+
description:
|
|
20
|
+
"A practical visual language for building consistent interfaces.",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default function Header() {
|
|
25
|
+
const pathname = usePathname();
|
|
26
|
+
const router = useRouter();
|
|
27
|
+
|
|
28
|
+
const meta =
|
|
29
|
+
HEADER_META[pathname] ??
|
|
30
|
+
(pathname.startsWith("/patients/")
|
|
31
|
+
? { title: "Dossier patient" }
|
|
32
|
+
: { title: "Modoock" });
|
|
33
|
+
|
|
34
|
+
const handleRefresh = () => {
|
|
35
|
+
router.refresh();
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const handleBack = () => {
|
|
39
|
+
router.back();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<header className="flex items-center justify-between gap-inline bg-background px-component pb-control pt-component">
|
|
44
|
+
<div className="flex min-w-0 items-center gap-inline">
|
|
45
|
+
<ClickableButton
|
|
46
|
+
type="button"
|
|
47
|
+
onClick={handleBack}
|
|
48
|
+
variant="ghost"
|
|
49
|
+
aria-label="Revenir à la page précédente"
|
|
50
|
+
title="Page précédente"
|
|
51
|
+
className="shrink-0 px-2"
|
|
52
|
+
>
|
|
53
|
+
<Icon name="ArrowLeft" aria-hidden="true" />
|
|
54
|
+
</ClickableButton>
|
|
55
|
+
<div className="min-w-0">
|
|
56
|
+
<h1 className="truncate text-page-title text-foreground">
|
|
57
|
+
{meta.title}
|
|
58
|
+
</h1>
|
|
59
|
+
{meta.description && (
|
|
60
|
+
<p className="truncate text-small text-muted-foreground">
|
|
61
|
+
{meta.description}
|
|
62
|
+
</p>
|
|
63
|
+
)}
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
<ClickableButton type="button" onClick={handleRefresh} variant="secondary">
|
|
67
|
+
<Icon name="RefreshCw" aria-hidden="true" />
|
|
68
|
+
Actualiser
|
|
69
|
+
</ClickableButton>
|
|
70
|
+
</header>
|
|
71
|
+
);
|
|
72
|
+
}
|