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(
|
refactor: Phase 3a — Global color class migration to SUMI semantics
- Replace all kodo-* color classes across ~100 TSX files:
kodo-void → background, kodo-ink → card, kodo-graphite → muted,
kodo-steel → muted-foreground, kodo-cyan → primary, kodo-magenta → destructive,
kodo-lime → success, kodo-red → destructive, kodo-gold → warning
- Replace cyan-500, magenta-500, lime-500 default Tailwind colors with
semantic equivalents (primary, destructive, success)
- Fix WaveformVisualizer hardcoded hex colors to SUMI values
- Delete global-effects.css (conflicting, redundant with index.css)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 00:51:49 +00:00
|
|
|
'w-full bg-muted/10 border-b border-border/30 text-muted-foreground',
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
'px-4 py-4 flex items-center justify-between gap-4',
|
2026-02-12 01:09:29 +00:00
|
|
|
'transition-all duration-[var(--sumi-duration-normal)]',
|
2026-01-15 23:50:01 +00:00
|
|
|
className,
|
|
|
|
|
)}
|
|
|
|
|
>
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
<div className="flex items-center gap-4 flex-1 min-w-0">
|
2026-01-15 23:50:01 +00:00
|
|
|
<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}
|
2026-02-12 01:09:29 +00:00
|
|
|
className="text-muted-foreground hover:text-foreground 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>
|
|
|
|
|
);
|
|
|
|
|
}
|