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,22 @@
|
|
|
1
|
+
.link {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 4px;
|
|
5
|
+
color: var(--color-primary);
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
font-weight: 600;
|
|
8
|
+
text-decoration: underline;
|
|
9
|
+
text-underline-offset: 2px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.link:hover {
|
|
13
|
+
padding: 4px;
|
|
14
|
+
background: var(--color-primary-soft);
|
|
15
|
+
color: var(--color-primary-hover);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.link[aria-disabled='true'] {
|
|
19
|
+
color: var(--color-disabled);
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { LinkButton } from './LinkButton';
|
|
3
|
+
|
|
4
|
+
describe('<LinkButton>', () => {
|
|
5
|
+
it('should render a link', () => {
|
|
6
|
+
render(<LinkButton href="/relais">Voir tous les relais partenaires</LinkButton>);
|
|
7
|
+
expect(screen.getByRole('link', { name: /Voir tous les relais/ })).toHaveAttribute('href', '/relais');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import { cn } from '@/lib/cn';
|
|
3
|
+
import { Icon } from '@/components/Icon';
|
|
4
|
+
import styles from './LinkButton.module.css';
|
|
5
|
+
|
|
6
|
+
export interface LinkButtonProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
7
|
+
children: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function LinkButton({ children, className, ...props }: LinkButtonProps) {
|
|
11
|
+
return (
|
|
12
|
+
<a className={cn(styles.link, className)} {...props}>
|
|
13
|
+
{children}
|
|
14
|
+
<Icon name="arrowRight" size={16} />
|
|
15
|
+
</a>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LinkButton, type LinkButtonProps } from './LinkButton';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
gap: 16px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
max-width: 416px;
|
|
8
|
+
padding: 24px;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
border: 1px solid #e8eaee;
|
|
11
|
+
border-radius: 22px;
|
|
12
|
+
background: #fff;
|
|
13
|
+
box-shadow: 0 8px 24px rgb(16 24 40 / 5%);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.label,
|
|
17
|
+
.name,
|
|
18
|
+
.area {
|
|
19
|
+
margin: 0;
|
|
20
|
+
line-height: 1.3;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.label {
|
|
24
|
+
color: #d34860;
|
|
25
|
+
font-size: 18px;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.name {
|
|
30
|
+
color: #191d26;
|
|
31
|
+
font-size: 18px;
|
|
32
|
+
font-weight: 700;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.area {
|
|
36
|
+
color: #606978;
|
|
37
|
+
font-size: 13px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.map {
|
|
41
|
+
position: relative;
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 170px;
|
|
44
|
+
border: 1px solid #d1d5db;
|
|
45
|
+
border-radius: 18px;
|
|
46
|
+
background: #edf2f5;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.marker {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 50%;
|
|
52
|
+
left: 50%;
|
|
53
|
+
display: grid;
|
|
54
|
+
place-items: center;
|
|
55
|
+
width: 40px;
|
|
56
|
+
height: 40px;
|
|
57
|
+
border-radius: 20px;
|
|
58
|
+
background: #d34860;
|
|
59
|
+
box-shadow: 0 6px 14px rgb(211 72 96 / 20%);
|
|
60
|
+
transform: translate(-50%, -50%);
|
|
61
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { LocationCard } from './LocationCard';
|
|
3
|
+
|
|
4
|
+
describe('<LocationCard>', () => {
|
|
5
|
+
it('should render the destination name', () => {
|
|
6
|
+
render(<LocationCard />);
|
|
7
|
+
expect(screen.getByText('Épicerie des Brotteaux')).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import pin from '@/assets/icons/core-pin-white.svg';
|
|
2
|
+
import styles from './LocationCard.module.css';
|
|
3
|
+
|
|
4
|
+
export interface LocationCardProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
area?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function LocationCard({
|
|
11
|
+
label = 'Destination',
|
|
12
|
+
name = 'Épicerie des Brotteaux',
|
|
13
|
+
area = 'Bouaké 3e',
|
|
14
|
+
}: LocationCardProps) {
|
|
15
|
+
return (
|
|
16
|
+
<article className={styles.card}>
|
|
17
|
+
<p className={styles.label}>{label}</p>
|
|
18
|
+
<p className={styles.name}>{name}</p>
|
|
19
|
+
<p className={styles.area}>{area}</p>
|
|
20
|
+
<div className={styles.map}>
|
|
21
|
+
<span className={styles.marker}>
|
|
22
|
+
<img src={pin} alt="" width={18} height={18} />
|
|
23
|
+
</span>
|
|
24
|
+
</div>
|
|
25
|
+
</article>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LocationCard, type LocationCardProps } from './LocationCard';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.logo {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 9px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.mark {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
width: 38px;
|
|
12
|
+
height: 38px;
|
|
13
|
+
border-radius: 12px;
|
|
14
|
+
background: var(--color-primary);
|
|
15
|
+
color: #fff;
|
|
16
|
+
font-size: 12px;
|
|
17
|
+
font-weight: 700;
|
|
18
|
+
line-height: 1.3;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.word {
|
|
22
|
+
font-size: 22px;
|
|
23
|
+
font-weight: 700;
|
|
24
|
+
line-height: 1.3;
|
|
25
|
+
color: var(--color-primary);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.light .word {
|
|
29
|
+
color: #fff;
|
|
30
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import styles from './Logo.module.css';
|
|
3
|
+
|
|
4
|
+
export interface LogoProps {
|
|
5
|
+
tone?: 'brand' | 'light';
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function Logo({ tone = 'brand', className }: LogoProps) {
|
|
10
|
+
return (
|
|
11
|
+
<span className={cn(styles.logo, styles[tone], className)}>
|
|
12
|
+
<span className={styles.mark} aria-hidden="true">
|
|
13
|
+
LR
|
|
14
|
+
</span>
|
|
15
|
+
<span className={styles.word}>LeRelais</span>
|
|
16
|
+
</span>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Logo, type LogoProps } from './Logo';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 7px;
|
|
5
|
+
width: 250px;
|
|
6
|
+
padding: 18px 20px;
|
|
7
|
+
border: 1px solid var(--color-border);
|
|
8
|
+
border-radius: var(--radius-card);
|
|
9
|
+
background: #fff;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.label,
|
|
13
|
+
.hint {
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
color: var(--color-text-secondary);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.hint {
|
|
19
|
+
font-size: 11px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.value {
|
|
23
|
+
font-size: 28px;
|
|
24
|
+
font-weight: 700;
|
|
25
|
+
line-height: 1.3;
|
|
26
|
+
color: var(--color-primary);
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { MetricCard } from './MetricCard';
|
|
3
|
+
|
|
4
|
+
describe('<MetricCard>', () => {
|
|
5
|
+
it('should render the metric', () => {
|
|
6
|
+
render(<MetricCard label="Colis en cours" value="128" hint="+8 cette semaine" />);
|
|
7
|
+
expect(screen.getByText('128')).toBeInTheDocument();
|
|
8
|
+
expect(screen.getByText('Colis en cours')).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import styles from './MetricCard.module.css';
|
|
3
|
+
|
|
4
|
+
export interface MetricCardProps {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
hint: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function MetricCard({ label, value, hint, className }: MetricCardProps) {
|
|
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 { MetricCard, type MetricCardProps } from './MetricCard';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
.navbar {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: 24px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
background: #fff;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.full {
|
|
11
|
+
height: 84px;
|
|
12
|
+
padding: 0 78px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.topbar,
|
|
16
|
+
.entreprise {
|
|
17
|
+
height: 84px;
|
|
18
|
+
padding: 0 78px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.topbar {
|
|
22
|
+
padding-inline: 120px;
|
|
23
|
+
height: 82px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.particulier {
|
|
27
|
+
height: 76px;
|
|
28
|
+
padding: 18px 64px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.links {
|
|
32
|
+
display: flex;
|
|
33
|
+
gap: 22px;
|
|
34
|
+
color: var(--color-text);
|
|
35
|
+
font-size: 13px;
|
|
36
|
+
font-weight: 500;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.particulier .links {
|
|
40
|
+
gap: 26px;
|
|
41
|
+
margin-left: auto;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.links a {
|
|
45
|
+
text-decoration: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.activeLink {
|
|
49
|
+
color: var(--color-primary);
|
|
50
|
+
font-weight: 600;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.heading {
|
|
54
|
+
color: var(--color-text-secondary);
|
|
55
|
+
font-size: 13px;
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.actions {
|
|
60
|
+
display: flex;
|
|
61
|
+
gap: 10px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.login,
|
|
65
|
+
.primary {
|
|
66
|
+
padding: 13px 20px;
|
|
67
|
+
border-radius: var(--radius-md);
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
font-weight: 600;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.login {
|
|
74
|
+
border: 1px solid var(--color-border-line);
|
|
75
|
+
background: #fff;
|
|
76
|
+
color: var(--color-text);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.primary {
|
|
80
|
+
border: 0;
|
|
81
|
+
background: var(--color-primary);
|
|
82
|
+
color: #fff;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.primary:hover {
|
|
86
|
+
background: var(--color-primary-hover);
|
|
87
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { Navbar } from './Navbar';
|
|
4
|
+
|
|
5
|
+
describe('<Navbar>', () => {
|
|
6
|
+
it('should render the public links', () => {
|
|
7
|
+
render(<Navbar />);
|
|
8
|
+
expect(screen.getByRole('link', { name: 'Suivre' })).toBeInTheDocument();
|
|
9
|
+
expect(screen.getByRole('button', { name: 'Connexion' })).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should call onPrimary when the send action is activated', async () => {
|
|
13
|
+
const user = userEvent.setup();
|
|
14
|
+
const onPrimary = vi.fn();
|
|
15
|
+
render(<Navbar onPrimary={onPrimary} />);
|
|
16
|
+
|
|
17
|
+
await user.click(screen.getByRole('button', { name: 'Envoyer un colis' }));
|
|
18
|
+
|
|
19
|
+
expect(onPrimary).toHaveBeenCalledOnce();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import { Logo } from '@/components/Logo';
|
|
3
|
+
import { Avatar } from '@/components/Avatar';
|
|
4
|
+
import styles from './Navbar.module.css';
|
|
5
|
+
|
|
6
|
+
export type NavbarVariant = 'full' | 'topbar' | 'entreprise' | 'particulier';
|
|
7
|
+
|
|
8
|
+
export interface NavbarLink {
|
|
9
|
+
label: string;
|
|
10
|
+
href: string;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface NavbarProps {
|
|
15
|
+
variant?: NavbarVariant;
|
|
16
|
+
links?: NavbarLink[];
|
|
17
|
+
title?: string;
|
|
18
|
+
initials?: string;
|
|
19
|
+
onLogin?: () => void;
|
|
20
|
+
onPrimary?: () => void;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const PUBLIC_LINKS: NavbarLink[] = [
|
|
25
|
+
{ label: 'Envoyer', href: '#envoyer' },
|
|
26
|
+
{ label: 'Suivre', href: '#suivre' },
|
|
27
|
+
{ label: 'Trouver un relais', href: '#relais' },
|
|
28
|
+
{ label: 'Devenir relais', href: '#devenir' },
|
|
29
|
+
{ label: 'Entreprises', href: '#entreprises' },
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const PARTICULIER_LINKS: NavbarLink[] = [
|
|
33
|
+
{ label: 'Tableau de bord', href: '#dashboard', active: true },
|
|
34
|
+
{ label: 'Mes colis', href: '#colis' },
|
|
35
|
+
{ label: 'Profil', href: '#profil' },
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
export function Navbar({
|
|
39
|
+
variant = 'full',
|
|
40
|
+
links,
|
|
41
|
+
title,
|
|
42
|
+
initials = 'EA',
|
|
43
|
+
onLogin,
|
|
44
|
+
onPrimary,
|
|
45
|
+
className,
|
|
46
|
+
}: NavbarProps) {
|
|
47
|
+
const resolvedLinks = links ?? (variant === 'full' ? PUBLIC_LINKS : variant === 'particulier' ? PARTICULIER_LINKS : []);
|
|
48
|
+
const heading =
|
|
49
|
+
title ?? (variant === 'topbar' ? 'Envoyer un colis' : variant === 'entreprise' ? 'Espace Entreprise' : undefined);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<header className={cn(styles.navbar, styles[variant], className)}>
|
|
53
|
+
<Logo />
|
|
54
|
+
{resolvedLinks.length > 0 ? (
|
|
55
|
+
<nav className={styles.links} aria-label="Navigation principale">
|
|
56
|
+
{resolvedLinks.map((link) => (
|
|
57
|
+
<a key={link.label} href={link.href} className={cn(link.active && styles.activeLink)}>
|
|
58
|
+
{link.label}
|
|
59
|
+
</a>
|
|
60
|
+
))}
|
|
61
|
+
</nav>
|
|
62
|
+
) : null}
|
|
63
|
+
{heading ? <p className={styles.heading}>{heading}</p> : null}
|
|
64
|
+
{variant === 'full' ? (
|
|
65
|
+
<div className={styles.actions}>
|
|
66
|
+
<button type="button" className={styles.login} onClick={onLogin}>
|
|
67
|
+
Connexion
|
|
68
|
+
</button>
|
|
69
|
+
<button type="button" className={styles.primary} onClick={onPrimary}>
|
|
70
|
+
Envoyer un colis
|
|
71
|
+
</button>
|
|
72
|
+
</div>
|
|
73
|
+
) : null}
|
|
74
|
+
{variant === 'particulier' ? <Avatar initials={initials} size="sm" /> : null}
|
|
75
|
+
</header>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Navbar, type NavbarProps, type NavbarVariant, type NavbarLink } from './Navbar';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.item {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: flex-start;
|
|
4
|
+
gap: 14px;
|
|
5
|
+
width: 440px;
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
padding: 16px;
|
|
8
|
+
border: 1px solid var(--color-border-subtle);
|
|
9
|
+
border-radius: var(--radius-control);
|
|
10
|
+
background: #fff;
|
|
11
|
+
box-shadow: var(--shadow-note);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.unread {
|
|
15
|
+
background: var(--color-primary-card);
|
|
16
|
+
border-color: var(--color-primary-border);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.icon {
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
width: 40px;
|
|
24
|
+
height: 40px;
|
|
25
|
+
border-radius: 20px;
|
|
26
|
+
background: #f1f2f4;
|
|
27
|
+
flex-shrink: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.iconUnread {
|
|
31
|
+
background: var(--color-primary);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.content {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex: 1;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
gap: 4px;
|
|
39
|
+
min-width: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.title {
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
line-height: 20px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.titleUnread {
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.description {
|
|
53
|
+
color: var(--color-text-secondary);
|
|
54
|
+
font-size: 13px;
|
|
55
|
+
line-height: 18px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.time {
|
|
59
|
+
display: inline-flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 4px;
|
|
62
|
+
color: var(--color-text-faint);
|
|
63
|
+
font-size: 12px;
|
|
64
|
+
line-height: 16px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.dot {
|
|
68
|
+
width: 8px;
|
|
69
|
+
height: 8px;
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
background: var(--color-primary);
|
|
72
|
+
flex-shrink: 0;
|
|
73
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { NotificationItem } from './NotificationItem';
|
|
3
|
+
|
|
4
|
+
describe('<NotificationItem>', () => {
|
|
5
|
+
it('should render the notification copy', () => {
|
|
6
|
+
render(
|
|
7
|
+
<NotificationItem
|
|
8
|
+
unread
|
|
9
|
+
title="Colis LR-2026-000123 disponible"
|
|
10
|
+
description="Votre colis est prêt à être retiré au relais Tabac du Centre."
|
|
11
|
+
time="Il y a 2 heures"
|
|
12
|
+
/>,
|
|
13
|
+
);
|
|
14
|
+
expect(screen.getByText('Colis LR-2026-000123 disponible')).toBeInTheDocument();
|
|
15
|
+
expect(screen.getByLabelText('Non lu')).toBeInTheDocument();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should hide the unread marker when the item is read', () => {
|
|
19
|
+
render(<NotificationItem title="Titre" description="Détail" time="Il y a 2 heures" />);
|
|
20
|
+
expect(screen.queryByLabelText('Non lu')).not.toBeInTheDocument();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import { Icon } from '@/components/Icon';
|
|
3
|
+
import styles from './NotificationItem.module.css';
|
|
4
|
+
|
|
5
|
+
export interface NotificationItemProps {
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
time: string;
|
|
9
|
+
unread?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function NotificationItem({ title, description, time, unread = false, className }: NotificationItemProps) {
|
|
14
|
+
return (
|
|
15
|
+
<article className={cn(styles.item, unread && styles.unread, className)}>
|
|
16
|
+
<span className={cn(styles.icon, unread && styles.iconUnread)}>
|
|
17
|
+
<Icon name={unread ? 'packageWhite' : 'packageRead'} size={18} />
|
|
18
|
+
</span>
|
|
19
|
+
<div className={styles.content}>
|
|
20
|
+
<p className={cn(styles.title, unread && styles.titleUnread)}>{title}</p>
|
|
21
|
+
<p className={styles.description}>{description}</p>
|
|
22
|
+
<p className={styles.time}>
|
|
23
|
+
<Icon name="clock" size={12} />
|
|
24
|
+
{time}
|
|
25
|
+
</p>
|
|
26
|
+
</div>
|
|
27
|
+
{unread ? <span className={styles.dot} aria-label="Non lu" /> : null}
|
|
28
|
+
</article>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NotificationItem, type NotificationItemProps } from './NotificationItem';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.row {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 18px;
|
|
5
|
+
width: 100%;
|
|
6
|
+
padding: 18px 20px;
|
|
7
|
+
border-bottom: 1px solid var(--color-border);
|
|
8
|
+
background: var(--color-primary-soft);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dot {
|
|
12
|
+
width: 8px;
|
|
13
|
+
height: 8px;
|
|
14
|
+
border-radius: 50%;
|
|
15
|
+
background: var(--color-primary);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.icon {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
width: 40px;
|
|
23
|
+
height: 40px;
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
background: #fff;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.title {
|
|
29
|
+
font-size: 14px;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.description,
|
|
34
|
+
.time {
|
|
35
|
+
color: var(--color-text-secondary);
|
|
36
|
+
font-size: 13px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.row > div {
|
|
40
|
+
flex: 1;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
gap: 4px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.time {
|
|
47
|
+
font-size: 12px;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { NotificationRow } from './NotificationRow';
|
|
3
|
+
|
|
4
|
+
describe('<NotificationRow>', () => {
|
|
5
|
+
it('should render the notification', () => {
|
|
6
|
+
render(
|
|
7
|
+
<NotificationRow
|
|
8
|
+
title="Colis disponible en point relais"
|
|
9
|
+
description="Votre colis LR-2026-084215 est arrivé au relais Cocody Centre."
|
|
10
|
+
time="Il y a 2h"
|
|
11
|
+
/>,
|
|
12
|
+
);
|
|
13
|
+
expect(screen.getByText('Il y a 2h')).toBeInTheDocument();
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import { Icon } from '@/components/Icon';
|
|
3
|
+
import styles from './NotificationRow.module.css';
|
|
4
|
+
|
|
5
|
+
export interface NotificationRowProps {
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
time: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function NotificationRow({ title, description, time, className }: NotificationRowProps) {
|
|
13
|
+
return (
|
|
14
|
+
<article className={cn(styles.row, className)}>
|
|
15
|
+
<span className={styles.dot} aria-hidden="true" />
|
|
16
|
+
<span className={styles.icon}>
|
|
17
|
+
<Icon name="package" size={20} />
|
|
18
|
+
</span>
|
|
19
|
+
<div>
|
|
20
|
+
<p className={styles.title}>{title}</p>
|
|
21
|
+
<p className={styles.description}>{description}</p>
|
|
22
|
+
</div>
|
|
23
|
+
<time className={styles.time}>{time}</time>
|
|
24
|
+
</article>
|
|
25
|
+
);
|
|
26
|
+
}
|