Plan UI premium 6–8 semaines (design system, shell, Storybook, a11y): - Design system: DESIGN_TOKENS.md, APP_SHELL.md, FULL_LAYOUT_PAGE.md. Single source for layout/shell (index.css), shadows (design-system.css), durations/easing. - Tokens: shadow-cover-depth, shadow-gold-glow, shadow-fab-glow; layout max-height (max-h-layout-drawer, max-h-layout-panel, max-h-layout-list). All duration-200/300/500 replaced by --duration-fast/normal/slow. Arbitrary shadows replaced by token classes. - Shell & player: Sidebar, Header, GlobalPlayer, MiniPlayer, PlayerQueue, PlayerControls, AudioPlayer use tokens; focus-visible on Sidebar, PlayerQueue, DropdownMenuTrigger/Item, TabsTrigger. Typography: text-[10px]/[9px] → text-xs where applicable. - ESLint: no-restricted-syntax (warn) for w-/h-/rounded-/shadow-/text-/spacing arbitrary. - Scripts: report-arbitrary-values.mjs, capture/compare/generate visual; visual-complete.spec.ts. - Stories full layout: Dashboard, Playlists, Library, Settings, Profile in DashboardLayout.stories. - .cursorrules + README: DESIGN_TOKENS, APP_SHELL, visual commands, no arbitrary without justification. - apps/web/.gitignore: e2e test artifacts (test-results-visual, playwright-report-visual). Co-authored-by: Cursor <cursoragent@cursor.com>
96 lines
2.4 KiB
TypeScript
96 lines
2.4 KiB
TypeScript
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-steel/10 border-b border-kodo-steel/30 text-kodo-steel',
|
|
'px-4 py-4 flex items-center justify-between gap-4',
|
|
'transition-all duration-[var(--duration-normal)]',
|
|
className,
|
|
)}
|
|
>
|
|
<div className="flex items-center gap-4 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}
|
|
className="text-kodo-steel hover:text-white hover:bg-white/5 h-auto py-1 px-2 flex-shrink-0"
|
|
aria-label="Fermer le mode sélection"
|
|
>
|
|
<X className="w-4 h-4" />
|
|
</Button>
|
|
</div>
|
|
);
|
|
}
|