2025-12-03 21:56:50 +00:00
|
|
|
/**
|
|
|
|
|
* Composant TrackListSelectionActions
|
|
|
|
|
* Barre d'actions pour les pistes sélectionnées
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { Play, Trash2, Heart, Download, MoreVertical, X } from 'lucide-react';
|
|
|
|
|
import { cn } from '@/lib/utils';
|
|
|
|
|
|
|
|
|
|
export interface TrackListSelectionActionsProps {
|
|
|
|
|
selectedCount: number;
|
2025-12-13 02:34:34 +00:00
|
|
|
onPlay?: (trackIds: string[]) => void;
|
|
|
|
|
onDelete?: (trackIds: string[]) => void;
|
|
|
|
|
onLike?: (trackIds: string[]) => void;
|
|
|
|
|
onDownload?: (trackIds: string[]) => void;
|
|
|
|
|
onMore?: (trackIds: string[]) => void;
|
2025-12-03 21:56:50 +00:00
|
|
|
onClearSelection?: () => void;
|
2025-12-13 02:34:34 +00:00
|
|
|
selectedTrackIds: string[];
|
2025-12-03 21:56:50 +00:00
|
|
|
className?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function TrackListSelectionActions({
|
|
|
|
|
selectedCount,
|
|
|
|
|
onPlay,
|
|
|
|
|
onDelete,
|
|
|
|
|
onLike,
|
|
|
|
|
onDownload,
|
|
|
|
|
onMore,
|
|
|
|
|
onClearSelection,
|
|
|
|
|
selectedTrackIds,
|
|
|
|
|
className,
|
|
|
|
|
}: TrackListSelectionActionsProps) {
|
|
|
|
|
if (selectedCount === 0) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handlePlay = () => {
|
|
|
|
|
onPlay?.(selectedTrackIds);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleDelete = () => {
|
|
|
|
|
onDelete?.(selectedTrackIds);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleLike = () => {
|
|
|
|
|
onLike?.(selectedTrackIds);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleDownload = () => {
|
|
|
|
|
onDownload?.(selectedTrackIds);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleMore = () => {
|
|
|
|
|
onMore?.(selectedTrackIds);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
className={cn(
|
|
|
|
|
'fixed bottom-0 left-0 right-0 z-50',
|
2026-01-16 00:57:04 +00:00
|
|
|
'bg-kodo-cyan dark:bg-kodo-cyan text-white',
|
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 shadow-lg',
|
2025-12-03 21:56:50 +00:00
|
|
|
'flex items-center justify-between gap-4',
|
|
|
|
|
'transition-transform duration-300 ease-in-out',
|
2025-12-13 02:34:34 +00:00
|
|
|
className,
|
2025-12-03 21:56:50 +00:00
|
|
|
)}
|
|
|
|
|
role="toolbar"
|
|
|
|
|
aria-label={`Actions pour ${selectedCount} piste${selectedCount > 1 ? 's' : ''} sélectionnée${selectedCount > 1 ? 's' : ''}`}
|
|
|
|
|
>
|
|
|
|
|
<div className="flex items-center gap-4">
|
|
|
|
|
<span className="text-sm font-medium">
|
2025-12-13 02:34:34 +00:00
|
|
|
{selectedCount} piste{selectedCount > 1 ? 's' : ''} sélectionnée
|
|
|
|
|
{selectedCount > 1 ? 's' : ''}
|
2025-12-03 21:56:50 +00:00
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
{onPlay && (
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={handlePlay}
|
|
|
|
|
className={cn(
|
|
|
|
|
'p-2 rounded-md transition-colors',
|
aesthetic-improvements: replace secondary cyan hover states with steel (batch 4)
- LibraryPage: card hover border, title hover text (3 instances, also removed scale transform)
- ProductCard: title hover text (1 instance)
- TrackListSelectionActions: action button hovers (5 instances: play, like, download, more, clear) - replaced with hover:bg-white/5
- AuthLayout: footer link hover text (1 instance)
- Pages: SocialPage, GearPage, DeveloperPage outline button hovers (3 instances)
- SocialPage: comment button hover text (1 instance)
- Total: ~8 files, ~14 instances replaced
- Preserved: Primary buttons (cyan), player control buttons (cyan - primary actions), AuthButton primary variant (cyan)
- Action 11.3.1.2 in progress (fourth batch complete)
2026-01-16 09:57:14 +00:00
|
|
|
'hover:bg-white/5 dark:hover:bg-white/5',
|
2025-12-13 02:34:34 +00:00
|
|
|
'focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-blue-600',
|
2025-12-03 21:56:50 +00:00
|
|
|
)}
|
|
|
|
|
aria-label={`Lire ${selectedCount} piste${selectedCount > 1 ? 's' : ''}`}
|
|
|
|
|
>
|
|
|
|
|
<Play className="h-5 w-5" aria-hidden="true" />
|
|
|
|
|
<span className="sr-only">Lire</span>
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{onLike && (
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={handleLike}
|
|
|
|
|
className={cn(
|
|
|
|
|
'p-2 rounded-md transition-colors',
|
aesthetic-improvements: replace secondary cyan hover states with steel (batch 4)
- LibraryPage: card hover border, title hover text (3 instances, also removed scale transform)
- ProductCard: title hover text (1 instance)
- TrackListSelectionActions: action button hovers (5 instances: play, like, download, more, clear) - replaced with hover:bg-white/5
- AuthLayout: footer link hover text (1 instance)
- Pages: SocialPage, GearPage, DeveloperPage outline button hovers (3 instances)
- SocialPage: comment button hover text (1 instance)
- Total: ~8 files, ~14 instances replaced
- Preserved: Primary buttons (cyan), player control buttons (cyan - primary actions), AuthButton primary variant (cyan)
- Action 11.3.1.2 in progress (fourth batch complete)
2026-01-16 09:57:14 +00:00
|
|
|
'hover:bg-white/5 dark:hover:bg-white/5',
|
2025-12-13 02:34:34 +00:00
|
|
|
'focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-blue-600',
|
2025-12-03 21:56:50 +00:00
|
|
|
)}
|
|
|
|
|
aria-label={`Ajouter ${selectedCount} piste${selectedCount > 1 ? 's' : ''} aux favoris`}
|
|
|
|
|
>
|
|
|
|
|
<Heart className="h-5 w-5" aria-hidden="true" />
|
|
|
|
|
<span className="sr-only">Ajouter aux favoris</span>
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{onDownload && (
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={handleDownload}
|
|
|
|
|
className={cn(
|
|
|
|
|
'p-2 rounded-md transition-colors',
|
aesthetic-improvements: replace secondary cyan hover states with steel (batch 4)
- LibraryPage: card hover border, title hover text (3 instances, also removed scale transform)
- ProductCard: title hover text (1 instance)
- TrackListSelectionActions: action button hovers (5 instances: play, like, download, more, clear) - replaced with hover:bg-white/5
- AuthLayout: footer link hover text (1 instance)
- Pages: SocialPage, GearPage, DeveloperPage outline button hovers (3 instances)
- SocialPage: comment button hover text (1 instance)
- Total: ~8 files, ~14 instances replaced
- Preserved: Primary buttons (cyan), player control buttons (cyan - primary actions), AuthButton primary variant (cyan)
- Action 11.3.1.2 in progress (fourth batch complete)
2026-01-16 09:57:14 +00:00
|
|
|
'hover:bg-white/5 dark:hover:bg-white/5',
|
2025-12-13 02:34:34 +00:00
|
|
|
'focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-blue-600',
|
2025-12-03 21:56:50 +00:00
|
|
|
)}
|
|
|
|
|
aria-label={`Télécharger ${selectedCount} piste${selectedCount > 1 ? 's' : ''}`}
|
|
|
|
|
>
|
|
|
|
|
<Download className="h-5 w-5" aria-hidden="true" />
|
|
|
|
|
<span className="sr-only">Télécharger</span>
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{onDelete && (
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={handleDelete}
|
|
|
|
|
className={cn(
|
|
|
|
|
'p-2 rounded-md transition-colors',
|
2026-01-16 00:57:04 +00:00
|
|
|
'hover:bg-kodo-red dark:hover:bg-kodo-red',
|
2025-12-13 02:34:34 +00:00
|
|
|
'focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-blue-600',
|
2025-12-03 21:56:50 +00:00
|
|
|
)}
|
|
|
|
|
aria-label={`Supprimer ${selectedCount} piste${selectedCount > 1 ? 's' : ''}`}
|
|
|
|
|
>
|
|
|
|
|
<Trash2 className="h-5 w-5" aria-hidden="true" />
|
|
|
|
|
<span className="sr-only">Supprimer</span>
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{onMore && (
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={handleMore}
|
|
|
|
|
className={cn(
|
|
|
|
|
'p-2 rounded-md transition-colors',
|
aesthetic-improvements: replace secondary cyan hover states with steel (batch 4)
- LibraryPage: card hover border, title hover text (3 instances, also removed scale transform)
- ProductCard: title hover text (1 instance)
- TrackListSelectionActions: action button hovers (5 instances: play, like, download, more, clear) - replaced with hover:bg-white/5
- AuthLayout: footer link hover text (1 instance)
- Pages: SocialPage, GearPage, DeveloperPage outline button hovers (3 instances)
- SocialPage: comment button hover text (1 instance)
- Total: ~8 files, ~14 instances replaced
- Preserved: Primary buttons (cyan), player control buttons (cyan - primary actions), AuthButton primary variant (cyan)
- Action 11.3.1.2 in progress (fourth batch complete)
2026-01-16 09:57:14 +00:00
|
|
|
'hover:bg-white/5 dark:hover:bg-white/5',
|
2025-12-13 02:34:34 +00:00
|
|
|
'focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-blue-600',
|
2025-12-03 21:56:50 +00:00
|
|
|
)}
|
|
|
|
|
aria-label={`Plus d'options pour ${selectedCount} piste${selectedCount > 1 ? 's' : ''}`}
|
|
|
|
|
>
|
|
|
|
|
<MoreVertical className="h-5 w-5" aria-hidden="true" />
|
|
|
|
|
<span className="sr-only">Plus d'options</span>
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{onClearSelection && (
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={onClearSelection}
|
|
|
|
|
className={cn(
|
|
|
|
|
'p-2 rounded-md transition-colors',
|
2026-01-16 10:00:12 +00:00
|
|
|
'hover:bg-white/5 dark:hover:bg-white/5',
|
2025-12-13 02:34:34 +00:00
|
|
|
'focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-blue-600',
|
2025-12-03 21:56:50 +00:00
|
|
|
)}
|
|
|
|
|
aria-label="Désélectionner toutes les pistes"
|
|
|
|
|
>
|
|
|
|
|
<X className="h-5 w-5" aria-hidden="true" />
|
|
|
|
|
<span className="sr-only">Fermer</span>
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default TrackListSelectionActions;
|