From db7a0cef96eef2bbcdcd7338a78a1b16420d6e98 Mon Sep 17 00:00:00 2001 From: Froidefond Julien Date: Tue, 3 Mar 2026 15:50:15 +0100 Subject: [PATCH] refactor(ui): unify low-level controls and expand design system --- src/app/(auth)/login/page.tsx | 24 +- src/app/(auth)/register/page.tsx | 41 +- src/app/design-system/page.tsx | 525 ++++++++++++++++++ src/app/gif-mood/new/page.tsx | 23 +- src/app/objectives/page.tsx | 11 +- src/app/page.tsx | 7 +- src/app/profile/PasswordForm.tsx | 34 +- src/app/profile/ProfileForm.tsx | 40 +- src/app/sessions/NewWorkshopDropdown.tsx | 58 +- src/app/sessions/SessionCard.tsx | 51 +- src/app/teams/[id]/page.tsx | 2 +- src/app/teams/new/page.tsx | 2 +- src/app/teams/page.tsx | 4 +- src/app/weather/new/page.tsx | 23 +- src/app/weekly-checkin/new/page.tsx | 23 +- src/app/year-review/new/page.tsx | 25 +- src/components/collaboration/ShareModal.tsx | 71 +-- src/components/layout/Header.tsx | 4 +- src/components/layout/NavLinks.tsx | 12 + src/components/layout/UserMenu.tsx | 64 +-- src/components/layout/WorkshopsDropdown.tsx | 62 +-- .../moving-motivators/MotivatorBoard.tsx | 29 +- src/components/okrs/OKRCard.tsx | 55 +- src/components/okrs/OKRForm.tsx | 2 +- src/components/swot/ActionPanel.tsx | 74 ++- src/components/swot/SwotBoard.tsx | 8 +- src/components/swot/SwotCard.tsx | 44 +- src/components/swot/SwotQuadrant.tsx | 50 +- src/components/teams/AddMemberModal.tsx | 2 +- src/components/teams/DeleteTeamButton.tsx | 8 +- src/components/teams/MembersList.tsx | 5 +- src/components/ui/Button.tsx | 35 +- src/components/ui/Disclosure.tsx | 52 ++ src/components/ui/DropdownMenu.tsx | 29 + src/components/ui/FormField.tsx | 67 +++ src/components/ui/IconButton.tsx | 53 ++ src/components/ui/InlineAddItem.tsx | 59 ++ src/components/ui/InlineEditor.tsx | 68 +++ src/components/ui/InlineFormActions.tsx | 20 +- src/components/ui/SegmentedControl.tsx | 59 ++ src/components/ui/index.ts | 9 +- src/components/weather/WeatherInfoPanel.tsx | 78 +-- src/components/weather/WeatherTrendChart.tsx | 34 +- .../weekly-checkin/WeeklyCheckInCard.tsx | 28 +- .../weekly-checkin/WeeklyCheckInSection.tsx | 65 +-- src/components/year-review/YearReviewCard.tsx | 28 +- .../year-review/YearReviewSection.tsx | 48 +- 47 files changed, 1404 insertions(+), 711 deletions(-) create mode 100644 src/app/design-system/page.tsx create mode 100644 src/components/ui/Disclosure.tsx create mode 100644 src/components/ui/DropdownMenu.tsx create mode 100644 src/components/ui/FormField.tsx create mode 100644 src/components/ui/IconButton.tsx create mode 100644 src/components/ui/InlineAddItem.tsx create mode 100644 src/components/ui/InlineEditor.tsx create mode 100644 src/components/ui/SegmentedControl.tsx diff --git a/src/app/(auth)/login/page.tsx b/src/app/(auth)/login/page.tsx index cdc120f..bf1e420 100644 --- a/src/app/(auth)/login/page.tsx +++ b/src/app/(auth)/login/page.tsx @@ -4,7 +4,7 @@ import { useState } from 'react'; import { signIn } from 'next-auth/react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; -import { RocketIcon } from '@/components/ui'; +import { Button, Input, RocketIcon } from '@/components/ui'; export default function LoginPage() { const router = useRouter(); @@ -62,42 +62,32 @@ export default function LoginPage() { )}
- -
- -
- +

Pas encore de compte ?{' '} diff --git a/src/app/(auth)/register/page.tsx b/src/app/(auth)/register/page.tsx index 0173b78..77320eb 100644 --- a/src/app/(auth)/register/page.tsx +++ b/src/app/(auth)/register/page.tsx @@ -4,7 +4,7 @@ import { useState } from 'react'; import { signIn } from 'next-auth/react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; -import { RocketIcon } from '@/components/ui'; +import { Button, Input, RocketIcon } from '@/components/ui'; export default function RegisterPage() { const router = useRouter(); @@ -91,74 +91,55 @@ export default function RegisterPage() { )}

- -
- -
- -
- -
- +

Déjà un compte ?{' '} diff --git a/src/app/design-system/page.tsx b/src/app/design-system/page.tsx new file mode 100644 index 0000000..54a0950 --- /dev/null +++ b/src/app/design-system/page.tsx @@ -0,0 +1,525 @@ +'use client'; + +import { useState } from 'react'; +import { + Avatar, + Badge, + Button, + Card, + CardContent, + CardDescription, + CardFooter, + CardHeader, + CardTitle, + CollaboratorDisplay, + DateInput, + Disclosure, + DropdownMenu, + EditableGifMoodTitle, + EditableMotivatorTitle, + EditableSessionTitle, + EditableTitle, + EditableWeatherTitle, + EditableWeeklyCheckInTitle, + EditableYearReviewTitle, + InlineFormActions, + Input, + IconCheck, + IconClose, + IconDuplicate, + IconEdit, + IconButton, + IconPlus, + IconTrash, + Modal, + ModalFooter, + PageHeader, + ParticipantInput, + RocketIcon, + Select, + SegmentedControl, + SessionPageHeader, + Textarea, + ToggleGroup, + FormField, + NumberInput, +} from '@/components/ui'; + +const BUTTON_VARIANTS = [ + 'primary', + 'secondary', + 'outline', + 'ghost', + 'destructive', + 'brand', +] as const; +const BUTTON_SIZES = ['sm', 'md', 'lg'] as const; + +const BADGE_VARIANTS = [ + 'default', + 'primary', + 'strength', + 'weakness', + 'opportunity', + 'threat', + 'success', + 'warning', + 'destructive', + 'accent', +] as const; + +const SELECT_OPTIONS = [ + { value: 'editor', label: 'Editeur' }, + { value: 'viewer', label: 'Lecteur' }, + { value: 'admin', label: 'Admin' }, +]; + +const SECTION_LINKS = [ + { id: 'buttons', label: 'Buttons' }, + { id: 'badges', label: 'Badges' }, + { id: 'icon-button', label: 'IconButton' }, + { id: 'form-inputs', label: 'Form Inputs' }, + { id: 'select-toggle', label: 'Select & Toggle' }, + { id: 'form-field', label: 'FormField / Date / Number' }, + { id: 'cards', label: 'Cards' }, + { id: 'avatars', label: 'Avatar & Collaborators' }, + { id: 'disclosure-dropdown', label: 'Disclosure & Dropdown' }, + { id: 'menu', label: 'Menu' }, + { id: 'editable-titles', label: 'Editable Titles' }, + { id: 'session-header', label: 'Session Header' }, + { id: 'participant-input', label: 'ParticipantInput' }, + { id: 'icons', label: 'Icons' }, + { id: 'modal', label: 'Modal' }, +] as const; + +export default function DesignSystemPage() { + const [modalOpen, setModalOpen] = useState(false); + const [toggleValue, setToggleValue] = useState<'cards' | 'table' | 'list'>('cards'); + const [selectMd, setSelectMd] = useState('editor'); + const [selectSm, setSelectSm] = useState('viewer'); + const [selectXs, setSelectXs] = useState('admin'); + const [selectLg, setSelectLg] = useState('editor'); + const [menuCount, setMenuCount] = useState(0); + + return ( +

+ + Action principale + + } + /> + +
+ + +
+ +

Buttons

+
+ {BUTTON_SIZES.map((size) => ( +
+ {size} + {BUTTON_VARIANTS.map((variant) => ( + + ))} +
+ ))} +
+ + +
+
+
+ + +

Badges

+
+ {BADGE_VARIANTS.map((variant) => ( + + {variant} + + ))} +
+
+ + +

IconButton

+
+ } label="Edit" /> + } label="Duplicate" variant="primary" /> + } label="Delete" variant="destructive" /> +
+
+ + +

Form Inputs

+
+ + +