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,34 @@
|
|
|
1
|
+
import styles from './RelayResultCard.module.css';
|
|
2
|
+
|
|
3
|
+
export interface RelayResultCardProps {
|
|
4
|
+
name?: string;
|
|
5
|
+
status?: string;
|
|
6
|
+
badge?: string;
|
|
7
|
+
address?: string;
|
|
8
|
+
distance?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function RelayResultCard({
|
|
12
|
+
name = 'Carrefour City - 350 m',
|
|
13
|
+
status = 'Ouvert',
|
|
14
|
+
badge = 'recommandé',
|
|
15
|
+
address = "12 rue de Charenton · Ouvert jusqu'à 21h",
|
|
16
|
+
distance = '350 m',
|
|
17
|
+
}: RelayResultCardProps) {
|
|
18
|
+
return (
|
|
19
|
+
<article className={styles.card}>
|
|
20
|
+
<div className={styles.content}>
|
|
21
|
+
<p className={styles.name}>{name}</p>
|
|
22
|
+
<div className={styles.meta}>
|
|
23
|
+
<span className={styles.status}>
|
|
24
|
+
<span className={styles.dot} />
|
|
25
|
+
{status}
|
|
26
|
+
</span>
|
|
27
|
+
<span className={styles.badge}>{badge}</span>
|
|
28
|
+
</div>
|
|
29
|
+
<p className={styles.address}>{address}</p>
|
|
30
|
+
</div>
|
|
31
|
+
<span className={styles.distance}>{distance}</span>
|
|
32
|
+
</article>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RelayResultCard, type RelayResultCardProps } from './RelayResultCard';
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
gap: 24px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
max-width: 480px;
|
|
8
|
+
padding: 48px;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
border: 1px solid #e8eaee;
|
|
11
|
+
border-radius: 16px;
|
|
12
|
+
background: #fff;
|
|
13
|
+
box-shadow: 0 12px 32px rgb(16 24 40 / 8%);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.icon {
|
|
17
|
+
display: grid;
|
|
18
|
+
place-items: center;
|
|
19
|
+
width: 48px;
|
|
20
|
+
height: 48px;
|
|
21
|
+
border-radius: 24px;
|
|
22
|
+
background: #fde7e0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.copy {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
gap: 10px;
|
|
29
|
+
width: 100%;
|
|
30
|
+
text-align: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.copy h3 {
|
|
34
|
+
margin: 0;
|
|
35
|
+
color: #191d26;
|
|
36
|
+
font-size: 28px;
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
line-height: 1.3;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.copy p {
|
|
42
|
+
margin: 0;
|
|
43
|
+
color: #606978;
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
line-height: 1.3;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.field {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: 7px;
|
|
52
|
+
width: 100%;
|
|
53
|
+
color: #191d26;
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
line-height: 1.3;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.field input {
|
|
60
|
+
height: 50px;
|
|
61
|
+
padding: 0 15px;
|
|
62
|
+
border: 1px solid #e8eaee;
|
|
63
|
+
border-radius: 12px;
|
|
64
|
+
background: #f9fafb;
|
|
65
|
+
color: #191d26;
|
|
66
|
+
font: inherit;
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
font-weight: 400;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.field input::placeholder {
|
|
72
|
+
color: #606978;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.submit {
|
|
76
|
+
width: 100%;
|
|
77
|
+
padding: 13px 20px;
|
|
78
|
+
border: 0;
|
|
79
|
+
border-radius: 14px;
|
|
80
|
+
background: #d34860;
|
|
81
|
+
box-shadow: 0 10px 24px rgb(211 72 96 / 20%);
|
|
82
|
+
color: #fff;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
font-family: inherit;
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
font-weight: 600;
|
|
87
|
+
line-height: 1.3;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.back {
|
|
91
|
+
width: 100%;
|
|
92
|
+
padding: 0;
|
|
93
|
+
border: 0;
|
|
94
|
+
background: transparent;
|
|
95
|
+
color: #d34860;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
font-family: inherit;
|
|
98
|
+
font-size: 13px;
|
|
99
|
+
font-weight: 500;
|
|
100
|
+
line-height: 1.3;
|
|
101
|
+
text-align: center;
|
|
102
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { ResetPasswordCard } from './ResetPasswordCard';
|
|
4
|
+
|
|
5
|
+
describe('<ResetPasswordCard>', () => {
|
|
6
|
+
it('should submit the email', async () => {
|
|
7
|
+
const user = userEvent.setup();
|
|
8
|
+
const onSubmit = vi.fn();
|
|
9
|
+
render(<ResetPasswordCard onSubmit={onSubmit} />);
|
|
10
|
+
|
|
11
|
+
await user.type(screen.getByLabelText('Adresse email'), 'ada@lerelais.fr');
|
|
12
|
+
await user.click(screen.getByRole('button', { name: 'Envoyer le lien' }));
|
|
13
|
+
|
|
14
|
+
expect(onSubmit).toHaveBeenCalledWith('ada@lerelais.fr');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { FormEvent } from 'react';
|
|
2
|
+
import lock from '@/assets/icons/core-lock-form.svg';
|
|
3
|
+
import styles from './ResetPasswordCard.module.css';
|
|
4
|
+
|
|
5
|
+
export interface ResetPasswordCardProps {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
onSubmit?: (email: string) => void;
|
|
9
|
+
onBack?: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function ResetPasswordCard({
|
|
13
|
+
title = 'Mot de passe oublié',
|
|
14
|
+
description = 'Indiquez votre adresse email pour recevoir un lien de réinitialisation.',
|
|
15
|
+
onSubmit,
|
|
16
|
+
onBack,
|
|
17
|
+
}: ResetPasswordCardProps) {
|
|
18
|
+
function handleSubmit(event: FormEvent<HTMLFormElement>) {
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
const data = new FormData(event.currentTarget);
|
|
21
|
+
onSubmit?.(String(data.get('email') ?? ''));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<form className={styles.card} onSubmit={handleSubmit}>
|
|
26
|
+
<span className={styles.icon}>
|
|
27
|
+
<img src={lock} alt="" width={24} height={24} />
|
|
28
|
+
</span>
|
|
29
|
+
<div className={styles.copy}>
|
|
30
|
+
<h3>{title}</h3>
|
|
31
|
+
<p>{description}</p>
|
|
32
|
+
</div>
|
|
33
|
+
<label className={styles.field}>
|
|
34
|
+
Adresse email
|
|
35
|
+
<input name="email" type="email" placeholder="vous@email.fr" />
|
|
36
|
+
</label>
|
|
37
|
+
<button type="submit" className={styles.submit}>
|
|
38
|
+
Envoyer le lien
|
|
39
|
+
</button>
|
|
40
|
+
<button type="button" className={styles.back} onClick={onBack}>
|
|
41
|
+
Retour à la connexion
|
|
42
|
+
</button>
|
|
43
|
+
</form>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ResetPasswordCard, type ResetPasswordCardProps } from './ResetPasswordCard';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.bar {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
width: 360px;
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
height: 44px;
|
|
8
|
+
padding: 0 14px;
|
|
9
|
+
border: 1px solid var(--color-border);
|
|
10
|
+
border-radius: var(--radius-sm);
|
|
11
|
+
background: #fff;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.icon {
|
|
15
|
+
color: var(--color-text);
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.input {
|
|
20
|
+
flex: 1;
|
|
21
|
+
border: 0;
|
|
22
|
+
background: transparent;
|
|
23
|
+
color: var(--color-text);
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.input::placeholder {
|
|
28
|
+
color: var(--color-text-placeholder);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.input:focus {
|
|
32
|
+
outline: none;
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { SearchBar } from './SearchBar';
|
|
4
|
+
|
|
5
|
+
describe('<SearchBar>', () => {
|
|
6
|
+
it('should render the search field', () => {
|
|
7
|
+
render(<SearchBar placeholder="Rechercher un colis, un relais…" />);
|
|
8
|
+
expect(screen.getByRole('searchbox', { name: 'Recherche' })).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should update the query when the user types', async () => {
|
|
12
|
+
const user = userEvent.setup();
|
|
13
|
+
render(<SearchBar />);
|
|
14
|
+
|
|
15
|
+
await user.type(screen.getByRole('searchbox'), 'Cocody');
|
|
16
|
+
|
|
17
|
+
expect(screen.getByRole('searchbox')).toHaveValue('Cocody');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { cn } from '@/lib/cn';
|
|
3
|
+
import styles from './SearchBar.module.css';
|
|
4
|
+
|
|
5
|
+
export interface SearchBarProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function SearchBar({ label = 'Recherche', className, ...props }: SearchBarProps) {
|
|
10
|
+
return (
|
|
11
|
+
<label className={cn(styles.bar, className)}>
|
|
12
|
+
<span className={styles.icon} aria-hidden="true">
|
|
13
|
+
⌕
|
|
14
|
+
</span>
|
|
15
|
+
<input className={styles.input} type="search" aria-label={label} {...props} />
|
|
16
|
+
</label>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SearchBar, type SearchBarProps } from './SearchBar';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.field {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 6px;
|
|
5
|
+
width: 280px;
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.label {
|
|
10
|
+
font-size: 13px;
|
|
11
|
+
font-weight: 600;
|
|
12
|
+
color: var(--color-text-strong);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.box {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
height: 44px;
|
|
19
|
+
border: 1px solid var(--color-border);
|
|
20
|
+
border-radius: var(--radius-sm);
|
|
21
|
+
background: #fff;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.box:focus-within {
|
|
25
|
+
border: 2px solid var(--color-primary);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.boxError {
|
|
29
|
+
border-color: var(--color-error);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.select {
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
padding: 0 14px;
|
|
36
|
+
border: 0;
|
|
37
|
+
background: transparent;
|
|
38
|
+
color: var(--color-text);
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
appearance: none;
|
|
41
|
+
background-image: linear-gradient(45deg, transparent 50%, #7a8494 50%),
|
|
42
|
+
linear-gradient(135deg, #7a8494 50%, transparent 50%);
|
|
43
|
+
background-position:
|
|
44
|
+
calc(100% - 18px) 19px,
|
|
45
|
+
calc(100% - 12px) 19px;
|
|
46
|
+
background-size:
|
|
47
|
+
6px 6px,
|
|
48
|
+
6px 6px;
|
|
49
|
+
background-repeat: no-repeat;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.select:invalid,
|
|
53
|
+
.select option[value=''] {
|
|
54
|
+
color: var(--color-text-placeholder);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.select:disabled {
|
|
58
|
+
opacity: 0.5;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.error {
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
color: var(--color-error);
|
|
64
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { Select } from './Select';
|
|
4
|
+
|
|
5
|
+
const options = [
|
|
6
|
+
{ value: 'relay', label: 'Point relais' },
|
|
7
|
+
{ value: 'home', label: 'Domicile' },
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
describe('<Select>', () => {
|
|
11
|
+
it('should render the label and the placeholder', () => {
|
|
12
|
+
render(<Select label="Mode de livraison" options={options} />);
|
|
13
|
+
expect(screen.getByLabelText('Mode de livraison')).toBeInTheDocument();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('should update the selected option', async () => {
|
|
17
|
+
const user = userEvent.setup();
|
|
18
|
+
render(<Select label="Mode de livraison" options={options} />);
|
|
19
|
+
|
|
20
|
+
await user.selectOptions(screen.getByLabelText('Mode de livraison'), 'relay');
|
|
21
|
+
|
|
22
|
+
expect(screen.getByLabelText('Mode de livraison')).toHaveValue('relay');
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useId, type SelectHTMLAttributes } from 'react';
|
|
2
|
+
import { cn } from '@/lib/cn';
|
|
3
|
+
import styles from './Select.module.css';
|
|
4
|
+
|
|
5
|
+
export interface SelectOption {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
11
|
+
/** Libellé visible au-dessus du champ. */
|
|
12
|
+
label: string;
|
|
13
|
+
options: SelectOption[];
|
|
14
|
+
/** Texte affiché tant qu’aucune valeur n’est choisie. */
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function Select({
|
|
20
|
+
label,
|
|
21
|
+
options,
|
|
22
|
+
placeholder = 'Sélectionner…',
|
|
23
|
+
error,
|
|
24
|
+
id,
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: SelectProps) {
|
|
28
|
+
const generatedId = useId();
|
|
29
|
+
const fieldId = id ?? generatedId;
|
|
30
|
+
const errorId = error ? `${fieldId}-error` : undefined;
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className={cn(styles.field, className)}>
|
|
34
|
+
<label className={styles.label} htmlFor={fieldId}>
|
|
35
|
+
{label}
|
|
36
|
+
</label>
|
|
37
|
+
<div className={cn(styles.box, error && styles.boxError)}>
|
|
38
|
+
<select
|
|
39
|
+
id={fieldId}
|
|
40
|
+
className={styles.select}
|
|
41
|
+
aria-invalid={error ? true : undefined}
|
|
42
|
+
aria-describedby={errorId}
|
|
43
|
+
{...props}
|
|
44
|
+
>
|
|
45
|
+
<option value="">{placeholder}</option>
|
|
46
|
+
{options.map((option) => (
|
|
47
|
+
<option key={option.value} value={option.value}>
|
|
48
|
+
{option.label}
|
|
49
|
+
</option>
|
|
50
|
+
))}
|
|
51
|
+
</select>
|
|
52
|
+
</div>
|
|
53
|
+
{error ? (
|
|
54
|
+
<p id={errorId} className={styles.error} role="alert">
|
|
55
|
+
{error}
|
|
56
|
+
</p>
|
|
57
|
+
) : null}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Select, type SelectProps, type SelectOption } from './Select';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.status {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 6px;
|
|
5
|
+
padding: 4px 10px;
|
|
6
|
+
border-radius: var(--radius-pill);
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
font-weight: 600;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dot {
|
|
12
|
+
width: 6px;
|
|
13
|
+
height: 6px;
|
|
14
|
+
border-radius: 50%;
|
|
15
|
+
background: currentColor;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.neutral {
|
|
19
|
+
background: var(--color-surface-sunken);
|
|
20
|
+
color: var(--color-text-secondary);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.info {
|
|
24
|
+
background: var(--color-info-bg);
|
|
25
|
+
color: var(--color-info);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.warning {
|
|
29
|
+
background: var(--color-warning-bg);
|
|
30
|
+
color: var(--color-warning);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.success {
|
|
34
|
+
background: var(--color-success-bg);
|
|
35
|
+
color: var(--color-success);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.error {
|
|
39
|
+
background: var(--color-error-bg);
|
|
40
|
+
color: var(--color-error);
|
|
41
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { ShipmentStatus } from './ShipmentStatus';
|
|
3
|
+
|
|
4
|
+
describe('<ShipmentStatus>', () => {
|
|
5
|
+
it('should render the preparing label', () => {
|
|
6
|
+
render(<ShipmentStatus />);
|
|
7
|
+
expect(screen.getByText('Préparation')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('should render the anomaly label', () => {
|
|
11
|
+
render(<ShipmentStatus status="anomaly" />);
|
|
12
|
+
expect(screen.getByText('Anomalie')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import styles from './ShipmentStatus.module.css';
|
|
3
|
+
|
|
4
|
+
export type ShipmentStatusValue =
|
|
5
|
+
| 'preparing'
|
|
6
|
+
| 'dropped'
|
|
7
|
+
| 'picked'
|
|
8
|
+
| 'transit'
|
|
9
|
+
| 'available'
|
|
10
|
+
| 'collected'
|
|
11
|
+
| 'delivered'
|
|
12
|
+
| 'anomaly'
|
|
13
|
+
| 'expired';
|
|
14
|
+
|
|
15
|
+
const LABELS: Record<ShipmentStatusValue, string> = {
|
|
16
|
+
preparing: 'Préparation',
|
|
17
|
+
dropped: 'Déposé',
|
|
18
|
+
picked: 'Pris en charge',
|
|
19
|
+
transit: 'En transit',
|
|
20
|
+
available: 'Disponible',
|
|
21
|
+
collected: 'Retiré',
|
|
22
|
+
delivered: 'Livré',
|
|
23
|
+
anomaly: 'Anomalie',
|
|
24
|
+
expired: 'Expiré',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const TONE: Record<ShipmentStatusValue, string> = {
|
|
28
|
+
preparing: 'neutral',
|
|
29
|
+
dropped: 'info',
|
|
30
|
+
picked: 'info',
|
|
31
|
+
transit: 'warning',
|
|
32
|
+
available: 'success',
|
|
33
|
+
collected: 'success',
|
|
34
|
+
delivered: 'success',
|
|
35
|
+
anomaly: 'error',
|
|
36
|
+
expired: 'error',
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export interface ShipmentStatusProps {
|
|
40
|
+
status?: ShipmentStatusValue;
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function ShipmentStatus({ status = 'preparing', className }: ShipmentStatusProps) {
|
|
45
|
+
const tone = TONE[status];
|
|
46
|
+
return (
|
|
47
|
+
<span className={cn(styles.status, styles[tone], className)}>
|
|
48
|
+
<span className={styles.dot} aria-hidden="true" />
|
|
49
|
+
{LABELS[status]}
|
|
50
|
+
</span>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ShipmentStatus, type ShipmentStatusProps, type ShipmentStatusValue } from './ShipmentStatus';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.sidebar {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 18px;
|
|
5
|
+
width: 248px;
|
|
6
|
+
min-height: 100%;
|
|
7
|
+
padding: 26px 18px 24px;
|
|
8
|
+
background: var(--color-sidebar);
|
|
9
|
+
color: #fff;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.account,
|
|
13
|
+
.status {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 4px;
|
|
17
|
+
width: 212px;
|
|
18
|
+
padding: 12px 14px;
|
|
19
|
+
border-radius: var(--radius-md);
|
|
20
|
+
background: var(--color-sidebar-raised);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.kicker {
|
|
24
|
+
color: var(--color-text-placeholder);
|
|
25
|
+
font-size: 10px;
|
|
26
|
+
font-weight: 700;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.accountName {
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.meta {
|
|
35
|
+
color: var(--color-sidebar-muted);
|
|
36
|
+
font-size: 11px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.nav {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: 8px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.item,
|
|
46
|
+
.logout {
|
|
47
|
+
width: 212px;
|
|
48
|
+
height: 40px;
|
|
49
|
+
padding: 0 14px;
|
|
50
|
+
border: 0;
|
|
51
|
+
border-radius: 11px;
|
|
52
|
+
background: transparent;
|
|
53
|
+
color: var(--color-sidebar-text);
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
font-weight: 500;
|
|
56
|
+
text-align: left;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.active {
|
|
61
|
+
background: var(--color-sidebar-active);
|
|
62
|
+
color: #fff;
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.status {
|
|
67
|
+
margin-top: auto;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ok {
|
|
71
|
+
color: var(--color-success-bright);
|
|
72
|
+
font-size: 11px;
|
|
73
|
+
font-weight: 600;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.logout {
|
|
77
|
+
margin-top: auto;
|
|
78
|
+
color: var(--color-sidebar-muted);
|
|
79
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { Sidebar } from './Sidebar';
|
|
4
|
+
|
|
5
|
+
describe('<Sidebar>', () => {
|
|
6
|
+
it('should render the admin navigation', () => {
|
|
7
|
+
render(<Sidebar />);
|
|
8
|
+
expect(screen.getByRole('button', { name: 'Vue d’ensemble' })).toHaveAttribute('aria-current', 'page');
|
|
9
|
+
expect(screen.getByText('Super Admin')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should call onSelect when a section is activated', async () => {
|
|
13
|
+
const user = userEvent.setup();
|
|
14
|
+
const onSelect = vi.fn();
|
|
15
|
+
render(<Sidebar onSelect={onSelect} />);
|
|
16
|
+
|
|
17
|
+
await user.click(screen.getByRole('button', { name: 'Colis' }));
|
|
18
|
+
|
|
19
|
+
expect(onSelect).toHaveBeenCalledWith('parcels');
|
|
20
|
+
});
|
|
21
|
+
});
|