2026-01-15 23:50:01 +00:00
|
|
|
import { X, CheckSquare } from 'lucide-react';
|
|
|
|
|
import { cn } from '@/lib/utils';
|
|
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* BulkModeBannerProps - Propriétés du composant BulkModeBanner
|
|
|
|
|
*/
|
|
|
|
|
export interface BulkModeBannerProps {
|
|
|
|
|
/**
|
|
|
|
|
* Si true, le banner est affiché
|
|
|
|
|
*/
|
|
|
|
|
isActive: boolean;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Nombre d'éléments sélectionnés
|
|
|
|
|
*/
|
|
|
|
|
selectedCount: number;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fonction appelée lors du clic sur le bouton de fermeture
|
|
|
|
|
* Doit désactiver le mode bulk et réinitialiser la sélection
|
|
|
|
|
*/
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Classes CSS personnalisées
|
|
|
|
|
*/
|
|
|
|
|
className?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* BulkModeBanner - Banner pour le mode sélection multiple
|
|
|
|
|
*
|
|
|
|
|
* Affiche un banner informatif lorsque le mode bulk est actif,
|
|
|
|
|
* montrant le nombre d'éléments sélectionnés et permettant
|
|
|
|
|
* de fermer le mode bulk.
|
|
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
* ```tsx
|
|
|
|
|
* <BulkModeBanner
|
|
|
|
|
* isActive={isBulkMode}
|
|
|
|
|
* selectedCount={selectedTracks.size}
|
|
|
|
|
* onClose={() => {
|
|
|
|
|
* setIsBulkMode(false);
|
|
|
|
|
* setSelectedTracks(new Set());
|
|
|
|
|
* }}
|
|
|
|
|
* />
|
|
|
|
|
* ```
|
|
|
|
|
*
|
|
|
|
|
* @component
|
|
|
|
|
* @param {BulkModeBannerProps} props - Propriétés du composant
|
|
|
|
|
* @returns {JSX.Element | null} Banner ou null si isActive est false
|
|
|
|
|
*/
|
|
|
|
|
export function BulkModeBanner({
|
|
|
|
|
isActive,
|
|
|
|
|
selectedCount,
|
|
|
|
|
onClose,
|
|
|
|
|
className,
|
|
|
|
|
}: BulkModeBannerProps) {
|
|
|
|
|
if (!isActive || selectedCount === 0) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const itemText =
|
|
|
|
|
selectedCount === 1 ? 'élément sélectionné' : 'éléments sélectionnés';
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
role="status"
|
|
|
|
|
aria-live="polite"
|
|
|
|
|
aria-atomic="true"
|
|
|
|
|
className={cn(
|
|
|
|
|
'w-full bg-kodo-cyan/10 border-b border-kodo-cyan/30 text-kodo-cyan',
|
|
|
|
|
'px-4 py-3 flex items-center justify-between gap-4',
|
|
|
|
|
'transition-all duration-300',
|
|
|
|
|
className,
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<div className="flex items-center gap-3 flex-1 min-w-0">
|
|
|
|
|
<CheckSquare className="w-5 h-5 flex-shrink-0" aria-hidden="true" />
|
|
|
|
|
<span className="text-sm font-medium">
|
|
|
|
|
<span className="font-bold">{selectedCount}</span> {itemText}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={onClose}
|
aesthetic-improvements: replace secondary cyan hover states with steel (batch 3)
- UI components: accordion hover text (1 file)
- Player components: AudioPlayer, MiniPlayer icon button hovers (2 files, 3 instances)
- Social components: CreatePostModal, SharePostModal, ProductDetailView (3 files, 3 instances)
- Settings: AccessibilitySettingsView hover text (1 file)
- Analytics: TrackAnalyticsView, AnalyticsView chart bar hovers (2 files, 2 instances)
- Gamification: LeaderboardView hover text (1 file)
- Upload: FileUploadZone hover border (1 file)
- Banner: BulkModeBanner close button hover (1 file)
- Total: ~12 files, ~15 instances replaced
- Preserved: Focus rings (cyan), active/selected states (cyan), primary actions (cyan)
- Note: ChatSidebar selected state hover kept cyan (primary state)
- Note: VirtualizedChatMessages scroll button kept cyan (primary action)
- Action 11.3.1.2 in progress (third batch complete)
2026-01-16 09:55:42 +00:00
|
|
|
className="text-kodo-cyan hover:text-white hover:bg-white/5 h-auto py-1 px-2 flex-shrink-0"
|
2026-01-15 23:50:01 +00:00
|
|
|
aria-label="Fermer le mode sélection"
|
|
|
|
|
>
|
|
|
|
|
<X className="w-4 h-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|