lerelais-front-library 0.1.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/.cursor/skills/project-structure/SKILL.md +51 -0
- package/.cursor/skills/storybook-react/SKILL.md +60 -0
- package/.cursor/skills/testing-react/SKILL.md +52 -0
- package/README.md +93 -0
- package/index.html +18 -0
- package/package.json +34 -0
- package/src/App.css +49 -0
- package/src/App.tsx +366 -0
- package/src/assets/icons/alert-triangle.svg +7 -0
- package/src/assets/icons/arrow-right.svg +5 -0
- package/src/assets/icons/bell.svg +6 -0
- package/src/assets/icons/chevron-down.svg +5 -0
- package/src/assets/icons/chevron-right.svg +5 -0
- package/src/assets/icons/clock-muted.svg +10 -0
- package/src/assets/icons/clock.svg +11 -0
- package/src/assets/icons/close.svg +5 -0
- package/src/assets/icons/core-camera.svg +5 -0
- package/src/assets/icons/core-check-sm.svg +5 -0
- package/src/assets/icons/core-check-white.svg +5 -0
- package/src/assets/icons/core-check.svg +5 -0
- package/src/assets/icons/core-chevron.svg +5 -0
- package/src/assets/icons/core-dot.svg +3 -0
- package/src/assets/icons/core-lock-form.svg +5 -0
- package/src/assets/icons/core-lock.svg +5 -0
- package/src/assets/icons/core-map-pin.svg +5 -0
- package/src/assets/icons/core-package-lg.svg +5 -0
- package/src/assets/icons/core-package.svg +5 -0
- package/src/assets/icons/core-pin-info.svg +6 -0
- package/src/assets/icons/core-pin-value.svg +5 -0
- package/src/assets/icons/core-pin-white.svg +5 -0
- package/src/assets/icons/core-plus.svg +5 -0
- package/src/assets/icons/core-search-dark.svg +5 -0
- package/src/assets/icons/core-search.svg +5 -0
- package/src/assets/icons/core-store.svg +9 -0
- package/src/assets/icons/core-x.svg +5 -0
- package/src/assets/icons/heart.svg +5 -0
- package/src/assets/icons/logout.svg +7 -0
- package/src/assets/icons/map-pin.svg +5 -0
- package/src/assets/icons/package-read.svg +8 -0
- package/src/assets/icons/package-white.svg +8 -0
- package/src/assets/icons/package.svg +8 -0
- package/src/assets/icons/plus.svg +6 -0
- package/src/assets/icons/settings.svg +6 -0
- package/src/assets/icons/switch-off.svg +19 -0
- package/src/assets/icons/switch-on.svg +19 -0
- package/src/assets/icons/unread-dot.svg +3 -0
- package/src/assets/icons/upload-cloud.svg +5 -0
- package/src/assets/icons/user.svg +6 -0
- package/src/assets/icons.ts +41 -0
- package/src/components/Accordion/Accordion.module.css +34 -0
- package/src/components/Accordion/Accordion.test.tsx +20 -0
- package/src/components/Accordion/Accordion.tsx +38 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/ActionCard/ActionCard.module.css +50 -0
- package/src/components/ActionCard/ActionCard.test.tsx +15 -0
- package/src/components/ActionCard/ActionCard.tsx +33 -0
- package/src/components/ActionCard/index.ts +1 -0
- package/src/components/Alert/Alert.module.css +47 -0
- package/src/components/Alert/Alert.test.tsx +14 -0
- package/src/components/Alert/Alert.tsx +27 -0
- package/src/components/Alert/index.ts +1 -0
- package/src/components/Avatar/Avatar.module.css +37 -0
- package/src/components/Avatar/Avatar.test.tsx +9 -0
- package/src/components/Avatar/Avatar.tsx +18 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Badge/Badge.module.css +37 -0
- package/src/components/Badge/Badge.test.tsx +14 -0
- package/src/components/Badge/Badge.tsx +21 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/BarChart/BarChart.module.css +57 -0
- package/src/components/BarChart/BarChart.test.tsx +18 -0
- package/src/components/BarChart/BarChart.tsx +47 -0
- package/src/components/BarChart/index.ts +1 -0
- package/src/components/BenefitsCard/BenefitsCard.module.css +44 -0
- package/src/components/BenefitsCard/BenefitsCard.test.tsx +10 -0
- package/src/components/BenefitsCard/BenefitsCard.tsx +33 -0
- package/src/components/BenefitsCard/index.ts +1 -0
- package/src/components/BottomNavItem/BottomNavItem.module.css +24 -0
- package/src/components/BottomNavItem/BottomNavItem.test.tsx +20 -0
- package/src/components/BottomNavItem/BottomNavItem.tsx +23 -0
- package/src/components/BottomNavItem/index.ts +1 -0
- package/src/components/Breadcrumb/Breadcrumb.module.css +31 -0
- package/src/components/Breadcrumb/Breadcrumb.test.tsx +29 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +36 -0
- package/src/components/Breadcrumb/index.ts +1 -0
- package/src/components/Button/Button.module.css +61 -0
- package/src/components/Button/Button.test.tsx +34 -0
- package/src/components/Button/Button.tsx +24 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.module.css +53 -0
- package/src/components/Checkbox/Checkbox.test.tsx +20 -0
- package/src/components/Checkbox/Checkbox.tsx +20 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/ConfirmModal/ConfirmModal.module.css +69 -0
- package/src/components/ConfirmModal/ConfirmModal.test.tsx +25 -0
- package/src/components/ConfirmModal/ConfirmModal.tsx +50 -0
- package/src/components/ConfirmModal/index.ts +1 -0
- package/src/components/CoreButton/CoreButton.module.css +71 -0
- package/src/components/CoreButton/CoreButton.test.tsx +24 -0
- package/src/components/CoreButton/CoreButton.tsx +27 -0
- package/src/components/CoreButton/index.ts +1 -0
- package/src/components/CoreField/CoreField.module.css +31 -0
- package/src/components/CoreField/CoreField.test.tsx +15 -0
- package/src/components/CoreField/CoreField.tsx +18 -0
- package/src/components/CoreField/index.ts +1 -0
- package/src/components/CoreSelect/CoreSelect.module.css +37 -0
- package/src/components/CoreSelect/CoreSelect.test.tsx +22 -0
- package/src/components/CoreSelect/CoreSelect.tsx +29 -0
- package/src/components/CoreSelect/index.ts +1 -0
- package/src/components/CoreTabs/CoreTabs.module.css +41 -0
- package/src/components/CoreTabs/CoreTabs.test.tsx +18 -0
- package/src/components/CoreTabs/CoreTabs.tsx +67 -0
- package/src/components/CoreTabs/index.ts +1 -0
- package/src/components/DashboardParcelRow/DashboardParcelRow.module.css +61 -0
- package/src/components/DashboardParcelRow/DashboardParcelRow.test.tsx +37 -0
- package/src/components/DashboardParcelRow/DashboardParcelRow.tsx +41 -0
- package/src/components/DashboardParcelRow/index.ts +1 -0
- package/src/components/DataFiltersToolbar/DataFiltersToolbar.module.css +29 -0
- package/src/components/DataFiltersToolbar/DataFiltersToolbar.test.tsx +15 -0
- package/src/components/DataFiltersToolbar/DataFiltersToolbar.tsx +22 -0
- package/src/components/DataFiltersToolbar/index.ts +1 -0
- package/src/components/DataSearchBar/DataSearchBar.module.css +28 -0
- package/src/components/DataSearchBar/DataSearchBar.test.tsx +15 -0
- package/src/components/DataSearchBar/DataSearchBar.tsx +15 -0
- package/src/components/DataSearchBar/index.ts +1 -0
- package/src/components/DataTable/DataTable.module.css +57 -0
- package/src/components/DataTable/DataTable.test.tsx +12 -0
- package/src/components/DataTable/DataTable.tsx +67 -0
- package/src/components/DataTable/index.ts +1 -0
- package/src/components/Divider/Divider.module.css +29 -0
- package/src/components/Divider/Divider.test.tsx +9 -0
- package/src/components/Divider/Divider.tsx +21 -0
- package/src/components/Divider/index.ts +1 -0
- package/src/components/DropdownMenu/DropdownMenu.module.css +45 -0
- package/src/components/DropdownMenu/DropdownMenu.test.tsx +21 -0
- package/src/components/DropdownMenu/DropdownMenu.tsx +45 -0
- package/src/components/DropdownMenu/index.ts +1 -0
- package/src/components/EmptyState/EmptyState.module.css +52 -0
- package/src/components/EmptyState/EmptyState.test.tsx +20 -0
- package/src/components/EmptyState/EmptyState.tsx +33 -0
- package/src/components/EmptyState/index.ts +1 -0
- package/src/components/FaqItem/FaqItem.module.css +47 -0
- package/src/components/FaqItem/FaqItem.test.tsx +14 -0
- package/src/components/FaqItem/FaqItem.tsx +28 -0
- package/src/components/FaqItem/index.ts +1 -0
- package/src/components/FavoriteRelayCard/FavoriteRelayCard.module.css +83 -0
- package/src/components/FavoriteRelayCard/FavoriteRelayCard.test.tsx +37 -0
- package/src/components/FavoriteRelayCard/FavoriteRelayCard.tsx +58 -0
- package/src/components/FavoriteRelayCard/index.ts +1 -0
- package/src/components/FeatureCard/FeatureCard.module.css +62 -0
- package/src/components/FeatureCard/FeatureCard.test.tsx +10 -0
- package/src/components/FeatureCard/FeatureCard.tsx +30 -0
- package/src/components/FeatureCard/index.ts +1 -0
- package/src/components/FileUpload/FileUpload.module.css +41 -0
- package/src/components/FileUpload/FileUpload.test.tsx +22 -0
- package/src/components/FileUpload/FileUpload.tsx +26 -0
- package/src/components/FileUpload/index.ts +1 -0
- package/src/components/FilterPill/FilterPill.module.css +18 -0
- package/src/components/FilterPill/FilterPill.test.tsx +19 -0
- package/src/components/FilterPill/FilterPill.tsx +20 -0
- package/src/components/FilterPill/index.ts +1 -0
- package/src/components/Footer/Footer.module.css +57 -0
- package/src/components/Footer/Footer.test.tsx +10 -0
- package/src/components/Footer/Footer.tsx +63 -0
- package/src/components/Footer/index.ts +1 -0
- package/src/components/Icon/Icon.tsx +20 -0
- package/src/components/Icon/index.ts +1 -0
- package/src/components/InfoRow/InfoRow.module.css +33 -0
- package/src/components/InfoRow/InfoRow.test.tsx +9 -0
- package/src/components/InfoRow/InfoRow.tsx +21 -0
- package/src/components/InfoRow/index.ts +1 -0
- package/src/components/LinkButton/LinkButton.module.css +22 -0
- package/src/components/LinkButton/LinkButton.test.tsx +9 -0
- package/src/components/LinkButton/LinkButton.tsx +17 -0
- package/src/components/LinkButton/index.ts +1 -0
- package/src/components/LocationCard/LocationCard.module.css +61 -0
- package/src/components/LocationCard/LocationCard.test.tsx +9 -0
- package/src/components/LocationCard/LocationCard.tsx +27 -0
- package/src/components/LocationCard/index.ts +1 -0
- package/src/components/Logo/Logo.module.css +30 -0
- package/src/components/Logo/Logo.tsx +18 -0
- package/src/components/Logo/index.ts +1 -0
- package/src/components/MetricCard/MetricCard.module.css +27 -0
- package/src/components/MetricCard/MetricCard.test.tsx +10 -0
- package/src/components/MetricCard/MetricCard.tsx +19 -0
- package/src/components/MetricCard/index.ts +1 -0
- package/src/components/Navbar/Navbar.module.css +87 -0
- package/src/components/Navbar/Navbar.test.tsx +21 -0
- package/src/components/Navbar/Navbar.tsx +77 -0
- package/src/components/Navbar/index.ts +1 -0
- package/src/components/NotificationItem/NotificationItem.module.css +73 -0
- package/src/components/NotificationItem/NotificationItem.test.tsx +22 -0
- package/src/components/NotificationItem/NotificationItem.tsx +30 -0
- package/src/components/NotificationItem/index.ts +1 -0
- package/src/components/NotificationRow/NotificationRow.module.css +49 -0
- package/src/components/NotificationRow/NotificationRow.test.tsx +15 -0
- package/src/components/NotificationRow/NotificationRow.tsx +26 -0
- package/src/components/NotificationRow/index.ts +1 -0
- package/src/components/OutcomeModal/OutcomeModal.module.css +101 -0
- package/src/components/OutcomeModal/OutcomeModal.test.tsx +15 -0
- package/src/components/OutcomeModal/OutcomeModal.tsx +45 -0
- package/src/components/OutcomeModal/index.ts +1 -0
- package/src/components/Pagination/Pagination.module.css +27 -0
- package/src/components/Pagination/Pagination.test.tsx +25 -0
- package/src/components/Pagination/Pagination.tsx +41 -0
- package/src/components/Pagination/index.ts +1 -0
- package/src/components/ParcelCard/ParcelCard.module.css +34 -0
- package/src/components/ParcelCard/ParcelCard.test.tsx +17 -0
- package/src/components/ParcelCard/ParcelCard.tsx +21 -0
- package/src/components/ParcelCard/index.ts +1 -0
- package/src/components/ParcelRow/ParcelRow.module.css +25 -0
- package/src/components/ParcelRow/ParcelRow.test.tsx +18 -0
- package/src/components/ParcelRow/ParcelRow.tsx +31 -0
- package/src/components/ParcelRow/index.ts +1 -0
- package/src/components/ParcelTimeline/ParcelTimeline.module.css +68 -0
- package/src/components/ParcelTimeline/ParcelTimeline.test.tsx +17 -0
- package/src/components/ParcelTimeline/ParcelTimeline.tsx +33 -0
- package/src/components/ParcelTimeline/index.ts +1 -0
- package/src/components/PhotoUpload/PhotoUpload.module.css +39 -0
- package/src/components/PhotoUpload/PhotoUpload.test.tsx +16 -0
- package/src/components/PhotoUpload/PhotoUpload.tsx +29 -0
- package/src/components/PhotoUpload/index.ts +1 -0
- package/src/components/ProcessBadge/ProcessBadge.module.css +29 -0
- package/src/components/ProcessBadge/ProcessBadge.test.tsx +9 -0
- package/src/components/ProcessBadge/ProcessBadge.tsx +19 -0
- package/src/components/ProcessBadge/index.ts +1 -0
- package/src/components/ProgressBar/ProgressBar.module.css +56 -0
- package/src/components/ProgressBar/ProgressBar.test.tsx +18 -0
- package/src/components/ProgressBar/ProgressBar.tsx +33 -0
- package/src/components/ProgressBar/index.ts +1 -0
- package/src/components/QrScanner/QrScanner.module.css +50 -0
- package/src/components/QrScanner/QrScanner.test.tsx +20 -0
- package/src/components/QrScanner/QrScanner.tsx +27 -0
- package/src/components/QrScanner/index.ts +1 -0
- package/src/components/QuestionSearch/QuestionSearch.module.css +28 -0
- package/src/components/QuestionSearch/QuestionSearch.test.tsx +15 -0
- package/src/components/QuestionSearch/QuestionSearch.tsx +26 -0
- package/src/components/QuestionSearch/index.ts +1 -0
- package/src/components/QuickActionCard/QuickActionCard.module.css +31 -0
- package/src/components/QuickActionCard/QuickActionCard.test.tsx +20 -0
- package/src/components/QuickActionCard/QuickActionCard.tsx +22 -0
- package/src/components/QuickActionCard/index.ts +1 -0
- package/src/components/Radio/Radio.module.css +53 -0
- package/src/components/Radio/Radio.test.tsx +20 -0
- package/src/components/Radio/Radio.tsx +20 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/RelayCard/RelayCard.module.css +38 -0
- package/src/components/RelayCard/RelayCard.test.tsx +22 -0
- package/src/components/RelayCard/RelayCard.tsx +31 -0
- package/src/components/RelayCard/index.ts +1 -0
- package/src/components/RelayResultCard/RelayResultCard.module.css +82 -0
- package/src/components/RelayResultCard/RelayResultCard.test.tsx +10 -0
- package/src/components/RelayResultCard/RelayResultCard.tsx +34 -0
- package/src/components/RelayResultCard/index.ts +1 -0
- package/src/components/ResetPasswordCard/ResetPasswordCard.module.css +102 -0
- package/src/components/ResetPasswordCard/ResetPasswordCard.test.tsx +16 -0
- package/src/components/ResetPasswordCard/ResetPasswordCard.tsx +45 -0
- package/src/components/ResetPasswordCard/index.ts +1 -0
- package/src/components/SearchBar/SearchBar.module.css +33 -0
- package/src/components/SearchBar/SearchBar.test.tsx +19 -0
- package/src/components/SearchBar/SearchBar.tsx +18 -0
- package/src/components/SearchBar/index.ts +1 -0
- package/src/components/Select/Select.module.css +64 -0
- package/src/components/Select/Select.test.tsx +24 -0
- package/src/components/Select/Select.tsx +60 -0
- package/src/components/Select/index.ts +1 -0
- package/src/components/ShipmentStatus/ShipmentStatus.module.css +41 -0
- package/src/components/ShipmentStatus/ShipmentStatus.test.tsx +14 -0
- package/src/components/ShipmentStatus/ShipmentStatus.tsx +52 -0
- package/src/components/ShipmentStatus/index.ts +1 -0
- package/src/components/Sidebar/Sidebar.module.css +79 -0
- package/src/components/Sidebar/Sidebar.test.tsx +21 -0
- package/src/components/Sidebar/Sidebar.tsx +98 -0
- package/src/components/Sidebar/index.ts +1 -0
- package/src/components/SidebarNavItem/SidebarNavItem.module.css +21 -0
- package/src/components/SidebarNavItem/SidebarNavItem.test.tsx +20 -0
- package/src/components/SidebarNavItem/SidebarNavItem.tsx +22 -0
- package/src/components/SidebarNavItem/index.ts +1 -0
- package/src/components/Skeleton/Skeleton.module.css +22 -0
- package/src/components/Skeleton/Skeleton.test.tsx +9 -0
- package/src/components/Skeleton/Skeleton.tsx +13 -0
- package/src/components/Skeleton/index.ts +1 -0
- package/src/components/StatCard/StatCard.module.css +22 -0
- package/src/components/StatCard/StatCard.test.tsx +9 -0
- package/src/components/StatCard/StatCard.tsx +19 -0
- package/src/components/StatCard/index.ts +1 -0
- package/src/components/StatusSummary/StatusSummary.module.css +43 -0
- package/src/components/StatusSummary/StatusSummary.test.tsx +9 -0
- package/src/components/StatusSummary/StatusSummary.tsx +32 -0
- package/src/components/StatusSummary/index.ts +1 -0
- package/src/components/StepCard/StepCard.module.css +48 -0
- package/src/components/StepCard/StepCard.test.tsx +9 -0
- package/src/components/StepCard/StepCard.tsx +27 -0
- package/src/components/StepCard/index.ts +1 -0
- package/src/components/Stepper/Stepper.module.css +66 -0
- package/src/components/Stepper/Stepper.test.tsx +20 -0
- package/src/components/Stepper/Stepper.tsx +39 -0
- package/src/components/Stepper/index.ts +1 -0
- package/src/components/StepsList/StepsList.module.css +35 -0
- package/src/components/StepsList/StepsList.test.tsx +10 -0
- package/src/components/StepsList/StepsList.tsx +24 -0
- package/src/components/StepsList/index.ts +1 -0
- package/src/components/SuccessFeedback/SuccessFeedback.module.css +42 -0
- package/src/components/SuccessFeedback/SuccessFeedback.test.tsx +9 -0
- package/src/components/SuccessFeedback/SuccessFeedback.tsx +21 -0
- package/src/components/SuccessFeedback/index.ts +1 -0
- package/src/components/Switch/Switch.module.css +57 -0
- package/src/components/Switch/Switch.test.tsx +20 -0
- package/src/components/Switch/Switch.tsx +22 -0
- package/src/components/Switch/index.ts +1 -0
- package/src/components/Tabs/Tabs.module.css +26 -0
- package/src/components/Tabs/Tabs.test.tsx +34 -0
- package/src/components/Tabs/Tabs.tsx +38 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/Tag/Tag.module.css +39 -0
- package/src/components/Tag/Tag.test.tsx +24 -0
- package/src/components/Tag/Tag.tsx +25 -0
- package/src/components/Tag/index.ts +1 -0
- package/src/components/TextField/TextField.module.css +55 -0
- package/src/components/TextField/TextField.test.tsx +24 -0
- package/src/components/TextField/TextField.tsx +37 -0
- package/src/components/TextField/index.ts +1 -0
- package/src/components/Toast/Toast.module.css +72 -0
- package/src/components/Toast/Toast.test.tsx +20 -0
- package/src/components/Toast/Toast.tsx +32 -0
- package/src/components/Toast/index.ts +1 -0
- package/src/components/Tooltip/Tooltip.module.css +37 -0
- package/src/components/Tooltip/Tooltip.test.tsx +22 -0
- package/src/components/Tooltip/Tooltip.tsx +20 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/TrackingBadge/TrackingBadge.module.css +10 -0
- package/src/components/TrackingBadge/TrackingBadge.test.tsx +9 -0
- package/src/components/TrackingBadge/TrackingBadge.tsx +9 -0
- package/src/components/TrackingBadge/index.ts +1 -0
- package/src/components/TrackingCard/TrackingCard.module.css +128 -0
- package/src/components/TrackingCard/TrackingCard.test.tsx +10 -0
- package/src/components/TrackingCard/TrackingCard.tsx +58 -0
- package/src/components/TrackingCard/index.ts +1 -0
- package/src/components/TrackingSearch/TrackingSearch.module.css +35 -0
- package/src/components/TrackingSearch/TrackingSearch.test.tsx +15 -0
- package/src/components/TrackingSearch/TrackingSearch.tsx +24 -0
- package/src/components/TrackingSearch/index.ts +1 -0
- package/src/components/ValueCard/ValueCard.module.css +38 -0
- package/src/components/ValueCard/ValueCard.test.tsx +9 -0
- package/src/components/ValueCard/ValueCard.tsx +24 -0
- package/src/components/ValueCard/index.ts +1 -0
- package/src/lib/cn.ts +3 -0
- package/src/main.tsx +10 -0
- package/src/styles/global.css +36 -0
- package/src/styles/tokens.css +61 -0
- package/src/test/setup.ts +9 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.app.json +25 -0
- package/tsconfig.app.tsbuildinfo +1 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +18 -0
- package/tsconfig.node.tsbuildinfo +1 -0
- package/vite.config.ts +12 -0
- package/vitest.config.ts +22 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import { Logo } from '@/components/Logo';
|
|
3
|
+
import styles from './Sidebar.module.css';
|
|
4
|
+
|
|
5
|
+
export type SidebarVariant = 'admin' | 'gerant';
|
|
6
|
+
|
|
7
|
+
export interface SidebarItem {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface SidebarProps {
|
|
13
|
+
variant?: SidebarVariant;
|
|
14
|
+
items?: SidebarItem[];
|
|
15
|
+
activeId?: string;
|
|
16
|
+
onSelect?: (id: string) => void;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const ADMIN_ITEMS: SidebarItem[] = [
|
|
21
|
+
{ id: 'overview', label: 'Vue d’ensemble' },
|
|
22
|
+
{ id: 'users', label: 'Utilisateurs' },
|
|
23
|
+
{ id: 'companies', label: 'Entreprises' },
|
|
24
|
+
{ id: 'relays', label: 'Points relais' },
|
|
25
|
+
{ id: 'parcels', label: 'Colis' },
|
|
26
|
+
{ id: 'delivery', label: 'Livraison & API' },
|
|
27
|
+
{ id: 'payments', label: 'Paiements' },
|
|
28
|
+
{ id: 'disputes', label: 'Litiges' },
|
|
29
|
+
{ id: 'support', label: 'Support' },
|
|
30
|
+
{ id: 'reports', label: 'Rapports' },
|
|
31
|
+
{ id: 'settings', label: 'Paramètres' },
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
export const GERANT_ITEMS: SidebarItem[] = [
|
|
35
|
+
{ id: 'dashboard', label: 'Tableau de bord' },
|
|
36
|
+
{ id: 'incoming', label: 'Colis à réceptionner' },
|
|
37
|
+
{ id: 'available', label: 'Colis disponibles' },
|
|
38
|
+
{ id: 'scan', label: 'Scan & remise' },
|
|
39
|
+
{ id: 'history', label: 'Historique' },
|
|
40
|
+
{ id: 'alerts', label: 'Alertes' },
|
|
41
|
+
{ id: 'reports', label: 'Rapports' },
|
|
42
|
+
{ id: 'commissions', label: 'Commissions' },
|
|
43
|
+
{ id: 'settings', label: 'Paramètres' },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
export function Sidebar({
|
|
47
|
+
variant = 'admin',
|
|
48
|
+
items,
|
|
49
|
+
activeId,
|
|
50
|
+
onSelect,
|
|
51
|
+
className,
|
|
52
|
+
}: SidebarProps) {
|
|
53
|
+
const navigation = items ?? (variant === 'gerant' ? GERANT_ITEMS : ADMIN_ITEMS);
|
|
54
|
+
const current = activeId ?? navigation[0]?.id;
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<aside className={cn(styles.sidebar, className)}>
|
|
58
|
+
<Logo tone={variant === 'admin' ? 'light' : 'brand'} />
|
|
59
|
+
{variant === 'admin' ? (
|
|
60
|
+
<div className={styles.account}>
|
|
61
|
+
<p className={styles.kicker}>ADMINISTRATION</p>
|
|
62
|
+
<p className={styles.accountName}>Super Admin</p>
|
|
63
|
+
</div>
|
|
64
|
+
) : (
|
|
65
|
+
<div className={styles.account}>
|
|
66
|
+
<p className={styles.accountName}>Point relais</p>
|
|
67
|
+
<p className={styles.meta}>Carrefour City — Abidjan 12e</p>
|
|
68
|
+
<p className={styles.meta}>Relais #PR-0842</p>
|
|
69
|
+
</div>
|
|
70
|
+
)}
|
|
71
|
+
<nav className={styles.nav} aria-label="Navigation latérale">
|
|
72
|
+
{navigation.map((item) => (
|
|
73
|
+
<button
|
|
74
|
+
key={item.id}
|
|
75
|
+
type="button"
|
|
76
|
+
className={cn(styles.item, item.id === current && styles.active)}
|
|
77
|
+
aria-current={item.id === current ? 'page' : undefined}
|
|
78
|
+
onClick={() => onSelect?.(item.id)}
|
|
79
|
+
>
|
|
80
|
+
{item.label}
|
|
81
|
+
</button>
|
|
82
|
+
))}
|
|
83
|
+
</nav>
|
|
84
|
+
{variant === 'admin' ? (
|
|
85
|
+
<div className={styles.status}>
|
|
86
|
+
<p className={styles.kicker}>PLATEFORME</p>
|
|
87
|
+
<p className={styles.ok}>● Tous les services opérationnels</p>
|
|
88
|
+
<p className={styles.meta}>Dernière vérification · à l’instant</p>
|
|
89
|
+
<p className={styles.meta}>Version admin 1.0</p>
|
|
90
|
+
</div>
|
|
91
|
+
) : (
|
|
92
|
+
<button type="button" className={styles.logout}>
|
|
93
|
+
Déconnexion
|
|
94
|
+
</button>
|
|
95
|
+
)}
|
|
96
|
+
</aside>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Sidebar, ADMIN_ITEMS, GERANT_ITEMS, type SidebarProps, type SidebarVariant, type SidebarItem } from './Sidebar';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.item {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
width: 220px;
|
|
5
|
+
height: 44px;
|
|
6
|
+
padding: 0 14px;
|
|
7
|
+
border: 0;
|
|
8
|
+
border-radius: var(--radius-control);
|
|
9
|
+
background: var(--color-sidebar);
|
|
10
|
+
color: var(--color-sidebar-text);
|
|
11
|
+
font-size: 13px;
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
text-align: left;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.active {
|
|
18
|
+
background: var(--color-sidebar-active);
|
|
19
|
+
color: #fff;
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { SidebarNavItem } from './SidebarNavItem';
|
|
4
|
+
|
|
5
|
+
describe('<SidebarNavItem>', () => {
|
|
6
|
+
it('should render the label', () => {
|
|
7
|
+
render(<SidebarNavItem label="Tableau de bord" active />);
|
|
8
|
+
expect(screen.getByRole('button', { name: 'Tableau de bord' })).toHaveAttribute('aria-current', 'page');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should call onClick when activated', async () => {
|
|
12
|
+
const user = userEvent.setup();
|
|
13
|
+
const onClick = vi.fn();
|
|
14
|
+
render(<SidebarNavItem label="Colis" onClick={onClick} />);
|
|
15
|
+
|
|
16
|
+
await user.click(screen.getByRole('button', { name: 'Colis' }));
|
|
17
|
+
|
|
18
|
+
expect(onClick).toHaveBeenCalledOnce();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import styles from './SidebarNavItem.module.css';
|
|
3
|
+
|
|
4
|
+
export interface SidebarNavItemProps {
|
|
5
|
+
label: string;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function SidebarNavItem({ label, active = false, onClick, className }: SidebarNavItemProps) {
|
|
12
|
+
return (
|
|
13
|
+
<button
|
|
14
|
+
type="button"
|
|
15
|
+
className={cn(styles.item, active && styles.active, className)}
|
|
16
|
+
aria-current={active ? 'page' : undefined}
|
|
17
|
+
onClick={onClick}
|
|
18
|
+
>
|
|
19
|
+
{label}
|
|
20
|
+
</button>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SidebarNavItem, type SidebarNavItemProps } from './SidebarNavItem';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.skeleton {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
background: var(--color-skeleton);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.text {
|
|
7
|
+
width: 200px;
|
|
8
|
+
height: 16px;
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.rectangle {
|
|
13
|
+
width: 200px;
|
|
14
|
+
height: 80px;
|
|
15
|
+
border-radius: 8px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.circle {
|
|
19
|
+
width: 48px;
|
|
20
|
+
height: 48px;
|
|
21
|
+
border-radius: 24px;
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { Skeleton } from './Skeleton';
|
|
3
|
+
|
|
4
|
+
describe('<Skeleton>', () => {
|
|
5
|
+
it('should render a loading placeholder', () => {
|
|
6
|
+
const { container } = render(<Skeleton />);
|
|
7
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import styles from './Skeleton.module.css';
|
|
3
|
+
|
|
4
|
+
export type SkeletonType = 'text' | 'rectangle' | 'circle';
|
|
5
|
+
|
|
6
|
+
export interface SkeletonProps {
|
|
7
|
+
type?: SkeletonType;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function Skeleton({ type = 'text', className }: SkeletonProps) {
|
|
12
|
+
return <span className={cn(styles.skeleton, styles[type], className)} aria-hidden="true" />;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Skeleton, type SkeletonProps, type SkeletonType } from './Skeleton';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
width: 420px;
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
padding: 20px 24px;
|
|
8
|
+
border: 1px solid var(--color-border);
|
|
9
|
+
border-radius: var(--radius-xl);
|
|
10
|
+
background: #fff;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.label,
|
|
14
|
+
.hint {
|
|
15
|
+
color: var(--color-text-secondary);
|
|
16
|
+
font-size: 13px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.value {
|
|
20
|
+
font-size: 30px;
|
|
21
|
+
font-weight: 700;
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { StatCard } from './StatCard';
|
|
3
|
+
|
|
4
|
+
describe('<StatCard>', () => {
|
|
5
|
+
it('should render the statistic', () => {
|
|
6
|
+
render(<StatCard label="Colis en cours" value="0" hint="En transit ou en préparation" />);
|
|
7
|
+
expect(screen.getByText('0')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import styles from './StatCard.module.css';
|
|
3
|
+
|
|
4
|
+
export interface StatCardProps {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
hint: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function StatCard({ label, value, hint, className }: StatCardProps) {
|
|
12
|
+
return (
|
|
13
|
+
<article className={cn(styles.card, className)}>
|
|
14
|
+
<p className={styles.label}>{label}</p>
|
|
15
|
+
<p className={styles.value}>{value}</p>
|
|
16
|
+
<p className={styles.hint}>{hint}</p>
|
|
17
|
+
</article>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StatCard, type StatCardProps } from './StatCard';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.summary {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: stretch;
|
|
4
|
+
width: 100%;
|
|
5
|
+
padding: 16px 20px;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
border: 1px solid #e8eaee;
|
|
8
|
+
border-radius: 20px;
|
|
9
|
+
background: #fff;
|
|
10
|
+
box-shadow: 0 8px 24px rgb(16 24 40 / 5%);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.item {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex: 1;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 16px;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.item p {
|
|
22
|
+
margin: 0;
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
line-height: 1.3;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.item p:first-child {
|
|
29
|
+
color: #606978;
|
|
30
|
+
font-size: 12px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.item p:last-child {
|
|
34
|
+
margin-top: 4px;
|
|
35
|
+
color: #191d26;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.rule {
|
|
40
|
+
width: 1px;
|
|
41
|
+
height: 40px;
|
|
42
|
+
background: #e8eaee;
|
|
43
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { StatusSummary } from './StatusSummary';
|
|
3
|
+
|
|
4
|
+
describe('<StatusSummary>', () => {
|
|
5
|
+
it('should render the next step', () => {
|
|
6
|
+
render(<StatusSummary />);
|
|
7
|
+
expect(screen.getByText('Disponible en point relais')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import styles from './StatusSummary.module.css';
|
|
2
|
+
|
|
3
|
+
export interface StatusSummaryItem {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface StatusSummaryProps {
|
|
9
|
+
items?: StatusSummaryItem[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const DEFAULT_ITEMS: StatusSummaryItem[] = [
|
|
13
|
+
{ label: 'Estimé', value: '15 août 2026' },
|
|
14
|
+
{ label: 'Localisation', value: 'Bouaké 3e' },
|
|
15
|
+
{ label: 'Étape suivante', value: 'Disponible en point relais' },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export function StatusSummary({ items = DEFAULT_ITEMS }: StatusSummaryProps) {
|
|
19
|
+
return (
|
|
20
|
+
<div className={styles.summary}>
|
|
21
|
+
{items.map((item, index) => (
|
|
22
|
+
<div key={item.label} className={styles.item}>
|
|
23
|
+
{index > 0 ? <span className={styles.rule} /> : null}
|
|
24
|
+
<div>
|
|
25
|
+
<p>{item.label}</p>
|
|
26
|
+
<p>{item.value}</p>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
))}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StatusSummary, type StatusSummaryItem, type StatusSummaryProps } from './StatusSummary';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 16px;
|
|
5
|
+
width: 100%;
|
|
6
|
+
max-width: 258px;
|
|
7
|
+
padding: 24px;
|
|
8
|
+
border: 1px solid #e5e8ed;
|
|
9
|
+
border-radius: 20px;
|
|
10
|
+
background: #fff;
|
|
11
|
+
box-shadow: 0 4px 6px rgb(0 0 0 / 5%);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.header {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.icon {
|
|
21
|
+
display: grid;
|
|
22
|
+
place-items: center;
|
|
23
|
+
width: 56px;
|
|
24
|
+
height: 56px;
|
|
25
|
+
border-radius: 16px;
|
|
26
|
+
background: #fdf4f6;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.index {
|
|
30
|
+
color: rgb(211 72 96 / 12%);
|
|
31
|
+
font-size: 36px;
|
|
32
|
+
font-weight: 700;
|
|
33
|
+
line-height: 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.title {
|
|
37
|
+
margin: 0;
|
|
38
|
+
color: #191d26;
|
|
39
|
+
font-size: 20px;
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.description {
|
|
44
|
+
margin: -8px 0 0;
|
|
45
|
+
color: #606978;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
line-height: 1.5;
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { StepCard } from './StepCard';
|
|
3
|
+
|
|
4
|
+
describe('<StepCard>', () => {
|
|
5
|
+
it('should render the step title', () => {
|
|
6
|
+
render(<StepCard />);
|
|
7
|
+
expect(screen.getByRole('heading', { name: 'Préparez votre colis' })).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import parcel from '@/assets/icons/core-package.svg';
|
|
2
|
+
import styles from './StepCard.module.css';
|
|
3
|
+
|
|
4
|
+
export interface StepCardProps {
|
|
5
|
+
index?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function StepCard({
|
|
11
|
+
index = '01',
|
|
12
|
+
title = 'Préparez votre colis',
|
|
13
|
+
description = 'Destinataire, poids et dimensions.',
|
|
14
|
+
}: StepCardProps) {
|
|
15
|
+
return (
|
|
16
|
+
<article className={styles.card}>
|
|
17
|
+
<div className={styles.header}>
|
|
18
|
+
<span className={styles.icon}>
|
|
19
|
+
<img src={parcel} alt="" width={28} height={28} />
|
|
20
|
+
</span>
|
|
21
|
+
<span className={styles.index}>{index}</span>
|
|
22
|
+
</div>
|
|
23
|
+
<h3 className={styles.title}>{title}</h3>
|
|
24
|
+
<p className={styles.description}>{description}</p>
|
|
25
|
+
</article>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StepCard, type StepCardProps } from './StepCard';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
.stepper {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
list-style: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.item {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: 8px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.content {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 7px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.dot {
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
width: 30px;
|
|
27
|
+
height: 30px;
|
|
28
|
+
border-radius: var(--radius-pill);
|
|
29
|
+
font-size: 11px;
|
|
30
|
+
font-weight: 700;
|
|
31
|
+
line-height: 1.3;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.done,
|
|
35
|
+
.active {
|
|
36
|
+
background: var(--color-primary);
|
|
37
|
+
color: #fff;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.upcoming {
|
|
41
|
+
background: var(--color-surface-muted);
|
|
42
|
+
color: var(--color-text-secondary);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.label {
|
|
46
|
+
font-size: 12px;
|
|
47
|
+
font-weight: 500;
|
|
48
|
+
line-height: 1.3;
|
|
49
|
+
color: var(--color-text-secondary);
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.labelActive {
|
|
54
|
+
font-weight: 600;
|
|
55
|
+
color: var(--color-text);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.connector {
|
|
59
|
+
width: 48px;
|
|
60
|
+
height: 2px;
|
|
61
|
+
background: var(--color-primary);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.connectorMuted {
|
|
65
|
+
background: #e8eaee;
|
|
66
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Stepper } from './Stepper';
|
|
3
|
+
|
|
4
|
+
describe('<Stepper>', () => {
|
|
5
|
+
it('should render each step label', () => {
|
|
6
|
+
render(
|
|
7
|
+
<Stepper
|
|
8
|
+
steps={[
|
|
9
|
+
{ label: 'Je prépare mon colis', state: 'done' },
|
|
10
|
+
{ label: 'Récapitulatif', state: 'active' },
|
|
11
|
+
{ label: 'Paiement', state: 'upcoming' },
|
|
12
|
+
]}
|
|
13
|
+
/>,
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
expect(screen.getByText('Je prépare mon colis')).toBeInTheDocument();
|
|
17
|
+
expect(screen.getByText('Récapitulatif')).toBeInTheDocument();
|
|
18
|
+
expect(screen.getByText('Paiement')).toBeInTheDocument();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import styles from './Stepper.module.css';
|
|
3
|
+
|
|
4
|
+
export type StepState = 'done' | 'active' | 'upcoming';
|
|
5
|
+
|
|
6
|
+
export interface Step {
|
|
7
|
+
label: string;
|
|
8
|
+
state: StepState;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface StepperProps {
|
|
12
|
+
steps: Step[];
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function Stepper({ steps, className }: StepperProps) {
|
|
17
|
+
return (
|
|
18
|
+
<ol className={cn(styles.stepper, className)}>
|
|
19
|
+
{steps.map((step, index) => (
|
|
20
|
+
<li key={step.label} className={styles.item}>
|
|
21
|
+
{index > 0 ? (
|
|
22
|
+
<span
|
|
23
|
+
className={cn(styles.connector, step.state === 'upcoming' && styles.connectorMuted)}
|
|
24
|
+
aria-hidden="true"
|
|
25
|
+
/>
|
|
26
|
+
) : null}
|
|
27
|
+
<span className={styles.content}>
|
|
28
|
+
<span className={cn(styles.dot, styles[step.state])} aria-hidden="true">
|
|
29
|
+
{step.state === 'done' ? '✓' : index + 1}
|
|
30
|
+
</span>
|
|
31
|
+
<span className={cn(styles.label, step.state === 'active' && styles.labelActive)}>
|
|
32
|
+
{step.label}
|
|
33
|
+
</span>
|
|
34
|
+
</span>
|
|
35
|
+
</li>
|
|
36
|
+
))}
|
|
37
|
+
</ol>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Stepper, type StepperProps, type Step, type StepState } from './Stepper';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.list {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
width: 100%;
|
|
6
|
+
max-width: 632px;
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 16px 18px;
|
|
9
|
+
list-style: none;
|
|
10
|
+
border-radius: 16px;
|
|
11
|
+
background: #f9fafc;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.list li {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 12px;
|
|
18
|
+
color: #191d26;
|
|
19
|
+
font-size: 13px;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
line-height: 1.3;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.list span {
|
|
25
|
+
display: grid;
|
|
26
|
+
place-items: center;
|
|
27
|
+
flex-shrink: 0;
|
|
28
|
+
width: 28px;
|
|
29
|
+
height: 28px;
|
|
30
|
+
border-radius: 999px;
|
|
31
|
+
background: #d34860;
|
|
32
|
+
color: #fff;
|
|
33
|
+
font-size: 13px;
|
|
34
|
+
font-weight: 700;
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { StepsList } from './StepsList';
|
|
3
|
+
|
|
4
|
+
describe('<StepsList>', () => {
|
|
5
|
+
it('should render the three steps', () => {
|
|
6
|
+
render(<StepsList />);
|
|
7
|
+
expect(screen.getAllByRole('listitem')).toHaveLength(3);
|
|
8
|
+
expect(screen.getByText('Activation de votre espace gérant')).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import styles from './StepsList.module.css';
|
|
2
|
+
|
|
3
|
+
export interface StepsListProps {
|
|
4
|
+
steps?: string[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const DEFAULT_STEPS = [
|
|
8
|
+
'Vérification des informations',
|
|
9
|
+
'Validation administrative',
|
|
10
|
+
'Activation de votre espace gérant',
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
export function StepsList({ steps = DEFAULT_STEPS }: StepsListProps) {
|
|
14
|
+
return (
|
|
15
|
+
<ol className={styles.list}>
|
|
16
|
+
{steps.map((step, index) => (
|
|
17
|
+
<li key={step}>
|
|
18
|
+
<span>{index + 1}</span>
|
|
19
|
+
{step}
|
|
20
|
+
</li>
|
|
21
|
+
))}
|
|
22
|
+
</ol>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StepsList, type StepsListProps } from './StepsList';
|