2026-01-07 09:31:02 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
import { Play, Pause, X } from 'lucide-react';
|
|
|
|
|
|
|
|
|
|
interface UploadProgressBarProps {
|
|
|
|
|
progress: number; // 0 to 100
|
|
|
|
|
status: 'uploading' | 'paused' | 'completed' | 'error' | 'processing';
|
|
|
|
|
onPause?: () => void;
|
|
|
|
|
onResume?: () => void;
|
|
|
|
|
onCancel?: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
export const UploadProgressBar: React.FC<UploadProgressBarProps> = ({
|
|
|
|
|
progress,
|
|
|
|
|
status,
|
|
|
|
|
onPause,
|
|
|
|
|
onResume,
|
|
|
|
|
onCancel,
|
2026-01-07 09:31:02 +00:00
|
|
|
}) => {
|
|
|
|
|
const isPaused = status === 'paused';
|
|
|
|
|
const isCompleted = status === 'completed';
|
|
|
|
|
const isError = status === 'error';
|
|
|
|
|
|
|
|
|
|
const getColor = () => {
|
2026-02-07 15:07:09 +00:00
|
|
|
if (isError) return 'bg-destructive';
|
|
|
|
|
if (isCompleted) return 'bg-success';
|
2026-01-07 09:31:02 +00:00
|
|
|
if (isPaused) return 'bg-kodo-gold';
|
2026-02-07 15:07:09 +00:00
|
|
|
return 'bg-primary';
|
2026-01-07 09:31:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
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="w-full flex items-center gap-4">
|
2026-01-07 09:31:02 +00:00
|
|
|
<div className="flex-1">
|
feat(web): UI premium Discord/Spotify-like — tokens, shadows, focus, layout
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>
2026-02-08 16:15:58 +00:00
|
|
|
<div className="flex justify-between text-xs uppercase font-bold text-muted-foreground mb-1">
|
2026-01-07 09:31:02 +00:00
|
|
|
<span>{status}</span>
|
|
|
|
|
<span>{Math.round(progress)}%</span>
|
|
|
|
|
</div>
|
2026-02-07 15:07:09 +00:00
|
|
|
<div className="h-1.5 bg-muted rounded-full overflow-hidden">
|
2026-01-13 18:47:57 +00:00
|
|
|
<div
|
feat(web): UI premium Discord/Spotify-like — tokens, shadows, focus, layout
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>
2026-02-08 16:15:58 +00:00
|
|
|
className={`h-full transition-all duration-[var(--duration-normal)] ${getColor()} ${status === 'uploading' ? 'animate-pulse' : ''}`}
|
2026-01-07 09:31:02 +00:00
|
|
|
style={{ width: `${progress}%` }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
|
2026-01-07 09:31:02 +00:00
|
|
|
{!isCompleted && !isError && (
|
|
|
|
|
<div className="flex gap-1">
|
|
|
|
|
{isPaused ? (
|
2026-01-13 18:47:57 +00:00
|
|
|
<button
|
|
|
|
|
onClick={onResume}
|
2026-02-07 15:07:09 +00:00
|
|
|
className="p-1 hover:text-white text-success transition-colors"
|
2026-01-13 18:47:57 +00:00
|
|
|
title="Resume"
|
|
|
|
|
>
|
2026-01-07 09:31:02 +00:00
|
|
|
<Play className="w-3 h-3 fill-current" />
|
|
|
|
|
</button>
|
|
|
|
|
) : (
|
2026-01-13 18:47:57 +00:00
|
|
|
<button
|
|
|
|
|
onClick={onPause}
|
2026-02-07 15:07:09 +00:00
|
|
|
className="p-1 hover:text-white text-warning transition-colors"
|
2026-01-13 18:47:57 +00:00
|
|
|
title="Pause"
|
|
|
|
|
>
|
2026-01-07 09:31:02 +00:00
|
|
|
<Pause className="w-3 h-3 fill-current" />
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
2026-01-13 18:47:57 +00:00
|
|
|
<button
|
|
|
|
|
onClick={onCancel}
|
2026-02-07 15:07:09 +00:00
|
|
|
className="p-1 hover:text-white text-destructive transition-colors"
|
2026-01-13 18:47:57 +00:00
|
|
|
title="Cancel"
|
|
|
|
|
>
|
2026-01-07 09:31:02 +00:00
|
|
|
<X className="w-3 h-3" />
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2026-01-13 18:47:57 +00:00
|
|
|
};
|