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,50 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import { Icon } from '@/components/Icon';
|
|
3
|
+
import { Button } from '@/components/Button';
|
|
4
|
+
import styles from './ConfirmModal.module.css';
|
|
5
|
+
|
|
6
|
+
export interface ConfirmModalProps {
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
confirmLabel?: string;
|
|
10
|
+
cancelLabel?: string;
|
|
11
|
+
open?: boolean;
|
|
12
|
+
onConfirm?: () => void;
|
|
13
|
+
onCancel?: () => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function ConfirmModal({
|
|
18
|
+
title,
|
|
19
|
+
description,
|
|
20
|
+
confirmLabel = 'Confirmer',
|
|
21
|
+
cancelLabel = 'Annuler',
|
|
22
|
+
open = true,
|
|
23
|
+
onConfirm,
|
|
24
|
+
onCancel,
|
|
25
|
+
className,
|
|
26
|
+
}: ConfirmModalProps) {
|
|
27
|
+
if (!open) return null;
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div className={styles.backdrop} role="presentation">
|
|
31
|
+
<div className={cn(styles.modal, className)} role="dialog" aria-modal="true" aria-labelledby="confirm-title">
|
|
32
|
+
<span className={styles.icon}>
|
|
33
|
+
<Icon name="alertTriangle" size={24} />
|
|
34
|
+
</span>
|
|
35
|
+
<h2 id="confirm-title" className={styles.title}>
|
|
36
|
+
{title}
|
|
37
|
+
</h2>
|
|
38
|
+
<p className={styles.description}>{description}</p>
|
|
39
|
+
<div className={styles.actions}>
|
|
40
|
+
<button type="button" className={styles.cancel} onClick={onCancel}>
|
|
41
|
+
{cancelLabel}
|
|
42
|
+
</button>
|
|
43
|
+
<Button className={styles.confirm} onClick={onConfirm}>
|
|
44
|
+
{confirmLabel}
|
|
45
|
+
</Button>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ConfirmModal, type ConfirmModalProps } from './ConfirmModal';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
.button {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 10px;
|
|
6
|
+
border: 0;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
font-family: inherit;
|
|
9
|
+
font-weight: 600;
|
|
10
|
+
line-height: 1.3;
|
|
11
|
+
color: #fff;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.button:disabled {
|
|
15
|
+
cursor: not-allowed;
|
|
16
|
+
opacity: 0.5;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.primary {
|
|
20
|
+
width: 100%;
|
|
21
|
+
max-width: 520px;
|
|
22
|
+
padding: 13px 20px;
|
|
23
|
+
border-radius: 14px;
|
|
24
|
+
background: #d34860;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
box-shadow: 0 10px 24px rgb(211 72 96 / 20%);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.secondary {
|
|
30
|
+
width: 100%;
|
|
31
|
+
max-width: 402px;
|
|
32
|
+
height: 53px;
|
|
33
|
+
padding: 16px 20px;
|
|
34
|
+
border: 1px solid #d34860;
|
|
35
|
+
border-radius: 14px;
|
|
36
|
+
background: #fff;
|
|
37
|
+
color: #d34860;
|
|
38
|
+
font-size: 16px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.icon {
|
|
42
|
+
height: 44px;
|
|
43
|
+
padding: 0 18px;
|
|
44
|
+
border: 1px solid #d34860;
|
|
45
|
+
border-radius: 16px;
|
|
46
|
+
background: #fff;
|
|
47
|
+
color: #d34860;
|
|
48
|
+
font-size: 14px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.compact {
|
|
52
|
+
padding: 8px 12px;
|
|
53
|
+
border-radius: 999px;
|
|
54
|
+
background: #fff4f5;
|
|
55
|
+
color: #d34860;
|
|
56
|
+
font-size: 13px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.filter {
|
|
60
|
+
width: 118px;
|
|
61
|
+
height: 44px;
|
|
62
|
+
justify-content: flex-start;
|
|
63
|
+
padding: 0 15px;
|
|
64
|
+
border: 1px solid #e5e8ed;
|
|
65
|
+
border-radius: 13px;
|
|
66
|
+
background: #fff;
|
|
67
|
+
color: #191d26;
|
|
68
|
+
font-size: 12px;
|
|
69
|
+
font-weight: 600;
|
|
70
|
+
line-height: normal;
|
|
71
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { CoreButton } from './CoreButton';
|
|
4
|
+
|
|
5
|
+
describe('<CoreButton>', () => {
|
|
6
|
+
it('should render its label', () => {
|
|
7
|
+
render(<CoreButton>Se connecter</CoreButton>);
|
|
8
|
+
expect(screen.getByRole('button', { name: 'Se connecter' })).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should call onClick when activated', async () => {
|
|
12
|
+
const user = userEvent.setup();
|
|
13
|
+
const onClick = vi.fn();
|
|
14
|
+
render(
|
|
15
|
+
<CoreButton variant="icon" onClick={onClick}>
|
|
16
|
+
Voir sur la carte
|
|
17
|
+
</CoreButton>,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
await user.click(screen.getByRole('button', { name: 'Voir sur la carte' }));
|
|
21
|
+
|
|
22
|
+
expect(onClick).toHaveBeenCalledOnce();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import mapPin from '@/assets/icons/core-map-pin.svg';
|
|
3
|
+
import { cn } from '@/lib/cn';
|
|
4
|
+
import styles from './CoreButton.module.css';
|
|
5
|
+
|
|
6
|
+
export type CoreButtonVariant = 'primary' | 'secondary' | 'icon' | 'compact' | 'filter';
|
|
7
|
+
|
|
8
|
+
export interface CoreButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
|
+
variant?: CoreButtonVariant;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function CoreButton({
|
|
14
|
+
variant = 'primary',
|
|
15
|
+
className,
|
|
16
|
+
type = 'button',
|
|
17
|
+
children,
|
|
18
|
+
icon,
|
|
19
|
+
...props
|
|
20
|
+
}: CoreButtonProps) {
|
|
21
|
+
return (
|
|
22
|
+
<button type={type} className={cn(styles.button, styles[variant], className)} {...props}>
|
|
23
|
+
{variant === 'icon' ? (icon ?? <img src={mapPin} alt="" width={18} height={18} />) : null}
|
|
24
|
+
{children}
|
|
25
|
+
</button>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CoreButton, type CoreButtonProps, type CoreButtonVariant } from './CoreButton';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.field {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 7px;
|
|
5
|
+
width: 100%;
|
|
6
|
+
max-width: 520px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.label {
|
|
10
|
+
color: #191d26;
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
line-height: 1.3;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.input {
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 52px;
|
|
19
|
+
padding: 0 15px;
|
|
20
|
+
border: 1px solid #e8eaee;
|
|
21
|
+
border-radius: 12px;
|
|
22
|
+
background: #f9fafb;
|
|
23
|
+
color: #191d26;
|
|
24
|
+
font: inherit;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.input::placeholder {
|
|
30
|
+
color: #606978;
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { CoreField } from './CoreField';
|
|
4
|
+
|
|
5
|
+
describe('<CoreField>', () => {
|
|
6
|
+
it('should accept typed text', async () => {
|
|
7
|
+
const user = userEvent.setup();
|
|
8
|
+
render(<CoreField label="Adresse email" placeholder="vous@email.fr" />);
|
|
9
|
+
|
|
10
|
+
const field = screen.getByLabelText('Adresse email');
|
|
11
|
+
await user.type(field, 'ada@lerelais.fr');
|
|
12
|
+
|
|
13
|
+
expect(field).toHaveValue('ada@lerelais.fr');
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { cn } from '@/lib/cn';
|
|
3
|
+
import styles from './CoreField.module.css';
|
|
4
|
+
|
|
5
|
+
export interface CoreFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function CoreField({ label, className, id, ...props }: CoreFieldProps) {
|
|
10
|
+
const fieldId = id ?? (label ? label.toLowerCase().replace(/\s+/g, '-') : undefined);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<label className={styles.field} htmlFor={fieldId}>
|
|
14
|
+
{label ? <span className={styles.label}>{label}</span> : null}
|
|
15
|
+
<input id={fieldId} className={cn(styles.input, className)} {...props} />
|
|
16
|
+
</label>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CoreField, type CoreFieldProps } from './CoreField';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.field {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 7px;
|
|
5
|
+
width: 234px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.label {
|
|
9
|
+
color: #191d26;
|
|
10
|
+
font-size: 12px;
|
|
11
|
+
font-weight: 600;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.control {
|
|
15
|
+
position: relative;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.select {
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 52px;
|
|
23
|
+
padding: 0 36px 0 14px;
|
|
24
|
+
border: 1px solid #e8eaee;
|
|
25
|
+
border-radius: 12px;
|
|
26
|
+
appearance: none;
|
|
27
|
+
background: #f9fafb;
|
|
28
|
+
color: #191d26;
|
|
29
|
+
font: inherit;
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.control img {
|
|
34
|
+
position: absolute;
|
|
35
|
+
right: 14px;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { CoreSelect } from './CoreSelect';
|
|
4
|
+
|
|
5
|
+
describe('<CoreSelect>', () => {
|
|
6
|
+
it('should change the selected option', async () => {
|
|
7
|
+
const user = userEvent.setup();
|
|
8
|
+
render(
|
|
9
|
+
<CoreSelect
|
|
10
|
+
label="Ville"
|
|
11
|
+
options={[
|
|
12
|
+
{ value: 'abidjan', label: 'Abidjan' },
|
|
13
|
+
{ value: 'bouake', label: 'Bouaké' },
|
|
14
|
+
]}
|
|
15
|
+
/>,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
await user.selectOptions(screen.getByLabelText('Ville'), 'bouake');
|
|
19
|
+
|
|
20
|
+
expect(screen.getByLabelText('Ville')).toHaveValue('bouake');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { SelectHTMLAttributes } from 'react';
|
|
2
|
+
import chevron from '@/assets/icons/core-chevron.svg';
|
|
3
|
+
import { cn } from '@/lib/cn';
|
|
4
|
+
import styles from './CoreSelect.module.css';
|
|
5
|
+
|
|
6
|
+
export interface CoreSelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
7
|
+
label?: string;
|
|
8
|
+
options: { value: string; label: string }[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function CoreSelect({ label, options, className, id, ...props }: CoreSelectProps) {
|
|
12
|
+
const fieldId = id ?? 'core-select';
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<label className={styles.field} htmlFor={fieldId}>
|
|
16
|
+
{label ? <span className={styles.label}>{label}</span> : null}
|
|
17
|
+
<span className={styles.control}>
|
|
18
|
+
<select id={fieldId} className={cn(styles.select, className)} {...props}>
|
|
19
|
+
{options.map((option) => (
|
|
20
|
+
<option key={option.value} value={option.value}>
|
|
21
|
+
{option.label}
|
|
22
|
+
</option>
|
|
23
|
+
))}
|
|
24
|
+
</select>
|
|
25
|
+
<img src={chevron} alt="" width={16} height={16} />
|
|
26
|
+
</span>
|
|
27
|
+
</label>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CoreSelect, type CoreSelectProps } from './CoreSelect';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.tabs {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 24px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.tab {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 12px;
|
|
10
|
+
width: 124px;
|
|
11
|
+
padding: 0;
|
|
12
|
+
border: 0;
|
|
13
|
+
background: transparent;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
font-family: inherit;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.label {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 8px;
|
|
22
|
+
color: #606978;
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
line-height: 1.3;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.bar {
|
|
29
|
+
height: 3px;
|
|
30
|
+
border-radius: 2px;
|
|
31
|
+
background: transparent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.active .label {
|
|
35
|
+
color: #d34860;
|
|
36
|
+
font-weight: 700;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.active .bar {
|
|
40
|
+
background: #d34860;
|
|
41
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { CoreTabs } from './CoreTabs';
|
|
4
|
+
|
|
5
|
+
describe('<CoreTabs>', () => {
|
|
6
|
+
it('should select the clicked tab', async () => {
|
|
7
|
+
const user = userEvent.setup();
|
|
8
|
+
render(<CoreTabs />);
|
|
9
|
+
|
|
10
|
+
const tabs = screen.getAllByRole('tab', { name: 'Se connecter' });
|
|
11
|
+
expect(tabs[1]).toHaveAttribute('aria-selected', 'true');
|
|
12
|
+
|
|
13
|
+
await user.click(tabs[0]);
|
|
14
|
+
|
|
15
|
+
expect(tabs[0]).toHaveAttribute('aria-selected', 'true');
|
|
16
|
+
expect(tabs[1]).toHaveAttribute('aria-selected', 'false');
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import lockIcon from '@/assets/icons/core-lock.svg';
|
|
3
|
+
import plusIcon from '@/assets/icons/core-plus.svg';
|
|
4
|
+
import { cn } from '@/lib/cn';
|
|
5
|
+
import styles from './CoreTabs.module.css';
|
|
6
|
+
|
|
7
|
+
const ICONS = {
|
|
8
|
+
lock: lockIcon,
|
|
9
|
+
plus: plusIcon,
|
|
10
|
+
} as const;
|
|
11
|
+
|
|
12
|
+
export interface CoreTabItem {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
icon?: keyof typeof ICONS;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface CoreTabsProps {
|
|
19
|
+
items?: CoreTabItem[];
|
|
20
|
+
value?: string;
|
|
21
|
+
defaultValue?: string;
|
|
22
|
+
onChange?: (id: string) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const DEFAULT_ITEMS: CoreTabItem[] = [
|
|
26
|
+
{ id: 'login', label: 'Se connecter', icon: 'lock' },
|
|
27
|
+
{ id: 'create', label: 'Se connecter', icon: 'plus' },
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
export function CoreTabs({
|
|
31
|
+
items = DEFAULT_ITEMS,
|
|
32
|
+
value,
|
|
33
|
+
defaultValue,
|
|
34
|
+
onChange,
|
|
35
|
+
}: CoreTabsProps) {
|
|
36
|
+
const [internal, setInternal] = useState(defaultValue ?? items[1]?.id ?? items[0]?.id);
|
|
37
|
+
const current = value ?? internal;
|
|
38
|
+
|
|
39
|
+
function select(id: string) {
|
|
40
|
+
if (value === undefined) setInternal(id);
|
|
41
|
+
onChange?.(id);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className={styles.tabs} role="tablist">
|
|
46
|
+
{items.map((item) => {
|
|
47
|
+
const selected = item.id === current;
|
|
48
|
+
return (
|
|
49
|
+
<button
|
|
50
|
+
key={item.id}
|
|
51
|
+
type="button"
|
|
52
|
+
role="tab"
|
|
53
|
+
aria-selected={selected}
|
|
54
|
+
className={cn(styles.tab, selected && styles.active)}
|
|
55
|
+
onClick={() => select(item.id)}
|
|
56
|
+
>
|
|
57
|
+
<span className={styles.label}>
|
|
58
|
+
{item.icon ? <img src={ICONS[item.icon]} alt="" width={18} height={18} /> : null}
|
|
59
|
+
{item.label}
|
|
60
|
+
</span>
|
|
61
|
+
<span className={styles.bar} />
|
|
62
|
+
</button>
|
|
63
|
+
);
|
|
64
|
+
})}
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CoreTabs, type CoreTabItem, type CoreTabsProps } from './CoreTabs';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.row {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: 24px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
min-height: 116px;
|
|
8
|
+
padding: 18px 24px;
|
|
9
|
+
border: 1px solid var(--color-border);
|
|
10
|
+
border-radius: var(--radius-lg);
|
|
11
|
+
background: #fff;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.row > div:first-child {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: 6px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.id,
|
|
21
|
+
.row button {
|
|
22
|
+
color: var(--color-primary);
|
|
23
|
+
font-size: 13px;
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.route {
|
|
28
|
+
font-size: 15px;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.recipient,
|
|
33
|
+
.date {
|
|
34
|
+
color: var(--color-text-secondary);
|
|
35
|
+
font-size: 13px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.row > div:nth-child(2) {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: 8px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.status {
|
|
45
|
+
padding: 6px 16px;
|
|
46
|
+
border-radius: var(--radius-pill);
|
|
47
|
+
background: var(--color-primary-soft);
|
|
48
|
+
color: var(--color-primary);
|
|
49
|
+
font-size: 13px;
|
|
50
|
+
font-weight: 600;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.date {
|
|
54
|
+
font-size: 11px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.row button {
|
|
58
|
+
border: 0;
|
|
59
|
+
background: transparent;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { DashboardParcelRow } from './DashboardParcelRow';
|
|
4
|
+
|
|
5
|
+
describe('<DashboardParcelRow>', () => {
|
|
6
|
+
it('should render the parcel summary', () => {
|
|
7
|
+
render(
|
|
8
|
+
<DashboardParcelRow
|
|
9
|
+
trackingId="LR-2026-084215"
|
|
10
|
+
route="Abidjan → Bouaké"
|
|
11
|
+
recipient="À l'attention de Marie Konan"
|
|
12
|
+
status="En transit"
|
|
13
|
+
date="13 août 2026 · 08:42"
|
|
14
|
+
/>,
|
|
15
|
+
);
|
|
16
|
+
expect(screen.getByText('Abidjan → Bouaké')).toBeInTheDocument();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should call onDetail when the detail action is activated', async () => {
|
|
20
|
+
const user = userEvent.setup();
|
|
21
|
+
const onDetail = vi.fn();
|
|
22
|
+
render(
|
|
23
|
+
<DashboardParcelRow
|
|
24
|
+
trackingId="LR-1"
|
|
25
|
+
route="Abidjan"
|
|
26
|
+
recipient="Marie"
|
|
27
|
+
status="En transit"
|
|
28
|
+
date="13 août"
|
|
29
|
+
onDetail={onDetail}
|
|
30
|
+
/>,
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
await user.click(screen.getByRole('button', { name: 'Voir le détail →' }));
|
|
34
|
+
|
|
35
|
+
expect(onDetail).toHaveBeenCalledOnce();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cn } from '@/lib/cn';
|
|
2
|
+
import styles from './DashboardParcelRow.module.css';
|
|
3
|
+
|
|
4
|
+
export interface DashboardParcelRowProps {
|
|
5
|
+
trackingId: string;
|
|
6
|
+
route: string;
|
|
7
|
+
recipient: string;
|
|
8
|
+
status: string;
|
|
9
|
+
date: string;
|
|
10
|
+
detailLabel?: string;
|
|
11
|
+
onDetail?: () => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function DashboardParcelRow({
|
|
16
|
+
trackingId,
|
|
17
|
+
route,
|
|
18
|
+
recipient,
|
|
19
|
+
status,
|
|
20
|
+
date,
|
|
21
|
+
detailLabel = 'Voir le détail →',
|
|
22
|
+
onDetail,
|
|
23
|
+
className,
|
|
24
|
+
}: DashboardParcelRowProps) {
|
|
25
|
+
return (
|
|
26
|
+
<article className={cn(styles.row, className)}>
|
|
27
|
+
<div>
|
|
28
|
+
<p className={styles.id}>{trackingId}</p>
|
|
29
|
+
<p className={styles.route}>{route}</p>
|
|
30
|
+
<p className={styles.recipient}>{recipient}</p>
|
|
31
|
+
</div>
|
|
32
|
+
<div>
|
|
33
|
+
<span className={styles.status}>{status}</span>
|
|
34
|
+
<p className={styles.date}>{date}</p>
|
|
35
|
+
</div>
|
|
36
|
+
<button type="button" onClick={onDetail}>
|
|
37
|
+
{detailLabel}
|
|
38
|
+
</button>
|
|
39
|
+
</article>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DashboardParcelRow, type DashboardParcelRowProps } from './DashboardParcelRow';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.toolbar {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: 16px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
max-width: 1098px;
|
|
8
|
+
height: 72px;
|
|
9
|
+
padding: 13px 17px 13px 17px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
border: 1px solid #e5e8ed;
|
|
12
|
+
border-radius: 16px;
|
|
13
|
+
background: #fff;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.input {
|
|
17
|
+
flex: 1;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
border: 0;
|
|
20
|
+
background: transparent;
|
|
21
|
+
color: #191d26;
|
|
22
|
+
font: inherit;
|
|
23
|
+
font-size: 12px;
|
|
24
|
+
outline: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.input::placeholder {
|
|
28
|
+
color: #606978;
|
|
29
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { DataFiltersToolbar } from './DataFiltersToolbar';
|
|
4
|
+
|
|
5
|
+
describe('<DataFiltersToolbar>', () => {
|
|
6
|
+
it('should open the filters', async () => {
|
|
7
|
+
const user = userEvent.setup();
|
|
8
|
+
const onFilters = vi.fn();
|
|
9
|
+
render(<DataFiltersToolbar onFilters={onFilters} />);
|
|
10
|
+
|
|
11
|
+
await user.click(screen.getByRole('button', { name: 'Filtres' }));
|
|
12
|
+
|
|
13
|
+
expect(onFilters).toHaveBeenCalledOnce();
|
|
14
|
+
});
|
|
15
|
+
});
|