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(
|
2026-01-16 10:40:13 +00:00
|
|
|
'w-full bg-kodo-steel/10 border-b border-kodo-steel/30 text-kodo-steel',
|
2026-01-15 23:50:01 +00:00
|
|
|
'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: reduce decorative cyan in layout and settings (80/20 rule, batch 15)
- Layout: AudioPlayer decorative queue icon (1 instance)
- Settings: AccountSettings decorative icon (1 instance)
- Components: BulkModeBanner decorative close button text (1 instance)
- Total: ~3 files, ~3 instances replaced
- Preserved: Active/selected states (AudioPlayer selected queue tab, BulkModeBanner active state banner - functional active mode indicator, AccountSettings selected theme, CreatorModal selected visibility option, GroupCard public/private badges - semantic indicators, dialog.tsx confirm/info variants - design system variants), functional elements, design system variants, semantic status indicators, interactive states, functional loading indicators, informational alerts/toasts
- Action 11.3.1.3 in progress (fifteenth batch: layout and settings components)
2026-01-16 10:35:43 +00:00
|
|
|
className="text-kodo-steel 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>
|
|
|
|
|
);
|
|
|
|
|
}
|